create-packer 1.32.0 → 1.32.2
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/web-app/react/README.md +1 -1
- package/template/web-app/react/domain/app/components/app-context.tsx +6 -3
- package/template/web-app/react/package.json +2 -1
- package/template/web-app/react/pages/home/home.mock.ts +12 -9
- package/template/web-app/react/pages/home/home.tsx +4 -7
- package/template/web-app/react/shared/service/home.ts +10 -0
- package/template/web-app/react/shared/service/index.ts +2 -1
- package/template/web-app/react/shared/service/request.ts +1 -3
- package/template/web-app/react-webpack/domain/app/components/app-context.tsx +6 -3
- package/template/web-app/react-webpack/global.d.ts +4 -2
- package/template/web-app/react-webpack/package.json +1 -0
- package/template/web-app/react-webpack/pages/home/home.tsx +5 -0
- package/template/web-app/react-webpack/shared/service/home.ts +8 -0
- package/template/web-app/react-webpack/shared/service/index.ts +2 -1
- package/template/web-app/react-webpack/shared/service/request.ts +1 -3
- package/template/web-app/vue/main.ts +2 -1
- package/template/web-app/vue/package.json +71 -70
- package/template/web-app/vue/pages/home/home.mock.ts +12 -9
- package/template/web-app/vue/pages/home/home.vue +10 -7
- package/template/web-app/vue/shared/service/home.ts +10 -0
- package/template/web-app/vue/shared/service/index.ts +2 -1
- package/template/web-app/vue/shared/service/request.ts +1 -3
- package/template/web-extension/package.json +1 -0
- package/template/web-extension/shared/components/app-context.tsx +8 -1
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { FunctionComponent
|
|
1
|
+
import { FunctionComponent } from 'react'
|
|
2
2
|
import { ThemeProvider } from 'styled-components'
|
|
3
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
3
4
|
import { theme } from '@/shared/theme'
|
|
4
5
|
|
|
6
|
+
const queryClient = new QueryClient()
|
|
7
|
+
|
|
5
8
|
export interface propsType {
|
|
6
9
|
children: React.ReactNode
|
|
7
10
|
}
|
|
8
11
|
export const Root: FunctionComponent<propsType> = props => {
|
|
9
12
|
return (
|
|
10
|
-
<
|
|
13
|
+
<QueryClientProvider client={queryClient}>
|
|
11
14
|
<ThemeProvider theme={theme}>{props.children}</ThemeProvider>
|
|
12
|
-
</
|
|
15
|
+
</QueryClientProvider>
|
|
13
16
|
)
|
|
14
17
|
}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"1k-types": "1.2.0",
|
|
22
|
+
"@tanstack/react-query": "5.51.15",
|
|
22
23
|
"axios": "1.3.6",
|
|
23
24
|
"define-zustand": "3.1.1",
|
|
24
25
|
"immer": "10.0.1",
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
"@commitlint/cli": "17.6.1",
|
|
36
37
|
"@commitlint/config-conventional": "17.6.1",
|
|
37
38
|
"@commitlint/cz-commitlint": "17.5.0",
|
|
39
|
+
"@faker-js/faker": "8.4.1",
|
|
38
40
|
"@rollup/plugin-eslint": "9.0.5",
|
|
39
41
|
"@types/lodash-es": "4.17.7",
|
|
40
42
|
"@types/mockjs": "1.0.7",
|
|
@@ -56,7 +58,6 @@
|
|
|
56
58
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
57
59
|
"husky": "8.0.3",
|
|
58
60
|
"inquirer": "^8.1.2",
|
|
59
|
-
"mockjs": "1.1.0",
|
|
60
61
|
"postcss": "8.4.35",
|
|
61
62
|
"postcss-import": "16.0.1",
|
|
62
63
|
"postcss-nesting": "12.0.3",
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { faker } from '@faker-js/faker'
|
|
2
2
|
import { defineMock } from '@/mockUtils'
|
|
3
3
|
import { API } from '@/shared/service'
|
|
4
|
+
|
|
4
5
|
export default defineMock([
|
|
5
6
|
{
|
|
6
7
|
url: API.HOME_DATA,
|
|
7
|
-
body:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
body: faker.helpers.multiple(
|
|
9
|
+
() => ({
|
|
10
|
+
id: faker.string.uuid(),
|
|
11
|
+
name: faker.person.fullName(),
|
|
12
|
+
age: faker.number.int({ max: 110 })
|
|
13
|
+
}),
|
|
14
|
+
{
|
|
15
|
+
count: 10
|
|
16
|
+
}
|
|
17
|
+
)
|
|
15
18
|
}
|
|
16
19
|
])
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { request, API } from '@/shared/service'
|
|
1
|
+
import { useHomeQuery } from '@/shared/service'
|
|
3
2
|
import { StyledRoot } from './home.styled'
|
|
4
3
|
|
|
5
4
|
export default function Home() {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})
|
|
10
|
-
}, [])
|
|
5
|
+
const query = useHomeQuery()
|
|
6
|
+
|
|
7
|
+
console.log('data', query.data)
|
|
11
8
|
|
|
12
9
|
return <StyledRoot>sdfs</StyledRoot>
|
|
13
10
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { FunctionComponent
|
|
1
|
+
import { FunctionComponent } from 'react'
|
|
2
2
|
import { ThemeProvider } from 'styled-components'
|
|
3
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
3
4
|
import { theme } from '@/shared/theme'
|
|
4
5
|
|
|
6
|
+
const queryClient = new QueryClient()
|
|
7
|
+
|
|
5
8
|
export interface propsType {
|
|
6
9
|
children: React.ReactNode
|
|
7
10
|
}
|
|
8
11
|
export const Root: FunctionComponent<propsType> = props => {
|
|
9
12
|
return (
|
|
10
|
-
<
|
|
13
|
+
<QueryClientProvider client={queryClient}>
|
|
11
14
|
<ThemeProvider theme={theme}>{props.children}</ThemeProvider>
|
|
12
|
-
</
|
|
15
|
+
</QueryClientProvider>
|
|
13
16
|
)
|
|
14
17
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import 'styled-components'
|
|
2
2
|
import { themeType } from './shared/theme'
|
|
3
3
|
|
|
4
|
-
declare
|
|
5
|
-
|
|
4
|
+
declare global {
|
|
5
|
+
const ENV_BASE_URL: string
|
|
6
|
+
const ENV_API_HOST: string
|
|
7
|
+
}
|
|
6
8
|
|
|
7
9
|
declare module '*.css'
|
|
8
10
|
declare module '*.less'
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './request'
|
|
2
|
+
export * from './home'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createPinia } from 'pinia'
|
|
2
|
+
import { VueQueryPlugin } from '@tanstack/vue-query'
|
|
2
3
|
import { router } from '@/router'
|
|
3
4
|
import { app } from '@/domain/app'
|
|
4
5
|
import './style.css'
|
|
5
6
|
|
|
6
|
-
app.use(createPinia()).use(router).mount('#app')
|
|
7
|
+
app.use(VueQueryPlugin).use(createPinia()).use(router).mount('#app')
|
|
@@ -1,70 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vue-vite",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"prepare": "husky install",
|
|
8
|
-
"dev": "vite",
|
|
9
|
-
"build": "vue-tsc --noEmit && vite build",
|
|
10
|
-
"build:analyse": "tsc --noEmit && vite build --mode analyse",
|
|
11
|
-
"preview": "vite preview",
|
|
12
|
-
"format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,vue,css,scss,less}\"",
|
|
13
|
-
"lint": "vue-tsc --noEmit && eslint **/*.{ts,tsx,js,jsx,vue} --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less}",
|
|
14
|
-
"lint:fix": "eslint **/*.{ts,tsx,js,jsx,vue} --fix && stylelint **/*.{css,scss,less} --fix",
|
|
15
|
-
"cz": "cz",
|
|
16
|
-
"push": "npm run commit && git push",
|
|
17
|
-
"commit": "git add . && npm run cz",
|
|
18
|
-
"up:vite": "pnpm up vite @vitejs/* vite-plugin-* -L"
|
|
19
|
-
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"1k-types": "1.2.0",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"vue
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"@commitlint/
|
|
31
|
-
"@commitlint/
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"eslint
|
|
45
|
-
"eslint-
|
|
46
|
-
"eslint-plugin-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"postcss
|
|
52
|
-
"postcss-
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"stylelint
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"vite
|
|
61
|
-
"vite-plugin-
|
|
62
|
-
"vite-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "vue-vite",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"prepare": "husky install",
|
|
8
|
+
"dev": "vite",
|
|
9
|
+
"build": "vue-tsc --noEmit && vite build",
|
|
10
|
+
"build:analyse": "tsc --noEmit && vite build --mode analyse",
|
|
11
|
+
"preview": "vite preview",
|
|
12
|
+
"format": "prettier --write \"**/*.{ts,js,tsx,jsx,json,vue,css,scss,less}\"",
|
|
13
|
+
"lint": "vue-tsc --noEmit && eslint **/*.{ts,tsx,js,jsx,vue} --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less}",
|
|
14
|
+
"lint:fix": "eslint **/*.{ts,tsx,js,jsx,vue} --fix && stylelint **/*.{css,scss,less} --fix",
|
|
15
|
+
"cz": "cz",
|
|
16
|
+
"push": "npm run commit && git push",
|
|
17
|
+
"commit": "git add . && npm run cz",
|
|
18
|
+
"up:vite": "pnpm up vite @vitejs/* vite-plugin-* -L"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"1k-types": "1.2.0",
|
|
22
|
+
"@tanstack/vue-query": "5.51.15",
|
|
23
|
+
"axios": "1.3.6",
|
|
24
|
+
"lodash-es": "4.17.21",
|
|
25
|
+
"pinia": "2.1.7",
|
|
26
|
+
"vue": "3.4.21",
|
|
27
|
+
"vue-router": "4.3.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@commitlint/cli": "17.6.1",
|
|
31
|
+
"@commitlint/config-conventional": "17.6.1",
|
|
32
|
+
"@commitlint/cz-commitlint": "17.5.0",
|
|
33
|
+
"@faker-js/faker": "8.4.1",
|
|
34
|
+
"@rollup/plugin-eslint": "9.0.5",
|
|
35
|
+
"@types/lodash-es": "4.17.12",
|
|
36
|
+
"@types/mockjs": "1.0.10",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "7.6.0",
|
|
38
|
+
"@typescript-eslint/parser": "7.6.0",
|
|
39
|
+
"@vitejs/plugin-vue": "5.0.5",
|
|
40
|
+
"@vitejs/plugin-vue-jsx": "4.0.0",
|
|
41
|
+
"autoprefixer": "10.4.14",
|
|
42
|
+
"commitizen": "4.3.0",
|
|
43
|
+
"cssnano": "6.0.0",
|
|
44
|
+
"eslint": "8.56.0",
|
|
45
|
+
"eslint-import-resolver-typescript": "3.6.1",
|
|
46
|
+
"eslint-plugin-import": "2.29.1",
|
|
47
|
+
"eslint-plugin-prettier": "5.1.3",
|
|
48
|
+
"eslint-plugin-vue": "9.21.1",
|
|
49
|
+
"husky": "8.0.3",
|
|
50
|
+
"inquirer": "8.1.2",
|
|
51
|
+
"postcss": "8.4.38",
|
|
52
|
+
"postcss-import": "16.1.0",
|
|
53
|
+
"postcss-nesting": "12.1.1",
|
|
54
|
+
"prettier": "3.2.5",
|
|
55
|
+
"rollup-plugin-visualizer": "5.12.0",
|
|
56
|
+
"stylelint": "16.3.1",
|
|
57
|
+
"stylelint-config-standard-scss": "13.1.0",
|
|
58
|
+
"tailwindcss": "3.4.3",
|
|
59
|
+
"typescript": "5.5.2",
|
|
60
|
+
"vite": "5.3.3",
|
|
61
|
+
"vite-plugin-mock-dev-server": "1.5.1",
|
|
62
|
+
"vite-plugin-stylelint": "5.3.1",
|
|
63
|
+
"vite-svg-loader": "5.1.0",
|
|
64
|
+
"vue-tsc": "2.0.11"
|
|
65
|
+
},
|
|
66
|
+
"config": {
|
|
67
|
+
"commitizen": {
|
|
68
|
+
"path": "@commitlint/cz-commitlint"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { faker } from '@faker-js/faker'
|
|
2
2
|
import { defineMock } from '@/mockUtils'
|
|
3
3
|
import { API } from '@/shared/service'
|
|
4
|
+
|
|
4
5
|
export default defineMock([
|
|
5
6
|
{
|
|
6
7
|
url: API.HOME_DATA,
|
|
7
|
-
body:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
body: faker.helpers.multiple(
|
|
9
|
+
() => ({
|
|
10
|
+
id: faker.string.uuid(),
|
|
11
|
+
name: faker.person.fullName(),
|
|
12
|
+
age: faker.number.int({ max: 110 })
|
|
13
|
+
}),
|
|
14
|
+
{
|
|
15
|
+
count: 10
|
|
16
|
+
}
|
|
17
|
+
)
|
|
15
18
|
}
|
|
16
19
|
])
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>Home</div>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
1
|
<script setup lang="ts">
|
|
6
|
-
import {
|
|
2
|
+
import { watch } from 'vue'
|
|
3
|
+
import { useHomeQuery } from '@/shared/service'
|
|
4
|
+
|
|
5
|
+
const { data } = useHomeQuery()
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
console.log('data', data)
|
|
7
|
+
watch(data, data => {
|
|
8
|
+
console.log('data', data?.data)
|
|
10
9
|
})
|
|
11
10
|
</script>
|
|
12
11
|
|
|
12
|
+
<template>
|
|
13
|
+
<div>Home</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
13
16
|
<style scoped></style>
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode } from 'react'
|
|
2
2
|
import { ThemeProvider } from 'styled-components'
|
|
3
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
3
4
|
import { theme } from 'shared/styles'
|
|
4
5
|
|
|
6
|
+
const queryClient = new QueryClient()
|
|
7
|
+
|
|
5
8
|
export const AppContext: FunctionComponent<{ children: ReactNode }> = props => {
|
|
6
|
-
return
|
|
9
|
+
return (
|
|
10
|
+
<QueryClientProvider client={queryClient}>
|
|
11
|
+
<ThemeProvider theme={theme}>{props.children}</ThemeProvider>
|
|
12
|
+
</QueryClientProvider>
|
|
13
|
+
)
|
|
7
14
|
}
|