create-packer 1.45.2 → 1.45.3

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.
Files changed (27) hide show
  1. package/package.json +1 -1
  2. package/template/lib/workspace/eslint.config.mjs +118 -116
  3. package/template/web-app/react-rsbuild/domain/router/components/index.ts +2 -2
  4. package/template/web-app/react-rsbuild/domain/router/components/route-layout.tsx +19 -19
  5. package/template/web-app/react-rsbuild/domain/router/components/sub-route-outlet.tsx +22 -22
  6. package/template/web-app/react-rsbuild/domain/router/home/routes.tsx +1 -1
  7. package/template/web-app/react-rsbuild/domain/router/index.ts +4 -4
  8. package/template/web-app/react-rsbuild/eslint.config.js +106 -104
  9. package/template/web-app/react-rsbuild/main.css +2 -2
  10. package/template/web-app/react-rsbuild/pages/home/index.ts +1 -1
  11. package/template/web-app/react-rsbuild/shared/components/componentInstance.tsx +80 -80
  12. package/template/web-app/react-rsbuild/shared/components/index.ts +1 -1
  13. package/template/web-app/react-rsbuild/shared/types/utils.ts +1 -1
  14. package/template/web-app/react-vite/domain/router/home/routes.tsx +1 -1
  15. package/template/web-app/react-vite/eslint.config.js +3 -1
  16. package/template/web-app/react-vite/shared/types/utils.ts +1 -1
  17. package/template/web-app/svelte/.env +1 -1
  18. package/template/web-app/svelte/.svelte-kit/ambient.d.ts +12 -14
  19. package/template/web-app/svelte/eslint.config.js +2 -0
  20. package/template/web-app/vue/eslint.config.js +3 -1
  21. package/template/web-app/vue/shared/hooks/useList.ts +1 -1
  22. package/template/web-app/vue/vite-env.d.ts +1 -1
  23. package/template/web-app/vue-rsbuild/env.d.ts +1 -1
  24. package/template/web-app/vue-rsbuild/eslint.config.js +113 -111
  25. package/template/web-app/vue-rsbuild/shared/hooks/useList.ts +1 -1
  26. package/template/web-extension/eslint.config.js +107 -105
  27. package/template/web-extension/shared/types/utils.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-packer",
3
- "version": "1.45.2",
3
+ "version": "1.45.3",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/kevily/create-packer",
6
6
  "author": "1k <bug_zero@163.com>",
@@ -1,116 +1,118 @@
1
- import eslint from '@eslint/js'
2
- import globals from 'globals'
3
- import tseslint from 'typescript-eslint'
4
- import importPlugin from 'eslint-plugin-import'
5
- import reactPlugin from 'eslint-plugin-react'
6
- import reactHooksPlugin from 'eslint-plugin-react-hooks'
7
- import storybook from 'eslint-plugin-storybook'
8
-
9
- const scriptExtensions = ['js', 'jsx', 'mjs', 'cjs', 'ts', 'tsx']
10
- const storybookFiles = scriptExtensions.map(ext => `**/*.stories.${ext}`)
11
- const files = scriptExtensions.map(ext => `**/*.${ext}`)
12
- const ignores = [
13
- '**/node_modules/',
14
- '**/dist/',
15
- '**/cjs/',
16
- '**/.history/',
17
- '**/storybook-static/',
18
- '**/.vscode/'
19
- ]
20
-
21
- export default tseslint.config([
22
- { ignores },
23
- eslint.configs.recommended,
24
- importPlugin.flatConfigs.recommended,
25
- tseslint.configs.recommended,
26
- {
27
- plugins: {
28
- reactPlugin,
29
- reactHooksPlugin
30
- },
31
- files,
32
- languageOptions: {
33
- ecmaVersion: 2018,
34
- sourceType: 'module',
35
- parserOptions: {
36
- ecmaFeatures: {
37
- jsx: true
38
- },
39
- useJSXTextNode: true
40
- },
41
- globals: {
42
- ...globals.browser,
43
- ...globals.node
44
- }
45
- },
46
- settings: {
47
- 'import/resolver': {
48
- typescript: true,
49
- node: true
50
- },
51
- react: {
52
- version: '18'
53
- }
54
- },
55
- rules: {
56
- 'import/export': 'off',
57
- 'import/namespace': 'off',
58
- 'import/default': 'off',
59
- 'import/no-named-as-default-member': 'off',
60
- 'import/no-named-as-default': 'off',
61
- 'import/order': [
62
- 'error',
63
- {
64
- groups: [
65
- 'builtin',
66
- 'external',
67
- 'internal',
68
- 'parent',
69
- 'sibling',
70
- 'index',
71
- 'object',
72
- 'type'
73
- ],
74
- pathGroups: [
75
- { pattern: 'react', group: 'external', position: 'before' },
76
- { pattern: 'react-dom/*', group: 'external', position: 'before' },
77
- { pattern: 'react-router', group: 'external', position: 'before' },
78
- { pattern: 'react-router-dom', group: 'external', position: 'before' }
79
- ],
80
- pathGroupsExcludedImportTypes: ['react', 'react-router', 'react-router-dom']
81
- }
82
- ],
83
- 'no-case-declarations': 'off',
84
- '@typescript-eslint/no-unused-expressions': 'off',
85
- '@typescript-eslint/no-empty-object-type': 'off',
86
- '@typescript-eslint/no-var-requires': 0,
87
- '@typescript-eslint/explicit-function-return-type': 'off',
88
- '@typescript-eslint/no-explicit-any': 0,
89
- '@typescript-eslint/no-non-null-assertion': 'off',
90
- '@typescript-eslint/no-inferrable-types': [
91
- 'warn',
92
- {
93
- ignoreParameters: true
94
- }
95
- ],
96
- '@typescript-eslint/no-unused-vars': [
97
- 'warn',
98
- {
99
- argsIgnorePattern: '^_'
100
- }
101
- ],
102
- '@typescript-eslint/member-delimiter-style': 0,
103
- '@typescript-eslint/class-name-casing': 0,
104
- '@typescript-eslint/explicit-module-boundary-types': 'off',
105
- '@typescript-eslint/ban-ts-comment': 'off',
106
- '@typescript-eslint/no-empty-interface': 'off',
107
- 'react/prop-types': 'off',
108
- 'react/no-find-dom-node': 'off',
109
- 'react-hooks/exhaustive-deps': 'off',
110
- 'react/display-name': 'off',
111
- 'react/react-in-jsx-scope': 'off',
112
- 'no-constant-condition': 'off'
113
- }
114
- },
115
- { extends: [storybook.configs['flat/recommended']], files: storybookFiles }
116
- ])
1
+ import eslint from '@eslint/js'
2
+ import globals from 'globals'
3
+ import tseslint from 'typescript-eslint'
4
+ import importPlugin from 'eslint-plugin-import'
5
+ import reactPlugin from 'eslint-plugin-react'
6
+ import reactHooksPlugin from 'eslint-plugin-react-hooks'
7
+ import storybook from 'eslint-plugin-storybook'
8
+
9
+ const scriptExtensions = ['js', 'jsx', 'mjs', 'cjs', 'ts', 'tsx']
10
+ const storybookFiles = scriptExtensions.map(ext => `**/*.stories.${ext}`)
11
+ const files = scriptExtensions.map(ext => `**/*.${ext}`)
12
+ const ignores = [
13
+ '**/node_modules/',
14
+ '**/dist/',
15
+ '**/cjs/',
16
+ '**/.history/',
17
+ '**/storybook-static/',
18
+ '**/.vscode/'
19
+ ]
20
+
21
+ export default tseslint.config([
22
+ { ignores },
23
+ eslint.configs.recommended,
24
+ importPlugin.flatConfigs.recommended,
25
+ tseslint.configs.recommended,
26
+ {
27
+ plugins: {
28
+ reactPlugin,
29
+ reactHooksPlugin
30
+ },
31
+ files,
32
+ languageOptions: {
33
+ ecmaVersion: 2018,
34
+ sourceType: 'module',
35
+ parserOptions: {
36
+ ecmaFeatures: {
37
+ jsx: true
38
+ },
39
+ useJSXTextNode: true
40
+ },
41
+ globals: {
42
+ ...globals.browser,
43
+ ...globals.node
44
+ }
45
+ },
46
+ settings: {
47
+ 'import/resolver': {
48
+ typescript: true,
49
+ node: true
50
+ },
51
+ react: {
52
+ version: '18'
53
+ }
54
+ },
55
+ rules: {
56
+ 'import/export': 'off',
57
+ 'import/namespace': 'off',
58
+ 'import/default': 'off',
59
+ 'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
60
+ 'import/no-duplicates': ['error', { 'prefer-inline': true }],
61
+ 'import/no-named-as-default-member': 'off',
62
+ 'import/no-named-as-default': 'off',
63
+ 'import/order': [
64
+ 'error',
65
+ {
66
+ groups: [
67
+ 'builtin',
68
+ 'external',
69
+ 'internal',
70
+ 'parent',
71
+ 'sibling',
72
+ 'index',
73
+ 'object',
74
+ 'type'
75
+ ],
76
+ pathGroups: [
77
+ { pattern: 'react', group: 'external', position: 'before' },
78
+ { pattern: 'react-dom/*', group: 'external', position: 'before' },
79
+ { pattern: 'react-router', group: 'external', position: 'before' },
80
+ { pattern: 'react-router-dom', group: 'external', position: 'before' }
81
+ ],
82
+ pathGroupsExcludedImportTypes: ['builtin']
83
+ }
84
+ ],
85
+ 'no-case-declarations': 'off',
86
+ '@typescript-eslint/no-unused-expressions': 'off',
87
+ '@typescript-eslint/no-empty-object-type': 'off',
88
+ '@typescript-eslint/no-var-requires': 0,
89
+ '@typescript-eslint/explicit-function-return-type': 'off',
90
+ '@typescript-eslint/no-explicit-any': 0,
91
+ '@typescript-eslint/no-non-null-assertion': 'off',
92
+ '@typescript-eslint/no-inferrable-types': [
93
+ 'warn',
94
+ {
95
+ ignoreParameters: true
96
+ }
97
+ ],
98
+ '@typescript-eslint/no-unused-vars': [
99
+ 'warn',
100
+ {
101
+ argsIgnorePattern: '^_'
102
+ }
103
+ ],
104
+ '@typescript-eslint/member-delimiter-style': 0,
105
+ '@typescript-eslint/class-name-casing': 0,
106
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
107
+ '@typescript-eslint/ban-ts-comment': 'off',
108
+ '@typescript-eslint/no-empty-interface': 'off',
109
+ 'react/prop-types': 'off',
110
+ 'react/no-find-dom-node': 'off',
111
+ 'react-hooks/exhaustive-deps': 'off',
112
+ 'react/display-name': 'off',
113
+ 'react/react-in-jsx-scope': 'off',
114
+ 'no-constant-condition': 'off'
115
+ }
116
+ },
117
+ { extends: [storybook.configs['flat/recommended']], files: storybookFiles }
118
+ ])
@@ -1,2 +1,2 @@
1
- export * as SubRouteOutlet from './sub-route-outlet'
2
- export * as RouteLayout from './route-layout'
1
+ export * as SubRouteOutlet from './sub-route-outlet'
2
+ export * as RouteLayout from './route-layout'
@@ -1,19 +1,19 @@
1
- import { FunctionComponent } from 'react'
2
- import { Outlet } from 'react-router'
3
- import { last } from 'es-toolkit'
4
- import { routeType, useMatchRoutes } from '@/domain/router'
5
-
6
- export interface propsType {
7
- Index: FunctionComponent
8
- rootId: routeType['id']
9
- }
10
-
11
- export const Root: FunctionComponent<propsType> = ({ Index, rootId }) => {
12
- const matchRoutes = useMatchRoutes()
13
-
14
- if (last(matchRoutes)?.id === rootId) {
15
- return <Index />
16
- }
17
-
18
- return <Outlet />
19
- }
1
+ import { FunctionComponent } from 'react'
2
+ import { Outlet } from 'react-router'
3
+ import { last } from 'es-toolkit'
4
+ import { routeType, useMatchRoutes } from '@/domain/router'
5
+
6
+ export interface propsType {
7
+ Index: FunctionComponent
8
+ rootId: routeType['id']
9
+ }
10
+
11
+ export const Root: FunctionComponent<propsType> = ({ Index, rootId }) => {
12
+ const matchRoutes = useMatchRoutes()
13
+
14
+ if (last(matchRoutes)?.id === rootId) {
15
+ return <Index />
16
+ }
17
+
18
+ return <Outlet />
19
+ }
@@ -1,22 +1,22 @@
1
- import { FunctionComponent } from 'react'
2
- import { Outlet } from 'react-router'
3
- import { useMount } from 'react-use'
4
- import { last } from 'es-toolkit'
5
- import { useMatchRoutes, useRouter, routeType } from '@/domain/router'
6
-
7
- export interface propsType {
8
- rootId: routeType['id']
9
- homeId: routeType['id']
10
- }
11
- export const Root: FunctionComponent<propsType> = props => {
12
- const matchRoutes = useMatchRoutes()
13
- const navigate = useRouter(state => state.navigate)
14
-
15
- useMount(() => {
16
- if (last(matchRoutes)?.id === props.rootId) {
17
- navigate({ id: props.homeId })
18
- }
19
- })
20
-
21
- return <Outlet />
22
- }
1
+ import { FunctionComponent } from 'react'
2
+ import { Outlet } from 'react-router'
3
+ import { useMount } from 'react-use'
4
+ import { last } from 'es-toolkit'
5
+ import { useMatchRoutes, useRouter, routeType } from '@/domain/router'
6
+
7
+ export interface propsType {
8
+ rootId: routeType['id']
9
+ homeId: routeType['id']
10
+ }
11
+ export const Root: FunctionComponent<propsType> = props => {
12
+ const matchRoutes = useMatchRoutes()
13
+ const navigate = useRouter(state => state.navigate)
14
+
15
+ useMount(() => {
16
+ if (last(matchRoutes)?.id === props.rootId) {
17
+ navigate({ id: props.homeId })
18
+ }
19
+ })
20
+
21
+ return <Outlet />
22
+ }
@@ -1,6 +1,6 @@
1
1
  import { lazy } from 'react'
2
+ import { type routeType } from '../router.types'
2
3
  import ids from './ids'
3
- import type { routeType } from '../router.types'
4
4
 
5
5
  const routes: routeType[] = [
6
6
  {
@@ -1,4 +1,4 @@
1
- export { default as routerIds } from './ids'
2
- export * from './router'
3
- export * from './router.types'
4
- export * from './components'
1
+ export { default as routerIds } from './ids'
2
+ export * from './router'
3
+ export * from './router.types'
4
+ export * from './components'
@@ -1,104 +1,106 @@
1
- import eslint from '@eslint/js'
2
- import globals from 'globals'
3
- import tseslint from 'typescript-eslint'
4
- import importPlugin from 'eslint-plugin-import'
5
- import reactPlugin from 'eslint-plugin-react'
6
- import reactHooksPlugin from 'eslint-plugin-react-hooks'
7
-
8
- const scriptExtensions = ['js', 'jsx', 'mjs', 'cjs', 'ts', 'tsx']
9
- const files = scriptExtensions.map(ext => `**/*.${ext}`)
10
-
11
- export default tseslint.config([
12
- {
13
- ignores: ['**/node_modules/', '**/dist/', '**/.history/', '**/.vscode/']
14
- },
15
- eslint.configs.recommended,
16
- importPlugin.flatConfigs.recommended,
17
- tseslint.configs.recommended,
18
- {
19
- plugins: { reactPlugin, reactHooksPlugin },
20
- files,
21
- languageOptions: {
22
- ecmaVersion: 2018,
23
- sourceType: 'module',
24
- parserOptions: {
25
- ecmaFeatures: {
26
- jsx: true
27
- },
28
- useJSXTextNode: true
29
- },
30
- globals: {
31
- ...globals.browser,
32
- ...globals.node
33
- }
34
- },
35
- settings: {
36
- 'import/resolver': {
37
- typescript: true,
38
- node: true
39
- },
40
- react: {
41
- version: '18'
42
- }
43
- },
44
- rules: {
45
- 'import/export': 'off',
46
- 'import/namespace': 'off',
47
- 'import/default': 'off',
48
- 'import/no-named-as-default-member': 'off',
49
- 'import/no-named-as-default': 'off',
50
- 'import/order': [
51
- 'error',
52
- {
53
- groups: [
54
- 'builtin',
55
- 'external',
56
- 'internal',
57
- 'parent',
58
- 'sibling',
59
- 'index',
60
- 'object',
61
- 'type'
62
- ],
63
- pathGroups: [
64
- { pattern: 'react', group: 'external', position: 'before' },
65
- { pattern: 'react-dom/*', group: 'external', position: 'before' },
66
- { pattern: 'react-router', group: 'external', position: 'before' },
67
- { pattern: 'react-router-dom', group: 'external', position: 'before' }
68
- ],
69
- pathGroupsExcludedImportTypes: ['react', 'react-router', 'react-router-dom']
70
- }
71
- ],
72
- 'no-case-declarations': 'off',
73
- '@typescript-eslint/no-unused-expressions': 'off',
74
- '@typescript-eslint/no-empty-object-type': 'off',
75
- '@typescript-eslint/no-var-requires': 0,
76
- '@typescript-eslint/explicit-function-return-type': 'off',
77
- '@typescript-eslint/no-explicit-any': 0,
78
- '@typescript-eslint/no-non-null-assertion': 'off',
79
- '@typescript-eslint/no-inferrable-types': [
80
- 'warn',
81
- {
82
- ignoreParameters: true
83
- }
84
- ],
85
- '@typescript-eslint/no-unused-vars': [
86
- 'warn',
87
- {
88
- argsIgnorePattern: '^_'
89
- }
90
- ],
91
- '@typescript-eslint/member-delimiter-style': 0,
92
- '@typescript-eslint/class-name-casing': 0,
93
- '@typescript-eslint/explicit-module-boundary-types': 'off',
94
- '@typescript-eslint/ban-ts-comment': 'off',
95
- '@typescript-eslint/no-empty-interface': 'off',
96
- 'react/prop-types': 'off',
97
- 'react/no-find-dom-node': 'off',
98
- 'react-hooks/exhaustive-deps': 'off',
99
- 'react/display-name': 'off',
100
- 'react/react-in-jsx-scope': 'off',
101
- 'no-constant-condition': 'off'
102
- }
103
- }
104
- ])
1
+ import eslint from '@eslint/js'
2
+ import globals from 'globals'
3
+ import tseslint from 'typescript-eslint'
4
+ import importPlugin from 'eslint-plugin-import'
5
+ import reactPlugin from 'eslint-plugin-react'
6
+ import reactHooksPlugin from 'eslint-plugin-react-hooks'
7
+
8
+ const scriptExtensions = ['js', 'jsx', 'mjs', 'cjs', 'ts', 'tsx']
9
+ const files = scriptExtensions.map(ext => `**/*.${ext}`)
10
+
11
+ export default tseslint.config([
12
+ {
13
+ ignores: ['**/node_modules/', '**/dist/', '**/.history/', '**/.vscode/']
14
+ },
15
+ eslint.configs.recommended,
16
+ importPlugin.flatConfigs.recommended,
17
+ tseslint.configs.recommended,
18
+ {
19
+ plugins: { reactPlugin, reactHooksPlugin },
20
+ files,
21
+ languageOptions: {
22
+ ecmaVersion: 2018,
23
+ sourceType: 'module',
24
+ parserOptions: {
25
+ ecmaFeatures: {
26
+ jsx: true
27
+ },
28
+ useJSXTextNode: true
29
+ },
30
+ globals: {
31
+ ...globals.browser,
32
+ ...globals.node
33
+ }
34
+ },
35
+ settings: {
36
+ 'import/resolver': {
37
+ typescript: true,
38
+ node: true
39
+ },
40
+ react: {
41
+ version: '18'
42
+ }
43
+ },
44
+ rules: {
45
+ 'import/export': 'off',
46
+ 'import/namespace': 'off',
47
+ 'import/default': 'off',
48
+ 'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
49
+ 'import/no-duplicates': ['error', { 'prefer-inline': true }],
50
+ 'import/no-named-as-default-member': 'off',
51
+ 'import/no-named-as-default': 'off',
52
+ 'import/order': [
53
+ 'error',
54
+ {
55
+ groups: [
56
+ 'builtin',
57
+ 'external',
58
+ 'internal',
59
+ 'parent',
60
+ 'sibling',
61
+ 'index',
62
+ 'object',
63
+ 'type'
64
+ ],
65
+ pathGroups: [
66
+ { pattern: 'react', group: 'external', position: 'before' },
67
+ { pattern: 'react-dom/*', group: 'external', position: 'before' },
68
+ { pattern: 'react-router', group: 'external', position: 'before' },
69
+ { pattern: 'react-router-dom', group: 'external', position: 'before' }
70
+ ],
71
+ pathGroupsExcludedImportTypes: ['builtin']
72
+ }
73
+ ],
74
+ 'no-case-declarations': 'off',
75
+ '@typescript-eslint/no-unused-expressions': 'off',
76
+ '@typescript-eslint/no-empty-object-type': 'off',
77
+ '@typescript-eslint/no-var-requires': 0,
78
+ '@typescript-eslint/explicit-function-return-type': 'off',
79
+ '@typescript-eslint/no-explicit-any': 0,
80
+ '@typescript-eslint/no-non-null-assertion': 'off',
81
+ '@typescript-eslint/no-inferrable-types': [
82
+ 'warn',
83
+ {
84
+ ignoreParameters: true
85
+ }
86
+ ],
87
+ '@typescript-eslint/no-unused-vars': [
88
+ 'warn',
89
+ {
90
+ argsIgnorePattern: '^_'
91
+ }
92
+ ],
93
+ '@typescript-eslint/member-delimiter-style': 0,
94
+ '@typescript-eslint/class-name-casing': 0,
95
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
96
+ '@typescript-eslint/ban-ts-comment': 'off',
97
+ '@typescript-eslint/no-empty-interface': 'off',
98
+ 'react/prop-types': 'off',
99
+ 'react/no-find-dom-node': 'off',
100
+ 'react-hooks/exhaustive-deps': 'off',
101
+ 'react/display-name': 'off',
102
+ 'react/react-in-jsx-scope': 'off',
103
+ 'no-constant-condition': 'off'
104
+ }
105
+ }
106
+ ])
@@ -1,6 +1,6 @@
1
1
  @layer theme, base, components, utilities;
2
- @import "tailwindcss/theme.css" prefix(tw) layer(theme);
3
- @import "tailwindcss/utilities.css" layer(utilities);
2
+ @import 'tailwindcss/theme.css' prefix(tw) layer(theme);
3
+ @import 'tailwindcss/utilities.css' layer(utilities);
4
4
 
5
5
  body {
6
6
  margin: 0;
@@ -1 +1 @@
1
- export { default } from './view'
1
+ export { default } from './view'