create-packer 1.32.0 → 1.32.1
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/domain/app/components/app-context.tsx +6 -3
- package/template/web-app/react/package.json +1 -0
- 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 +1 -0
- 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
|
}
|
|
@@ -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,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
|
}
|