@undp/create-app 0.6.0 → 0.8.0

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.
Files changed (43) hide show
  1. package/bin/generateFiles/generatePackageJson.js +1 -1
  2. package/bin/generateFiles/generateStylesCss.js +9 -5
  3. package/bin/templates/next/auth/app/globals.css +1 -3
  4. package/bin/templates/next/basic/app/globals.css +1 -3
  5. package/bin/templates/vite/basic/src/styles/style.css +3 -3
  6. package/bin/templates/vite/basic/tsconfig.json +1 -1
  7. package/bin/templates/vite/query/src/styles/style.css +1 -2
  8. package/bin/templates/vite/query/tsconfig.json +1 -1
  9. package/bin/templates/vite/query+router/src/main.tsx +1 -1
  10. package/bin/templates/vite/query+router/src/routes/{queryDemo.tsx → queryDemo.lazy.tsx} +5 -11
  11. package/bin/templates/vite/query+router/src/routes/queryDemo.route.tsx +9 -0
  12. package/bin/templates/vite/query+router/src/styles/style.css +1 -2
  13. package/bin/templates/vite/query+router/tsconfig.json +1 -1
  14. package/bin/templates/vite/router/src/main.tsx +1 -1
  15. package/bin/templates/vite/router/src/routes/{about.tsx → about.lazy.tsx} +5 -11
  16. package/bin/templates/vite/router/src/routes/about.route.tsx +9 -0
  17. package/bin/templates/vite/router/src/styles/style.css +3 -3
  18. package/bin/templates/vite/router/tsconfig.json +1 -1
  19. package/bin/templates/viteWithLanguage/basic/src/styles/style.css +3 -3
  20. package/bin/templates/viteWithLanguage/basic/tsconfig.json +1 -1
  21. package/bin/templates/viteWithLanguage/query/src/styles/style.css +3 -3
  22. package/bin/templates/viteWithLanguage/query/tsconfig.json +1 -1
  23. package/bin/templates/viteWithLanguage/query+router/src/main.tsx +1 -1
  24. package/bin/templates/viteWithLanguage/query+router/src/routes/{queryDemo.tsx → queryDemo.lazy.tsx} +5 -12
  25. package/bin/templates/viteWithLanguage/query+router/src/routes/queryDemo.route.tsx +9 -0
  26. package/bin/templates/viteWithLanguage/query+router/src/styles/style.css +3 -3
  27. package/bin/templates/viteWithLanguage/query+router/tsconfig.json +1 -1
  28. package/bin/templates/viteWithLanguage/router/src/main.tsx +1 -1
  29. package/bin/templates/viteWithLanguage/router/src/routes/{about.tsx → about.lazy.tsx} +6 -12
  30. package/bin/templates/viteWithLanguage/router/src/routes/about.route.tsx +9 -0
  31. package/bin/templates/viteWithLanguage/router/src/styles/style.css +3 -3
  32. package/bin/templates/viteWithLanguage/router/tsconfig.json +1 -1
  33. package/package.json +2 -2
  34. package/bin/templates/next/auth/tailwind.config.js +0 -7
  35. package/bin/templates/next/basic/tailwind.config.js +0 -7
  36. package/bin/templates/vite/basic/tailwind.config.js +0 -7
  37. package/bin/templates/vite/query/tailwind.config.js +0 -7
  38. package/bin/templates/vite/query+router/tailwind.config.js +0 -7
  39. package/bin/templates/vite/router/tailwind.config.js +0 -7
  40. package/bin/templates/viteWithLanguage/basic/tailwind.config.js +0 -7
  41. package/bin/templates/viteWithLanguage/query/tailwind.config.js +0 -7
  42. package/bin/templates/viteWithLanguage/query+router/tailwind.config.js +0 -7
  43. package/bin/templates/viteWithLanguage/router/tailwind.config.js +0 -7
@@ -27,7 +27,7 @@ export function generatePackageJson(config) {
27
27
  "dom-to-svg": "^0.12.2",
28
28
  "file-saver": "^2.0.5",
29
29
  handlebars: "^4.7.8",
30
- "maplibre-gl": "^5.16.0",
30
+ "maplibre-gl": "^6.9.0",
31
31
  marked: "^18.0.9",
32
32
  "math-expression-evaluator": "^2.0.7",
33
33
  pmtiles: "^4.3.0",
@@ -1,8 +1,12 @@
1
1
  export function generateStylesCss(dataViz) {
2
- return `@import '@undp/design-system-react/style.css';${dataViz ? `
3
- @import '@undp/data-viz/style.css';` : ''}
2
+ return `
4
3
  @import 'tailwindcss';
5
- @config '../../tailwind.config.js';
6
- `
4
+ @import '@undp/design-system-react/style.css';
5
+ @import '@undp/design-system-react/theme.css';${
6
+ dataViz
7
+ ? `
8
+ @import '@undp/data-viz/style.css';`
9
+ : ""
10
+ }
11
+ `;
7
12
  }
8
-
@@ -1,3 +1 @@
1
- @import "tailwindcss";
2
-
3
- @config "../tailwind.config.js";
1
+ @import "tailwindcss";
@@ -1,3 +1 @@
1
- @import "tailwindcss";
2
-
3
- @config "../tailwind.config.js";
1
+ @import "tailwindcss";
@@ -1,3 +1,3 @@
1
- @import '@undp/design-system-react/style.css';
2
- @import 'tailwindcss';
3
- @config '../../tailwind.config.js';
1
+ @import "tailwindcss";
2
+ @import "@undp/design-system-react/style.css";
3
+ @import "@undp/design-system-react/theme.css";
@@ -24,6 +24,6 @@
24
24
  }
25
25
  },
26
26
  "files": [],
27
- "include": ["src", "tailwind.config.js"],
27
+ "include": ["src"],
28
28
  "references": [{ "path": "./tsconfig.node.json" }]
29
29
  }
@@ -1,3 +1,2 @@
1
- @import '@undp/design-system-react/style.css';
2
1
  @import 'tailwindcss';
3
- @config '../../tailwind.config.js';
2
+ @import '@undp/design-system-react/style.css';
@@ -24,6 +24,6 @@
24
24
  }
25
25
  },
26
26
  "files": [],
27
- "include": ["src", "tailwind.config.js"],
27
+ "include": ["src"],
28
28
  "references": [{ "path": "./tsconfig.node.json" }]
29
29
  }
@@ -12,7 +12,7 @@ import * as TanStackQueryProvider from './integration/tanstack-query';
12
12
  import HeaderEl from './components/Header';
13
13
  import FooterEl from './components/Footer';
14
14
  import App from './App';
15
- import createTanStackQueryDemoRoute from './routes/queryDemo';
15
+ import createTanStackQueryDemoRoute from './routes/queryDemo.route';
16
16
 
17
17
  import './styles/fonts.css';
18
18
  import './styles/style.css';
@@ -1,6 +1,5 @@
1
- import { createRoute } from '@tanstack/react-router';
1
+ import { createLazyRoute } from '@tanstack/react-router';
2
2
  import { useQuery } from '@tanstack/react-query';
3
- import type { AnyRootRoute } from '@tanstack/react-router';
4
3
  import { Spinner } from '@undp/design-system-react/Spinner';
5
4
  import { P } from '@undp/design-system-react/Typography';
6
5
 
@@ -66,12 +65,7 @@ export function TanStackQueryDemo() {
66
65
  </>
67
66
  );
68
67
  }
69
- export default function createTanStackQueryDemoRoute(
70
- parentRoute: AnyRootRoute,
71
- ) {
72
- return createRoute({
73
- path: '/query-demo',
74
- component: TanStackQueryDemo,
75
- getParentRoute: () => parentRoute,
76
- });
77
- }
68
+
69
+ export const Route = createLazyRoute('/query-demo')({
70
+ component: QueryDemo,
71
+ });
@@ -0,0 +1,9 @@
1
+ import type { AnyRootRoute } from '@tanstack/react-router';
2
+ import { createRoute } from '@tanstack/react-router';
3
+
4
+ export default function createTanStackQueryDemoRoute(parentRoute: AnyRootRoute) {
5
+ return createRoute({
6
+ path: '/query-demo',
7
+ getParentRoute: () => parentRoute,
8
+ }).lazy(() => import('./queryDemo.lazy').then((d) => d.Route));
9
+ }
@@ -1,3 +1,2 @@
1
- @import '@undp/design-system-react/style.css';
2
1
  @import 'tailwindcss';
3
- @config '../../tailwind.config.js';
2
+ @import '@undp/design-system-react/style.css';
@@ -24,6 +24,6 @@
24
24
  }
25
25
  },
26
26
  "files": [],
27
- "include": ["src", "tailwind.config.js"],
27
+ "include": ["src"],
28
28
  "references": [{ "path": "./tsconfig.node.json" }]
29
29
  }
@@ -11,7 +11,7 @@ import {
11
11
  import HeaderEl from './components/Header';
12
12
  import FooterEl from './components/Footer';
13
13
  import App from './App';
14
- import createAboutRoute from './routes/about';
14
+ import createAboutRoute from './routes/about.route';
15
15
 
16
16
  import './styles/fonts.css';
17
17
  import './styles/style.css';
@@ -1,5 +1,4 @@
1
- import { createRoute } from '@tanstack/react-router';
2
- import type { AnyRootRoute } from '@tanstack/react-router';
1
+ import { createLazyRoute } from '@tanstack/react-router';
3
2
  import { P } from '@undp/design-system-react/Typography';
4
3
 
5
4
  export function About() {
@@ -47,12 +46,7 @@ export function About() {
47
46
  </>
48
47
  );
49
48
  }
50
- export default function createAboutRoute(
51
- parentRoute: AnyRootRoute,
52
- ) {
53
- return createRoute({
54
- path: '/about',
55
- component: About,
56
- getParentRoute: () => parentRoute,
57
- });
58
- }
49
+
50
+ export const Route = createLazyRoute('/about')({
51
+ component: About,
52
+ });
@@ -0,0 +1,9 @@
1
+ import type { AnyRootRoute } from '@tanstack/react-router';
2
+ import { createRoute } from '@tanstack/react-router';
3
+
4
+ export default function createAboutRoute(parentRoute: AnyRootRoute) {
5
+ return createRoute({
6
+ path: '/about',
7
+ getParentRoute: () => parentRoute,
8
+ }).lazy(() => import('./about.lazy').then((d) => d.Route));
9
+ }
@@ -1,3 +1,3 @@
1
- @import '@undp/design-system-react/style.css';
2
- @import 'tailwindcss';
3
- @config '../../tailwind.config.js';
1
+ @import "tailwindcss";
2
+ @import "@undp/design-system-react/style.css";
3
+ @import "@undp/design-system-react/theme.css";
@@ -24,6 +24,6 @@
24
24
  }
25
25
  },
26
26
  "files": [],
27
- "include": ["src", "tailwind.config.js"],
27
+ "include": ["src"],
28
28
  "references": [{ "path": "./tsconfig.node.json" }]
29
29
  }
@@ -1,3 +1,3 @@
1
- @import '@undp/design-system-react/style.css';
2
- @import 'tailwindcss';
3
- @config '../../tailwind.config.js';
1
+ @import "tailwindcss";
2
+ @import "@undp/design-system-react/style.css";
3
+ @import "@undp/design-system-react/theme.css";
@@ -24,6 +24,6 @@
24
24
  }
25
25
  },
26
26
  "files": [],
27
- "include": ["src", "tailwind.config.js"],
27
+ "include": ["src"],
28
28
  "references": [{ "path": "./tsconfig.node.json" }]
29
29
  }
@@ -1,3 +1,3 @@
1
- @import '@undp/design-system-react/style.css';
2
- @import 'tailwindcss';
3
- @config '../../tailwind.config.js';
1
+ @import "tailwindcss";
2
+ @import "@undp/design-system-react/style.css";
3
+ @import "@undp/design-system-react/theme.css";
@@ -24,6 +24,6 @@
24
24
  }
25
25
  },
26
26
  "files": [],
27
- "include": ["src", "tailwind.config.js"],
27
+ "include": ["src"],
28
28
  "references": [{ "path": "./tsconfig.node.json" }]
29
29
  }
@@ -13,7 +13,7 @@ import * as TanStackQueryProvider from './integration/tanstack-query';
13
13
  import HeaderEl from './components/Header';
14
14
  import FooterEl from './components/Footer';
15
15
  import App from './App';
16
- import createTanStackQueryDemoRoute from './routes/queryDemo';
16
+ import createTanStackQueryDemoRoute from './routes/queryDemo.route';
17
17
  import i18n from './i18n';
18
18
  import { DEFAULT_LANGUAGE, LANGUAGES } from './constants';
19
19
 
@@ -1,9 +1,7 @@
1
- import { createRoute } from '@tanstack/react-router';
1
+ import { createLazyRoute } from '@tanstack/react-router';
2
2
  import { useQuery } from '@tanstack/react-query';
3
- import type { AnyRoute } from '@tanstack/react-router';
4
3
  import { Spinner } from '@undp/design-system-react/Spinner';
5
4
  import { P } from '@undp/design-system-react/Typography';
6
- import { useTranslation } from 'react-i18next';
7
5
 
8
6
  function useTodoData() {
9
7
  return useQuery({
@@ -19,7 +17,6 @@ function useTodoData() {
19
17
 
20
18
  export function TanStackQueryDemo() {
21
19
  const { data, isLoading, isError } = useTodoData();
22
- const { t } = useTranslation();
23
20
 
24
21
  if (isLoading) return <Spinner size='lg' className='mx-auto my-20' />;
25
22
 
@@ -63,16 +60,12 @@ export function TanStackQueryDemo() {
63
60
  />
64
61
  </div>
65
62
  <P marginBottom='xl' className='text-center'>
66
- {t('dataLoading', { count: data?.length })}
63
+ Data loaded successfully. {data?.length} elements in the query.
67
64
  </P>
68
65
  </>
69
66
  );
70
67
  }
71
68
 
72
- export default function createTanStackQueryDemoRoute(parentRoute: AnyRoute) {
73
- return createRoute({
74
- path: '/query-demo',
75
- component: TanStackQueryDemo,
76
- getParentRoute: () => parentRoute,
77
- });
78
- }
69
+ export const Route = createLazyRoute('/query-demo')({
70
+ component: QueryDemo,
71
+ });
@@ -0,0 +1,9 @@
1
+ import type { AnyRootRoute } from '@tanstack/react-router';
2
+ import { createRoute } from '@tanstack/react-router';
3
+
4
+ export default function createTanStackQueryDemoRoute(parentRoute: AnyRootRoute) {
5
+ return createRoute({
6
+ path: '/query-demo',
7
+ getParentRoute: () => parentRoute,
8
+ }).lazy(() => import('./queryDemo.lazy').then((d) => d.Route));
9
+ }
@@ -1,3 +1,3 @@
1
- @import '@undp/design-system-react/style.css';
2
- @import 'tailwindcss';
3
- @config '../../tailwind.config.js';
1
+ @import "tailwindcss";
2
+ @import "@undp/design-system-react/style.css";
3
+ @import "@undp/design-system-react/theme.css";
@@ -24,6 +24,6 @@
24
24
  }
25
25
  },
26
26
  "files": [],
27
- "include": ["src", "tailwind.config.js"],
27
+ "include": ["src"],
28
28
  "references": [{ "path": "./tsconfig.node.json" }]
29
29
  }
@@ -13,7 +13,7 @@ import {
13
13
  import HeaderEl from './components/Header';
14
14
  import FooterEl from './components/Footer';
15
15
  import App from './App';
16
- import createAboutRoute from './routes/about';
16
+ import createAboutRoute from './routes/about.route';
17
17
  import i18n from './i18n';
18
18
  import { DEFAULT_LANGUAGE, LANGUAGES } from './constants';
19
19
 
@@ -1,10 +1,7 @@
1
- import { createRoute } from '@tanstack/react-router';
2
- import type { AnyRoute } from '@tanstack/react-router';
1
+ import { createLazyRoute } from '@tanstack/react-router';
3
2
  import { P } from '@undp/design-system-react/Typography';
4
- import { useTranslation } from 'react-i18next';
5
3
 
6
4
  export function About() {
7
- const { t } = useTranslation();
8
5
  return (
9
6
  <>
10
7
  <div className='mx-auto my-8 flex items-center justify-center gap-4'>
@@ -44,15 +41,12 @@ export function About() {
44
41
  />
45
42
  </div>
46
43
  <P marginBottom='xl' className='text-center'>
47
- {t('aboutPage')}
44
+ To edit this page, edit the about.tsx file in the routes folder.
48
45
  </P>
49
46
  </>
50
47
  );
51
48
  }
52
- export default function createAboutRoute(parentRoute: AnyRoute) {
53
- return createRoute({
54
- path: '/about',
55
- component: About,
56
- getParentRoute: () => parentRoute,
57
- });
58
- }
49
+
50
+ export const Route = createLazyRoute('/about')({
51
+ component: About,
52
+ });
@@ -0,0 +1,9 @@
1
+ import type { AnyRootRoute } from '@tanstack/react-router';
2
+ import { createRoute } from '@tanstack/react-router';
3
+
4
+ export default function createAboutRoute(parentRoute: AnyRootRoute) {
5
+ return createRoute({
6
+ path: '/about',
7
+ getParentRoute: () => parentRoute,
8
+ }).lazy(() => import('./about.lazy').then((d) => d.Route));
9
+ }
@@ -1,3 +1,3 @@
1
- @import '@undp/design-system-react/style.css';
2
- @import 'tailwindcss';
3
- @config '../../tailwind.config.js';
1
+ @import "tailwindcss";
2
+ @import "@undp/design-system-react/style.css";
3
+ @import "@undp/design-system-react/theme.css";
@@ -24,6 +24,6 @@
24
24
  }
25
25
  },
26
26
  "files": [],
27
- "include": ["src", "tailwind.config.js"],
27
+ "include": ["src"],
28
28
  "references": [{ "path": "./tsconfig.node.json" }]
29
29
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@undp/create-app",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "UNDP's project scaffolding tool",
5
5
  "bin": {
6
6
  "create-undp-app": "./bin/index.js"
7
7
  },
8
8
  "scripts": {
9
- "dev": "node ./bin/index.js"
9
+ "dev": "node ./bin/index.djs"
10
10
  },
11
11
  "publishConfig": {
12
12
  "access": "public"
@@ -1,7 +0,0 @@
1
- import * as Preset from '@undp/design-system-react/tailwind.config';
2
-
3
- /** @type {import('tailwindcss').Config} */
4
-
5
- export default {
6
- presets: [Preset],
7
- };
@@ -1,7 +0,0 @@
1
- import * as Preset from '@undp/design-system-react/tailwind.config';
2
-
3
- /** @type {import('tailwindcss').Config} */
4
-
5
- export default {
6
- presets: [Preset],
7
- };
@@ -1,7 +0,0 @@
1
- import * as Preset from '@undp/design-system-react/tailwind.config';
2
-
3
- /** @type {import('tailwindcss').Config} */
4
-
5
- export default {
6
- presets: [Preset],
7
- };
@@ -1,7 +0,0 @@
1
- import * as Preset from '@undp/design-system-react/tailwind.config';
2
-
3
- /** @type {import('tailwindcss').Config} */
4
-
5
- export default {
6
- presets: [Preset],
7
- };
@@ -1,7 +0,0 @@
1
- import * as Preset from '@undp/design-system-react/tailwind.config';
2
-
3
- /** @type {import('tailwindcss').Config} */
4
-
5
- export default {
6
- presets: [Preset],
7
- };
@@ -1,7 +0,0 @@
1
- import * as Preset from '@undp/design-system-react/tailwind.config';
2
-
3
- /** @type {import('tailwindcss').Config} */
4
-
5
- export default {
6
- presets: [Preset],
7
- };
@@ -1,7 +0,0 @@
1
- import * as Preset from '@undp/design-system-react/tailwind.config';
2
-
3
- /** @type {import('tailwindcss').Config} */
4
-
5
- export default {
6
- presets: [Preset],
7
- };
@@ -1,7 +0,0 @@
1
- import * as Preset from '@undp/design-system-react/tailwind.config';
2
-
3
- /** @type {import('tailwindcss').Config} */
4
-
5
- export default {
6
- presets: [Preset],
7
- };
@@ -1,7 +0,0 @@
1
- import * as Preset from '@undp/design-system-react/tailwind.config';
2
-
3
- /** @type {import('tailwindcss').Config} */
4
-
5
- export default {
6
- presets: [Preset],
7
- };
@@ -1,7 +0,0 @@
1
- import * as Preset from '@undp/design-system-react/tailwind.config';
2
-
3
- /** @type {import('tailwindcss').Config} */
4
-
5
- export default {
6
- presets: [Preset],
7
- };