@itcase/storybook-config 1.1.2 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/mainConfig.js +37 -3
- package/package.json +9 -9
|
@@ -1,15 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import path from 'path'
|
|
2
|
+
|
|
3
|
+
import chalk from 'chalk'
|
|
2
4
|
|
|
3
5
|
const STORYBOOK_PUBLIC_PATH = null
|
|
6
|
+
const WEBPACK_ALIAS = {
|
|
7
|
+
'@': path.resolve(__dirname, '../src'),
|
|
8
|
+
}
|
|
4
9
|
|
|
5
10
|
const MAIN_CONFIG = {
|
|
6
11
|
webpackFinal: async (config) => {
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
console.log(
|
|
13
|
+
chalk.green(
|
|
14
|
+
'info => ,
|
|
15
|
+
),
|
|
9
16
|
)
|
|
17
|
+
|
|
18
|
+
console.log(
|
|
19
|
+
chalk.green(
|
|
20
|
+
'info =>',
|
|
21
|
+
chalk.white('Using default "publicPath" set "STORYBOOK_PUBLIC_PATH" variable to use another one'),
|
|
22
|
+
)
|
|
23
|
+
)
|
|
24
|
+
|
|
10
25
|
if (STORYBOOK_PUBLIC_PATH) {
|
|
11
26
|
config.output.publicPath = STORYBOOK_PUBLIC_PATH
|
|
12
27
|
}
|
|
28
|
+
// @svgr/webpack
|
|
13
29
|
const imageRule = config.module?.rules?.find((rule) => {
|
|
14
30
|
const test = rule.test
|
|
15
31
|
if (!test) {
|
|
@@ -24,6 +40,24 @@ const MAIN_CONFIG = {
|
|
|
24
40
|
test: /\.svg$/,
|
|
25
41
|
use: ['@svgr/webpack'],
|
|
26
42
|
})
|
|
43
|
+
|
|
44
|
+
// update webpack alias
|
|
45
|
+
console.log(
|
|
46
|
+
chalk.green(
|
|
47
|
+
'info =>',
|
|
48
|
+
chalk.white('Using default "WEBPACK_ALIAS" from'),
|
|
49
|
+
chalk.cyan('@'),
|
|
50
|
+
chalk.white('to'),
|
|
51
|
+
chalk.cyan('../src'),
|
|
52
|
+
chalk.white('change it to use another one')
|
|
53
|
+
),
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
config.resolve.alias = {
|
|
57
|
+
...config.resolve.alias,
|
|
58
|
+
...WEBPACK_ALIAS,
|
|
59
|
+
}
|
|
60
|
+
|
|
27
61
|
return config
|
|
28
62
|
},
|
|
29
63
|
layout: 'fullscreen',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/storybook-config",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"author": "ITCase",
|
|
5
5
|
"description": "Code style linter configuration presets",
|
|
6
6
|
"engines": {
|
|
@@ -73,14 +73,14 @@
|
|
|
73
73
|
"@storybook/blocks": "^8.6.12",
|
|
74
74
|
"@storybook/manager-api": "^8.6.12",
|
|
75
75
|
"@storybook/nextjs": "^8.6.12",
|
|
76
|
-
"@storybook/node-logger": "^8.6.12",
|
|
77
76
|
"@storybook/preview-api": "^8.6.12",
|
|
78
77
|
"@storybook/react": "^8.6.12",
|
|
79
78
|
"@storybook/react-vite": "^8.6.12",
|
|
80
79
|
"@storybook/react-webpack5": "^8.6.12",
|
|
81
80
|
"@storybook/theming": "^8.6.12",
|
|
82
|
-
"
|
|
83
|
-
"
|
|
81
|
+
"chalk": "^5.4.1",
|
|
82
|
+
"http-proxy-middleware": "^3.0.5",
|
|
83
|
+
"msw": "^2.7.4",
|
|
84
84
|
"msw-storybook-addon": "^2.0.4",
|
|
85
85
|
"react-docgen": "^7.1.1",
|
|
86
86
|
"react-docgen-typescript-plugin": "^1.0.8",
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@commitlint/cli": "^19.8.0",
|
|
91
91
|
"@commitlint/config-conventional": "^19.8.0",
|
|
92
|
-
"@itcase/common": "^1.2.
|
|
93
|
-
"@itcase/lint": "^1.1.
|
|
94
|
-
"@itcase/ui": "^1.4.
|
|
92
|
+
"@itcase/common": "^1.2.22",
|
|
93
|
+
"@itcase/lint": "^1.1.4",
|
|
94
|
+
"@itcase/ui": "^1.4.6",
|
|
95
95
|
"@rollup/plugin-babel": "^6.0.4",
|
|
96
96
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
97
97
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
@@ -104,11 +104,11 @@
|
|
|
104
104
|
"eslint": "9.24.0",
|
|
105
105
|
"glob": "^11.0.1",
|
|
106
106
|
"husky": "^9.1.7",
|
|
107
|
-
"lint-staged": "^15.5.
|
|
107
|
+
"lint-staged": "^15.5.1",
|
|
108
108
|
"prettier": "^3.5.3",
|
|
109
109
|
"react": "^18",
|
|
110
110
|
"react-dom": "^18",
|
|
111
|
-
"rollup": "^4.
|
|
111
|
+
"rollup": "^4.40.0",
|
|
112
112
|
"rollup-plugin-copy": "^3.5.0",
|
|
113
113
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
114
114
|
"semantic-release": "^24.2.3",
|