@undp/create-app 0.2.1 → 0.2.3
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 +20 -21
- package/bin/generateFiles/generateEnv.js +21 -0
- package/bin/generateFiles/generateLayoutForNext.js +40 -0
- package/bin/generateFiles/generateNextEnvTypes.js +9 -0
- package/bin/generateFiles/generatePackageJson.js +10 -11
- package/bin/generateFiles/generatePageForNext.js +102 -0
- package/bin/generateFiles/generateStylesCss.js +8 -0
- package/bin/generateFiles/index.js +5 -0
- package/bin/index.js +25 -9
- package/bin/promptUser.js +22 -26
- package/bin/templates/next/auth/app/about/page.tsx +51 -0
- package/bin/templates/next/{withDataViz/auth → auth}/app/layout.tsx +2 -1
- package/bin/templates/next/{withDataViz/auth → auth}/app/login/page.tsx +20 -2
- package/bin/templates/next/auth/app/page.tsx +75 -0
- package/bin/templates/next/auth/app/user/page.tsx +84 -0
- package/bin/templates/next/auth/public/imgs/Zustand-logo.svg +266 -0
- package/bin/templates/next/auth/stores/counter.ts +23 -0
- package/bin/templates/next/basic/app/about/page.tsx +51 -0
- package/bin/templates/next/{withDataViz/basic → basic}/app/layout.tsx +2 -1
- package/bin/templates/next/basic/app/page.tsx +75 -0
- package/bin/templates/next/basic/public/imgs/Zustand-logo.svg +266 -0
- package/bin/templates/next/basic/stores/counter.ts +23 -0
- package/bin/templates/queryIntegrationForNext/integration/tanstack-query.tsx +27 -0
- package/bin/templates/vite/basic/public/imgs/Zustand-logo.svg +266 -0
- package/bin/templates/vite/{withDataViz/query → basic}/src/App.tsx +30 -31
- package/bin/templates/vite/{withDataViz/basic → basic}/src/main.tsx +1 -1
- package/bin/templates/vite/basic/src/stores/counter.ts +23 -0
- package/bin/templates/vite/query/public/imgs/Zustand-logo.svg +266 -0
- package/bin/templates/vite/{withoutDataViz/query → query}/src/App.tsx +39 -10
- package/bin/templates/vite/{withDataViz/query → query}/src/integration/tanstack-query.tsx +2 -1
- package/bin/templates/vite/query/src/stores/counter.ts +23 -0
- package/bin/templates/vite/query+router/public/imgs/Zustand-logo.svg +266 -0
- package/bin/templates/vite/query+router/src/App.tsx +73 -0
- package/bin/templates/vite/{withDataViz/query+router → query+router}/src/integration/tanstack-query.tsx +2 -1
- package/bin/templates/vite/{withDataViz/query+router → query+router}/src/routes/queryDemo.tsx +12 -8
- package/bin/templates/vite/query+router/src/stores/counter.ts +23 -0
- package/bin/templates/vite/router/public/imgs/Zustand-logo.svg +266 -0
- package/bin/templates/vite/router/src/App.tsx +73 -0
- package/bin/templates/vite/{withDataViz/router → router}/src/main.tsx +2 -2
- package/bin/templates/vite/{withoutDataViz/router/src/App.tsx → router/src/routes/about.tsx} +14 -7
- package/bin/templates/vite/router/src/stores/counter.ts +23 -0
- package/bin/templates/vite/{withoutDataViz/router → router}/src/styles/style.css +0 -1
- package/package.json +1 -1
- package/bin/templates/next/withDataViz/auth/README.md +0 -108
- package/bin/templates/next/withDataViz/auth/app/about/page.tsx +0 -33
- package/bin/templates/next/withDataViz/auth/app/page.tsx +0 -33
- package/bin/templates/next/withDataViz/auth/app/user/page.tsx +0 -86
- package/bin/templates/next/withDataViz/basic/README.md +0 -56
- package/bin/templates/next/withDataViz/basic/app/about/page.tsx +0 -33
- package/bin/templates/next/withDataViz/basic/app/page.tsx +0 -33
- package/bin/templates/next/withoutDataViz/auth/app/about/page.tsx +0 -33
- package/bin/templates/next/withoutDataViz/auth/app/api/auth/[...all]/route.ts +0 -5
- package/bin/templates/next/withoutDataViz/auth/app/globals.css +0 -3
- package/bin/templates/next/withoutDataViz/auth/app/layout.tsx +0 -30
- package/bin/templates/next/withoutDataViz/auth/app/login/page.tsx +0 -45
- package/bin/templates/next/withoutDataViz/auth/app/page.tsx +0 -33
- package/bin/templates/next/withoutDataViz/auth/app/user/page.tsx +0 -86
- package/bin/templates/next/withoutDataViz/auth/components/Footer.tsx +0 -16
- package/bin/templates/next/withoutDataViz/auth/components/Header.tsx +0 -56
- package/bin/templates/next/withoutDataViz/auth/eslint.config.mjs +0 -103
- package/bin/templates/next/withoutDataViz/auth/lib/auth-client.ts +0 -7
- package/bin/templates/next/withoutDataViz/auth/lib/auth.ts +0 -30
- package/bin/templates/next/withoutDataViz/auth/next.config.ts +0 -10
- package/bin/templates/next/withoutDataViz/auth/postcss.config.mjs +0 -7
- package/bin/templates/next/withoutDataViz/auth/public/next.svg +0 -1
- package/bin/templates/next/withoutDataViz/auth/tsconfig.json +0 -34
- package/bin/templates/next/withoutDataViz/basic/app/about/page.tsx +0 -33
- package/bin/templates/next/withoutDataViz/basic/app/globals.css +0 -3
- package/bin/templates/next/withoutDataViz/basic/app/layout.tsx +0 -31
- package/bin/templates/next/withoutDataViz/basic/app/page.tsx +0 -33
- package/bin/templates/next/withoutDataViz/basic/components/Footer.tsx +0 -16
- package/bin/templates/next/withoutDataViz/basic/components/Header.tsx +0 -27
- package/bin/templates/next/withoutDataViz/basic/eslint.config.mjs +0 -103
- package/bin/templates/next/withoutDataViz/basic/next.config.ts +0 -7
- package/bin/templates/next/withoutDataViz/basic/postcss.config.mjs +0 -7
- package/bin/templates/next/withoutDataViz/basic/public/next.svg +0 -1
- package/bin/templates/next/withoutDataViz/basic/tsconfig.json +0 -34
- package/bin/templates/vite/withDataViz/basic/README.md +0 -76
- package/bin/templates/vite/withDataViz/basic/src/App.tsx +0 -38
- package/bin/templates/vite/withDataViz/basic/src/styles/style.css +0 -4
- package/bin/templates/vite/withDataViz/basic/vite.config.ts +0 -74
- package/bin/templates/vite/withDataViz/query/.prettierrc +0 -10
- package/bin/templates/vite/withDataViz/query/README.md +0 -80
- package/bin/templates/vite/withDataViz/query/public/favicon.ico +0 -0
- package/bin/templates/vite/withDataViz/query/src/styles/style.css +0 -4
- package/bin/templates/vite/withDataViz/query/tailwind.config.js +0 -7
- package/bin/templates/vite/withDataViz/query+router/README.md +0 -112
- package/bin/templates/vite/withDataViz/query+router/src/App.tsx +0 -42
- package/bin/templates/vite/withDataViz/query+router/src/styles/style.css +0 -4
- package/bin/templates/vite/withDataViz/router/.prettierrc +0 -10
- package/bin/templates/vite/withDataViz/router/README.md +0 -107
- package/bin/templates/vite/withDataViz/router/public/favicon.ico +0 -0
- package/bin/templates/vite/withDataViz/router/public/imgs/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withDataViz/router/src/App.tsx +0 -51
- package/bin/templates/vite/withDataViz/router/src/assets/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withDataViz/router/src/routes/about.tsx +0 -73
- package/bin/templates/vite/withDataViz/router/src/styles/style.css +0 -4
- package/bin/templates/vite/withDataViz/router/tailwind.config.js +0 -7
- package/bin/templates/vite/withoutDataViz/basic/.prettierrc +0 -10
- package/bin/templates/vite/withoutDataViz/basic/eslint.config.mjs +0 -97
- package/bin/templates/vite/withoutDataViz/basic/index.html +0 -13
- package/bin/templates/vite/withoutDataViz/basic/public/favicon.ico +0 -0
- package/bin/templates/vite/withoutDataViz/basic/public/imgs/Vitejs-logo.svg +0 -15
- package/bin/templates/vite/withoutDataViz/basic/public/imgs/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/basic/src/App.tsx +0 -38
- package/bin/templates/vite/withoutDataViz/basic/src/assets/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/basic/src/components/Footer.tsx +0 -14
- package/bin/templates/vite/withoutDataViz/basic/src/components/Header.tsx +0 -25
- package/bin/templates/vite/withoutDataViz/basic/src/main.tsx +0 -10
- package/bin/templates/vite/withoutDataViz/basic/src/styles/fonts.css +0 -213
- package/bin/templates/vite/withoutDataViz/basic/src/vite-env.d.ts +0 -1
- package/bin/templates/vite/withoutDataViz/basic/tailwind.config.js +0 -7
- package/bin/templates/vite/withoutDataViz/basic/tsconfig.json +0 -29
- package/bin/templates/vite/withoutDataViz/basic/tsconfig.node.json +0 -9
- package/bin/templates/vite/withoutDataViz/query/.prettierrc +0 -10
- package/bin/templates/vite/withoutDataViz/query/eslint.config.mjs +0 -97
- package/bin/templates/vite/withoutDataViz/query/index.html +0 -13
- package/bin/templates/vite/withoutDataViz/query/public/favicon.ico +0 -0
- package/bin/templates/vite/withoutDataViz/query/public/imgs/Tailwind_CSS_Logo.svg +0 -1
- package/bin/templates/vite/withoutDataViz/query/public/imgs/Vitejs-logo.svg +0 -15
- package/bin/templates/vite/withoutDataViz/query/public/imgs/logo-color-600.png +0 -0
- package/bin/templates/vite/withoutDataViz/query/public/imgs/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/query/src/assets/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/query/src/components/Footer.tsx +0 -14
- package/bin/templates/vite/withoutDataViz/query/src/components/Header.tsx +0 -25
- package/bin/templates/vite/withoutDataViz/query/src/integration/tanstack-query.tsx +0 -27
- package/bin/templates/vite/withoutDataViz/query/src/main.tsx +0 -21
- package/bin/templates/vite/withoutDataViz/query/src/styles/fonts.css +0 -213
- package/bin/templates/vite/withoutDataViz/query/src/vite-env.d.ts +0 -1
- package/bin/templates/vite/withoutDataViz/query/tailwind.config.js +0 -7
- package/bin/templates/vite/withoutDataViz/query/tsconfig.json +0 -29
- package/bin/templates/vite/withoutDataViz/query/tsconfig.node.json +0 -9
- package/bin/templates/vite/withoutDataViz/query/vite.config.ts +0 -75
- package/bin/templates/vite/withoutDataViz/query+router/.prettierrc +0 -10
- package/bin/templates/vite/withoutDataViz/query+router/eslint.config.mjs +0 -97
- package/bin/templates/vite/withoutDataViz/query+router/index.html +0 -13
- package/bin/templates/vite/withoutDataViz/query+router/public/favicon.ico +0 -0
- package/bin/templates/vite/withoutDataViz/query+router/public/imgs/Vitejs-logo.svg +0 -15
- package/bin/templates/vite/withoutDataViz/query+router/public/imgs/logo-color-600.png +0 -0
- package/bin/templates/vite/withoutDataViz/query+router/public/imgs/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/query+router/src/App.tsx +0 -42
- package/bin/templates/vite/withoutDataViz/query+router/src/assets/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/query+router/src/components/Footer.tsx +0 -14
- package/bin/templates/vite/withoutDataViz/query+router/src/components/Header.tsx +0 -25
- package/bin/templates/vite/withoutDataViz/query+router/src/integration/tanstack-query.tsx +0 -27
- package/bin/templates/vite/withoutDataViz/query+router/src/main.tsx +0 -73
- package/bin/templates/vite/withoutDataViz/query+router/src/routes/queryDemo.tsx +0 -73
- package/bin/templates/vite/withoutDataViz/query+router/src/styles/fonts.css +0 -213
- package/bin/templates/vite/withoutDataViz/query+router/src/vite-env.d.ts +0 -1
- package/bin/templates/vite/withoutDataViz/query+router/tailwind.config.js +0 -7
- package/bin/templates/vite/withoutDataViz/query+router/tsconfig.json +0 -29
- package/bin/templates/vite/withoutDataViz/query+router/tsconfig.node.json +0 -9
- package/bin/templates/vite/withoutDataViz/query+router/vite.config.ts +0 -75
- package/bin/templates/vite/withoutDataViz/router/.prettierrc +0 -10
- package/bin/templates/vite/withoutDataViz/router/eslint.config.mjs +0 -97
- package/bin/templates/vite/withoutDataViz/router/index.html +0 -13
- package/bin/templates/vite/withoutDataViz/router/public/favicon.ico +0 -0
- package/bin/templates/vite/withoutDataViz/router/public/imgs/Tailwind_CSS_Logo.svg +0 -1
- package/bin/templates/vite/withoutDataViz/router/public/imgs/Vitejs-logo.svg +0 -15
- package/bin/templates/vite/withoutDataViz/router/public/imgs/logo-color-600.png +0 -0
- package/bin/templates/vite/withoutDataViz/router/public/imgs/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/router/src/assets/undp-logo-blue.svg +0 -1
- package/bin/templates/vite/withoutDataViz/router/src/components/Footer.tsx +0 -14
- package/bin/templates/vite/withoutDataViz/router/src/components/Header.tsx +0 -25
- package/bin/templates/vite/withoutDataViz/router/src/main.tsx +0 -66
- package/bin/templates/vite/withoutDataViz/router/src/routes/about.tsx +0 -73
- package/bin/templates/vite/withoutDataViz/router/src/styles/fonts.css +0 -213
- package/bin/templates/vite/withoutDataViz/router/src/vite-env.d.ts +0 -1
- package/bin/templates/vite/withoutDataViz/router/tailwind.config.js +0 -7
- package/bin/templates/vite/withoutDataViz/router/tsconfig.json +0 -29
- package/bin/templates/vite/withoutDataViz/router/tsconfig.node.json +0 -9
- package/bin/templates/vite/withoutDataViz/router/vite.config.ts +0 -75
- /package/bin/templates/next/{withDataViz/auth → auth}/.prettierrc +0 -0
- /package/bin/templates/next/{withoutDataViz/auth → auth}/README.md +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/app/api/auth/[...all]/route.ts +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/app/favicon.ico +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/app/globals.css +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/components/Footer.tsx +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/components/Header.tsx +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/eslint.config.mjs +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/lib/auth-client.ts +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/lib/auth.ts +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/next.config.ts +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/postcss.config.mjs +0 -0
- /package/bin/templates/{vite/withDataViz/basic → next/auth}/public/imgs/Tailwind_CSS_Logo.svg +0 -0
- /package/bin/templates/next/{withDataViz/auth/public → auth/public/imgs}/next.svg +0 -0
- /package/bin/templates/next/{withDataViz/auth/public → auth/public/imgs}/undp-logo-blue.svg +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/tailwind.config.js +0 -0
- /package/bin/templates/next/{withDataViz/auth → auth}/tsconfig.json +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/.prettierrc +0 -0
- /package/bin/templates/next/{withoutDataViz/basic → basic}/README.md +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/app/favicon.ico +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/app/globals.css +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/components/Footer.tsx +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/components/Header.tsx +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/eslint.config.mjs +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/next.config.ts +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/postcss.config.mjs +0 -0
- /package/bin/templates/{vite/withDataViz/query+router → next/basic}/public/imgs/Tailwind_CSS_Logo.svg +0 -0
- /package/bin/templates/next/{withDataViz/basic/public → basic/public/imgs}/next.svg +0 -0
- /package/bin/templates/next/{withDataViz/basic/public → basic/public/imgs}/undp-logo-blue.svg +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/tailwind.config.js +0 -0
- /package/bin/templates/next/{withDataViz/basic → basic}/tsconfig.json +0 -0
- /package/bin/templates/{next/withoutDataViz/auth → vite/basic}/.prettierrc +0 -0
- /package/bin/templates/vite/{withoutDataViz/basic → basic}/README.md +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/eslint.config.mjs +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/index.html +0 -0
- /package/bin/templates/{next/withoutDataViz/auth/app → vite/basic/public}/favicon.ico +0 -0
- /package/bin/templates/vite/{withDataViz/query → basic}/public/imgs/Tailwind_CSS_Logo.svg +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/public/imgs/Vitejs-logo.svg +0 -0
- /package/bin/templates/{next/withoutDataViz/auth/public → vite/basic/public/imgs}/undp-logo-blue.svg +0 -0
- /package/bin/templates/{next/withoutDataViz/basic/public → vite/basic/src/assets}/undp-logo-blue.svg +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/src/components/Footer.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/src/components/Header.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/src/styles/fonts.css +0 -0
- /package/bin/templates/vite/{withoutDataViz/basic → basic}/src/styles/style.css +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/src/vite-env.d.ts +0 -0
- /package/bin/templates/{next/withoutDataViz/auth → vite/basic}/tailwind.config.js +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/tsconfig.json +0 -0
- /package/bin/templates/vite/{withDataViz/basic → basic}/tsconfig.node.json +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → basic}/vite.config.ts +0 -0
- /package/bin/templates/vite/{withDataViz/basic → query}/.prettierrc +0 -0
- /package/bin/templates/vite/{withoutDataViz/query → query}/README.md +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/eslint.config.mjs +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/index.html +0 -0
- /package/bin/templates/vite/{withDataViz/basic → query}/public/favicon.ico +0 -0
- /package/bin/templates/vite/{withoutDataViz/basic → query}/public/imgs/Tailwind_CSS_Logo.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query/public/imgs/logo-color-600.png → query/public/imgs/Tanstack-logo.png} +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/public/imgs/Vitejs-logo.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query}/public/imgs/undp-logo-blue.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query}/src/assets/undp-logo-blue.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/src/components/Footer.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/src/components/Header.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/src/main.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/src/styles/fonts.css +0 -0
- /package/bin/templates/vite/{withoutDataViz/query → query}/src/styles/style.css +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/src/vite-env.d.ts +0 -0
- /package/bin/templates/vite/{withDataViz/basic → query}/tailwind.config.js +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/tsconfig.json +0 -0
- /package/bin/templates/vite/{withDataViz/query → query}/tsconfig.node.json +0 -0
- /package/bin/templates/vite/{withDataViz/router → query}/vite.config.ts +0 -0
- /package/bin/templates/{next/withoutDataViz/basic → vite/query+router}/.prettierrc +0 -0
- /package/bin/templates/vite/{withoutDataViz/query+router → query+router}/README.md +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/eslint.config.mjs +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/index.html +0 -0
- /package/bin/templates/{next/withoutDataViz/basic/app → vite/query+router/public}/favicon.ico +0 -0
- /package/bin/templates/vite/{withDataViz/router → query+router}/public/imgs/Tailwind_CSS_Logo.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query+router/public/imgs/logo-color-600.png → query+router/public/imgs/Tanstack-logo.png} +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/public/imgs/Vitejs-logo.svg +0 -0
- /package/bin/templates/vite/{withDataViz/basic → query+router}/public/imgs/undp-logo-blue.svg +0 -0
- /package/bin/templates/vite/{withDataViz/basic → query+router}/src/assets/undp-logo-blue.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/src/components/Footer.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/src/components/Header.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/src/main.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/src/styles/fonts.css +0 -0
- /package/bin/templates/vite/{withoutDataViz/query+router → query+router}/src/styles/style.css +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/src/vite-env.d.ts +0 -0
- /package/bin/templates/{next/withoutDataViz/basic → vite/query+router}/tailwind.config.js +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/tsconfig.json +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → query+router}/tsconfig.node.json +0 -0
- /package/bin/templates/vite/{withDataViz/query → query+router}/vite.config.ts +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → router}/.prettierrc +0 -0
- /package/bin/templates/vite/{withoutDataViz/router → router}/README.md +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/eslint.config.mjs +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/index.html +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → router}/public/favicon.ico +0 -0
- /package/bin/templates/vite/{withoutDataViz/query+router → router}/public/imgs/Tailwind_CSS_Logo.svg +0 -0
- /package/bin/templates/vite/{withDataViz/router/public/imgs/logo-color-600.png → router/public/imgs/Tanstack-logo.png} +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/public/imgs/Vitejs-logo.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query → router}/public/imgs/undp-logo-blue.svg +0 -0
- /package/bin/templates/vite/{withDataViz/query → router}/src/assets/undp-logo-blue.svg +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/src/components/Footer.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/src/components/Header.tsx +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/src/styles/fonts.css +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/src/vite-env.d.ts +0 -0
- /package/bin/templates/vite/{withDataViz/query+router → router}/tailwind.config.js +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/tsconfig.json +0 -0
- /package/bin/templates/vite/{withDataViz/router → router}/tsconfig.node.json +0 -0
- /package/bin/templates/vite/{withoutDataViz/basic → router}/vite.config.ts +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 🏗️ UNDP Create App CLI 
|
|
2
2
|
|
|
3
|
-
**`@undp/create-app`** is UNDP’s official **project scaffolding tool** for quickly bootstrapping frontend applications using **React**, and **TypeScript** — complete with sensible defaults for ESLint, Prettier
|
|
3
|
+
**`@undp/create-app`** is UNDP’s official **project scaffolding tool** for quickly bootstrapping frontend applications using **React**, and **TypeScript** — complete with sensible defaults for ESLint, Prettier.
|
|
4
4
|
|
|
5
5
|
[NPM Package](https://www.npmjs.com/package/@undp/create-app)
|
|
6
6
|
|
|
@@ -8,29 +8,28 @@
|
|
|
8
8
|
|
|
9
9
|
## 🚀 Features
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
11
|
+
- ⚛️ **React + TypeScript** setup out of the box
|
|
12
|
+
- 🖌️ Includes **Tailwind CSS** for styling
|
|
13
|
+
- 🗂️ Includes **Zustand** for state management
|
|
14
|
+
- 🚀 **Vite support** for fast SPA development, including optional **routing** with **Tanstack router**
|
|
15
|
+
- 🌐 **Next.js support** for full-stack apps, including optional **authentication** with **Better Auth**
|
|
16
|
+
- 🎨 Preconfigured for **UNDP’s Design System**
|
|
17
|
+
- ⚡️ Optional integration with **Tanstack query** for data fetching
|
|
18
|
+
- 📊 Optional integration with **@undp/data-viz** for interactive data visualization
|
|
19
|
+
- ✨ **ESLint** + **Prettier** preconfigured for consistent code style
|
|
17
20
|
|
|
18
21
|
---
|
|
19
22
|
|
|
20
23
|
## 🧩 Pre-configured setups
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- Next.js + Tailwind
|
|
31
|
-
- Production-ready React framework with file-based routing and SSR
|
|
32
|
-
- Next.js + Tailwind + Auth
|
|
33
|
-
- Secure, full-stack framework with authentication and SSR
|
|
25
|
+
All setups include **Tailwind CSS** for styling and **Zustand** for state management.
|
|
26
|
+
|
|
27
|
+
| Framework | Variants | Description |
|
|
28
|
+
|------------|-----------|-------------|
|
|
29
|
+
| **Vite** | Basic | Minimal React + TypeScript setup |
|
|
30
|
+
| **Vite** | + Router | Adds TanStack Router for routing |
|
|
31
|
+
| **Next.js** | Basic | SSR and file-based routing |
|
|
32
|
+
| **Next.js** | + Auth | Includes authentication via Better Auth |
|
|
34
33
|
|
|
35
34
|
---
|
|
36
35
|
|
|
@@ -39,7 +38,7 @@
|
|
|
39
38
|
You don’t need to install it globally — just use **npx**:
|
|
40
39
|
|
|
41
40
|
```bash
|
|
42
|
-
npx @undp/create-app my-
|
|
41
|
+
npx @undp/create-app my-undp-app
|
|
43
42
|
```
|
|
44
43
|
|
|
45
44
|
---
|
|
@@ -49,7 +48,7 @@ npx @undp/create-app my-project
|
|
|
49
48
|
After running the CLI, navigate into your project and start the dev server:
|
|
50
49
|
|
|
51
50
|
```bash
|
|
52
|
-
cd my-
|
|
51
|
+
cd my-undp-app && npm run dev
|
|
53
52
|
```
|
|
54
53
|
|
|
55
54
|
*Please note: If you have not installed the dependencies then you might want to run `npm install` before `npm run dev`.*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function generateEnv() {
|
|
2
|
+
return `# Secret key used by Better Auth for signing tokens and securing sessions
|
|
3
|
+
BETTER_AUTH_SECRET=
|
|
4
|
+
|
|
5
|
+
# The base URL where your Better Auth instance is running (e.g., localhost for dev)
|
|
6
|
+
BETTER_AUTH_URL=http://localhost:3000
|
|
7
|
+
|
|
8
|
+
# --- GitHub OAuth credentials ---
|
|
9
|
+
# Client ID from your GitHub OAuth app (used for GitHub login)
|
|
10
|
+
GITHUB_CLIENT_ID=
|
|
11
|
+
# Client Secret from your GitHub OAuth app
|
|
12
|
+
GITHUB_CLIENT_SECRET=
|
|
13
|
+
|
|
14
|
+
# --- Azure AD OAuth credentials ---
|
|
15
|
+
# Client ID from your Azure AD App Registration
|
|
16
|
+
AZURE_CLIENT_ID=
|
|
17
|
+
# Client Secret generated for your Azure AD App
|
|
18
|
+
AZURE_CLIENT_SECRET=
|
|
19
|
+
# Tenant ID of your Azure AD directory (found in Azure portal)
|
|
20
|
+
AZURE_TENANT_ID=`
|
|
21
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export function generateLayoutForNext(dataViz, projectName, query) {
|
|
2
|
+
return `import type { Metadata } from 'next';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
import HeaderEl from '@/components/Header';
|
|
6
|
+
import FooterEl from '@/components/Footer';${query ? `
|
|
7
|
+
import TanStackQueryProvider from '@/integration/tanstack-query';`:''}
|
|
8
|
+
|
|
9
|
+
import './globals.css';
|
|
10
|
+
import '@undp/design-system-react/style.css';${dataViz ? `
|
|
11
|
+
import '@undp/data-viz/style.css';` : ''}
|
|
12
|
+
|
|
13
|
+
export const metadata: Metadata = {
|
|
14
|
+
title: '${projectName}',
|
|
15
|
+
description: 'Generated by create undp app',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default function RootLayout({
|
|
19
|
+
children,
|
|
20
|
+
}: Readonly<{
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}>) {
|
|
23
|
+
return (
|
|
24
|
+
<html lang='en'>
|
|
25
|
+
<body className='flex flex-col gap-0 min-h-screen'>
|
|
26
|
+
<HeaderEl />
|
|
27
|
+
<main className='grow-1 flex flex-col justify-center'>${query ? `
|
|
28
|
+
<TanStackQueryProvider>
|
|
29
|
+
<div className='flex flex-col justify-center'>{children}</div>
|
|
30
|
+
</TanStackQueryProvider>` : `
|
|
31
|
+
<div className='flex flex-col justify-center'>{children}</div>`}
|
|
32
|
+
</main>
|
|
33
|
+
<FooterEl />
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
`
|
|
39
|
+
}
|
|
40
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function generateNextEnvTypes() {
|
|
2
|
+
return `/// <reference types='next' />
|
|
3
|
+
/// <reference types='next/image-types/global' />
|
|
4
|
+
import './.next/dev/types/routes.d.ts';
|
|
5
|
+
|
|
6
|
+
// NOTE: This file should not be edited
|
|
7
|
+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
|
8
|
+
`
|
|
9
|
+
}
|
|
@@ -2,7 +2,6 @@ import { execSync } from 'child_process';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
|
|
4
4
|
function getLatestVersion(pkg) {
|
|
5
|
-
console.log(chalk.gray(` Fetching latest version for ${pkg}`));
|
|
6
5
|
try {
|
|
7
6
|
return execSync(`npm show ${pkg} version`).toString().trim();
|
|
8
7
|
} catch {
|
|
@@ -11,7 +10,9 @@ function getLatestVersion(pkg) {
|
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
export function generatePackageJson(config) {
|
|
13
|
+
console.log(chalk.gray(` Fetching latest version for packages...`));
|
|
14
14
|
const designSystemVer = `^${getLatestVersion('@undp/design-system-react')}`
|
|
15
|
+
const zustandVer = `^${getLatestVersion('zustand')}`
|
|
15
16
|
const dependencies = config.libraries.includes('peer') && config.libraries.includes('@undp/data-viz') ? {
|
|
16
17
|
"@undp/design-system-react": designSystemVer,
|
|
17
18
|
"react": "^19.2.0",
|
|
@@ -27,24 +28,19 @@ export function generatePackageJson(config) {
|
|
|
27
28
|
"math-expression-evaluator": "^2.0.7",
|
|
28
29
|
"pmtiles": "^4.3.0",
|
|
29
30
|
"react-globe.gl": "^2.37.0",
|
|
30
|
-
"three": "^0.180.0"
|
|
31
|
+
"three": "^0.180.0",
|
|
32
|
+
"zustand": zustandVer
|
|
31
33
|
} : {
|
|
32
34
|
"@undp/design-system-react": designSystemVer,
|
|
33
35
|
"react": "^19.2.0",
|
|
34
36
|
"react-dom": "^19.2.0",
|
|
37
|
+
"zustand": zustandVer
|
|
35
38
|
};
|
|
36
39
|
|
|
37
40
|
switch (config.framework) {
|
|
38
|
-
case 'vite-query':
|
|
39
|
-
dependencies['@tanstack/react-query'] = '^5.90.7';
|
|
40
|
-
break;
|
|
41
41
|
case 'vite-router':
|
|
42
42
|
dependencies['@tanstack/react-router'] = '^1.135.0';
|
|
43
43
|
break;
|
|
44
|
-
case 'vite-full':
|
|
45
|
-
dependencies['@tanstack/react-query'] = '^5.90.7';
|
|
46
|
-
dependencies['@tanstack/react-router'] = '^1.135.0';
|
|
47
|
-
break;
|
|
48
44
|
case 'next-basic':
|
|
49
45
|
dependencies['next'] = '16.0.1';
|
|
50
46
|
break;
|
|
@@ -55,6 +51,9 @@ export function generatePackageJson(config) {
|
|
|
55
51
|
default:
|
|
56
52
|
break;
|
|
57
53
|
}
|
|
54
|
+
if (config.query) {
|
|
55
|
+
dependencies['@tanstack/react-query'] = '^5.90.7';
|
|
56
|
+
}
|
|
58
57
|
if (config.libraries.includes('@undp/data-viz')) {
|
|
59
58
|
const dataVizVer = `^${getLatestVersion('@undp/data-viz')}`
|
|
60
59
|
dependencies['@undp/data-viz'] = dataVizVer;
|
|
@@ -63,7 +62,7 @@ export function generatePackageJson(config) {
|
|
|
63
62
|
const lucideReactVer = `^${getLatestVersion('lucide-react')}`
|
|
64
63
|
dependencies['lucide-react'] = lucideReactVer;
|
|
65
64
|
}
|
|
66
|
-
const devDependencies = config.framework
|
|
65
|
+
const devDependencies = config.framework.includes('vite') ? {
|
|
67
66
|
"@eslint/config-array": "^0.21.1",
|
|
68
67
|
"@eslint/js": "^9.39.1",
|
|
69
68
|
"@nabla/vite-plugin-eslint": "^2.0.6",
|
|
@@ -138,7 +137,7 @@ export function generatePackageJson(config) {
|
|
|
138
137
|
sideEffects: [
|
|
139
138
|
'*.css'
|
|
140
139
|
],
|
|
141
|
-
scripts: config.framework
|
|
140
|
+
scripts: config.framework.includes('next')
|
|
142
141
|
? {
|
|
143
142
|
dev: 'next dev',
|
|
144
143
|
build: 'next build',
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export function generatePageForNext(query) {
|
|
2
|
+
return `'use client';
|
|
3
|
+
|
|
4
|
+
import { P } from '@undp/design-system-react/Typography';
|
|
5
|
+
import { Button } from '@undp/design-system-react/Button';
|
|
6
|
+
import Image from 'next/image';${query ? `
|
|
7
|
+
import { useQuery } from '@tanstack/react-query';
|
|
8
|
+
import { Spinner } from '@undp/design-system-react/Spinner';` :''}
|
|
9
|
+
|
|
10
|
+
import { useCounterActions, useCounter } from '@/stores/counter';${query ? `
|
|
11
|
+
|
|
12
|
+
function useTodoData() {
|
|
13
|
+
return useQuery({
|
|
14
|
+
queryKey: ['todos'],
|
|
15
|
+
queryFn: () =>
|
|
16
|
+
Promise.resolve([
|
|
17
|
+
{ id: 1, name: 'Alice' },
|
|
18
|
+
{ id: 2, name: 'Bob' },
|
|
19
|
+
{ id: 3, name: 'Charlie' },
|
|
20
|
+
]),
|
|
21
|
+
});
|
|
22
|
+
}` :''}
|
|
23
|
+
|
|
24
|
+
export default function Home() {
|
|
25
|
+
const count = useCounter();
|
|
26
|
+
const { increment, decrement } = useCounterActions();${query ? `
|
|
27
|
+
|
|
28
|
+
const { data, isLoading, isError } = useTodoData();
|
|
29
|
+
|
|
30
|
+
if (isLoading) return <Spinner size='lg' className='my-20 m-auto' />;
|
|
31
|
+
|
|
32
|
+
if (isError) return <>Error</>;` : ''}
|
|
33
|
+
return (
|
|
34
|
+
<>
|
|
35
|
+
<div className='flex gap-4 items-center justify-center my-8 mx-auto'>
|
|
36
|
+
<Image
|
|
37
|
+
className='dark:invert'
|
|
38
|
+
src='/imgs/next.svg'
|
|
39
|
+
alt='Next.js logo'
|
|
40
|
+
width={100}
|
|
41
|
+
height={20}
|
|
42
|
+
priority
|
|
43
|
+
/>
|
|
44
|
+
<P marginBottom='none'>&</P>
|
|
45
|
+
<Image
|
|
46
|
+
className='dark:invert'
|
|
47
|
+
src='/imgs/Tailwind_CSS_Logo.svg'
|
|
48
|
+
alt='Tailwind logo'
|
|
49
|
+
width={40}
|
|
50
|
+
height={20}
|
|
51
|
+
priority
|
|
52
|
+
/>
|
|
53
|
+
<P marginBottom='none'>&</P>
|
|
54
|
+
<Image
|
|
55
|
+
className='dark:invert'
|
|
56
|
+
src='/imgs/Zustand-logo.svg'
|
|
57
|
+
alt='Zustand logo'
|
|
58
|
+
width={40}
|
|
59
|
+
height={20}
|
|
60
|
+
priority
|
|
61
|
+
/>
|
|
62
|
+
<P marginBottom='none'>&</P>
|
|
63
|
+
<Image
|
|
64
|
+
className='dark:invert'
|
|
65
|
+
src='/imgs/undp-logo-blue.svg'
|
|
66
|
+
alt='UNDP logo'
|
|
67
|
+
width={40}
|
|
68
|
+
height={20}
|
|
69
|
+
priority
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
<P marginBottom='xl' className='text-center'>
|
|
73
|
+
To get started, edit the App.tsx file.{' '}
|
|
74
|
+
<span className='font-bold'>Count: {count}</span>
|
|
75
|
+
</P>
|
|
76
|
+
<div className='flex gap-4 justify-center mb-8'>
|
|
77
|
+
<Button
|
|
78
|
+
variant='tertiary'
|
|
79
|
+
onClick={() => {
|
|
80
|
+
increment();
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
Increase counter
|
|
84
|
+
</Button>
|
|
85
|
+
<Button
|
|
86
|
+
variant='tertiary'
|
|
87
|
+
onClick={() => {
|
|
88
|
+
decrement();
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
Decrease counter
|
|
92
|
+
</Button>
|
|
93
|
+
</div>${query ? `
|
|
94
|
+
<P marginBottom='xl' className='text-center'>
|
|
95
|
+
Data loaded successfully. {data?.length} elements in the query.
|
|
96
|
+
</P>` : ''}
|
|
97
|
+
</>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
`
|
|
101
|
+
}
|
|
102
|
+
|
|
@@ -2,3 +2,8 @@ export { generatePackageJson } from './generatePackageJson.js';
|
|
|
2
2
|
export { generateViteConfig } from './generateViteConfig.js';
|
|
3
3
|
export { generateIndexHtml } from './generateIndexHtml.js';
|
|
4
4
|
export { generateStaticWebAppConfig } from './generateStaticWebAppConfig.js';
|
|
5
|
+
export { generateLayoutForNext } from './generateLayoutForNext.js';
|
|
6
|
+
export { generateStylesCss } from './generateStylesCss.js';
|
|
7
|
+
export { generateNextEnvTypes } from './generateNextEnvTypes.js';
|
|
8
|
+
export { generateEnv } from './generateEnv.js';
|
|
9
|
+
export { generatePageForNext } from './generatePageForNext.js';
|
package/bin/index.js
CHANGED
|
@@ -13,6 +13,11 @@ import {
|
|
|
13
13
|
generateViteConfig,
|
|
14
14
|
generateIndexHtml,
|
|
15
15
|
generateStaticWebAppConfig,
|
|
16
|
+
generateStylesCss,
|
|
17
|
+
generateLayoutForNext,
|
|
18
|
+
generateNextEnvTypes,
|
|
19
|
+
generateEnv,
|
|
20
|
+
generatePageForNext,
|
|
16
21
|
} from './generateFiles/index.js';
|
|
17
22
|
|
|
18
23
|
function copyFolder(source, destination) {
|
|
@@ -37,19 +42,21 @@ async function main() {
|
|
|
37
42
|
|
|
38
43
|
const baseFolder = config.framework.includes('vite') ? 'vite' : 'next';
|
|
39
44
|
|
|
40
|
-
const secondaryFolder = config.libraries.includes('@undp/data-viz') ? 'withDataViz' : 'withoutDataViz';
|
|
41
45
|
|
|
42
46
|
let tertiaryFolder = 'basic';
|
|
43
47
|
|
|
44
48
|
switch (config.framework) {
|
|
45
|
-
case 'vite-
|
|
46
|
-
|
|
49
|
+
case 'vite-basic':
|
|
50
|
+
if (config.query)
|
|
51
|
+
tertiaryFolder = 'query';
|
|
52
|
+
else
|
|
53
|
+
tertiaryFolder = 'basic';
|
|
47
54
|
break;
|
|
48
55
|
case 'vite-router':
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
if (config.query)
|
|
57
|
+
tertiaryFolder = 'query+router';
|
|
58
|
+
else
|
|
59
|
+
tertiaryFolder = 'router';
|
|
53
60
|
break;
|
|
54
61
|
case 'next-auth':
|
|
55
62
|
tertiaryFolder = 'auth';
|
|
@@ -58,18 +65,27 @@ async function main() {
|
|
|
58
65
|
break;
|
|
59
66
|
}
|
|
60
67
|
|
|
61
|
-
|
|
68
|
+
|
|
62
69
|
|
|
63
70
|
if (config.framework.includes('vite')) {
|
|
71
|
+
copyFolder(path.join(__dirname, `./templates/${baseFolder}/${tertiaryFolder}`), projectPath);
|
|
64
72
|
fs.writeFileSync('vite.config.ts', generateViteConfig(config));
|
|
65
73
|
fs.writeFileSync('index.html', generateIndexHtml(config));
|
|
74
|
+
fs.writeFileSync('src/styles/style.css', generateStylesCss(config.libraries.includes('@undp/data-viz')));
|
|
66
75
|
if (config.addStaticWebAppConfig) {
|
|
67
76
|
fs.writeFileSync('staticwebapp.config.json', generateStaticWebAppConfig());
|
|
68
77
|
}
|
|
78
|
+
} else {
|
|
79
|
+
copyFolder(path.join(__dirname, `./templates/${baseFolder}/${tertiaryFolder}`), projectPath);
|
|
80
|
+
fs.writeFileSync('app/layout.tsx', generateLayoutForNext(config.libraries.includes('@undp/data-viz'), config.projectName, config.query));
|
|
81
|
+
fs.writeFileSync('next-env.d.ts', generateNextEnvTypes());
|
|
82
|
+
fs.writeFileSync('app/page.tsx', generatePageForNext(config.query));
|
|
83
|
+
if (config.framework === 'next-auth') fs.writeFileSync('.env.local', generateEnv());
|
|
84
|
+
if (config.query) copyFolder(path.join(__dirname, './templates/queryIntegrationForNext'), projectPath);
|
|
69
85
|
}
|
|
70
86
|
fs.writeFileSync('package.json', JSON.stringify(generatePackageJson(config), null, 2));
|
|
71
87
|
|
|
72
|
-
console.log(chalk.green(' ✓ Project folder and files generated'));
|
|
88
|
+
console.log(chalk.green(' ✓ Project folder and files generated\n'));
|
|
73
89
|
|
|
74
90
|
const { installNow } = await inquirer.prompt([
|
|
75
91
|
{
|
package/bin/promptUser.js
CHANGED
|
@@ -22,37 +22,32 @@ export async function promptUser(name) {
|
|
|
22
22
|
{
|
|
23
23
|
type: 'list',
|
|
24
24
|
name: 'framework',
|
|
25
|
-
|
|
25
|
+
loop: false,
|
|
26
|
+
message: chalk.yellow('📦 Choose your setup (all include Tailwind for styling & Zustand for state management):\n'),
|
|
26
27
|
choices: [
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
name: 'Vite + Tailwind + Query — Optimized starter with data fetching powered by TanStack Query (ideal if you are planning to embed the SPA in another page)',
|
|
33
|
-
value: 'vite-query'
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: 'Vite + Tailwind + Router — Fast starter with built-in routing support',
|
|
37
|
-
value: 'vite-router'
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'Vite + Tailwind + Router + Query — Complete Vite setup for routing and data management',
|
|
41
|
-
value: 'vite-full'
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: 'Next.js + Tailwind — Production-ready React framework with file-based routing and SSR',
|
|
45
|
-
value: 'next-basic'
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: 'Next.js + Tailwind + Auth — Secure, full-stack framework with authentication and SSR',
|
|
49
|
-
value: 'next-auth'
|
|
50
|
-
},
|
|
28
|
+
{ name: 'Vite — Basic React setup (ideal for embedding)', value: 'vite-basic' },
|
|
29
|
+
{ name: 'Vite + Router — With routing support', value: 'vite-router' },
|
|
30
|
+
{ name: 'Next.js — SSR and file routing', value: 'next-basic' },
|
|
31
|
+
{ name: 'Next.js + Auth — With authentication', value: 'next-auth' },
|
|
51
32
|
],
|
|
52
33
|
default: 'vite-basic',
|
|
53
34
|
},
|
|
35
|
+
]);
|
|
36
|
+
|
|
37
|
+
const { addQuery } = await inquirer.prompt([
|
|
38
|
+
{
|
|
39
|
+
type: 'list',
|
|
40
|
+
name: 'addQuery',
|
|
41
|
+
message: chalk.yellow(
|
|
42
|
+
'⚙️ Add @tanstack/query for data fetching?'
|
|
43
|
+
),
|
|
44
|
+
choices: ['Yes', 'No'],
|
|
45
|
+
default: 'No',
|
|
46
|
+
},
|
|
54
47
|
]);
|
|
55
48
|
|
|
49
|
+
const query = addQuery === 'Yes';
|
|
50
|
+
|
|
56
51
|
const libraryChoices = [
|
|
57
52
|
{
|
|
58
53
|
name: '@undp/data-viz — UNDP data visualization components',
|
|
@@ -114,6 +109,7 @@ export async function promptUser(name) {
|
|
|
114
109
|
libraries,
|
|
115
110
|
addStaticWebAppConfig,
|
|
116
111
|
addPostCSSScripts,
|
|
117
|
-
framework,
|
|
112
|
+
framework,
|
|
113
|
+
query,
|
|
118
114
|
};
|
|
119
115
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { P } from '@undp/design-system-react/Typography';
|
|
4
|
+
import Image from 'next/image';
|
|
5
|
+
|
|
6
|
+
export default function About() {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<div className='flex gap-4 items-center justify-center my-8 mx-auto'>
|
|
10
|
+
<Image
|
|
11
|
+
className='dark:invert'
|
|
12
|
+
src='/imgs/next.svg'
|
|
13
|
+
alt='Next.js logo'
|
|
14
|
+
width={100}
|
|
15
|
+
height={20}
|
|
16
|
+
priority
|
|
17
|
+
/>
|
|
18
|
+
<P marginBottom='none'>&</P>
|
|
19
|
+
<Image
|
|
20
|
+
className='dark:invert'
|
|
21
|
+
src='/imgs/Tailwind_CSS_Logo.svg'
|
|
22
|
+
alt='Tailwind logo'
|
|
23
|
+
width={40}
|
|
24
|
+
height={20}
|
|
25
|
+
priority
|
|
26
|
+
/>
|
|
27
|
+
<P marginBottom='none'>&</P>
|
|
28
|
+
<Image
|
|
29
|
+
className='dark:invert'
|
|
30
|
+
src='/imgs/Zustand-logo.svg'
|
|
31
|
+
alt='Zustand logo'
|
|
32
|
+
width={40}
|
|
33
|
+
height={20}
|
|
34
|
+
priority
|
|
35
|
+
/>
|
|
36
|
+
<P marginBottom='none'>&</P>
|
|
37
|
+
<Image
|
|
38
|
+
className='dark:invert'
|
|
39
|
+
src='/imgs/undp-logo-blue.svg'
|
|
40
|
+
alt='UNDP logo'
|
|
41
|
+
width={40}
|
|
42
|
+
height={20}
|
|
43
|
+
priority
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
<P marginBottom='xl' className='text-center'>
|
|
47
|
+
To edit this page, edit the page.tsx file in the about folder.
|
|
48
|
+
</P>
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Metadata } from 'next';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
|
|
3
4
|
import HeaderEl from '@/components/Header';
|
|
4
5
|
import FooterEl from '@/components/Footer';
|
|
@@ -14,7 +15,7 @@ export const metadata: Metadata = {
|
|
|
14
15
|
export default function RootLayout({
|
|
15
16
|
children,
|
|
16
17
|
}: Readonly<{
|
|
17
|
-
children:
|
|
18
|
+
children: ReactNode;
|
|
18
19
|
}>) {
|
|
19
20
|
return (
|
|
20
21
|
<html lang='en'>
|
|
@@ -19,7 +19,7 @@ export default function LoginPage() {
|
|
|
19
19
|
<div className='flex gap-4 items-center justify-center my-8 mx-auto'>
|
|
20
20
|
<Image
|
|
21
21
|
className='dark:invert'
|
|
22
|
-
src='/next.svg'
|
|
22
|
+
src='/imgs/next.svg'
|
|
23
23
|
alt='Next.js logo'
|
|
24
24
|
width={100}
|
|
25
25
|
height={20}
|
|
@@ -28,7 +28,25 @@ export default function LoginPage() {
|
|
|
28
28
|
<P marginBottom='none'>&</P>
|
|
29
29
|
<Image
|
|
30
30
|
className='dark:invert'
|
|
31
|
-
src='/
|
|
31
|
+
src='/imgs/Tailwind_CSS_Logo.svg'
|
|
32
|
+
alt='Tailwind logo'
|
|
33
|
+
width={40}
|
|
34
|
+
height={20}
|
|
35
|
+
priority
|
|
36
|
+
/>
|
|
37
|
+
<P marginBottom='none'>&</P>
|
|
38
|
+
<Image
|
|
39
|
+
className='dark:invert'
|
|
40
|
+
src='/imgs/Zustand-logo.svg'
|
|
41
|
+
alt='Zustand logo'
|
|
42
|
+
width={40}
|
|
43
|
+
height={20}
|
|
44
|
+
priority
|
|
45
|
+
/>
|
|
46
|
+
<P marginBottom='none'>&</P>
|
|
47
|
+
<Image
|
|
48
|
+
className='dark:invert'
|
|
49
|
+
src='/imgs/undp-logo-blue.svg'
|
|
32
50
|
alt='UNDP logo'
|
|
33
51
|
width={40}
|
|
34
52
|
height={20}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { P } from '@undp/design-system-react/Typography';
|
|
4
|
+
import { Button } from '@undp/design-system-react/Button';
|
|
5
|
+
import Image from 'next/image';
|
|
6
|
+
|
|
7
|
+
import { useCounterActions, useCounter } from '@/stores/counter';
|
|
8
|
+
|
|
9
|
+
export default function Home() {
|
|
10
|
+
const count = useCounter();
|
|
11
|
+
const { increment, decrement } = useCounterActions();
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<div className='flex gap-4 items-center justify-center my-8 mx-auto'>
|
|
15
|
+
<Image
|
|
16
|
+
className='dark:invert'
|
|
17
|
+
src='/imgs/next.svg'
|
|
18
|
+
alt='Next.js logo'
|
|
19
|
+
width={100}
|
|
20
|
+
height={20}
|
|
21
|
+
priority
|
|
22
|
+
/>
|
|
23
|
+
<P marginBottom='none'>&</P>
|
|
24
|
+
<Image
|
|
25
|
+
className='dark:invert'
|
|
26
|
+
src='/imgs/Tailwind_CSS_Logo.svg'
|
|
27
|
+
alt='Tailwind logo'
|
|
28
|
+
width={40}
|
|
29
|
+
height={20}
|
|
30
|
+
priority
|
|
31
|
+
/>
|
|
32
|
+
<P marginBottom='none'>&</P>
|
|
33
|
+
<Image
|
|
34
|
+
className='dark:invert'
|
|
35
|
+
src='/imgs/Zustand-logo.svg'
|
|
36
|
+
alt='Zustand logo'
|
|
37
|
+
width={40}
|
|
38
|
+
height={20}
|
|
39
|
+
priority
|
|
40
|
+
/>
|
|
41
|
+
<P marginBottom='none'>&</P>
|
|
42
|
+
<Image
|
|
43
|
+
className='dark:invert'
|
|
44
|
+
src='/imgs/undp-logo-blue.svg'
|
|
45
|
+
alt='UNDP logo'
|
|
46
|
+
width={40}
|
|
47
|
+
height={20}
|
|
48
|
+
priority
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
51
|
+
<P marginBottom='xl' className='text-center'>
|
|
52
|
+
To get started, edit the App.tsx file.{' '}
|
|
53
|
+
<span className='font-bold'>Count: {count}</span>
|
|
54
|
+
</P>
|
|
55
|
+
<div className='flex gap-4 justify-center'>
|
|
56
|
+
<Button
|
|
57
|
+
variant='tertiary'
|
|
58
|
+
onClick={() => {
|
|
59
|
+
increment();
|
|
60
|
+
}}
|
|
61
|
+
>
|
|
62
|
+
Increase counter
|
|
63
|
+
</Button>
|
|
64
|
+
<Button
|
|
65
|
+
variant='tertiary'
|
|
66
|
+
onClick={() => {
|
|
67
|
+
decrement();
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
Decrease counter
|
|
71
|
+
</Button>
|
|
72
|
+
</div>
|
|
73
|
+
</>
|
|
74
|
+
);
|
|
75
|
+
}
|