create-packer 1.41.3 → 1.41.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-packer",
3
- "version": "1.41.3",
3
+ "version": "1.41.5",
4
4
  "main": "index.js",
5
5
  "repository": "https://github.com/kevily/create-packer",
6
6
  "author": "1k <bug_zero@163.com>",
@@ -1,17 +1,10 @@
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, ReactNode } from 'react'
2
+ import { ThemeProvider } from 'styled-components'
3
+ import { theme } from '@/shared/theme'
4
+
5
+ export interface propsType {
6
+ children: ReactNode
7
+ }
8
+ export const Root: FunctionComponent<propsType> = props => {
9
+ return <ThemeProvider theme={theme}>{props.children}</ThemeProvider>
10
+ }
@@ -19,7 +19,6 @@
19
19
  "commit": "git add . && npm run cz"
20
20
  },
21
21
  "dependencies": {
22
- "@tanstack/react-query": "5.51.15",
23
22
  "axios": "1.7.9",
24
23
  "cross-env": "7.0.3",
25
24
  "define-zustand": "3.1.1",
@@ -31,6 +30,7 @@
31
30
  "react-router-dom": "6.14.0",
32
31
  "react-use": "17.5.0",
33
32
  "styled-components": "6.1.11",
33
+ "type-fest": "4.33.0",
34
34
  "zustand": "4.4.1"
35
35
  },
36
36
  "devDependencies": {
@@ -1,10 +1,11 @@
1
- import { useHomeQuery } from '@/shared/service'
2
- import { StyledRoot } from './view.styled'
3
-
4
- export default function Home() {
5
- const query = useHomeQuery()
6
-
7
- console.log('data', query.data)
8
-
9
- return <StyledRoot>sdfs</StyledRoot>
10
- }
1
+ import { useAsync } from 'react-use'
2
+ import { fetchHomeData } from '@/shared/service'
3
+ import { StyledRoot } from './view.styled'
4
+
5
+ export default function Home() {
6
+ const homeData = useAsync(fetchHomeData)
7
+
8
+ console.log('data', homeData.value)
9
+
10
+ return <StyledRoot>sdfs</StyledRoot>
11
+ }
@@ -1,8 +1,7 @@
1
- import { useQuery } from '@tanstack/react-query'
2
-
3
- export function useHomeQuery() {
4
- return useQuery({
5
- queryKey: ['home_data'],
6
- queryFn: () => [{ name: '1' }]
7
- })
8
- }
1
+ import { request } from './request'
2
+ import { HOME_DATA } from './api'
3
+
4
+ export async function fetchHomeData() {
5
+ const { data } = await request(HOME_DATA)
6
+ return data
7
+ }
@@ -1,17 +1,10 @@
1
- import { FunctionComponent } from 'react'
1
+ import { FunctionComponent, ReactNode } from 'react'
2
2
  import { ThemeProvider } from 'styled-components'
3
- import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
4
3
  import { theme } from '@/shared/theme'
5
4
 
6
- const queryClient = new QueryClient()
7
-
8
5
  export interface propsType {
9
- children: React.ReactNode
6
+ children: ReactNode
10
7
  }
11
8
  export const Root: FunctionComponent<propsType> = props => {
12
- return (
13
- <QueryClientProvider client={queryClient}>
14
- <ThemeProvider theme={theme}>{props.children}</ThemeProvider>
15
- </QueryClientProvider>
16
- )
9
+ return <ThemeProvider theme={theme}>{props.children}</ThemeProvider>
17
10
  }
@@ -18,7 +18,6 @@
18
18
  "commit": "git add . && npm run cz"
19
19
  },
20
20
  "dependencies": {
21
- "@tanstack/react-query": "5.51.15",
22
21
  "axios": "1.7.9",
23
22
  "define-zustand": "3.1.1",
24
23
  "immer": "10.0.1",
@@ -29,6 +28,7 @@
29
28
  "react-router-dom": "6.14.0",
30
29
  "react-use": "17.5.0",
31
30
  "styled-components": "6.1.11",
31
+ "type-fest": "4.33.0",
32
32
  "zustand": "4.4.1"
33
33
  },
34
34
  "devDependencies": {
@@ -1,10 +1,11 @@
1
- import { useHomeQuery } from '@/shared/service'
2
- import { StyledRoot } from './view.styled'
3
-
4
- export default function Home() {
5
- const query = useHomeQuery()
6
-
7
- console.log('data', query.data)
8
-
9
- return <StyledRoot>sdfs</StyledRoot>
10
- }
1
+ import { useAsync } from 'react-use'
2
+ import { fetchHomeData } from '@/shared/service'
3
+ import { StyledRoot } from './view.styled'
4
+
5
+ export default function Home() {
6
+ const homeData = useAsync(fetchHomeData)
7
+
8
+ console.log('data', homeData.value)
9
+
10
+ return <StyledRoot>sdfs</StyledRoot>
11
+ }
@@ -1,10 +1,7 @@
1
- import { useQuery } from '@tanstack/react-query'
2
- import { request } from './request'
3
- import { HOME_DATA } from './api'
4
-
5
- export function useHomeQuery() {
6
- return useQuery({
7
- queryKey: ['home_data'],
8
- queryFn: () => request.post(HOME_DATA)
9
- })
10
- }
1
+ import { request } from './request'
2
+ import { HOME_DATA } from './api'
3
+
4
+ export async function fetchHomeData() {
5
+ const { data } = await request(HOME_DATA)
6
+ return data
7
+ }
@@ -4,4 +4,4 @@ import { router } from '@/router'
4
4
  import { app } from '@/domain/app'
5
5
  import './style.css'
6
6
 
7
- app.use(VueQueryPlugin).use(createPinia()).use(router).mount('#app')
7
+ app.use(createPinia()).use(router).mount('#app')
@@ -1,70 +1,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 \"**/*.{vue,ts,js,tsx,jsx,json,css,scss,less}\"",
13
- "lint": "vue-tsc --noEmit && eslint --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less}",
14
- "lint:fix": "eslint --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
- "@tanstack/vue-query": "5.51.15",
22
- "axios": "1.7.9",
23
- "lodash-es": "4.17.21",
24
- "pinia": "2.3.1",
25
- "vue": "3.5.13",
26
- "vue-router": "4.5.0"
27
- },
28
- "devDependencies": {
29
- "@commitlint/cli": "17.6.1",
30
- "@commitlint/config-conventional": "17.6.1",
31
- "@commitlint/cz-commitlint": "17.5.0",
32
- "@eslint/js": "9.15.0",
33
- "@faker-js/faker": "8.4.1",
34
- "@types/lodash-es": "4.17.12",
35
- "@types/mockjs": "1.0.10",
36
- "@vitejs/plugin-vue": "5.2.1",
37
- "@vitejs/plugin-vue-jsx": "4.1.1",
38
- "autoprefixer": "10.4.14",
39
- "commitizen": "4.3.0",
40
- "cssnano": "6.0.0",
41
- "eslint": "9.17.0",
42
- "eslint-import-resolver-typescript": "3.7.0",
43
- "eslint-plugin-import": "2.31.0",
44
- "eslint-plugin-vue": "9.32.0",
45
- "globals": "15.12.0",
46
- "husky": "9.1.6",
47
- "inquirer": "8.1.2",
48
- "postcss": "8.4.38",
49
- "postcss-import": "16.1.0",
50
- "postcss-nesting": "12.1.1",
51
- "prettier": "3.2.5",
52
- "rollup-plugin-visualizer": "5.12.0",
53
- "stylelint": "16.10.0",
54
- "stylelint-config-standard-scss": "13.1.0",
55
- "tailwindcss": "3.4.3",
56
- "typescript": "5.7.2",
57
- "typescript-eslint": "8.15.0",
58
- "vite": "6.0.7",
59
- "vite-plugin-checker": "0.8.0",
60
- "vite-plugin-mock-dev-server": "1.8.3",
61
- "vite-plugin-stylelint": "6.0.0",
62
- "vite-svg-loader": "5.1.0",
63
- "vue-tsc": "2.2.0"
64
- },
65
- "config": {
66
- "commitizen": {
67
- "path": "@commitlint/cz-commitlint"
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 \"**/*.{vue,ts,js,tsx,jsx,json,css,scss,less}\"",
13
+ "lint": "vue-tsc --noEmit && eslint --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less}",
14
+ "lint:fix": "eslint --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
+ "axios": "1.7.9",
22
+ "lodash-es": "4.17.21",
23
+ "pinia": "2.3.1",
24
+ "type-fest": "4.33.0",
25
+ "vue": "3.5.13",
26
+ "vue-router": "4.5.0"
27
+ },
28
+ "devDependencies": {
29
+ "@commitlint/cli": "17.6.1",
30
+ "@commitlint/config-conventional": "17.6.1",
31
+ "@commitlint/cz-commitlint": "17.5.0",
32
+ "@eslint/js": "9.15.0",
33
+ "@faker-js/faker": "8.4.1",
34
+ "@types/lodash-es": "4.17.12",
35
+ "@types/mockjs": "1.0.10",
36
+ "@vitejs/plugin-vue": "5.2.1",
37
+ "@vitejs/plugin-vue-jsx": "4.1.1",
38
+ "autoprefixer": "10.4.14",
39
+ "commitizen": "4.3.0",
40
+ "cssnano": "6.0.0",
41
+ "eslint": "9.17.0",
42
+ "eslint-import-resolver-typescript": "3.7.0",
43
+ "eslint-plugin-import": "2.31.0",
44
+ "eslint-plugin-vue": "9.32.0",
45
+ "globals": "15.12.0",
46
+ "husky": "9.1.6",
47
+ "inquirer": "8.1.2",
48
+ "postcss": "8.4.38",
49
+ "postcss-import": "16.1.0",
50
+ "postcss-nesting": "12.1.1",
51
+ "prettier": "3.2.5",
52
+ "rollup-plugin-visualizer": "5.12.0",
53
+ "stylelint": "16.10.0",
54
+ "stylelint-config-standard-scss": "13.1.0",
55
+ "tailwindcss": "3.4.3",
56
+ "typescript": "5.7.2",
57
+ "typescript-eslint": "8.15.0",
58
+ "vite": "6.0.7",
59
+ "vite-plugin-checker": "0.8.0",
60
+ "vite-plugin-mock-dev-server": "1.8.3",
61
+ "vite-plugin-stylelint": "6.0.0",
62
+ "vite-svg-loader": "5.1.0",
63
+ "vue-tsc": "2.2.0"
64
+ },
65
+ "config": {
66
+ "commitizen": {
67
+ "path": "@commitlint/cz-commitlint"
68
+ }
69
+ }
70
+ }
@@ -1,16 +1,12 @@
1
- <script setup lang="ts">
2
- import { watch } from 'vue'
3
- import { useHomeQuery } from '@/shared/service'
4
-
5
- const { data } = useHomeQuery()
6
-
7
- watch(data, data => {
8
- console.log('data', data?.data)
9
- })
10
- </script>
11
-
12
- <template>
13
- <div>Home</div>
14
- </template>
15
-
16
- <style scoped></style>
1
+ <script setup lang="ts">
2
+ import { fetchHomeData } from '@/shared/service'
3
+
4
+ const data = fetchHomeData()
5
+ console.log('data', data)
6
+ </script>
7
+
8
+ <template>
9
+ <div>Home</div>
10
+ </template>
11
+
12
+ <style scoped></style>
@@ -1,10 +1,7 @@
1
- import { useQuery } from '@tanstack/vue-query'
2
1
  import { request } from './request'
3
2
  import { HOME_DATA } from './api'
4
3
 
5
- export function useHomeQuery() {
6
- return useQuery({
7
- queryKey: ['home_data'],
8
- queryFn: () => request.post(HOME_DATA)
9
- })
4
+ export async function fetchHomeData() {
5
+ const { data } = await request(HOME_DATA)
6
+ return data
10
7
  }
@@ -1,7 +1,6 @@
1
1
  import { createPinia } from 'pinia'
2
- import { VueQueryPlugin } from '@tanstack/vue-query'
3
2
  import { router } from '@/router'
4
3
  import { app } from '@/domain/app'
5
4
  import './style.css'
6
5
 
7
- app.use(VueQueryPlugin).use(createPinia()).use(router).mount('#app')
6
+ app.use(createPinia()).use(router).mount('#app')
@@ -1,72 +1,72 @@
1
- {
2
- "name": "vue-vite",
3
- "private": true,
4
- "version": "0.0.0",
5
- "type": "module",
6
- "scripts": {
7
- "prepare": "husky install",
8
- "dev": "rsbuild dev",
9
- "build": "rsbuild build",
10
- "build:analyse": "rsbuild build --env-mode analyse",
11
- "build:rsdoctor": "cross-env RSDOCTOR=true rsbuild build",
12
- "preview": "rsbuild preview",
13
- "up:rsbuild": "pnpm up @rsbuild/* -L",
14
- "format": "prettier --write \"**/*.{vue,ts,js,tsx,jsx,json,css,scss,less}\"",
15
- "lint": "vue-tsc --noEmit && eslint --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less}",
16
- "lint:fix": "eslint --fix && stylelint **/*.{css,scss,less} --fix",
17
- "cz": "cz",
18
- "push": "npm run commit && git push",
19
- "commit": "git add . && npm run cz",
20
- "up:vite": "pnpm up vite @vitejs/* vite-plugin-* -L"
21
- },
22
- "dependencies": {
23
- "@tanstack/vue-query": "5.51.15",
24
- "axios": "1.7.9",
25
- "lodash-es": "4.17.21",
26
- "pinia": "2.3.1",
27
- "vue": "3.5.13",
28
- "vue-router": "4.5.0"
29
- },
30
- "devDependencies": {
31
- "@commitlint/cli": "17.6.1",
32
- "@commitlint/config-conventional": "17.6.1",
33
- "@commitlint/cz-commitlint": "17.5.0",
34
- "@eslint/js": "9.15.0",
35
- "@rsbuild/core": "1.2.2",
36
- "@rsbuild/plugin-eslint": "1.1.0",
37
- "@rsbuild/plugin-vue": "1.0.5",
38
- "@rsbuild/plugin-styled-components": "1.2.0",
39
- "@rsbuild/plugin-type-check": "1.2.1",
40
- "@rsdoctor/rspack-plugin": "0.4.13",
41
- "@faker-js/faker": "8.4.1",
42
- "@types/lodash-es": "4.17.12",
43
- "@types/mockjs": "1.0.10",
44
- "autoprefixer": "10.4.14",
45
- "commitizen": "4.3.0",
46
- "cssnano": "6.0.0",
47
- "eslint": "9.17.0",
48
- "eslint-import-resolver-typescript": "3.7.0",
49
- "eslint-plugin-import": "2.31.0",
50
- "eslint-plugin-vue": "9.32.0",
51
- "globals": "15.12.0",
52
- "husky": "9.1.6",
53
- "inquirer": "8.1.2",
54
- "postcss": "8.4.38",
55
- "postcss-import": "16.1.0",
56
- "postcss-nesting": "12.1.1",
57
- "prettier": "3.2.5",
58
- "rollup-plugin-visualizer": "5.12.0",
59
- "stylelint": "16.10.0",
60
- "stylelint-config-standard-scss": "13.1.0",
61
- "stylelint-webpack-plugin": "5.0.0",
62
- "tailwindcss": "3.4.3",
63
- "typescript": "5.7.2",
64
- "typescript-eslint": "8.15.0",
65
- "vue-tsc": "2.2.0"
66
- },
67
- "config": {
68
- "commitizen": {
69
- "path": "@commitlint/cz-commitlint"
70
- }
71
- }
72
- }
1
+ {
2
+ "name": "vue-vite",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "prepare": "husky install",
8
+ "dev": "rsbuild dev",
9
+ "build": "rsbuild build",
10
+ "build:analyse": "rsbuild build --env-mode analyse",
11
+ "build:rsdoctor": "cross-env RSDOCTOR=true rsbuild build",
12
+ "preview": "rsbuild preview",
13
+ "up:rsbuild": "pnpm up @rsbuild/* -L",
14
+ "format": "prettier --write \"**/*.{vue,ts,js,tsx,jsx,json,css,scss,less}\"",
15
+ "lint": "vue-tsc --noEmit && eslint --no-error-on-unmatched-pattern && stylelint **/*.{css,scss,less}",
16
+ "lint:fix": "eslint --fix && stylelint **/*.{css,scss,less} --fix",
17
+ "cz": "cz",
18
+ "push": "npm run commit && git push",
19
+ "commit": "git add . && npm run cz",
20
+ "up:vite": "pnpm up vite @vitejs/* vite-plugin-* -L"
21
+ },
22
+ "dependencies": {
23
+ "axios": "1.7.9",
24
+ "lodash-es": "4.17.21",
25
+ "pinia": "2.3.1",
26
+ "type-fest": "4.33.0",
27
+ "vue": "3.5.13",
28
+ "vue-router": "4.5.0"
29
+ },
30
+ "devDependencies": {
31
+ "@commitlint/cli": "17.6.1",
32
+ "@commitlint/config-conventional": "17.6.1",
33
+ "@commitlint/cz-commitlint": "17.5.0",
34
+ "@eslint/js": "9.15.0",
35
+ "@faker-js/faker": "8.4.1",
36
+ "@rsbuild/core": "1.2.2",
37
+ "@rsbuild/plugin-eslint": "1.1.0",
38
+ "@rsbuild/plugin-styled-components": "1.2.0",
39
+ "@rsbuild/plugin-type-check": "1.2.1",
40
+ "@rsbuild/plugin-vue": "1.0.5",
41
+ "@rsdoctor/rspack-plugin": "0.4.13",
42
+ "@types/lodash-es": "4.17.12",
43
+ "@types/mockjs": "1.0.10",
44
+ "autoprefixer": "10.4.14",
45
+ "commitizen": "4.3.0",
46
+ "cssnano": "6.0.0",
47
+ "eslint": "9.17.0",
48
+ "eslint-import-resolver-typescript": "3.7.0",
49
+ "eslint-plugin-import": "2.31.0",
50
+ "eslint-plugin-vue": "9.32.0",
51
+ "globals": "15.12.0",
52
+ "husky": "9.1.6",
53
+ "inquirer": "8.1.2",
54
+ "postcss": "8.4.38",
55
+ "postcss-import": "16.1.0",
56
+ "postcss-nesting": "12.1.1",
57
+ "prettier": "3.2.5",
58
+ "rollup-plugin-visualizer": "5.12.0",
59
+ "stylelint": "16.10.0",
60
+ "stylelint-config-standard-scss": "13.1.0",
61
+ "stylelint-webpack-plugin": "5.0.0",
62
+ "tailwindcss": "3.4.3",
63
+ "typescript": "5.7.2",
64
+ "typescript-eslint": "8.15.0",
65
+ "vue-tsc": "2.2.0"
66
+ },
67
+ "config": {
68
+ "commitizen": {
69
+ "path": "@commitlint/cz-commitlint"
70
+ }
71
+ }
72
+ }
@@ -0,0 +1,19 @@
1
+ import { faker } from '@faker-js/faker'
2
+ import { defineMock } from '@/mockUtils'
3
+ import { API } from '@/shared/service'
4
+
5
+ export default defineMock([
6
+ {
7
+ url: API.HOME_DATA,
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
+ )
18
+ }
19
+ ])
@@ -1,16 +1,12 @@
1
- <script setup lang="ts">
2
- import { watch } from 'vue'
3
- import { useHomeQuery } from '@/shared/service'
4
-
5
- const { data } = useHomeQuery()
6
-
7
- watch(data, data => {
8
- console.log('data', data?.data)
9
- })
10
- </script>
11
-
12
- <template>
13
- <div>Home</div>
14
- </template>
15
-
16
- <style scoped></style>
1
+ <script setup lang="ts">
2
+ import { fetchHomeData } from '@/shared/service'
3
+
4
+ const data = fetchHomeData()
5
+ console.log('data', data)
6
+ </script>
7
+
8
+ <template>
9
+ <div>Home</div>
10
+ </template>
11
+
12
+ <style scoped></style>
@@ -1,5 +1,5 @@
1
1
  import { ref, reactive, computed, unref } from 'vue'
2
- import { cloneDeep, concat, assign, pick, isNil, size, max } from 'lodash-es'
2
+ import { cloneDeep, concat, assign, pick, isNil, size, map, max } from 'lodash-es'
3
3
 
4
4
  export interface stateType<ListItem, P> {
5
5
  loading: boolean
@@ -73,9 +73,9 @@ export default function createListStore<
73
73
  assign(params, arg?.params)
74
74
  const result = await config.fetch({
75
75
  pagination: unref(pagination),
76
- selected: unref(selected) as ListItem[],
76
+ selected: unref(selected),
77
77
  total: unref(total),
78
- params: params as P
78
+ params
79
79
  })
80
80
  list.value =
81
81
  !isNil(result.page) && arg?.isConcat ? concat(list.value, result.list) : result.list
@@ -1,10 +1,7 @@
1
- import { useQuery } from '@tanstack/vue-query'
2
1
  import { request } from './request'
3
2
  import { HOME_DATA } from './api'
4
3
 
5
- export function useHomeQuery() {
6
- return useQuery({
7
- queryKey: ['home_data'],
8
- queryFn: () => request.post(HOME_DATA)
9
- })
4
+ export async function fetchHomeData() {
5
+ const { data } = await request(HOME_DATA)
6
+ return data
10
7
  }
@@ -34,6 +34,7 @@
34
34
  "react": "18.3.1",
35
35
  "react-dom": "18.3.1",
36
36
  "styled-components": "6.1.11",
37
+ "type-fest": "4.33.0",
37
38
  "zustand": "4.4.1"
38
39
  },
39
40
  "devDependencies": {