create-packer 1.35.14 → 1.35.15

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 (118) hide show
  1. package/package.json +2 -1
  2. package/template/cli/biome.json +37 -0
  3. package/template/cli/package.json +1 -0
  4. package/template/lib/workspace/.eslintrc +1 -7
  5. package/template/lib/workspace/biome.json +37 -0
  6. package/template/lib/workspace/package.json +1 -2
  7. package/template/lib/workspace/packages/react/.eslintrc +1 -7
  8. package/template/lib/workspace/packages/react/package.json +0 -2
  9. package/template/lib/workspace/packages/ts/.eslintrc +1 -7
  10. package/template/lib/workspace/packages/ts/package.json +0 -1
  11. package/template/web-app/react-rspack/.eslintrc +1 -10
  12. package/template/web-app/react-rspack/.vscode/extensions.json +2 -2
  13. package/template/web-app/react-rspack/biome.json +37 -0
  14. package/template/web-app/react-rspack/package.json +2 -3
  15. package/template/web-app/react-vite/.eslintrc +1 -10
  16. package/template/web-app/react-vite/.vscode/extensions.json +8 -8
  17. package/template/web-app/react-vite/.vscode/settings.json +4 -18
  18. package/template/web-app/react-vite/biome.json +37 -0
  19. package/template/web-app/react-vite/domain/app/app.model.ts +7 -7
  20. package/template/web-app/react-vite/domain/app/app.styled.ts +3 -3
  21. package/template/web-app/react-vite/domain/app/components/app-context.tsx +17 -17
  22. package/template/web-app/react-vite/domain/app/components/app.tsx +24 -24
  23. package/template/web-app/react-vite/domain/app/components/index.ts +1 -1
  24. package/template/web-app/react-vite/domain/app/index.ts +2 -2
  25. package/template/web-app/react-vite/domain/router/home/ids.ts +3 -3
  26. package/template/web-app/react-vite/domain/router/home/index.ts +2 -2
  27. package/template/web-app/react-vite/domain/router/home/routes.tsx +13 -13
  28. package/template/web-app/react-vite/domain/router/ids.ts +6 -6
  29. package/template/web-app/react-vite/domain/router/index.ts +3 -3
  30. package/template/web-app/react-vite/domain/router/router.tsx +28 -28
  31. package/template/web-app/react-vite/domain/router/router.types.ts +3 -3
  32. package/template/web-app/react-vite/main.tsx +4 -4
  33. package/template/web-app/react-vite/mockUtils.ts +6 -6
  34. package/template/web-app/react-vite/package.json +79 -80
  35. package/template/web-app/react-vite/pages/home/home.mock.ts +19 -19
  36. package/template/web-app/react-vite/pages/home/home.styled.ts +7 -7
  37. package/template/web-app/react-vite/pages/home/home.tsx +10 -10
  38. package/template/web-app/react-vite/pages/home/index.ts +1 -1
  39. package/template/web-app/react-vite/pages/index.tsx +18 -18
  40. package/template/web-app/react-vite/pages/not-found.tsx +3 -3
  41. package/template/web-app/react-vite/scripts/createChunks.ts +26 -26
  42. package/template/web-app/react-vite/scripts/index.ts +1 -1
  43. package/template/web-app/react-vite/shared/hooks/defineRouter/defineRouter.types.ts +33 -33
  44. package/template/web-app/react-vite/shared/hooks/defineRouter/index.ts +2 -2
  45. package/template/web-app/react-vite/shared/hooks/index.ts +6 -6
  46. package/template/web-app/react-vite/shared/hooks/useInterval.ts +26 -26
  47. package/template/web-app/react-vite/shared/hooks/useLoadingAction.ts +27 -27
  48. package/template/web-app/react-vite/shared/hooks/useLowPriorityState.ts +26 -26
  49. package/template/web-app/react-vite/shared/hooks/useSyncState.ts +15 -15
  50. package/template/web-app/react-vite/shared/hooks/useVisible.ts +27 -27
  51. package/template/web-app/react-vite/shared/service/api.ts +1 -1
  52. package/template/web-app/react-vite/shared/service/home.ts +10 -10
  53. package/template/web-app/react-vite/shared/service/index.ts +3 -3
  54. package/template/web-app/react-vite/shared/service/request.ts +5 -5
  55. package/template/web-app/react-vite/shared/theme/index.ts +1 -1
  56. package/template/web-app/react-vite/shared/theme/theme.styled.ts +56 -56
  57. package/template/web-app/react-vite/shared/tools/componentInstance.tsx +80 -80
  58. package/template/web-app/react-vite/shared/tools/index.ts +1 -1
  59. package/template/web-app/react-vite/shared/types/index.ts +1 -1
  60. package/template/web-app/react-vite/shared/types/utils.ts +2 -2
  61. package/template/web-app/react-vite/tsconfig.json +32 -44
  62. package/template/web-app/react-vite/tsconfig.node.json +10 -10
  63. package/template/web-app/react-vite/vite-env.d.ts +18 -18
  64. package/template/web-app/react-vite/vite.config.ts +76 -76
  65. package/template/web-app/react-webpack/.eslintrc +1 -10
  66. package/template/web-app/react-webpack/.vscode/extensions.json +2 -2
  67. package/template/web-app/react-webpack/biome.json +37 -0
  68. package/template/web-app/react-webpack/package.json +2 -3
  69. package/template/web-app/vue/.eslintrc +0 -7
  70. package/template/web-app/vue/.vscode/extensions.json +9 -9
  71. package/template/web-app/vue/biome.json +37 -0
  72. package/template/web-app/vue/domain/app/app.ts +4 -4
  73. package/template/web-app/vue/domain/app/components/index.ts +1 -1
  74. package/template/web-app/vue/domain/app/createComponentInstance.ts +44 -44
  75. package/template/web-app/vue/domain/app/index.ts +3 -3
  76. package/template/web-app/vue/main.ts +7 -7
  77. package/template/web-app/vue/mockUtils.ts +6 -6
  78. package/template/web-app/vue/package.json +2 -3
  79. package/template/web-app/vue/pages/home/home.mock.ts +19 -19
  80. package/template/web-app/vue/pages/home/index.ts +1 -1
  81. package/template/web-app/vue/pages/index.ts +1 -1
  82. package/template/web-app/vue/router/home/index.ts +2 -2
  83. package/template/web-app/vue/router/home/names.ts +3 -3
  84. package/template/web-app/vue/router/home/routes.ts +8 -8
  85. package/template/web-app/vue/router/index.ts +26 -26
  86. package/template/web-app/vue/router/names.ts +5 -5
  87. package/template/web-app/vue/scripts/createChunks.ts +26 -26
  88. package/template/web-app/vue/scripts/index.ts +1 -1
  89. package/template/web-app/vue/shared/hooks/index.ts +2 -2
  90. package/template/web-app/vue/shared/hooks/useList.ts +104 -104
  91. package/template/web-app/vue/shared/hooks/useVisible.ts +27 -27
  92. package/template/web-app/vue/shared/service/api.ts +1 -1
  93. package/template/web-app/vue/shared/service/home.ts +10 -10
  94. package/template/web-app/vue/shared/service/index.ts +3 -3
  95. package/template/web-app/vue/shared/service/request.ts +5 -5
  96. package/template/web-app/vue/style.css +3 -3
  97. package/template/web-app/vue/tsconfig.json +24 -24
  98. package/template/web-app/vue/tsconfig.node.json +10 -10
  99. package/template/web-app/vue/vite-env.d.ts +18 -18
  100. package/template/web-app/vue/vite.config.ts +65 -65
  101. package/template/web-extension/.eslintrc +0 -9
  102. package/template/web-extension/biome.json +37 -0
  103. package/template/web-extension/package.json +2 -3
  104. package/template/cli/.prettierignore +0 -6
  105. package/template/cli/.prettierrc.js +0 -20
  106. package/template/lib/workspace/.prettierignore +0 -4
  107. package/template/lib/workspace/.prettierrc +0 -18
  108. package/template/lib/workspace/packages/react/.prettierignore +0 -4
  109. package/template/lib/workspace/packages/react/.prettierrc +0 -18
  110. package/template/lib/workspace/packages/ts/.prettierrc +0 -12
  111. package/template/web-app/react-rspack/.prettierignore +0 -6
  112. package/template/web-app/react-rspack/.prettierrc +0 -12
  113. package/template/web-app/react-vite/.prettierignore +0 -6
  114. package/template/web-app/react-vite/.prettierrc +0 -12
  115. package/template/web-app/vue/.prettierignore +0 -6
  116. package/template/web-app/vue/.prettierrc +0 -12
  117. package/template/web-extension/.prettierignore +0 -6
  118. package/template/web-extension/.prettierrc +0 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-packer",
3
- "version": "1.35.14",
3
+ "version": "1.35.15",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/kevily/create-packer",
6
6
  "author": "1k <bug_zero@163.com>",
@@ -22,6 +22,7 @@
22
22
  "ora": "5.4.1"
23
23
  },
24
24
  "devDependencies": {
25
+ "@biomejs/biome": "1.9.2",
25
26
  "@commitlint/config-conventional": "^17.7.0",
26
27
  "@commitlint/cz-commitlint": "17.4.2",
27
28
  "@types/fs-extra": "9.0.12",
@@ -0,0 +1,37 @@
1
+ {
2
+ "linter": {
3
+ "enabled": false
4
+ },
5
+ "formatter": {
6
+ "enabled": true,
7
+ "formatWithErrors": false,
8
+ "include": [
9
+ "**/*.ts",
10
+ "**/*.js",
11
+ "**/*.tsx",
12
+ "**/*.jsx",
13
+ "**/*.json",
14
+ "**/*.css",
15
+ "**/*.scss",
16
+ "**/*.less"
17
+ ],
18
+ "ignore": ["**/*.md", "**/*.svg", "**/*.ejs", "**/*.html", ".history", "dist"],
19
+ "attributePosition": "auto",
20
+ "indentStyle": "space",
21
+ "indentWidth": 4,
22
+ "lineEnding": "lf",
23
+ "lineWidth": 100
24
+ },
25
+ "javascript": {
26
+ "formatter": {
27
+ "arrowParentheses": "asNeeded",
28
+ "bracketSameLine": false,
29
+ "bracketSpacing": true,
30
+ "quoteStyle": "single",
31
+ "jsxQuoteStyle": "single",
32
+ "quoteProperties": "asNeeded",
33
+ "semicolons": "asNeeded",
34
+ "trailingCommas": "none"
35
+ }
36
+ }
37
+ }
@@ -30,6 +30,7 @@
30
30
  "ora": "5.4.1"
31
31
  },
32
32
  "devDependencies": {
33
+ "@biomejs/biome": "1.9.2",
33
34
  "@commitlint/config-conventional": "^17.6.3",
34
35
  "@commitlint/cz-commitlint": "17.4.2",
35
36
  "@types/fs-extra": "9.0.12",
@@ -108,12 +108,6 @@
108
108
  "react/display-name": "off",
109
109
  "react/react-in-jsx-scope": "off",
110
110
  "react-hooks/rules-of-hooks": "off",
111
- "prettier/prettier": [
112
- "error",
113
- {
114
- "endOfLine": "auto"
115
- }
116
- ],
117
111
  "no-constant-condition": "off"
118
112
  }
119
- }
113
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "linter": {
3
+ "enabled": false
4
+ },
5
+ "formatter": {
6
+ "enabled": true,
7
+ "formatWithErrors": false,
8
+ "include": [
9
+ "**/*.ts",
10
+ "**/*.js",
11
+ "**/*.tsx",
12
+ "**/*.jsx",
13
+ "**/*.json",
14
+ "**/*.css",
15
+ "**/*.scss",
16
+ "**/*.less"
17
+ ],
18
+ "ignore": ["**/*.md", "**/*.svg", "**/*.ejs", "**/*.html", ".history", "dist"],
19
+ "attributePosition": "auto",
20
+ "indentStyle": "space",
21
+ "indentWidth": 4,
22
+ "lineEnding": "lf",
23
+ "lineWidth": 100
24
+ },
25
+ "javascript": {
26
+ "formatter": {
27
+ "arrowParentheses": "asNeeded",
28
+ "bracketSameLine": false,
29
+ "bracketSpacing": true,
30
+ "quoteStyle": "single",
31
+ "jsxQuoteStyle": "single",
32
+ "quoteProperties": "asNeeded",
33
+ "semicolons": "asNeeded",
34
+ "trailingCommas": "none"
35
+ }
36
+ }
37
+ }
@@ -33,6 +33,7 @@
33
33
  "rimraf": "5.0.1"
34
34
  },
35
35
  "devDependencies": {
36
+ "@biomejs/biome": "1.9.2",
36
37
  "@changesets/cli": "2.26.2",
37
38
  "@storybook/addon-essentials": "8.2.7",
38
39
  "@storybook/addon-interactions": "8.2.7",
@@ -51,7 +52,6 @@
51
52
  "eslint": "8.56.0",
52
53
  "eslint-import-resolver-typescript": "3.6.1",
53
54
  "eslint-plugin-import": "2.29.1",
54
- "eslint-plugin-prettier": "5.1.3",
55
55
  "eslint-plugin-react": "7.33.2",
56
56
  "eslint-plugin-react-hooks": "4.6.0",
57
57
  "eslint-plugin-storybook": "0.8.0",
@@ -60,7 +60,6 @@
60
60
  "postcss-import": "15.1.0",
61
61
  "postcss-nesting": "12.0.0",
62
62
  "postcss-scss": "4.0.6",
63
- "prettier": "3.2.5",
64
63
  "prop-types": "15.8.1",
65
64
  "react": "18.2.0",
66
65
  "react-dom": "18.2.0",
@@ -108,12 +108,6 @@
108
108
  "react/display-name": "off",
109
109
  "react/react-in-jsx-scope": "off",
110
110
  "react-hooks/rules-of-hooks": "off",
111
- "prettier/prettier": [
112
- "error",
113
- {
114
- "endOfLine": "auto"
115
- }
116
- ],
117
111
  "no-constant-condition": "off"
118
112
  }
119
- }
113
+ }
@@ -28,11 +28,9 @@
28
28
  "eslint": "8.56.0",
29
29
  "eslint-import-resolver-typescript": "3.6.1",
30
30
  "eslint-plugin-import": "2.29.1",
31
- "eslint-plugin-prettier": "5.1.3",
32
31
  "eslint-plugin-react": "7.33.2",
33
32
  "eslint-plugin-react-hooks": "4.6.0",
34
33
  "eslint-plugin-storybook": "0.8.0",
35
- "prettier": "3.2.5",
36
34
  "react": "18.2.0",
37
35
  "react-dom": "18.2.0",
38
36
  "stylelint": "16.8.1",
@@ -69,12 +69,6 @@
69
69
  "@typescript-eslint/explicit-module-boundary-types": "off",
70
70
  "@typescript-eslint/ban-ts-comment": "off",
71
71
  "@typescript-eslint/no-empty-interface": "off",
72
- "prettier/prettier": [
73
- "error",
74
- {
75
- "endOfLine": "auto"
76
- }
77
- ],
78
72
  "no-constant-condition": "off"
79
73
  }
80
- }
74
+ }
@@ -20,7 +20,6 @@
20
20
  "eslint": "8.56.0",
21
21
  "eslint-import-resolver-typescript": "3.6.1",
22
22
  "eslint-plugin-import": "2.29.1",
23
- "eslint-plugin-prettier": "5.1.3",
24
23
  "prettier": "3.2.5",
25
24
  "stylelint": "16.8.1",
26
25
  "stylelint-config-standard-scss": "13.0.0",
@@ -1,9 +1,6 @@
1
1
  {
2
2
  "root": true,
3
3
  "parser": "@typescript-eslint/parser",
4
- "plugins": [
5
- "prettier"
6
- ],
7
4
  "extends": [
8
5
  "eslint:recommended",
9
6
  "plugin:@typescript-eslint/recommended",
@@ -109,12 +106,6 @@
109
106
  "react-hooks/exhaustive-deps": "off",
110
107
  "react/display-name": "off",
111
108
  "react/react-in-jsx-scope": "off",
112
- "prettier/prettier": [
113
- "error",
114
- {
115
- "endOfLine": "auto"
116
- }
117
- ],
118
109
  "no-constant-condition": "off"
119
110
  }
120
- }
111
+ }
@@ -2,7 +2,7 @@
2
2
  "recommendations": [
3
3
  "dbaeumer.vscode-eslint",
4
4
  "stylelint.vscode-stylelint",
5
- "esbenp.prettier-vscode",
5
+ "biomejs.biome",
6
6
  "styled-components.vscode-styled-components"
7
7
  ]
8
- }
8
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "linter": {
3
+ "enabled": false
4
+ },
5
+ "formatter": {
6
+ "enabled": true,
7
+ "formatWithErrors": false,
8
+ "include": [
9
+ "**/*.ts",
10
+ "**/*.js",
11
+ "**/*.tsx",
12
+ "**/*.jsx",
13
+ "**/*.json",
14
+ "**/*.css",
15
+ "**/*.scss",
16
+ "**/*.less"
17
+ ],
18
+ "ignore": ["**/*.md", "**/*.svg", "**/*.ejs", "**/*.html", ".history", "dist"],
19
+ "attributePosition": "auto",
20
+ "indentStyle": "space",
21
+ "indentWidth": 4,
22
+ "lineEnding": "lf",
23
+ "lineWidth": 100
24
+ },
25
+ "javascript": {
26
+ "formatter": {
27
+ "arrowParentheses": "asNeeded",
28
+ "bracketSameLine": false,
29
+ "bracketSpacing": true,
30
+ "quoteStyle": "single",
31
+ "jsxQuoteStyle": "single",
32
+ "quoteProperties": "asNeeded",
33
+ "semicolons": "asNeeded",
34
+ "trailingCommas": "none"
35
+ }
36
+ }
37
+ }
@@ -11,7 +11,7 @@
11
11
  "build:rsdoctor": "cross-env RSDOCTOR=true rsbuild build",
12
12
  "preview": "rsbuild preview",
13
13
  "up:rsbuild": "pnpm up @rsbuild/* -L",
14
- "format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,css,scss,less}\"",
14
+ "format": "biome format --write",
15
15
  "lint": "tsc --noEmit && eslint **/*.{tsx,ts,jsx,js} --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less,ts,tsx}",
16
16
  "lint:fix": "eslint **/*.{tsx,ts,jsx,js} --fix && stylelint **/*.{css,scss,less,ts,tsx} --fix",
17
17
  "cz": "cz",
@@ -35,6 +35,7 @@
35
35
  "zustand": "4.4.1"
36
36
  },
37
37
  "devDependencies": {
38
+ "@biomejs/biome": "1.9.2",
38
39
  "@commitlint/cli": "17.6.1",
39
40
  "@commitlint/config-conventional": "17.6.1",
40
41
  "@commitlint/cz-commitlint": "17.5.0",
@@ -58,7 +59,6 @@
58
59
  "eslint": "8.56.0",
59
60
  "eslint-import-resolver-typescript": "3.6.1",
60
61
  "eslint-plugin-import": "2.29.1",
61
- "eslint-plugin-prettier": "5.1.3",
62
62
  "eslint-plugin-react": "7.33.2",
63
63
  "eslint-plugin-react-hooks": "4.6.0",
64
64
  "husky": "8.0.3",
@@ -67,7 +67,6 @@
67
67
  "postcss-import": "16.0.1",
68
68
  "postcss-nesting": "12.0.3",
69
69
  "postcss-styled-syntax": "0.6.4",
70
- "prettier": "3.2.5",
71
70
  "stylelint": "16.2.1",
72
71
  "stylelint-config-standard": "36.0.1",
73
72
  "stylelint-webpack-plugin": "5.0.0",
@@ -1,9 +1,6 @@
1
1
  {
2
2
  "root": true,
3
3
  "parser": "@typescript-eslint/parser",
4
- "plugins": [
5
- "prettier"
6
- ],
7
4
  "extends": [
8
5
  "eslint:recommended",
9
6
  "plugin:@typescript-eslint/recommended",
@@ -108,12 +105,6 @@
108
105
  "react-hooks/exhaustive-deps": "off",
109
106
  "react/display-name": "off",
110
107
  "react/react-in-jsx-scope": "off",
111
- "prettier/prettier": [
112
- "error",
113
- {
114
- "endOfLine": "auto"
115
- }
116
- ],
117
108
  "no-constant-condition": "off"
118
109
  }
119
- }
110
+ }
@@ -1,8 +1,8 @@
1
- {
2
- "recommendations": [
3
- "dbaeumer.vscode-eslint",
4
- "stylelint.vscode-stylelint",
5
- "esbenp.prettier-vscode",
6
- "styled-components.vscode-styled-components"
7
- ]
8
- }
1
+ {
2
+ "recommendations": [
3
+ "dbaeumer.vscode-eslint",
4
+ "stylelint.vscode-stylelint",
5
+ "biomejs.biome",
6
+ "styled-components.vscode-styled-components"
7
+ ]
8
+ }
@@ -1,18 +1,4 @@
1
- {
2
- "stylelint.validate": [
3
- "css",
4
- "less",
5
- "postcss",
6
- "scss",
7
- "typescript",
8
- "typescriptreact"
9
- ],
10
- "stylelint.snippet": [
11
- "css",
12
- "less",
13
- "postcss",
14
- "scss",
15
- "typescript",
16
- "typescriptreact"
17
- ]
18
- }
1
+ {
2
+ "stylelint.validate": ["css", "less", "postcss", "scss", "typescript", "typescriptreact"],
3
+ "stylelint.snippet": ["css", "less", "postcss", "scss", "typescript", "typescriptreact"]
4
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "linter": {
3
+ "enabled": false
4
+ },
5
+ "formatter": {
6
+ "enabled": true,
7
+ "formatWithErrors": false,
8
+ "include": [
9
+ "**/*.ts",
10
+ "**/*.js",
11
+ "**/*.tsx",
12
+ "**/*.jsx",
13
+ "**/*.json",
14
+ "**/*.css",
15
+ "**/*.scss",
16
+ "**/*.less"
17
+ ],
18
+ "ignore": ["**/*.md", "**/*.svg", "**/*.ejs", "**/*.html", ".history", "dist"],
19
+ "attributePosition": "auto",
20
+ "indentStyle": "space",
21
+ "indentWidth": 4,
22
+ "lineEnding": "lf",
23
+ "lineWidth": 100
24
+ },
25
+ "javascript": {
26
+ "formatter": {
27
+ "arrowParentheses": "asNeeded",
28
+ "bracketSameLine": false,
29
+ "bracketSpacing": true,
30
+ "quoteStyle": "single",
31
+ "jsxQuoteStyle": "single",
32
+ "quoteProperties": "asNeeded",
33
+ "semicolons": "asNeeded",
34
+ "trailingCommas": "none"
35
+ }
36
+ }
37
+ }
@@ -1,7 +1,7 @@
1
- import { defineStore } from 'define-zustand'
2
-
3
- export const useApp = defineStore({
4
- state: () => ({}),
5
- getter: {},
6
- actions: () => ({})
7
- })
1
+ import { defineStore } from 'define-zustand'
2
+
3
+ export const useApp = defineStore({
4
+ state: () => ({}),
5
+ getter: {},
6
+ actions: () => ({})
7
+ })
@@ -1,3 +1,3 @@
1
- import { createGlobalStyle } from 'styled-components'
2
-
3
- export const GlobalStyle = createGlobalStyle``
1
+ import { createGlobalStyle } from 'styled-components'
2
+
3
+ export const GlobalStyle = createGlobalStyle``
@@ -1,17 +1,17 @@
1
- import { FunctionComponent } from 'react'
2
- import { ThemeProvider } from 'styled-components'
3
- import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
4
- import { theme } from '@/shared/theme'
5
-
6
- const queryClient = new QueryClient()
7
-
8
- export interface propsType {
9
- children: React.ReactNode
10
- }
11
- export const Root: FunctionComponent<propsType> = props => {
12
- return (
13
- <QueryClientProvider client={queryClient}>
14
- <ThemeProvider theme={theme}>{props.children}</ThemeProvider>
15
- </QueryClientProvider>
16
- )
17
- }
1
+ import { FunctionComponent } from 'react'
2
+ import { ThemeProvider } from 'styled-components'
3
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
4
+ import { theme } from '@/shared/theme'
5
+
6
+ const queryClient = new QueryClient()
7
+
8
+ export interface propsType {
9
+ children: React.ReactNode
10
+ }
11
+ export const Root: FunctionComponent<propsType> = props => {
12
+ return (
13
+ <QueryClientProvider client={queryClient}>
14
+ <ThemeProvider theme={theme}>{props.children}</ThemeProvider>
15
+ </QueryClientProvider>
16
+ )
17
+ }
@@ -1,24 +1,24 @@
1
- import { useLayoutEffect } from 'react'
2
- import { RouterProvider } from 'react-router-dom'
3
- import { request } from '@/shared/service'
4
- import { routerInstance } from '@/domain/router'
5
- import { GlobalStyle } from '../app.styled'
6
- import * as AppContext from './app-context'
7
-
8
- export const Root = () => {
9
- useLayoutEffect(() => {
10
- request.interceptors.response.use(
11
- res => res,
12
- error => {
13
- console.log(error)
14
- }
15
- )
16
- }, [])
17
-
18
- return (
19
- <AppContext.Root>
20
- <GlobalStyle />
21
- <RouterProvider router={routerInstance} fallbackElement={<>loading...</>} />
22
- </AppContext.Root>
23
- )
24
- }
1
+ import { useLayoutEffect } from 'react'
2
+ import { RouterProvider } from 'react-router-dom'
3
+ import { request } from '@/shared/service'
4
+ import { routerInstance } from '@/domain/router'
5
+ import { GlobalStyle } from '../app.styled'
6
+ import * as AppContext from './app-context'
7
+
8
+ export const Root = () => {
9
+ useLayoutEffect(() => {
10
+ request.interceptors.response.use(
11
+ res => res,
12
+ error => {
13
+ console.log(error)
14
+ }
15
+ )
16
+ }, [])
17
+
18
+ return (
19
+ <AppContext.Root>
20
+ <GlobalStyle />
21
+ <RouterProvider router={routerInstance} fallbackElement={<>loading...</>} />
22
+ </AppContext.Root>
23
+ )
24
+ }
@@ -1 +1 @@
1
- export * as App from './app'
1
+ export * as App from './app'
@@ -1,2 +1,2 @@
1
- export * from './app.model'
2
- export * from './components'
1
+ export * from './app.model'
2
+ export * from './components'
@@ -1,3 +1,3 @@
1
- export default {
2
- home: 'home'
3
- }
1
+ export default {
2
+ home: 'home'
3
+ }
@@ -1,2 +1,2 @@
1
- export { default as routes } from './routes'
2
- export { default as ids } from './ids'
1
+ export { default as routes } from './routes'
2
+ export { default as ids } from './ids'
@@ -1,13 +1,13 @@
1
- import { lazy } from 'react'
2
- import ids from './ids'
3
- import type { routeType } from '../router.types'
4
-
5
- const routes: routeType[] = [
6
- {
7
- path: 'home',
8
- id: ids.home,
9
- Component: lazy(() => import('@/pages/home'))
10
- }
11
- ]
12
-
13
- export default routes
1
+ import { lazy } from 'react'
2
+ import ids from './ids'
3
+ import type { routeType } from '../router.types'
4
+
5
+ const routes: routeType[] = [
6
+ {
7
+ path: 'home',
8
+ id: ids.home,
9
+ Component: lazy(() => import('@/pages/home'))
10
+ }
11
+ ]
12
+
13
+ export default routes
@@ -1,6 +1,6 @@
1
- import * as home from './home'
2
- export default {
3
- root: 'root',
4
- notFound: 'notFound',
5
- ...home.ids
6
- }
1
+ import * as home from './home'
2
+ export default {
3
+ root: 'root',
4
+ notFound: 'notFound',
5
+ ...home.ids
6
+ }
@@ -1,3 +1,3 @@
1
- export { default as routerIds } from './ids'
2
- export * from './router'
3
- export * from './router.types'
1
+ export { default as routerIds } from './ids'
2
+ export * from './router'
3
+ export * from './router.types'
@@ -1,28 +1,28 @@
1
- import { lazy } from 'react'
2
- import { createBrowserRouter } from 'react-router-dom'
3
- import { defineRouter, routeType } from '@/shared/hooks'
4
- import ids from './ids'
5
- import * as home from './home'
6
-
7
- const routes: routeType[] = [
8
- {
9
- path: '/',
10
- id: ids.root,
11
- Component: lazy(() => import('@/pages')),
12
- children: [
13
- ...home.routes,
14
- {
15
- path: '*',
16
- id: ids.notFound,
17
- Component: lazy(() => import('@/pages/not-found'))
18
- }
19
- ]
20
- }
21
- ]
22
-
23
- export const routerInstance = createBrowserRouter(routes as never, {
24
- basename: import.meta.env.VITE_BASE_URL
25
- })
26
-
27
- export const { useMatchRoutes, useQuery, useRouter, useRoutePermission } =
28
- defineRouter(routerInstance)
1
+ import { lazy } from 'react'
2
+ import { createBrowserRouter } from 'react-router-dom'
3
+ import { defineRouter, routeType } from '@/shared/hooks'
4
+ import ids from './ids'
5
+ import * as home from './home'
6
+
7
+ const routes: routeType[] = [
8
+ {
9
+ path: '/',
10
+ id: ids.root,
11
+ Component: lazy(() => import('@/pages')),
12
+ children: [
13
+ ...home.routes,
14
+ {
15
+ path: '*',
16
+ id: ids.notFound,
17
+ Component: lazy(() => import('@/pages/not-found'))
18
+ }
19
+ ]
20
+ }
21
+ ]
22
+
23
+ export const routerInstance = createBrowserRouter(routes as never, {
24
+ basename: import.meta.env.VITE_BASE_URL
25
+ })
26
+
27
+ export const { useMatchRoutes, useQuery, useRouter, useRoutePermission } =
28
+ defineRouter(routerInstance)
@@ -1,3 +1,3 @@
1
- import { routeType as $routeType } from '@/shared/hooks'
2
-
3
- export type routeType = $routeType
1
+ import { routeType as $routeType } from '@/shared/hooks'
2
+
3
+ export type routeType = $routeType