create-packer 1.10.2 → 1.10.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/package.json +1 -1
- package/template/react-vite/.eslintrc +2 -3
- package/template/react-vite/.vscode/extensions.json +3 -0
- package/template/react-vite/README.md +13 -0
- package/template/react-vite/package.json +4 -1
- package/template/react-vite/src/app/app.container.tsx +8 -0
- package/template/react-vite/src/app/app.controller.ts +7 -0
- package/template/react-vite/src/app/app.store.ts +8 -0
- package/template/react-vite/src/app/index.ts +3 -0
- package/template/react-vite/src/main.tsx +6 -10
- package/template/react-vite/src/pages/404/View.tsx +3 -0
- package/template/react-vite/src/pages/404/index.ts +1 -0
- package/template/react-vite/src/router/View.tsx +6 -0
- package/template/react-vite/src/router/index.ts +2 -0
- package/template/react-vite/src/router/routes.tsx +16 -0
- package/template/vue-vite/.eslintrc +45 -0
- package/template/vue-vite/.vscode/extensions.json +1 -1
- package/template/vue-vite/READEME.md +12 -0
- package/template/vue-vite/package.json +8 -2
- package/template/vue-vite/src/App/app.container.vue +10 -0
- package/template/vue-vite/src/App/app.controller.ts +7 -0
- package/template/vue-vite/src/App/app.store.ts +14 -0
- package/template/vue-vite/src/App/index.ts +3 -2
- package/template/vue-vite/src/pages/404/View.vue +3 -0
- package/template/vue-vite/src/pages/404/index.ts +1 -0
- package/template/vue-vite/src/routes/index.ts +16 -3
- package/template/vue-vite/src/routes/routeNames.ts +4 -0
- package/template/react-vite/src/Layout/View.tsx +0 -8
- package/template/react-vite/src/Layout/index.ts +0 -2
- package/template/react-vite/src/Layout/typings.ts +0 -1
- package/template/react-vite/src/routes/index.ts +0 -16
- package/template/vue-vite/src/App/View.vue +0 -7
- package/template/vue-vite/src/App/controllers/index.ts +0 -1
- package/template/vue-vite/src/App/controllers/useApp.ts +0 -9
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"root": true,
|
|
3
3
|
"parser": "@typescript-eslint/parser",
|
|
4
|
-
"plugins": ["@typescript-eslint"],
|
|
4
|
+
"plugins": ["@typescript-eslint", "prettier"],
|
|
5
5
|
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:react-hooks/recommended"],
|
|
6
6
|
"settings": {
|
|
7
7
|
"react": {
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"react-hooks/exhaustive-deps": "warn",
|
|
43
43
|
"react/display-name": "off",
|
|
44
44
|
"react/react-in-jsx-scope": "off",
|
|
45
|
-
"
|
|
46
|
-
"quotes": "off"
|
|
45
|
+
"prettier/prettier": "error"
|
|
47
46
|
}
|
|
48
47
|
}
|
|
@@ -22,9 +22,11 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"react": "18.2.0",
|
|
24
24
|
"react-dom": "18.2.0",
|
|
25
|
-
"react-router-dom": "6.3.0"
|
|
25
|
+
"react-router-dom": "6.3.0",
|
|
26
|
+
"zustand": "4.0.0"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
29
|
+
"@testing-library/dom": "8.14.0",
|
|
28
30
|
"@testing-library/jest-dom": "5.16.5",
|
|
29
31
|
"@testing-library/react": "13.3.0",
|
|
30
32
|
"@testing-library/user-event": "14.4.2",
|
|
@@ -40,6 +42,7 @@
|
|
|
40
42
|
"cssnano": "5.1.12",
|
|
41
43
|
"cz-adapter-eslint": "0.3.0",
|
|
42
44
|
"eslint": "8.21.0",
|
|
45
|
+
"eslint-plugin-prettier": "4.0.0",
|
|
43
46
|
"eslint-plugin-react": "7.30.1",
|
|
44
47
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
45
48
|
"husky": "8.0.1",
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import ReactDOM from 'react-dom/client'
|
|
3
|
-
import { BrowserRouter
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { BrowserRouter } from 'react-router-dom'
|
|
4
|
+
import App from './app'
|
|
5
|
+
import Route from './router'
|
|
6
6
|
import './index.css'
|
|
7
7
|
|
|
8
8
|
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
|
9
9
|
<React.StrictMode>
|
|
10
10
|
<BrowserRouter>
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
return <Route key={path} path={path} element={<Component />} />
|
|
15
|
-
})}
|
|
16
|
-
</Routes>
|
|
17
|
-
</Layout>
|
|
11
|
+
<App>
|
|
12
|
+
<Route />
|
|
13
|
+
</App>
|
|
18
14
|
</BrowserRouter>
|
|
19
15
|
</React.StrictMode>
|
|
20
16
|
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './View'
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RouteObject } from 'react-router-dom'
|
|
2
|
+
import Home from '@/pages/Home'
|
|
3
|
+
import CannotAccess from '@/pages/404'
|
|
4
|
+
|
|
5
|
+
const routes: RouteObject[] = [
|
|
6
|
+
{
|
|
7
|
+
path: '/',
|
|
8
|
+
element: <Home />
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
path: '*',
|
|
12
|
+
element: <CannotAccess />
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
export default routes
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"env": {
|
|
4
|
+
"browser": true,
|
|
5
|
+
"node": true,
|
|
6
|
+
"es6": true,
|
|
7
|
+
"jest": true
|
|
8
|
+
},
|
|
9
|
+
"globals": {
|
|
10
|
+
"defineProps": "readonly",
|
|
11
|
+
"defineEmits": "readonly",
|
|
12
|
+
"defineExpose": "readonly",
|
|
13
|
+
"withDefaults": "readonly"
|
|
14
|
+
},
|
|
15
|
+
"plugins": ["prettier"],
|
|
16
|
+
"extends": [
|
|
17
|
+
"plugin:vue/vue3-recommended",
|
|
18
|
+
"eslint:recommended",
|
|
19
|
+
"plugin:@typescript-eslint/recommended"
|
|
20
|
+
],
|
|
21
|
+
"parser": "vue-eslint-parser",
|
|
22
|
+
"parserOptions": {
|
|
23
|
+
"parser": "@typescript-eslint/parser",
|
|
24
|
+
"ecmaVersion": 2021
|
|
25
|
+
},
|
|
26
|
+
"rules": {
|
|
27
|
+
"@typescript-eslint/no-var-requires": 0,
|
|
28
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
29
|
+
"@typescript-eslint/no-explicit-any": 0,
|
|
30
|
+
"@typescript-eslint/no-inferrable-types": [
|
|
31
|
+
"warn",
|
|
32
|
+
{
|
|
33
|
+
"ignoreParameters": true
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"@typescript-eslint/no-unused-vars": "warn",
|
|
37
|
+
"@typescript-eslint/member-delimiter-style": 0,
|
|
38
|
+
"@typescript-eslint/class-name-casing": 0,
|
|
39
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
40
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
41
|
+
"prettier/prettier": "error",
|
|
42
|
+
"vue/multi-word-component-names": 0,
|
|
43
|
+
"vue/html-indent": ["error", 4]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
+
"prepare": "husky install",
|
|
7
8
|
"dev": "vite",
|
|
8
9
|
"build": "vue-tsc --noEmit && vite build",
|
|
9
10
|
"preview": "vite preview",
|
|
10
11
|
"format": "prettier --write \"src/**/*.{ts,js,tsx,jsx,vue,css,scss,less}\" \"./package.json\"",
|
|
11
|
-
"lint": "eslint ./src/**/*.{
|
|
12
|
-
"lint:fix": "eslint ./src/**/*.{
|
|
12
|
+
"lint": "eslint ./src/**/*.{ts,vue} && stylelint ./src/**/*.{css,scss,less}",
|
|
13
|
+
"lint:fix": "eslint ./src/**/*.{ts,vue} --fix && stylelint ./src/**/*.{css,scss,less} --fix",
|
|
13
14
|
"cz": "cz",
|
|
14
15
|
"push": "npm run commit && git push",
|
|
15
16
|
"commit": "git add . && npm run cz"
|
|
@@ -20,11 +21,16 @@
|
|
|
20
21
|
"vue-router": "4.1.3"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
24
|
+
"@typescript-eslint/eslint-plugin": "5.33.0",
|
|
25
|
+
"@typescript-eslint/parser": "5.33.0",
|
|
23
26
|
"@vitejs/plugin-vue": "3.0.3",
|
|
24
27
|
"autoprefixer": "10.4.8",
|
|
25
28
|
"commitizen": "4.2.5",
|
|
26
29
|
"cssnano": "5.1.12",
|
|
27
30
|
"cz-adapter-eslint": "0.3.0",
|
|
31
|
+
"eslint": "8.22.0",
|
|
32
|
+
"eslint-plugin-prettier": "4.0.0",
|
|
33
|
+
"eslint-plugin-vue": "9.3.0",
|
|
28
34
|
"husky": "8.0.1",
|
|
29
35
|
"postcss": "8.4.14",
|
|
30
36
|
"postcss-import": "14.1.0",
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { default } from './
|
|
1
|
+
export { default } from './app.container.vue'
|
|
2
|
+
export { default as useAppStore } from './app.store'
|
|
3
|
+
export * from './app.controller'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './View.vue'
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
|
|
2
2
|
import Home from '@/pages/Home'
|
|
3
|
+
import CannotAccess from '@/pages/404'
|
|
4
|
+
import routeNames from './routeNames'
|
|
3
5
|
|
|
4
|
-
const routes: RouteRecordRaw
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
const routes: (RouteRecordRaw & { name: string })[] = [
|
|
7
|
+
{ path: '/', name: routeNames.home, component: Home },
|
|
8
|
+
{ path: '/404', name: routeNames.cannotAccess, component: CannotAccess }
|
|
9
|
+
]
|
|
10
|
+
const router = createRouter({
|
|
7
11
|
history: createWebHashHistory(),
|
|
8
12
|
routes
|
|
9
13
|
})
|
|
14
|
+
router.beforeEach(async to => {
|
|
15
|
+
if (!Object.values(routeNames).includes(to.name! as string)) {
|
|
16
|
+
return {
|
|
17
|
+
replace: true,
|
|
18
|
+
name: routeNames.cannotAccess
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
export default router
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export interface LayoutPropsType {}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { FunctionComponent } from 'react'
|
|
2
|
-
import Home from '@/pages/Home'
|
|
3
|
-
|
|
4
|
-
export interface routeType {
|
|
5
|
-
path: string
|
|
6
|
-
Component: FunctionComponent<any>
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const routes: routeType[] = [
|
|
10
|
-
{
|
|
11
|
-
path: '/',
|
|
12
|
-
Component: Home
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
export default routes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useApp'
|