@undp/create-app 0.2.14 β†’ 0.2.16

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 (137) hide show
  1. package/bin/generateFiles/generatePackageJson.js +12 -30
  2. package/bin/generateFiles/generateViteConfig.js +2 -4
  3. package/bin/index.js +1 -1
  4. package/bin/promptUser.js +21 -2
  5. package/bin/templates/next/auth/biome.json +67 -0
  6. package/bin/templates/next/basic/biome.json +67 -0
  7. package/bin/templates/vite/basic/biome.json +67 -0
  8. package/bin/templates/vite/query/biome.json +67 -0
  9. package/bin/templates/vite/query/src/App.tsx +1 -1
  10. package/bin/templates/vite/query+router/biome.json +67 -0
  11. package/bin/templates/vite/query+router/src/App.tsx +1 -1
  12. package/bin/templates/vite/query+router/src/components/Header.tsx +1 -1
  13. package/bin/templates/vite/query+router/src/routes/queryDemo.tsx +5 -5
  14. package/bin/templates/vite/router/biome.json +67 -0
  15. package/bin/templates/vite/router/src/App.tsx +1 -1
  16. package/bin/templates/vite/router/src/routes/about.tsx +5 -5
  17. package/bin/templates/viteWithLanguage/basic/README.md +75 -0
  18. package/bin/templates/viteWithLanguage/basic/biome.json +67 -0
  19. package/bin/templates/viteWithLanguage/basic/index.html +13 -0
  20. package/bin/templates/viteWithLanguage/basic/public/favicon.ico +0 -0
  21. package/bin/templates/viteWithLanguage/basic/public/imgs/Tailwind_CSS_Logo.svg +1 -0
  22. package/bin/templates/viteWithLanguage/basic/public/imgs/Vitejs-logo.svg +15 -0
  23. package/bin/templates/viteWithLanguage/basic/public/imgs/Zustand-logo.svg +266 -0
  24. package/bin/templates/viteWithLanguage/basic/public/imgs/undp-logo-blue.svg +1 -0
  25. package/bin/templates/viteWithLanguage/basic/src/App.tsx +95 -0
  26. package/bin/templates/viteWithLanguage/basic/src/assets/undp-logo-blue.svg +1 -0
  27. package/bin/templates/viteWithLanguage/basic/src/i18n.ts +31 -0
  28. package/bin/templates/viteWithLanguage/basic/src/locales/en/common.json +6 -0
  29. package/bin/templates/viteWithLanguage/basic/src/locales/es/common.json +6 -0
  30. package/bin/templates/viteWithLanguage/basic/src/locales/fr/common.json +6 -0
  31. package/bin/templates/viteWithLanguage/basic/src/main.tsx +15 -0
  32. package/bin/templates/viteWithLanguage/basic/src/stores/counter.ts +23 -0
  33. package/bin/templates/viteWithLanguage/basic/src/styles/fonts.css +213 -0
  34. package/bin/templates/viteWithLanguage/basic/src/styles/style.css +3 -0
  35. package/bin/templates/viteWithLanguage/basic/src/vite-env.d.ts +1 -0
  36. package/bin/templates/viteWithLanguage/basic/tailwind.config.js +7 -0
  37. package/bin/templates/viteWithLanguage/basic/tsconfig.json +29 -0
  38. package/bin/templates/viteWithLanguage/basic/tsconfig.node.json +9 -0
  39. package/bin/templates/viteWithLanguage/basic/vite.config.ts +58 -0
  40. package/bin/templates/viteWithLanguage/query/README.md +80 -0
  41. package/bin/templates/viteWithLanguage/query/biome.json +67 -0
  42. package/bin/templates/viteWithLanguage/query/index.html +13 -0
  43. package/bin/templates/viteWithLanguage/query/public/favicon.ico +0 -0
  44. package/bin/templates/viteWithLanguage/query/public/imgs/Tailwind_CSS_Logo.svg +1 -0
  45. package/bin/templates/viteWithLanguage/query/public/imgs/Tanstack-logo.png +0 -0
  46. package/bin/templates/viteWithLanguage/query/public/imgs/Vitejs-logo.svg +15 -0
  47. package/bin/templates/viteWithLanguage/query/public/imgs/Zustand-logo.svg +266 -0
  48. package/bin/templates/viteWithLanguage/query/public/imgs/undp-logo-blue.svg +1 -0
  49. package/bin/templates/viteWithLanguage/query/src/App.tsx +125 -0
  50. package/bin/templates/viteWithLanguage/query/src/assets/undp-logo-blue.svg +1 -0
  51. package/bin/templates/viteWithLanguage/query/src/constants.ts +16 -0
  52. package/bin/templates/viteWithLanguage/query/src/i18n.ts +31 -0
  53. package/bin/templates/viteWithLanguage/query/src/integration/tanstack-query.tsx +28 -0
  54. package/bin/templates/viteWithLanguage/query/src/locales/en/common.json +8 -0
  55. package/bin/templates/viteWithLanguage/query/src/locales/es/common.json +8 -0
  56. package/bin/templates/viteWithLanguage/query/src/locales/fr/common.json +8 -0
  57. package/bin/templates/viteWithLanguage/query/src/main.tsx +24 -0
  58. package/bin/templates/viteWithLanguage/query/src/stores/counter.ts +23 -0
  59. package/bin/templates/viteWithLanguage/query/src/styles/fonts.css +213 -0
  60. package/bin/templates/viteWithLanguage/query/src/styles/style.css +3 -0
  61. package/bin/templates/viteWithLanguage/query/src/vite-env.d.ts +1 -0
  62. package/bin/templates/viteWithLanguage/query/tailwind.config.js +7 -0
  63. package/bin/templates/viteWithLanguage/query/tsconfig.json +29 -0
  64. package/bin/templates/viteWithLanguage/query/tsconfig.node.json +9 -0
  65. package/bin/templates/viteWithLanguage/query/vite.config.ts +58 -0
  66. package/bin/templates/viteWithLanguage/query+router/README.md +111 -0
  67. package/bin/templates/viteWithLanguage/query+router/biome.json +67 -0
  68. package/bin/templates/viteWithLanguage/query+router/index.html +13 -0
  69. package/bin/templates/viteWithLanguage/query+router/public/favicon.ico +0 -0
  70. package/bin/templates/viteWithLanguage/query+router/public/imgs/Tailwind_CSS_Logo.svg +1 -0
  71. package/bin/templates/viteWithLanguage/query+router/public/imgs/Tanstack-logo.png +0 -0
  72. package/bin/templates/viteWithLanguage/query+router/public/imgs/Vitejs-logo.svg +15 -0
  73. package/bin/templates/viteWithLanguage/query+router/public/imgs/Zustand-logo.svg +266 -0
  74. package/bin/templates/viteWithLanguage/query+router/public/imgs/undp-logo-blue.svg +1 -0
  75. package/bin/templates/viteWithLanguage/query+router/src/App.tsx +75 -0
  76. package/bin/templates/viteWithLanguage/query+router/src/Icons.tsx +74 -0
  77. package/bin/templates/viteWithLanguage/query+router/src/assets/undp-logo-blue.svg +1 -0
  78. package/bin/templates/viteWithLanguage/query+router/src/components/Footer.tsx +16 -0
  79. package/bin/templates/viteWithLanguage/query+router/src/components/Header.tsx +70 -0
  80. package/bin/templates/viteWithLanguage/query+router/src/constants.ts +16 -0
  81. package/bin/templates/viteWithLanguage/query+router/src/i18n.ts +31 -0
  82. package/bin/templates/viteWithLanguage/query+router/src/integration/tanstack-query.tsx +28 -0
  83. package/bin/templates/viteWithLanguage/query+router/src/locales/en/common.json +13 -0
  84. package/bin/templates/viteWithLanguage/query+router/src/locales/es/common.json +13 -0
  85. package/bin/templates/viteWithLanguage/query+router/src/locales/fr/common.json +14 -0
  86. package/bin/templates/viteWithLanguage/query+router/src/main.tsx +95 -0
  87. package/bin/templates/viteWithLanguage/query+router/src/routes/queryDemo.tsx +78 -0
  88. package/bin/templates/viteWithLanguage/query+router/src/stores/counter.ts +23 -0
  89. package/bin/templates/viteWithLanguage/query+router/src/styles/fonts.css +213 -0
  90. package/bin/templates/viteWithLanguage/query+router/src/styles/style.css +3 -0
  91. package/bin/templates/viteWithLanguage/query+router/src/vite-env.d.ts +1 -0
  92. package/bin/templates/viteWithLanguage/query+router/tailwind.config.js +7 -0
  93. package/bin/templates/viteWithLanguage/query+router/tsconfig.json +29 -0
  94. package/bin/templates/viteWithLanguage/query+router/tsconfig.node.json +9 -0
  95. package/bin/templates/viteWithLanguage/query+router/vite.config.ts +58 -0
  96. package/bin/templates/viteWithLanguage/router/README.md +106 -0
  97. package/bin/templates/viteWithLanguage/router/biome.json +67 -0
  98. package/bin/templates/viteWithLanguage/router/index.html +13 -0
  99. package/bin/templates/viteWithLanguage/router/public/favicon.ico +0 -0
  100. package/bin/templates/viteWithLanguage/router/public/imgs/Tailwind_CSS_Logo.svg +1 -0
  101. package/bin/templates/viteWithLanguage/router/public/imgs/Tanstack-logo.png +0 -0
  102. package/bin/templates/viteWithLanguage/router/public/imgs/Vitejs-logo.svg +15 -0
  103. package/bin/templates/viteWithLanguage/router/public/imgs/Zustand-logo.svg +266 -0
  104. package/bin/templates/viteWithLanguage/router/public/imgs/undp-logo-blue.svg +1 -0
  105. package/bin/templates/viteWithLanguage/router/src/App.tsx +74 -0
  106. package/bin/templates/viteWithLanguage/router/src/Icons.tsx +74 -0
  107. package/bin/templates/viteWithLanguage/router/src/assets/undp-logo-blue.svg +1 -0
  108. package/bin/templates/viteWithLanguage/router/src/components/Footer.tsx +16 -0
  109. package/bin/templates/viteWithLanguage/router/src/components/Header.tsx +70 -0
  110. package/bin/templates/viteWithLanguage/router/src/constants.ts +16 -0
  111. package/bin/templates/viteWithLanguage/router/src/i18n.ts +31 -0
  112. package/bin/templates/viteWithLanguage/router/src/locales/en/common.json +11 -0
  113. package/bin/templates/viteWithLanguage/router/src/locales/es/common.json +11 -0
  114. package/bin/templates/viteWithLanguage/router/src/locales/fr/common.json +11 -0
  115. package/bin/templates/viteWithLanguage/router/src/main.tsx +89 -0
  116. package/bin/templates/viteWithLanguage/router/src/routes/about.tsx +58 -0
  117. package/bin/templates/viteWithLanguage/router/src/stores/counter.ts +23 -0
  118. package/bin/templates/viteWithLanguage/router/src/styles/fonts.css +213 -0
  119. package/bin/templates/viteWithLanguage/router/src/styles/style.css +3 -0
  120. package/bin/templates/viteWithLanguage/router/src/vite-env.d.ts +1 -0
  121. package/bin/templates/viteWithLanguage/router/tailwind.config.js +7 -0
  122. package/bin/templates/viteWithLanguage/router/tsconfig.json +29 -0
  123. package/bin/templates/viteWithLanguage/router/tsconfig.node.json +9 -0
  124. package/bin/templates/viteWithLanguage/router/vite.config.ts +58 -0
  125. package/package.json +1 -1
  126. package/bin/templates/next/auth/.prettierrc +0 -10
  127. package/bin/templates/next/auth/eslint.config.mjs +0 -103
  128. package/bin/templates/next/basic/.prettierrc +0 -10
  129. package/bin/templates/next/basic/eslint.config.mjs +0 -103
  130. package/bin/templates/vite/basic/.prettierrc +0 -10
  131. package/bin/templates/vite/basic/eslint.config.mjs +0 -97
  132. package/bin/templates/vite/query/.prettierrc +0 -10
  133. package/bin/templates/vite/query/eslint.config.mjs +0 -97
  134. package/bin/templates/vite/query+router/.prettierrc +0 -10
  135. package/bin/templates/vite/query+router/eslint.config.mjs +0 -97
  136. package/bin/templates/vite/router/.prettierrc +0 -10
  137. package/bin/templates/vite/router/eslint.config.mjs +0 -97
@@ -7,35 +7,35 @@ export function About() {
7
7
  <>
8
8
  <div className='flex gap-4 items-center justify-center my-8 mx-auto'>
9
9
  <img
10
- src='./imgs/Vitejs-logo.svg'
10
+ src='/imgs/Vitejs-logo.svg'
11
11
  alt='vite logo'
12
12
  width='72px'
13
13
  style={{ marginLeft: 'auto', marginRight: 'auto' }}
14
14
  />
15
15
  <P marginBottom='none'>&</P>
16
16
  <img
17
- src='./imgs/Tailwind_CSS_Logo.svg'
17
+ src='/imgs/Tailwind_CSS_Logo.svg'
18
18
  alt='tailwind logo'
19
19
  width='72px'
20
20
  style={{ marginLeft: 'auto', marginRight: 'auto' }}
21
21
  />
22
22
  <P marginBottom='none'>&</P>
23
23
  <img
24
- src='./imgs/Tanstack-logo.png'
24
+ src='/imgs/Tanstack-logo.png'
25
25
  alt='tanstack logo'
26
26
  width='72px'
27
27
  style={{ marginLeft: 'auto', marginRight: 'auto' }}
28
28
  />
29
29
  <P marginBottom='none'>&</P>
30
30
  <img
31
- src='./imgs/Zustand-logo.svg'
31
+ src='/imgs/Zustand-logo.svg'
32
32
  alt='Zustand logo'
33
33
  width='72px'
34
34
  style={{ marginLeft: 'auto', marginRight: 'auto' }}
35
35
  />
36
36
  <P marginBottom='none'>&</P>
37
37
  <img
38
- src='./imgs/undp-logo-blue.svg'
38
+ src='/imgs/undp-logo-blue.svg'
39
39
  alt='UNDP logo'
40
40
  width='72px'
41
41
  style={{ marginLeft: 'auto', marginRight: 'auto' }}
@@ -0,0 +1,75 @@
1
+ This is a React + TypeScript + Vite project powered by Tailwind CSS, and the UNDP Design System, bootstrapped with [@undp/create-app](https://www.npmjs.com/package/@undp/create-app).
2
+
3
+ It includes:
4
+ * React 19.x with React compiler
5
+ * UNDP Design System
6
+ * TailwindCSS
7
+ * Code linting and formatting via ESLint and Prettier
8
+
9
+ ## 🧩 Installation
10
+
11
+ This project uses `npm`.
12
+
13
+ For installation you will need to install `node` and `npm`, if you don't already have it. `node` and `npm` can be installed from [here](https://nodejs.org/en/download/).
14
+
15
+ To install the project, simply run `npm install` in the project folder in the terminal on Mac or Command Prompt on Windows.
16
+
17
+ ## πŸš€ Local Development
18
+
19
+ To start the project locally:
20
+
21
+ ```bash
22
+ npm run dev
23
+ ```
24
+
25
+ This is run the app in development mode. Open [http://localhost:5173/](http://localhost:5173/) to view it in the browser.
26
+
27
+ The page will reload if you make edits. You will also see any lint errors in the console.
28
+
29
+ ## πŸ“œ Available Scripts
30
+
31
+ - `npm run dev`: Executes `vite` and start the local server for local deployment.
32
+ - `npm run build`: Executes `tsc && vite build` and builds the app for production and deployment.
33
+ - `npm run preview`: Executes `vite preview` and serves the static build output (from vite build) locally.
34
+ - `npm run clean`: Executes `rimraf node_modules && rimraf dist && rimraf package-lock.json` and remove node_modules folder, dist folder and package-lock.json.
35
+ - `npm run lint`: Executes `npx eslint --fix && npx prettier . --write` and resolve all the linting and prettier errors.
36
+
37
+ ## 🧰 Tooling Setup
38
+
39
+ This project uses ESLint integrated with Prettier to automatically format and lint your code.
40
+
41
+ If you’re using Visual Studio Code, install:
42
+ * [ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
43
+ * [Prettier extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
44
+
45
+ Your editor should now show linting errors and automatically fix issues where possible.
46
+
47
+ More info: [ESLint Integrations](http://eslint.org/docs/user-guide/integrations)
48
+
49
+ ## 🎨 Styling
50
+
51
+ This project uses [Tailwind CSS](https://tailwindcss.com/) for styling and and includes pre-configured design tokens from the UNDP Design System.
52
+
53
+ ## 🌐 Embedding the Visualization
54
+
55
+ To embed the visualization on an external page, include:
56
+
57
+ **HTML Placeholder**
58
+
59
+ ```html
60
+ <div id="root"></div>
61
+ ```
62
+
63
+ **Required `<script>` and `<link>` tags**
64
+
65
+ ```
66
+ <link rel="dns-prefetch" href="{{Visualization URL}}">
67
+ <script defer="defer" type="module" src="{{Visualization URL}}/index.js"></script>
68
+ <link rel="modulepreload" crossorigin href="{{Visualization URL}}/react-{{hash}}.js">
69
+ <link rel="modulepreload" crossorigin href="{{Visualization URL}}/undp-{{hash}}.js">
70
+ <link rel="stylesheet" href="{{Visualization URL}}/style.css"></link>
71
+ ```
72
+
73
+ ## πŸ“¬ Contact us
74
+
75
+ For questions or feedback, contact us at [data@undp.org](mailto:data@undp.org).
@@ -0,0 +1,67 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.4.8/schema.json",
3
+ "vcs": {
4
+ "enabled": true,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": true
7
+ },
8
+ "files": {
9
+ "ignoreUnknown": true,
10
+ "includes": ["**/*.{js,jsx,ts,tsx,css}"]
11
+ },
12
+ "formatter": {
13
+ "enabled": true,
14
+ "indentStyle": "space",
15
+ "indentWidth": 2,
16
+ "lineWidth": 100,
17
+ "bracketSameLine": false
18
+ },
19
+ "linter": {
20
+ "enabled": true,
21
+ "rules": {
22
+ "recommended": true,
23
+ "suspicious": {
24
+ "noExplicitAny": "warn",
25
+ "noUnassignedVariables": "warn",
26
+ "noUnusedExpressions": "warn",
27
+ "noConsole": {
28
+ "level": "warn",
29
+ "options": {
30
+ "allow": ["assert", "error", "info", "warn"]
31
+ }
32
+ },
33
+ "noArrayIndexKey": "error"
34
+ },
35
+ "a11y": {
36
+ "useAltText": "error",
37
+ "useValidAnchor": "error"
38
+ },
39
+ "style": {
40
+ "useConst": "error",
41
+ "useSelfClosingElements": "error",
42
+ "useConsistentCurlyBraces": "error",
43
+ "useImportType": "warn"
44
+ },
45
+ "correctness": {
46
+ "noUnusedVariables": "error",
47
+ "noUndeclaredVariables": "error"
48
+ }
49
+ }
50
+ },
51
+ "javascript": {
52
+ "formatter": {
53
+ "quoteStyle": "single",
54
+ "jsxQuoteStyle": "single",
55
+ "semicolons": "always",
56
+ "trailingCommas": "all"
57
+ }
58
+ },
59
+ "assist": {
60
+ "enabled": true,
61
+ "actions": {
62
+ "source": {
63
+ "organizeImports": "on"
64
+ }
65
+ }
66
+ }
67
+ }
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/undp-logo-blue.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>My Vite + Tailwind + UNDP App</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.tsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 54 33"><g clip-path="url(#prefix__clip0)"><path fill="#38bdf8" fill-rule="evenodd" d="M27 0c-7.2 0-11.7 3.6-13.5 10.8 2.7-3.6 5.85-4.95 9.45-4.05 2.054.513 3.522 2.004 5.147 3.653C30.744 13.09 33.808 16.2 40.5 16.2c7.2 0 11.7-3.6 13.5-10.8-2.7 3.6-5.85 4.95-9.45 4.05-2.054-.513-3.522-2.004-5.147-3.653C36.756 3.11 33.692 0 27 0zM13.5 16.2C6.3 16.2 1.8 19.8 0 27c2.7-3.6 5.85-4.95 9.45-4.05 2.054.514 3.522 2.004 5.147 3.653C17.244 29.29 20.308 32.4 27 32.4c7.2 0 11.7-3.6 13.5-10.8-2.7 3.6-5.85 4.95-9.45 4.05-2.054-.513-3.522-2.004-5.147-3.653C23.256 19.31 20.192 16.2 13.5 16.2z" clip-rule="evenodd"/></g><defs><clipPath id="prefix__clip0"><path fill="#fff" d="M0 0h54v32.4H0z"/></clipPath></defs></svg>
@@ -0,0 +1,15 @@
1
+ <svg width="410" height="404" viewBox="0 0 410 404" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M399.641 59.5246L215.643 388.545C211.844 395.338 202.084 395.378 198.228 388.618L10.5817 59.5563C6.38087 52.1896 12.6802 43.2665 21.0281 44.7586L205.223 77.6824C206.398 77.8924 207.601 77.8904 208.776 77.6763L389.119 44.8058C397.439 43.2894 403.768 52.1434 399.641 59.5246Z" fill="url(#paint0_linear)"/>
3
+ <path d="M292.965 1.5744L156.801 28.2552C154.563 28.6937 152.906 30.5903 152.771 32.8664L144.395 174.33C144.198 177.662 147.258 180.248 150.51 179.498L188.42 170.749C191.967 169.931 195.172 173.055 194.443 176.622L183.18 231.775C182.422 235.487 185.907 238.661 189.532 237.56L212.947 230.446C216.577 229.344 220.065 232.527 219.297 236.242L201.398 322.875C200.278 328.294 207.486 331.249 210.492 326.603L212.5 323.5L323.454 102.072C325.312 98.3645 322.108 94.137 318.036 94.9228L279.014 102.454C275.347 103.161 272.227 99.746 273.262 96.1583L298.731 7.86689C299.767 4.27314 296.636 0.855181 292.965 1.5744Z" fill="url(#paint1_linear)"/>
4
+ <defs>
5
+ <linearGradient id="paint0_linear" x1="6.00017" y1="32.9999" x2="235" y2="344" gradientUnits="userSpaceOnUse">
6
+ <stop stop-color="#41D1FF"/>
7
+ <stop offset="1" stop-color="#BD34FE"/>
8
+ </linearGradient>
9
+ <linearGradient id="paint1_linear" x1="194.651" y1="8.81818" x2="236.076" y2="292.989" gradientUnits="userSpaceOnUse">
10
+ <stop stop-color="#FFEA83"/>
11
+ <stop offset="0.0833333" stop-color="#FFDD35"/>
12
+ <stop offset="1" stop-color="#FFA800"/>
13
+ </linearGradient>
14
+ </defs>
15
+ </svg>