@itcase/storybook-config 1.1.41 → 1.1.45
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/addonThemes.js +1 -0
- package/dist/config/addons/addonThemes.js +1 -0
- package/dist/config/addons/{addonsReactVite.js → addonsVite.js} +2 -2
- package/dist/config/addons/{addonsReact.js → addonsWebpack.js} +2 -2
- package/dist/config/addons/index.js +5 -0
- package/dist/config/{addonsReactVite.js → addonsVite.js} +2 -2
- package/dist/config/{addonsReact.js → addonsWebpack.js} +2 -2
- package/dist/config/config/index.js +4 -0
- package/dist/config/config/mainConfigVite.js +13 -0
- package/dist/config/{mainConfig.js → config/mainConfigWebpack.js} +2 -3
- package/dist/config/framework/frameworkVite.js +5 -0
- package/dist/config/framework/{frameworkReact.js → frameworkWebpack.js} +2 -2
- package/dist/config/framework/index.js +5 -0
- package/dist/config/frameworkVite.js +5 -0
- package/dist/config/{frameworkReact.js → frameworkWebpack.js} +2 -2
- package/dist/config/index.js +49 -4
- package/dist/config/main/index.js +23 -24
- package/dist/config/mainConfigWebpack.js +65 -0
- package/dist/config/msw/index.js +7 -0
- package/dist/config/msw/mswHandlers.js +32 -0
- package/dist/config/preview/index.js +3 -3
- package/dist/config/static/index.js +5 -0
- package/dist/config/static/staticDirsVite.js +3 -0
- package/dist/config/static/staticDirsWebpack.js +3 -0
- package/dist/config/staticDirsVite.js +3 -0
- package/dist/config/staticDirsWebpack.js +3 -0
- package/dist/config/users/authorization.js +9 -0
- package/dist/config/users/users.js +22 -0
- package/dist/utils/handleMSWParameters.js +1 -1
- package/package.json +1 -1
- package/dist/config/framework/frameworkReactVite.js +0 -5
- package/dist/config/frameworkReactVite.js +0 -5
- package/dist/config/static/staticDirsReact.js +0 -3
- package/dist/config/static/staticDirsReactVite.js +0 -3
- package/dist/config/staticDirsReact.js +0 -3
- package/dist/config/staticDirsReactVite.js +0 -3
- /package/dist/config/{backgrounds.js → backgrounds/index.js} +0 -0
- /package/dist/config/{viewports.js → viewport/index.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ADDONS_VITE = [
|
|
2
2
|
'@storybook/addon-links',
|
|
3
3
|
'@storybook/addon-themes',
|
|
4
4
|
'@storybook/addon-designs',
|
|
@@ -7,4 +7,4 @@ const ADDONS_REACT_VITE = [
|
|
|
7
7
|
'@etchteam/storybook-addon-status',
|
|
8
8
|
]
|
|
9
9
|
|
|
10
|
-
export {
|
|
10
|
+
export { ADDONS_VITE }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ADDONS_WEBPACK = [
|
|
2
2
|
'@storybook/addon-webpack5-compiler-swc',
|
|
3
3
|
'@storybook/addon-themes',
|
|
4
4
|
'@storybook/addon-designs',
|
|
@@ -28,4 +28,4 @@ const ADDONS_REACT = [
|
|
|
28
28
|
},
|
|
29
29
|
]
|
|
30
30
|
|
|
31
|
-
export {
|
|
31
|
+
export { ADDONS_WEBPACK }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ADDONS_VITE = [
|
|
2
2
|
'@storybook/addon-links',
|
|
3
3
|
'@storybook/addon-themes',
|
|
4
4
|
'@storybook/addon-designs',
|
|
@@ -7,4 +7,4 @@ const ADDONS_REACT_VITE = [
|
|
|
7
7
|
'@etchteam/storybook-addon-status',
|
|
8
8
|
]
|
|
9
9
|
|
|
10
|
-
export {
|
|
10
|
+
export { ADDONS_VITE }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const ADDONS_WEBPACK = [
|
|
2
2
|
'@storybook/addon-webpack5-compiler-swc',
|
|
3
3
|
'@storybook/addon-themes',
|
|
4
4
|
'@storybook/addon-designs',
|
|
@@ -28,4 +28,4 @@ const ADDONS_REACT = [
|
|
|
28
28
|
},
|
|
29
29
|
]
|
|
30
30
|
|
|
31
|
-
export {
|
|
31
|
+
export { ADDONS_WEBPACK }
|
|
@@ -6,7 +6,7 @@ const WEBPACK_ALIAS = {
|
|
|
6
6
|
'@itcase/ui': `${process.cwd()}/node_modules/@itcase/ui/dist`,
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const MAIN_CONFIG_WEBPACK = {
|
|
10
10
|
webpackFinal: async (config) => {
|
|
11
11
|
console.log(
|
|
12
12
|
chalk.green(
|
|
@@ -55,7 +55,6 @@ const MAIN_CONFIG = {
|
|
|
55
55
|
|
|
56
56
|
return config
|
|
57
57
|
},
|
|
58
|
-
layout: 'fullscreen',
|
|
59
58
|
core: {
|
|
60
59
|
disableTelemetry: true,
|
|
61
60
|
disableWhatsNewNotifications: true,
|
|
@@ -63,4 +62,4 @@ const MAIN_CONFIG = {
|
|
|
63
62
|
tags: ['autodocs'],
|
|
64
63
|
}
|
|
65
64
|
|
|
66
|
-
export {
|
|
65
|
+
export { MAIN_CONFIG_WEBPACK }
|
package/dist/config/index.js
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BACKGROUNDS } from '../backgrounds.js'
|
|
3
|
-
import { VIEWPORTS } from '../viewports.js'
|
|
1
|
+
import { INITIAL_VIEWPORTS, MINIMAL_VIEWPORTS } from 'storybook/viewport'
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
const VIEWPORTS = {
|
|
4
|
+
desktop: {
|
|
5
|
+
name: 'Desktop',
|
|
6
|
+
styles: {
|
|
7
|
+
width: '1440px',
|
|
8
|
+
height: '100%',
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
form: {
|
|
12
|
+
name: 'Form',
|
|
13
|
+
styles: {
|
|
14
|
+
width: '520px',
|
|
15
|
+
height: '800px',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
formLarge: {
|
|
19
|
+
name: 'Form',
|
|
20
|
+
styles: {
|
|
21
|
+
width: '800px',
|
|
22
|
+
height: '800px',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
formSmall: {
|
|
26
|
+
name: 'Form Small',
|
|
27
|
+
styles: {
|
|
28
|
+
width: '360px',
|
|
29
|
+
height: '800px',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
mobile: {
|
|
33
|
+
name: 'Mobile',
|
|
34
|
+
styles: {
|
|
35
|
+
width: '375px',
|
|
36
|
+
height: '667px',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
standalone: {
|
|
40
|
+
name: 'Standalone',
|
|
41
|
+
styles: {
|
|
42
|
+
width: '480px',
|
|
43
|
+
height: '640px',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
...INITIAL_VIEWPORTS,
|
|
47
|
+
...MINIMAL_VIEWPORTS,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { VIEWPORTS }
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { ADDONS_NEXTJS } from '../addons/
|
|
2
|
-
import { ADDONS_REACT } from '../addons/addonsReact.js'
|
|
3
|
-
import { ADDONS_REACT_VITE } from '../addons/addonsReactVite.js'
|
|
4
|
-
import { ADDON_THEMES } from '../addons/addonThemes.js'
|
|
1
|
+
import { ADDONS_NEXTJS, ADDONS_VITE, ADDONS_WEBPACK } from '../addons/'
|
|
5
2
|
import { AUTHORIZATION } from '../authorization.js'
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
import { MAIN_CONFIG_VITE, MAIN_CONFIG_WEBPACK } from '../config/'
|
|
4
|
+
import {
|
|
5
|
+
FRAMEWORK_NEXTJS,
|
|
6
|
+
FRAMEWORK_VITE,
|
|
7
|
+
FRAMEWORK_WEBPACK,
|
|
8
|
+
} from '../framework/'
|
|
11
9
|
import { REFS } from '../refs.js'
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import {
|
|
11
|
+
STATIC_DIRS_NEXTJS,
|
|
12
|
+
STATIC_DIRS_VITE,
|
|
13
|
+
STATIC_DIRS_WEBPACK,
|
|
14
|
+
} from '../static'
|
|
15
15
|
import { STATUS } from '../status.js'
|
|
16
16
|
|
|
17
17
|
export {
|
|
18
|
-
AUTHORIZATION,
|
|
19
|
-
ADDON_THEMES,
|
|
20
18
|
ADDONS_NEXTJS,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
STATIC_DIRS_REACT_VITE,
|
|
25
|
-
FRAMEWORK_NEXTJS,
|
|
26
|
-
FRAMEWORK_REACT,
|
|
27
|
-
FRAMEWORK_REACT_VITE,
|
|
28
|
-
ADDONS_REACT,
|
|
29
|
-
ADDONS_REACT_VITE,
|
|
30
|
-
MAIN_CONFIG,
|
|
19
|
+
ADDONS_VITE,
|
|
20
|
+
ADDONS_WEBPACK,
|
|
21
|
+
AUTHORIZATION,
|
|
31
22
|
MAIN_CONFIG_VITE,
|
|
23
|
+
MAIN_CONFIG_WEBPACK,
|
|
24
|
+
FRAMEWORK_NEXTJS,
|
|
25
|
+
FRAMEWORK_VITE,
|
|
26
|
+
FRAMEWORK_WEBPACK,
|
|
32
27
|
REFS,
|
|
28
|
+
STATIC_DIRS_NEXTJS,
|
|
29
|
+
STATIC_DIRS_VITE,
|
|
30
|
+
STATIC_DIRS_WEBPACK,
|
|
31
|
+
STATUS,
|
|
33
32
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import chalk from 'chalk'
|
|
2
|
+
|
|
3
|
+
const STORYBOOK_PUBLIC_PATH = null
|
|
4
|
+
const WEBPACK_ALIAS = {
|
|
5
|
+
src: `${process.cwd()}/src`,
|
|
6
|
+
'@itcase/ui': `${process.cwd()}/node_modules/@itcase/ui/dist`,
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const MAIN_CONFIG_WEBPACK = {
|
|
10
|
+
webpackFinal: async (config) => {
|
|
11
|
+
console.log(
|
|
12
|
+
chalk.green(
|
|
13
|
+
'info =>',
|
|
14
|
+
chalk.white(
|
|
15
|
+
'Using default "publicPath" set "STORYBOOK_PUBLIC_PATH" variable to use another one',
|
|
16
|
+
),
|
|
17
|
+
),
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
if (STORYBOOK_PUBLIC_PATH) {
|
|
21
|
+
config.output.publicPath = STORYBOOK_PUBLIC_PATH
|
|
22
|
+
}
|
|
23
|
+
// @svgr/webpack
|
|
24
|
+
const imageRule = config.module?.rules?.find((rule) => {
|
|
25
|
+
const test = rule.test
|
|
26
|
+
if (!test) {
|
|
27
|
+
return false
|
|
28
|
+
}
|
|
29
|
+
return test.test('.svg')
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
imageRule.exclude = /\.svg$/
|
|
33
|
+
|
|
34
|
+
config.module?.rules?.push({
|
|
35
|
+
test: /\.svg$/,
|
|
36
|
+
use: ['@svgr/webpack'],
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
// update webpack alias
|
|
40
|
+
console.log(
|
|
41
|
+
chalk.green(
|
|
42
|
+
'info =>',
|
|
43
|
+
chalk.white('Using default "WEBPACK_ALIAS" from'),
|
|
44
|
+
chalk.cyan('src'),
|
|
45
|
+
chalk.white('to'),
|
|
46
|
+
chalk.cyan(`${process.cwd()}/src`),
|
|
47
|
+
chalk.white('change it to use another one'),
|
|
48
|
+
),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
config.resolve.alias = {
|
|
52
|
+
...config.resolve.alias,
|
|
53
|
+
...WEBPACK_ALIAS,
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return config
|
|
57
|
+
},
|
|
58
|
+
core: {
|
|
59
|
+
disableTelemetry: true,
|
|
60
|
+
disableWhatsNewNotifications: true,
|
|
61
|
+
},
|
|
62
|
+
tags: ['autodocs'],
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { MAIN_CONFIG_WEBPACK }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { delay, http, HttpResponse } from 'msw'
|
|
2
|
+
|
|
3
|
+
const serverErrorHandler = (formUrl, errors) => {
|
|
4
|
+
return http.post(formUrl, async () => {
|
|
5
|
+
return HttpResponse.json(errors, { status: 400 })
|
|
6
|
+
})
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const error500Handler = (formUrl) => {
|
|
10
|
+
http.post(formUrl, async () => {
|
|
11
|
+
return HttpResponse.json(
|
|
12
|
+
{},
|
|
13
|
+
{
|
|
14
|
+
status: 500,
|
|
15
|
+
},
|
|
16
|
+
)
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const loadingHandler = (formUrl) => {
|
|
21
|
+
http.post(formUrl, async () => {
|
|
22
|
+
await delay(60000)
|
|
23
|
+
return HttpResponse(
|
|
24
|
+
{},
|
|
25
|
+
{
|
|
26
|
+
status: 200,
|
|
27
|
+
},
|
|
28
|
+
)
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { serverErrorHandler, error500Handler, loadingHandler }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ADDON_THEMES } from '../addons
|
|
2
|
-
import { BACKGROUNDS } from '../backgrounds
|
|
3
|
-
import { VIEWPORTS } from '../viewports
|
|
1
|
+
import { ADDON_THEMES } from '../addons'
|
|
2
|
+
import { BACKGROUNDS } from '../backgrounds'
|
|
3
|
+
import { VIEWPORTS } from '../viewports'
|
|
4
4
|
|
|
5
5
|
export { ADDON_THEMES, BACKGROUNDS, VIEWPORTS }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DEFAULT_USERS } from '@itcase/storybook-addon-auth/defaults'
|
|
2
|
+
|
|
3
|
+
const USERS = {
|
|
4
|
+
admin: {
|
|
5
|
+
name: 'Admin',
|
|
6
|
+
color: '#1EA5FC',
|
|
7
|
+
token: process.env.ADMIN_AUTH_TOKEN,
|
|
8
|
+
},
|
|
9
|
+
manager: {
|
|
10
|
+
name: 'Manager',
|
|
11
|
+
color: '#D80E4F',
|
|
12
|
+
token: process.env.MANAGER_AUTH_TOKEN,
|
|
13
|
+
},
|
|
14
|
+
user: {
|
|
15
|
+
name: 'User',
|
|
16
|
+
color: '#777777',
|
|
17
|
+
token: process.env.USER_AUTH_TOKEN,
|
|
18
|
+
},
|
|
19
|
+
...DEFAULT_USERS,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { USERS }
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|