Compare commits

...

11 Commits

Author SHA1 Message Date
ce33af9093 chore: update dependencies to latest versions (#55)
Update 12 safe dependencies to their latest versions:
- Storybook ecosystem (4 packages): ^10.4.6 → ^10.5.0
- @types/node: ^26.0.0 → ^26.1.1
- cypress: ^15.17.0 → ^15.18.1
- globals: ^17.6.0 → ^17.7.0
- jest-fetch-mock: ^3.0.3 → ^4.2.0
- ts-loader: ^9.6.1 → ^9.6.2
- webpack: ^5.107.2 → ^5.108.4
- webpack-cli: ^7.0.3 → ^7.2.1

Skipped due to peer dependency conflicts:
- typescript (7.x incompatible with typescript-eslint 8.x)
- eslint (10.x incompatible with eslint-plugin-react 7.x)
2026-07-15 12:10:07 -06:00
d264fccaad Merge pull request #54 from aleleba/PR-733704
PR-733704: Update dependencies to latest, bump to v1.4.1
2026-06-21 00:09:43 -06:00
62dd7186c1 PR-733704: fix tsconfig.cy.json type errors
- Remove 'cypress' from types array: Cypress ships its own types,
  not via @types/cypress — the /// <reference types="cypress" />
  in support files resolves them correctly without this entry.
- Exclude *.stories.* and *.test.* from the program: ts-loader
  does full program type-checking, pulling in stories (@storybook
  types unavailable) and Jest tests (@testing-library/jest-dom not
  in scope). These files are irrelevant to Cypress.
2026-06-21 06:04:24 +00:00
df367639b9 PR-733704: remove noEmit from tsconfig.cy.json
ts-loader requires TypeScript to emit output. noEmit:true was causing
"TypeScript emitted no output" errors in the Cypress webpack build.
2026-06-21 06:01:33 +00:00
9223b1e144 PR-733704: fix TypeScript errors in Cypress webpack build
Add tsconfig.cy.json that extends the main tsconfig but removes the
rootDir restriction and adds Cypress types. Point ts-loader in
webpack.cy.config.ts to this dedicated tsconfig, fixing:
- TS6059: cypress/support files outside rootDir src/components
- TS2307: missing @storybook/react-webpack5 type declarations
- TS2339: toBeInTheDocument not found (jest-dom types scope)
2026-06-21 05:59:20 +00:00
a246c190ce PR-733704: trigger CI 2026-06-21 05:55:48 +00:00
d5891e8e09 PR-733704: use transpileOnly in webpack.cy.config.ts ts-loader
Cypress only needs transpilation, not full type-checking. This removes
TS2307 (@storybook/react-webpack5 types) and TS2339 (toBeInTheDocument)
errors from the Cypress webpack build output.
2026-06-21 05:53:59 +00:00
134b9e04f6 PR-733704: trigger CI 2026-06-21 05:51:26 +00:00
116d8a5667 PR-733704: bump CI from Node 22 to Node 24
Aligns CI with local dev environment (Node 24 / npm 11).
The lockfile generated by npm 11 causes npm ci to fail on Node 22
due to missing optional sub-dependency entries.
2026-06-21 05:49:22 +00:00
e9fb6ca556 PR-733704: regenerate package-lock.json to fix npm ci in CI
Lockfile generated with Node 24 / npm 11 was missing Babel 7 sub-dependency
entries required by @storybook/addon-webpack5-compiler-babel, causing
npm ci to fail on Node 22. Deleted and regenerated from scratch.
2026-06-21 05:46:02 +00:00
6c3dd344e6 PR-733704: update dependencies to latest, bump to v1.4.1
- Bump version 1.4.0 → 1.4.1
- Upgrade Babel 7 → 8 (@babel/core, preset-env, preset-react,
  preset-typescript, register)
- Add ts-node devDependency (webpack-cli needs it to load
  webpack.config.ts now that @babel/register v8 removed .hook)
- Replace __dirname with path.resolve() in webpack.config.ts and
  webpack.cy.config.ts (ESM-safe, no __dirname needed)
- Add npm overrides: force @babel/core ^8 for ts-jest (peerOptional
  conflict) and js-yaml ^4.2.0 to fix GHSA-h67p-54hq-rp68 DoS vuln
- Add babel hook in .storybook/main.js to strip bugfixes option that
  Storybook injects into @babel/preset-env (removed in Babel 8)
- Patch Storybook addons 10.4.3 → 10.4.6, @types/node v25→v26,
  globals v16→v17, sass minor, ts-loader patch, typescript-eslint patch
- 0 npm audit vulnerabilities
2026-06-21 05:40:41 +00:00
8 changed files with 7335 additions and 2031 deletions

View File

@@ -16,14 +16,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
node-version: [24.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
cache: 'npm'
registry-url: https://registry.npmjs.org/
- run: npm ci
@@ -34,10 +34,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
cache: 'npm'
registry-url: https://registry.npmjs.org/
- name: Cypress install
@@ -57,7 +57,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
@@ -71,7 +71,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish --access=public

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
#nodemodules
node_modules
.env
dist
dist
.worktrees

View File

@@ -77,5 +77,30 @@ module.exports = {
docs: {
autodocs: 'tag',
defaultName: 'Docs',
}
},
// Babel 8 removed the `bugfixes` option from @babel/preset-env (it's now always on).
// Storybook injects bugfixes:true in its internal overrides AFTER babelDefault, so we
// strip it here in the `babel` hook which runs after all presets have composed the config.
async babel(config) {
const stripBugfixes = preset => {
if (!Array.isArray(preset)) return preset;
const [name, options] = preset;
if (typeof name === 'string' && name.includes('@babel/preset-env') && options?.bugfixes !== undefined) {
const { bugfixes: _removed, ...rest } = options;
return [name, rest];
}
return preset;
};
if (config.presets) {
config.presets = config.presets.map(stripBugfixes);
}
if (config.overrides) {
config.overrides = config.overrides.map(override => {
if (!override.presets) return override;
return { ...override, presets: override.presets.map(stripBugfixes) };
});
}
return config;
},
};

9244
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@aleleba/create-react-component-library",
"version": "1.4.0",
"version": "1.4.2",
"description": "A starter kit for create a React component Library with storybook",
"bin": "./bin/cli.js",
"main": "dist/index.js",
@@ -44,26 +44,26 @@
},
"homepage": "https://github.com/aleleba/create-react-component-library#readme",
"devDependencies": {
"@babel/core": "^7.29.7",
"@babel/preset-env": "^7.29.7",
"@babel/preset-react": "^7.29.7",
"@babel/preset-typescript": "^7.29.7",
"@babel/register": "^7.29.7",
"@babel/core": "^8.0.1",
"@babel/preset-env": "^8.0.2",
"@babel/preset-react": "^8.0.1",
"@babel/preset-typescript": "^8.0.1",
"@babel/register": "^8.0.1",
"@eslint/js": "^9.39.4",
"@mdx-js/react": "^3.1.1",
"@storybook/addon-docs": "^10.4.3",
"@storybook/addon-links": "^10.4.3",
"@storybook/addon-docs": "^10.5.0",
"@storybook/addon-links": "^10.5.0",
"@storybook/addon-styling-webpack": "^3.0.2",
"@storybook/addon-webpack5-compiler-babel": "^4.0.1",
"@storybook/cli": "^10.4.3",
"@storybook/cli": "^10.5.0",
"@storybook/preset-scss": "^1.0.3",
"@storybook/react-webpack5": "^10.4.3",
"@storybook/react-webpack5": "^10.5.0",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/jest": "^30.0.0",
"@types/node": "^25.9.2",
"@types/node": "^26.1.1",
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"@types/webpack": "^5.28.5",
@@ -71,37 +71,44 @@
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^7.1.4",
"css-minimizer-webpack-plugin": "^8.0.0",
"cypress": "^15.17.0",
"cypress": "^15.18.1",
"dotenv": "^17.4.2",
"eslint": "^9.39.4",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-storybook": "^10.4.3",
"eslint-plugin-storybook": "^10.4.6",
"eslint-webpack-plugin": "^6.0.0",
"globals": "^16.5.0",
"globals": "^17.7.0",
"html-webpack-plugin": "^5.6.7",
"identity-obj-proxy": "^3.0.0",
"jest": "^30.4.2",
"jest-environment-jsdom": "^30.4.1",
"jest-fetch-mock": "^3.0.3",
"jest-fetch-mock": "^4.2.0",
"mini-css-extract-plugin": "^2.10.2",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"resolve-ts-aliases": "^1.0.1",
"sass": "^1.100.0",
"sass": "^1.101.0",
"sass-loader": "^17.0.0",
"storybook": "^10.4.3",
"storybook": "^10.5.0",
"style-loader": "^4.0.0",
"terser-webpack-plugin": "^5.6.1",
"ts-jest": "^29.4.11",
"ts-loader": "^9.6.0",
"ts-loader": "^9.6.2",
"ts-node": "^10.9.2",
"tsconfig-paths-webpack-plugin": "^4.2.0",
"typescript": "^6.0.3",
"typescript-eslint": "^8.61.0",
"typescript-eslint": "^8.61.1",
"url-loader": "^4.1.1",
"webpack": "^5.107.2",
"webpack-cli": "^7.0.3",
"webpack": "^5.108.4",
"webpack-cli": "^7.2.1",
"webpack-node-externals": "^3.0.0"
},
"overrides": {
"ts-jest": {
"@babel/core": "^8.0.1"
},
"js-yaml": "^4.2.0"
},
"peerDependencies": {
"react": "^19.1.0",
"react-dom": "^19.1.0"

18
tsconfig.cy.json Normal file
View File

@@ -0,0 +1,18 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "."
},
"include": [
"src",
"cypress",
"src/@types"
],
"exclude": [
"node_modules",
"dist",
"**/*.stories.*",
"**/*.test.ts",
"**/*.test.tsx"
]
}

View File

@@ -25,7 +25,7 @@ export default {
mode: 'production',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
path: path.resolve('dist'),
library: libraryName,
libraryTarget: 'umd',
globalObject: 'this',

View File

@@ -22,7 +22,7 @@ export default {
},
mode: 'development',
output: {
path: path.resolve(__dirname, 'dist'),
path: path.resolve('dist'),
},
target: 'web',
plugins: [
@@ -37,7 +37,7 @@ export default {
}),
new ESLintPlugin(),
new HtmlWebpackPlugin({
template: path.join(__dirname, 'public', 'index.html'),
template: path.join('public', 'index.html'),
}),
new webpack.ProvidePlugin({
React: 'react',
@@ -48,7 +48,10 @@ export default {
{
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
use: 'ts-loader',
use: {
loader: 'ts-loader',
options: { configFile: 'tsconfig.cy.json' },
},
},
{
test: /\.(js|jsx)$/,