PR-259604: Updating packages and fix css-loader.

This commit is contained in:
Alejandro Lembke Barrientos 2024-10-12 21:28:48 +00:00
parent 410dda1923
commit 7ab40e152d
Signed by: aleleba
GPG Key ID: F48D7CDEB47942BD
5 changed files with 2477 additions and 2151 deletions

View File

@ -3,38 +3,41 @@ const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const deFaultValues = { const deFaultValues = {
PREFIX_URL: '' PREFIX_URL: ''
} }
const prefixUrl = process.env.PREFIX_URL ? process.env.PREFIX_URL : deFaultValues.PREFIX_URL const prefixUrl = process.env.PREFIX_URL ? process.env.PREFIX_URL : deFaultValues.PREFIX_URL;
module.exports = { module.exports = {
"stories": ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
"addons": [ addons: [
"@storybook/addon-webpack5-compiler-babel",
"@storybook/addon-links", "@storybook/addon-links",
"@storybook/addon-essentials", "@storybook/addon-essentials",
"@storybook/addon-interactions", "@storybook/addon-interactions",
{ {
name: '@storybook/preset-scss', name: '@storybook/addon-styling-webpack',
options: {
rules: [
{
test: /\.(css|sass|scss)$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: { options: {
cssLoaderOptions: {
modules: { modules: {
namedExport: false,
exportLocalsConvention: 'as-is',
auto: /\.module\.\w+$/i, auto: /\.module\.\w+$/i,
} }
}
}
}
],
"webpackFinal": async config => {
config.module.rules.push(
{
test: /\.(ts|tsx)$/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true,
}, },
}, },
'sass-loader',
], ],
} }
); ]
},
}
],
webpackFinal: async config => {
config.entry = config.entry.map(function(entry) { config.entry = config.entry.map(function(entry) {
if (entry.includes("webpack-hot-middleware")) { if (entry.includes("webpack-hot-middleware")) {
return `${require.resolve('webpack-hot-middleware/client')}?path=${prefixUrl}__webpack_hmr&reload=true`; return `${require.resolve('webpack-hot-middleware/client')}?path=${prefixUrl}__webpack_hmr&reload=true`;
@ -48,7 +51,7 @@ module.exports = {
config.resolve.plugins = [new TsconfigPathsPlugin()]; config.resolve.plugins = [new TsconfigPathsPlugin()];
return config; return config;
}, },
"framework": { framework: {
name: "@storybook/react-webpack5", name: "@storybook/react-webpack5",
options: {} options: {}
}, },
@ -61,6 +64,9 @@ module.exports = {
} }
} }
}, },
features: {
previewMdx2: true
},
docs: { docs: {
autodocs: true autodocs: true
} }

4491
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.2.23", "version": "1.2.24",
"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",
@ -35,41 +35,43 @@
}, },
"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.25.2", "@babel/core": "^7.25.8",
"@babel/preset-env": "^7.25.4", "@babel/preset-env": "^7.25.8",
"@babel/preset-react": "^7.24.7", "@babel/preset-react": "^7.25.7",
"@babel/preset-typescript": "^7.24.7", "@babel/preset-typescript": "^7.25.7",
"@babel/register": "^7.24.6", "@babel/register": "^7.25.7",
"@mdx-js/react": "^3.0.1", "@mdx-js/react": "^3.0.1",
"@storybook/addon-actions": "^8.3.1", "@storybook/addon-actions": "^8.3.5",
"@storybook/addon-docs": "^8.3.1", "@storybook/addon-docs": "^8.3.5",
"@storybook/addon-essentials": "^8.3.1", "@storybook/addon-essentials": "^8.3.5",
"@storybook/addon-interactions": "^8.3.1", "@storybook/addon-interactions": "^8.3.5",
"@storybook/addon-links": "^8.3.1", "@storybook/addon-links": "^8.3.5",
"@storybook/blocks": "^8.3.1", "@storybook/addon-styling-webpack": "^1.0.0",
"@storybook/cli": "^8.3.1", "@storybook/addon-webpack5-compiler-babel": "^3.0.3",
"@storybook/blocks": "^8.3.5",
"@storybook/cli": "^8.3.5",
"@storybook/mdx2-csf": "^1.1.0", "@storybook/mdx2-csf": "^1.1.0",
"@storybook/preset-scss": "^1.0.3", "@storybook/preset-scss": "^1.0.3",
"@storybook/react": "^8.3.1", "@storybook/react": "^8.3.5",
"@storybook/react-webpack5": "^8.3.1", "@storybook/react-webpack5": "^8.3.5",
"@storybook/testing-library": "^0.2.2", "@storybook/testing-library": "^0.2.2",
"@testing-library/jest-dom": "^6.5.0", "@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1", "@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2", "@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.13", "@types/jest": "^29.5.13",
"@types/node": "^22.5.5", "@types/node": "^22.7.5",
"@types/react": "^18.3.7", "@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0", "@types/react-dom": "^18.3.1",
"@types/webpack": "^5.28.5", "@types/webpack": "^5.28.5",
"babel-loader": "^9.2.1", "babel-loader": "^9.2.1",
"clean-webpack-plugin": "^4.0.0", "clean-webpack-plugin": "^4.0.0",
"css-loader": "^7.1.2", "css-loader": "^7.1.2",
"css-minimizer-webpack-plugin": "^7.0.0", "css-minimizer-webpack-plugin": "^7.0.0",
"cypress": "^13.14.2", "cypress": "^13.15.0",
"dotenv": "^16.4.5", "dotenv": "^16.4.5",
"eslint": "^9.10.0", "eslint": "^9.12.0",
"eslint-plugin-react": "^7.36.1", "eslint-plugin-react": "^7.37.1",
"eslint-plugin-storybook": "^0.8.0", "eslint-plugin-storybook": "^0.9.0",
"eslint-webpack-plugin": "^4.2.0", "eslint-webpack-plugin": "^4.2.0",
"html-webpack-plugin": "^5.6.0", "html-webpack-plugin": "^5.6.0",
"identity-obj-proxy": "^3.0.0", "identity-obj-proxy": "^3.0.0",
@ -80,17 +82,16 @@
"react": "^18.3.1", "react": "^18.3.1",
"react-dom": "^18.3.1", "react-dom": "^18.3.1",
"resolve-ts-aliases": "^1.0.1", "resolve-ts-aliases": "^1.0.1",
"sass": "^1.79.1", "sass": "^1.79.5",
"sass-loader": "^16.0.1", "sass-loader": "^16.0.2",
"storybook": "^8.3.1", "storybook": "^8.3.5",
"style-loader": "^4.0.0", "style-loader": "^4.0.0",
"terser-webpack-plugin": "^5.3.10", "terser-webpack-plugin": "^5.3.10",
"ts-jest": "^29.2.5", "ts-jest": "^29.2.5",
"ts-loader": "^9.5.1",
"tsconfig-paths-webpack-plugin": "^4.1.0", "tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.6.2", "typescript": "^5.6.3",
"url-loader": "^4.1.1", "url-loader": "^4.1.1",
"webpack": "^5.94.0", "webpack": "^5.95.0",
"webpack-cli": "^5.1.4", "webpack-cli": "^5.1.4",
"webpack-node-externals": "^3.0.0" "webpack-node-externals": "^3.0.0"
}, },

View File

@ -56,9 +56,11 @@ export default {
use: [ use: [
externalCss === true ? MiniCssExtractPlugin.loader : 'style-loader', externalCss === true ? MiniCssExtractPlugin.loader : 'style-loader',
{ {
'loader': 'css-loader', loader: 'css-loader',
'options': { options: {
modules: { modules: {
namedExport: false,
exportLocalsConvention: 'as-is',
auto: /\.module\.\w+$/i, auto: /\.module\.\w+$/i,
} }
}, },

View File

@ -57,9 +57,11 @@ export default {
use: [ use: [
externalCss === true ? MiniCssExtractPlugin.loader : 'style-loader', externalCss === true ? MiniCssExtractPlugin.loader : 'style-loader',
{ {
'loader': 'css-loader', loader: 'css-loader',
'options': { options: {
modules: { modules: {
namedExport: false,
exportLocalsConvention: 'as-is',
auto: /\.module\.\w+$/i, auto: /\.module\.\w+$/i,
} }
}, },