create-packer 1.33.0 → 1.34.0
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/package.json +1 -1
- package/template/lib/workspace/.editorconfig +14 -0
- package/template/lib/workspace/.eslintrc +119 -0
- package/template/lib/workspace/.prettierignore +4 -0
- package/template/lib/workspace/.prettierrc +18 -0
- package/template/lib/workspace/{packages/react/.storybook → .storybook}/main.ts +10 -2
- package/template/lib/workspace/{packages/react/.storybook/preview.ts → .storybook/preview.tsx} +2 -1
- package/template/lib/workspace/.stylelintrc +29 -0
- package/template/lib/workspace/package.json +36 -3
- package/template/lib/workspace/packages/react/package.json +1 -11
- package/template/lib/workspace/packages/react/src/Introduction.mdx +2 -2
- package/template/lib/workspace/packages/react/src/button/button.css +18 -18
- package/template/lib/workspace/packages/react/src/button/button.stories.ts +1 -1
- package/template/lib/workspace/packages/react/tsconfig.json +1 -1
- package/template/lib/workspace/tsconfig.json +16 -7
- package/template/lib/workspace/tsconfig.node.json +23 -0
- package/template/lib/workspace/.prettierrc.js +0 -21
- package/template/lib/workspace/packages/react/src/index.css +0 -3
- /package/template/lib/workspace/{packages/react/postcss.config.cjs → postcss.config.cjs} +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"parser": "@typescript-eslint/parser",
|
|
4
|
+
"plugins": [
|
|
5
|
+
"prettier"
|
|
6
|
+
],
|
|
7
|
+
"extends": [
|
|
8
|
+
"eslint:recommended",
|
|
9
|
+
"plugin:@typescript-eslint/recommended",
|
|
10
|
+
"plugin:storybook/recommended",
|
|
11
|
+
"plugin:react/recommended",
|
|
12
|
+
"plugin:react-hooks/recommended",
|
|
13
|
+
"plugin:import/recommended",
|
|
14
|
+
"plugin:import/typescript"
|
|
15
|
+
],
|
|
16
|
+
"settings": {
|
|
17
|
+
"import/resolver": {
|
|
18
|
+
"typescript": true,
|
|
19
|
+
"node": true
|
|
20
|
+
},
|
|
21
|
+
"react": {
|
|
22
|
+
"version": "18"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"env": {
|
|
26
|
+
"browser": true,
|
|
27
|
+
"node": true,
|
|
28
|
+
"es6": true,
|
|
29
|
+
"jest": true
|
|
30
|
+
},
|
|
31
|
+
"parserOptions": {
|
|
32
|
+
"ecmaVersion": 2018,
|
|
33
|
+
"sourceType": "module",
|
|
34
|
+
"ecmaFeatures": {
|
|
35
|
+
"jsx": true
|
|
36
|
+
},
|
|
37
|
+
"useJSXTextNode": true
|
|
38
|
+
},
|
|
39
|
+
"rules": {
|
|
40
|
+
"import/export": "off",
|
|
41
|
+
"import/namespace": "off",
|
|
42
|
+
"import/order": [
|
|
43
|
+
"error",
|
|
44
|
+
{
|
|
45
|
+
"groups": [
|
|
46
|
+
"builtin",
|
|
47
|
+
"external",
|
|
48
|
+
"internal",
|
|
49
|
+
"parent",
|
|
50
|
+
"sibling",
|
|
51
|
+
"index",
|
|
52
|
+
"object",
|
|
53
|
+
"type"
|
|
54
|
+
],
|
|
55
|
+
"pathGroups": [
|
|
56
|
+
{
|
|
57
|
+
"pattern": "react",
|
|
58
|
+
"group": "external",
|
|
59
|
+
"position": "before"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"pattern": "react-dom/*",
|
|
63
|
+
"group": "external",
|
|
64
|
+
"position": "before"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"pattern": "react-router",
|
|
68
|
+
"group": "external",
|
|
69
|
+
"position": "before"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"pattern": "react-router-dom",
|
|
73
|
+
"group": "external",
|
|
74
|
+
"position": "before"
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
"pathGroupsExcludedImportTypes": [
|
|
78
|
+
"react",
|
|
79
|
+
"react-router",
|
|
80
|
+
"react-router-dom"
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"@typescript-eslint/no-var-requires": 0,
|
|
85
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
86
|
+
"@typescript-eslint/no-explicit-any": 0,
|
|
87
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
88
|
+
"@typescript-eslint/no-inferrable-types": [
|
|
89
|
+
"warn",
|
|
90
|
+
{
|
|
91
|
+
"ignoreParameters": true
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"@typescript-eslint/no-unused-vars": [
|
|
95
|
+
"warn",
|
|
96
|
+
{
|
|
97
|
+
"argsIgnorePattern": "^_"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"@typescript-eslint/member-delimiter-style": 0,
|
|
101
|
+
"@typescript-eslint/class-name-casing": 0,
|
|
102
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
103
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
104
|
+
"@typescript-eslint/no-empty-interface": "off",
|
|
105
|
+
"react/prop-types": "off",
|
|
106
|
+
"react/no-find-dom-node": "off",
|
|
107
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
108
|
+
"react/display-name": "off",
|
|
109
|
+
"react/react-in-jsx-scope": "off",
|
|
110
|
+
"react-hooks/rules-of-hooks": "off",
|
|
111
|
+
"prettier/prettier": [
|
|
112
|
+
"error",
|
|
113
|
+
{
|
|
114
|
+
"endOfLine": "auto"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"no-constant-condition": "off"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"overrides": [
|
|
3
|
+
{
|
|
4
|
+
"files": ".prettierrc",
|
|
5
|
+
"options": { "parser": "json" }
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"printWidth": 100,
|
|
9
|
+
"tabWidth": 4,
|
|
10
|
+
"useTabs": false,
|
|
11
|
+
"semi": false,
|
|
12
|
+
"singleQuote": true,
|
|
13
|
+
"trailingComma": "none",
|
|
14
|
+
"bracketSpacing": true,
|
|
15
|
+
"bracketSameLine": false,
|
|
16
|
+
"arrowParens": "avoid",
|
|
17
|
+
"rangeStart": 0
|
|
18
|
+
}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import svgr from 'vite-plugin-svgr'
|
|
2
2
|
import type { StorybookConfig } from '@storybook/react-vite'
|
|
3
|
+
|
|
4
|
+
function createStories(lib: string): string[] {
|
|
5
|
+
return [
|
|
6
|
+
`../packages/${lib}/src/**/*.mdx`,
|
|
7
|
+
`../packages/${lib}/src/**/*.stories.@(js|jsx|ts|tsx)`
|
|
8
|
+
]
|
|
9
|
+
}
|
|
10
|
+
|
|
3
11
|
const config: StorybookConfig = {
|
|
4
|
-
stories: ['
|
|
12
|
+
stories: [...createStories('ts'), ...createStories('react')],
|
|
5
13
|
addons: [
|
|
6
14
|
'@storybook/addon-links',
|
|
7
15
|
'@storybook/addon-essentials',
|
|
@@ -12,7 +20,7 @@ const config: StorybookConfig = {
|
|
|
12
20
|
options: {}
|
|
13
21
|
},
|
|
14
22
|
async viteFinal(config) {
|
|
15
|
-
config.plugins
|
|
23
|
+
config.plugins?.unshift(svgr())
|
|
16
24
|
|
|
17
25
|
return config
|
|
18
26
|
},
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "stylelint-config-standard-scss",
|
|
3
|
+
"rules": {
|
|
4
|
+
"comment-empty-line-before": "never",
|
|
5
|
+
"no-empty-source": null,
|
|
6
|
+
"alpha-value-notation": null,
|
|
7
|
+
"color-function-notation": null,
|
|
8
|
+
"at-rule-no-unknown": [
|
|
9
|
+
true,
|
|
10
|
+
{
|
|
11
|
+
"ignoreAtRules": ["tailwind", "apply", "use"]
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"declaration-block-no-redundant-longhand-properties": null,
|
|
15
|
+
"selector-pseudo-class-no-unknown": [
|
|
16
|
+
true,
|
|
17
|
+
{
|
|
18
|
+
"ignorePseudoClasses": ["global"]
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"selector-class-pattern": null,
|
|
22
|
+
"scss/at-rule-no-unknown": [
|
|
23
|
+
true,
|
|
24
|
+
{
|
|
25
|
+
"ignoreAtRules": ["tailwind", "a pply"]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
"push": "pnpm run commit && git push",
|
|
13
13
|
"login": "npm login --registry https://registry.npmjs.org",
|
|
14
14
|
"clean:dist": "pnpm -r exec rimraf dist",
|
|
15
|
-
"pub": "pnpm run build && pnpm run changeVersion && pnpm run push && pnpm -r publish --registry https://registry.npmjs.org"
|
|
15
|
+
"pub": "pnpm run build && pnpm run changeVersion && pnpm run push && pnpm -r publish --registry https://registry.npmjs.org",
|
|
16
|
+
"storybook": "storybook dev -p 6006",
|
|
17
|
+
"build-storybook": "storybook build",
|
|
18
|
+
"up:storybook": "pnpm up storybook eslint-plugin-storybook @storybook/* -L"
|
|
16
19
|
},
|
|
17
20
|
"keywords": [],
|
|
18
21
|
"author": "kevily",
|
|
@@ -31,10 +34,40 @@
|
|
|
31
34
|
},
|
|
32
35
|
"devDependencies": {
|
|
33
36
|
"@changesets/cli": "2.26.2",
|
|
37
|
+
"@storybook/addon-essentials": "8.2.7",
|
|
38
|
+
"@storybook/addon-interactions": "8.2.7",
|
|
39
|
+
"@storybook/addon-links": "8.2.7",
|
|
40
|
+
"@storybook/blocks": "8.2.7",
|
|
41
|
+
"@storybook/react": "8.2.7",
|
|
42
|
+
"@storybook/react-vite": "8.2.7",
|
|
43
|
+
"@storybook/testing-library": "0.2.2",
|
|
44
|
+
"@types/react": "18.3.3",
|
|
45
|
+
"@types/react-dom": "18.3.0",
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "7.0.2",
|
|
47
|
+
"@typescript-eslint/parser": "7.0.2",
|
|
34
48
|
"@types/node": "20.3.2",
|
|
49
|
+
"autoprefixer": "10.4.14",
|
|
50
|
+
"eslint": "8.56.0",
|
|
51
|
+
"eslint-import-resolver-typescript": "3.6.1",
|
|
52
|
+
"eslint-plugin-import": "2.29.1",
|
|
53
|
+
"eslint-plugin-prettier": "5.1.3",
|
|
54
|
+
"eslint-plugin-react": "7.33.2",
|
|
55
|
+
"eslint-plugin-react-hooks": "4.6.0",
|
|
56
|
+
"eslint-plugin-storybook": "0.8.0",
|
|
35
57
|
"inquirer": "8",
|
|
36
|
-
"
|
|
58
|
+
"postcss": "8.4.31",
|
|
59
|
+
"postcss-import": "15.1.0",
|
|
60
|
+
"postcss-nesting": "12.0.0",
|
|
61
|
+
"postcss-scss": "4.0.6",
|
|
62
|
+
"prettier": "3.2.5",
|
|
63
|
+
"prop-types": "15.8.1",
|
|
64
|
+
"react": "18.2.0",
|
|
65
|
+
"react-dom": "18.2.0",
|
|
66
|
+
"storybook": "8.2.7",
|
|
67
|
+
"stylelint": "16.8.1",
|
|
68
|
+
"stylelint-config-standard-scss": "13.0.0",
|
|
37
69
|
"ts-node": "10.9.1",
|
|
38
|
-
"typescript": "5.
|
|
70
|
+
"typescript": "5.5.2",
|
|
71
|
+
"vite-plugin-svgr": "4.2.0"
|
|
39
72
|
}
|
|
40
73
|
}
|
|
@@ -21,13 +21,6 @@
|
|
|
21
21
|
"react-dom": "18.2.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@storybook/addon-essentials": "8.2.7",
|
|
25
|
-
"@storybook/addon-interactions": "8.2.7",
|
|
26
|
-
"@storybook/addon-links": "8.2.7",
|
|
27
|
-
"@storybook/blocks": "8.2.7",
|
|
28
|
-
"@storybook/react": "8.2.7",
|
|
29
|
-
"@storybook/react-vite": "8.2.7",
|
|
30
|
-
"@storybook/testing-library": "0.2.2",
|
|
31
24
|
"@types/react": "18.3.3",
|
|
32
25
|
"@types/react-dom": "18.3.0",
|
|
33
26
|
"@typescript-eslint/eslint-plugin": "7.0.2",
|
|
@@ -40,13 +33,10 @@
|
|
|
40
33
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
41
34
|
"eslint-plugin-storybook": "0.8.0",
|
|
42
35
|
"prettier": "3.2.5",
|
|
43
|
-
"prop-types": "15.8.1",
|
|
44
36
|
"react": "18.2.0",
|
|
45
37
|
"react-dom": "18.2.0",
|
|
46
|
-
"storybook": "8.2.7",
|
|
47
38
|
"stylelint": "16.8.1",
|
|
48
39
|
"stylelint-config-standard-scss": "13.0.0",
|
|
49
|
-
"typescript": "5.5.2"
|
|
50
|
-
"vite-plugin-svgr": "4.2.0"
|
|
40
|
+
"typescript": "5.5.2"
|
|
51
41
|
}
|
|
52
42
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Meta } from '@storybook/blocks'
|
|
1
|
+
import { Meta } from '@storybook/blocks'
|
|
2
2
|
|
|
3
|
-
<Meta title="
|
|
3
|
+
<Meta title="react-components/Introduction" />
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
.storybook-button {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
3
|
+
font-weight: 700;
|
|
4
|
+
border: 0;
|
|
5
|
+
border-radius: 3em;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
display: inline-block;
|
|
8
|
+
line-height: 1;
|
|
9
9
|
}
|
|
10
10
|
.storybook-button--primary {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
color: white;
|
|
12
|
+
background-color: #1ea7fd;
|
|
13
13
|
}
|
|
14
14
|
.storybook-button--secondary {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
color: #333;
|
|
16
|
+
background-color: transparent;
|
|
17
|
+
box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
|
|
18
18
|
}
|
|
19
19
|
.storybook-button--small {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
padding: 10px 16px;
|
|
22
22
|
}
|
|
23
23
|
.storybook-button--medium {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
padding: 11px 20px;
|
|
26
26
|
}
|
|
27
27
|
.storybook-button--large {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
font-size: 16px;
|
|
29
|
+
padding: 12px 24px;
|
|
30
30
|
}
|
|
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react'
|
|
|
3
3
|
|
|
4
4
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
|
|
5
5
|
const meta: Meta<typeof Button> = {
|
|
6
|
-
title: '
|
|
6
|
+
title: 'react-components/Button',
|
|
7
7
|
component: Button,
|
|
8
8
|
tags: ['autodocs'],
|
|
9
9
|
argTypes: {
|
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"
|
|
3
|
+
"useDefineForClassFields": true,
|
|
4
|
+
"strict": true,
|
|
5
|
+
"forceConsistentCasingInFileNames": true,
|
|
6
|
+
"strictPropertyInitialization": false,
|
|
7
|
+
"resolveJsonModule": true,
|
|
8
|
+
"module": "ESNext",
|
|
4
9
|
"esModuleInterop": true,
|
|
10
|
+
"jsx": "react-jsx",
|
|
5
11
|
"allowSyntheticDefaultImports": true,
|
|
6
12
|
"allowJs": true,
|
|
7
|
-
"strictNullChecks": true,
|
|
8
13
|
"target": "ESNext",
|
|
9
14
|
"noImplicitAny": false,
|
|
15
|
+
"skipLibCheck": true,
|
|
10
16
|
"moduleResolution": "node",
|
|
11
17
|
"sourceMap": false,
|
|
12
18
|
"declaration": true,
|
|
13
|
-
"outDir": "
|
|
14
|
-
"baseUrl": "."
|
|
19
|
+
"outDir": "dist",
|
|
20
|
+
"baseUrl": ".",
|
|
21
|
+
"emitDeclarationOnly": true
|
|
15
22
|
},
|
|
16
23
|
"include": [
|
|
17
|
-
"
|
|
24
|
+
".storybook"
|
|
18
25
|
],
|
|
19
|
-
"
|
|
20
|
-
|
|
26
|
+
"references": [
|
|
27
|
+
{
|
|
28
|
+
"path": "./tsconfig.node.json"
|
|
29
|
+
}
|
|
21
30
|
]
|
|
22
31
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": true,
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"allowSyntheticDefaultImports": true,
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"strictNullChecks": true,
|
|
9
|
+
"target": "ESNext",
|
|
10
|
+
"noImplicitAny": false,
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"sourceMap": false,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"outDir": "lib",
|
|
15
|
+
"baseUrl": "."
|
|
16
|
+
},
|
|
17
|
+
"include": [
|
|
18
|
+
"scripts/**/*"
|
|
19
|
+
],
|
|
20
|
+
"exclude": [
|
|
21
|
+
"node_modules/**/*"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// 配置文档: https://prettier.io/docs/en/options.html
|
|
2
|
-
// ----------------------------------------------------------------------
|
|
3
|
-
module.exports = {
|
|
4
|
-
overrides: [
|
|
5
|
-
{
|
|
6
|
-
files: '.prettierrc',
|
|
7
|
-
options: { parser: 'json' }
|
|
8
|
-
}
|
|
9
|
-
],
|
|
10
|
-
printWidth: 100,
|
|
11
|
-
tabWidth: 4,
|
|
12
|
-
useTabs: false,
|
|
13
|
-
semi: false,
|
|
14
|
-
singleQuote: true,
|
|
15
|
-
trailingComma: 'none',
|
|
16
|
-
bracketSpacing: true,
|
|
17
|
-
jsxBracketSameLine: true,
|
|
18
|
-
arrowParens: 'avoid',
|
|
19
|
-
rangeStart: 0,
|
|
20
|
-
Parser: 'none'
|
|
21
|
-
}
|
|
File without changes
|