Compare commits

...

10 Commits

Author SHA1 Message Date
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
7 changed files with 5237 additions and 1674 deletions

View File

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

View File

@@ -77,5 +77,30 @@ module.exports = {
docs: { docs: {
autodocs: 'tag', autodocs: 'tag',
defaultName: 'Docs', 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;
},
}; };

6800
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", "name": "@aleleba/create-react-component-library",
"version": "1.4.0", "version": "1.4.1",
"description": "A starter kit for create a React component Library with storybook", "description": "A starter kit for create a React component Library with storybook",
"bin": "./bin/cli.js", "bin": "./bin/cli.js",
"main": "dist/index.js", "main": "dist/index.js",
@@ -44,26 +44,26 @@
}, },
"homepage": "https://github.com/aleleba/create-react-component-library#readme", "homepage": "https://github.com/aleleba/create-react-component-library#readme",
"devDependencies": { "devDependencies": {
"@babel/core": "^7.29.7", "@babel/core": "^8.0.1",
"@babel/preset-env": "^7.29.7", "@babel/preset-env": "^8.0.2",
"@babel/preset-react": "^7.29.7", "@babel/preset-react": "^8.0.1",
"@babel/preset-typescript": "^7.29.7", "@babel/preset-typescript": "^8.0.1",
"@babel/register": "^7.29.7", "@babel/register": "^8.0.1",
"@eslint/js": "^9.39.4", "@eslint/js": "^9.39.4",
"@mdx-js/react": "^3.1.1", "@mdx-js/react": "^3.1.1",
"@storybook/addon-docs": "^10.4.3", "@storybook/addon-docs": "^10.4.6",
"@storybook/addon-links": "^10.4.3", "@storybook/addon-links": "^10.4.6",
"@storybook/addon-styling-webpack": "^3.0.2", "@storybook/addon-styling-webpack": "^3.0.2",
"@storybook/addon-webpack5-compiler-babel": "^4.0.1", "@storybook/addon-webpack5-compiler-babel": "^4.0.1",
"@storybook/cli": "^10.4.3", "@storybook/cli": "^10.4.6",
"@storybook/preset-scss": "^1.0.3", "@storybook/preset-scss": "^1.0.3",
"@storybook/react-webpack5": "^10.4.3", "@storybook/react-webpack5": "^10.4.6",
"@testing-library/dom": "^10.4.1", "@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1", "@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2", "@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1", "@testing-library/user-event": "^14.6.1",
"@types/jest": "^30.0.0", "@types/jest": "^30.0.0",
"@types/node": "^25.9.2", "@types/node": "^26.0.0",
"@types/react": "^19.2.17", "@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^19.2.3",
"@types/webpack": "^5.28.5", "@types/webpack": "^5.28.5",
@@ -75,9 +75,9 @@
"dotenv": "^17.4.2", "dotenv": "^17.4.2",
"eslint": "^9.39.4", "eslint": "^9.39.4",
"eslint-plugin-react": "^7.37.5", "eslint-plugin-react": "^7.37.5",
"eslint-plugin-storybook": "^10.4.3", "eslint-plugin-storybook": "^10.4.6",
"eslint-webpack-plugin": "^6.0.0", "eslint-webpack-plugin": "^6.0.0",
"globals": "^16.5.0", "globals": "^17.6.0",
"html-webpack-plugin": "^5.6.7", "html-webpack-plugin": "^5.6.7",
"identity-obj-proxy": "^3.0.0", "identity-obj-proxy": "^3.0.0",
"jest": "^30.4.2", "jest": "^30.4.2",
@@ -87,21 +87,28 @@
"react": "^19.2.7", "react": "^19.2.7",
"react-dom": "^19.2.7", "react-dom": "^19.2.7",
"resolve-ts-aliases": "^1.0.1", "resolve-ts-aliases": "^1.0.1",
"sass": "^1.100.0", "sass": "^1.101.0",
"sass-loader": "^17.0.0", "sass-loader": "^17.0.0",
"storybook": "^10.4.3", "storybook": "^10.4.6",
"style-loader": "^4.0.0", "style-loader": "^4.0.0",
"terser-webpack-plugin": "^5.6.1", "terser-webpack-plugin": "^5.6.1",
"ts-jest": "^29.4.11", "ts-jest": "^29.4.11",
"ts-loader": "^9.6.0", "ts-loader": "^9.6.1",
"ts-node": "^10.9.2",
"tsconfig-paths-webpack-plugin": "^4.2.0", "tsconfig-paths-webpack-plugin": "^4.2.0",
"typescript": "^6.0.3", "typescript": "^6.0.3",
"typescript-eslint": "^8.61.0", "typescript-eslint": "^8.61.1",
"url-loader": "^4.1.1", "url-loader": "^4.1.1",
"webpack": "^5.107.2", "webpack": "^5.107.2",
"webpack-cli": "^7.0.3", "webpack-cli": "^7.0.3",
"webpack-node-externals": "^3.0.0" "webpack-node-externals": "^3.0.0"
}, },
"overrides": {
"ts-jest": {
"@babel/core": "^8.0.1"
},
"js-yaml": "^4.2.0"
},
"peerDependencies": { "peerDependencies": {
"react": "^19.1.0", "react": "^19.1.0",
"react-dom": "^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', mode: 'production',
output: { output: {
filename: 'index.js', filename: 'index.js',
path: path.resolve(__dirname, 'dist'), path: path.resolve('dist'),
library: libraryName, library: libraryName,
libraryTarget: 'umd', libraryTarget: 'umd',
globalObject: 'this', globalObject: 'this',

View File

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