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

@ -1,40 +1,43 @@
const path = require('path');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
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 = {
"stories": ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
"addons": [
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-webpack5-compiler-babel",
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
{
name: '@storybook/preset-scss',
name: '@storybook/addon-styling-webpack',
options: {
cssLoaderOptions: {
modules: {
auto: /\.module\.\w+$/i,
rules: [
{
test: /\.(css|sass|scss)$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: {
namedExport: false,
exportLocalsConvention: 'as-is',
auto: /\.module\.\w+$/i,
}
},
},
'sass-loader',
],
}
}
}
]
},
}
],
"webpackFinal": async config => {
config.module.rules.push(
{
test: /\.(ts|tsx)$/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
],
}
);
webpackFinal: async config => {
config.entry = config.entry.map(function(entry) {
if (entry.includes("webpack-hot-middleware")) {
return `${require.resolve('webpack-hot-middleware/client')}?path=${prefixUrl}__webpack_hmr&reload=true`;
@ -48,7 +51,7 @@ module.exports = {
config.resolve.plugins = [new TsconfigPathsPlugin()];
return config;
},
"framework": {
framework: {
name: "@storybook/react-webpack5",
options: {}
},
@ -61,6 +64,9 @@ module.exports = {
}
}
},
features: {
previewMdx2: true
},
docs: {
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",
"version": "1.2.23",
"version": "1.2.24",
"description": "A starter kit for create a React component Library with storybook",
"bin": "./bin/cli.js",
"main": "dist/index.js",
@ -35,41 +35,43 @@
},
"homepage": "https://github.com/aleleba/create-react-component-library#readme",
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.4",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@babel/register": "^7.24.6",
"@babel/core": "^7.25.8",
"@babel/preset-env": "^7.25.8",
"@babel/preset-react": "^7.25.7",
"@babel/preset-typescript": "^7.25.7",
"@babel/register": "^7.25.7",
"@mdx-js/react": "^3.0.1",
"@storybook/addon-actions": "^8.3.1",
"@storybook/addon-docs": "^8.3.1",
"@storybook/addon-essentials": "^8.3.1",
"@storybook/addon-interactions": "^8.3.1",
"@storybook/addon-links": "^8.3.1",
"@storybook/blocks": "^8.3.1",
"@storybook/cli": "^8.3.1",
"@storybook/addon-actions": "^8.3.5",
"@storybook/addon-docs": "^8.3.5",
"@storybook/addon-essentials": "^8.3.5",
"@storybook/addon-interactions": "^8.3.5",
"@storybook/addon-links": "^8.3.5",
"@storybook/addon-styling-webpack": "^1.0.0",
"@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/preset-scss": "^1.0.3",
"@storybook/react": "^8.3.1",
"@storybook/react-webpack5": "^8.3.1",
"@storybook/react": "^8.3.5",
"@storybook/react-webpack5": "^8.3.5",
"@storybook/testing-library": "^0.2.2",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.13",
"@types/node": "^22.5.5",
"@types/react": "^18.3.7",
"@types/react-dom": "^18.3.0",
"@types/node": "^22.7.5",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@types/webpack": "^5.28.5",
"babel-loader": "^9.2.1",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^7.1.2",
"css-minimizer-webpack-plugin": "^7.0.0",
"cypress": "^13.14.2",
"cypress": "^13.15.0",
"dotenv": "^16.4.5",
"eslint": "^9.10.0",
"eslint-plugin-react": "^7.36.1",
"eslint-plugin-storybook": "^0.8.0",
"eslint": "^9.12.0",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-storybook": "^0.9.0",
"eslint-webpack-plugin": "^4.2.0",
"html-webpack-plugin": "^5.6.0",
"identity-obj-proxy": "^3.0.0",
@ -80,17 +82,16 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"resolve-ts-aliases": "^1.0.1",
"sass": "^1.79.1",
"sass-loader": "^16.0.1",
"storybook": "^8.3.1",
"sass": "^1.79.5",
"sass-loader": "^16.0.2",
"storybook": "^8.3.5",
"style-loader": "^4.0.0",
"terser-webpack-plugin": "^5.3.10",
"ts-jest": "^29.2.5",
"ts-loader": "^9.5.1",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.6.2",
"typescript": "^5.6.3",
"url-loader": "^4.1.1",
"webpack": "^5.94.0",
"webpack": "^5.95.0",
"webpack-cli": "^5.1.4",
"webpack-node-externals": "^3.0.0"
},

View File

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

View File

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