@undp/create-app 0.2.17 → 0.2.19
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/README.md +2 -1
- package/bin/generateFiles/generatePackageJson.js +6 -6
- package/bin/templates/vite/query/src/main.tsx +1 -1
- package/bin/templates/vite/query+router/src/main.tsx +1 -1
- package/bin/templates/vite/router/src/main.tsx +1 -1
- package/bin/templates/viteWithLanguage/basic/src/main.tsx +1 -1
- package/bin/templates/viteWithLanguage/query/src/main.tsx +1 -1
- package/bin/templates/viteWithLanguage/query+router/src/main.tsx +1 -1
- package/bin/templates/viteWithLanguage/router/src/main.tsx +1 -1
- package/package.json +1 -1
- package/bin/templates/queryIntegrationForNext/integration/tanstack-query.tsx +0 -27
package/README.md
CHANGED
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
- 🎨 Preconfigured for **UNDP’s Design System**
|
|
17
17
|
- ⚡️ Optional integration with **Tanstack query** for data fetching
|
|
18
18
|
- 📊 Optional integration with **@undp/data-viz** for interactive data visualization
|
|
19
|
-
-
|
|
19
|
+
- 🌐 Optional integration with **i18next** for internationalization
|
|
20
|
+
- ✨ **Biome** preconfigured for consistent code style
|
|
20
21
|
|
|
21
22
|
---
|
|
22
23
|
|
|
@@ -72,9 +72,11 @@ export function generatePackageJson(config) {
|
|
|
72
72
|
const devDependencies = config.framework.includes('vite') ? {
|
|
73
73
|
"@biomejs/biome": "^2.4.12",
|
|
74
74
|
"@tailwindcss/postcss": "^4.1.17",
|
|
75
|
+
"@tailwindcss/vite": "^4.3.0",
|
|
75
76
|
"@types/node": "^24.10.0",
|
|
76
77
|
"@types/react": "^19.2.7",
|
|
77
78
|
"@types/react-dom": "^19.2.3",
|
|
79
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
78
80
|
"autoprefixer": "^10.4.21",
|
|
79
81
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
80
82
|
"postcss": "^8.5.6",
|
|
@@ -87,10 +89,8 @@ export function generatePackageJson(config) {
|
|
|
87
89
|
"tailwindcss-animate": "^1.0.7",
|
|
88
90
|
"typescript": "^5.9.3",
|
|
89
91
|
"typescript-eslint": "^8.46.3",
|
|
90
|
-
"vite": "^
|
|
91
|
-
"vite-plugin-static-copy": "^
|
|
92
|
-
"@vitejs/plugin-react": "^5.1.2",
|
|
93
|
-
"@tailwindcss/vite": "^4.1.17"
|
|
92
|
+
"vite": "^8.0.13",
|
|
93
|
+
"vite-plugin-static-copy": "^4.1.0"
|
|
94
94
|
} : {
|
|
95
95
|
"@biomejs/biome": "^2.4.12",
|
|
96
96
|
"@tailwindcss/postcss": "^4.1.17",
|
|
@@ -125,14 +125,14 @@ export function generatePackageJson(config) {
|
|
|
125
125
|
build: 'next build',
|
|
126
126
|
start: 'next start',
|
|
127
127
|
clean: 'rimraf node_modules && rimraf .next && rimraf package-lock.json',
|
|
128
|
-
lint:
|
|
128
|
+
lint: "biome check . --write"
|
|
129
129
|
} : {
|
|
130
130
|
dev: 'vite',
|
|
131
131
|
build: 'tsc && vite build',
|
|
132
132
|
preview: 'vite preview',
|
|
133
133
|
clean: 'rimraf node_modules && rimraf dist && rimraf package-lock.json',
|
|
134
134
|
'install:build': 'npm install && tsc && vite build',
|
|
135
|
-
lint:
|
|
135
|
+
lint: "biome check . --write"
|
|
136
136
|
},
|
|
137
137
|
dependencies: dependencies,
|
|
138
138
|
devDependencies: devDependencies
|
|
@@ -9,7 +9,7 @@ import './styles/style.css';
|
|
|
9
9
|
|
|
10
10
|
const TanStackQueryProviderContext = TanStackQueryProvider.getContext();
|
|
11
11
|
const rootElement = document.getElementById('root');
|
|
12
|
-
if (rootElement
|
|
12
|
+
if (rootElement) {
|
|
13
13
|
const root = ReactDOM.createRoot(rootElement);
|
|
14
14
|
root.render(
|
|
15
15
|
<StrictMode>
|
|
@@ -11,7 +11,7 @@ import './styles/style.css';
|
|
|
11
11
|
|
|
12
12
|
const TanStackQueryProviderContext = TanStackQueryProvider.getContext();
|
|
13
13
|
const rootElement = document.getElementById('root');
|
|
14
|
-
if (rootElement
|
|
14
|
+
if (rootElement) {
|
|
15
15
|
ReactDOM.createRoot(rootElement).render(
|
|
16
16
|
<StrictMode>
|
|
17
17
|
<I18nextProvider i18n={i18n}>
|
|
@@ -82,7 +82,7 @@ declare module '@tanstack/react-router' {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
const rootElement = document.getElementById('root');
|
|
85
|
-
if (rootElement
|
|
85
|
+
if (rootElement) {
|
|
86
86
|
ReactDOM.createRoot(rootElement).render(
|
|
87
87
|
<StrictMode>
|
|
88
88
|
<I18nextProvider i18n={i18n}>
|
|
@@ -78,7 +78,7 @@ declare module '@tanstack/react-router' {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
const rootElement = document.getElementById('root');
|
|
81
|
-
if (rootElement
|
|
81
|
+
if (rootElement) {
|
|
82
82
|
ReactDOM.createRoot(rootElement).render(
|
|
83
83
|
<StrictMode>
|
|
84
84
|
<I18nextProvider i18n={i18n}>
|
package/package.json
CHANGED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
4
|
-
import { ReactNode, useState } from 'react';
|
|
5
|
-
|
|
6
|
-
export default function TanStackQueryProvider({
|
|
7
|
-
children,
|
|
8
|
-
}: {
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
}) {
|
|
11
|
-
// Create client only once
|
|
12
|
-
const [queryClient] = useState(
|
|
13
|
-
() =>
|
|
14
|
-
new QueryClient({
|
|
15
|
-
defaultOptions: {
|
|
16
|
-
queries: {
|
|
17
|
-
staleTime: 1000 * 60 * 60 * 24, // how long fetched data is considered “fresh” before it becomes “stale” 🡢 24 hrs
|
|
18
|
-
gcTime: 1000 * 60 * 60 * 24, // how long inactive (unused) query data stays in memory before being deleted 🡢 24 hrs
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
}),
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
|
26
|
-
);
|
|
27
|
-
}
|