create-quasar 2.2.2 → 4.0.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.
- package/{templates/ui-kit/quasar-v2/BASE/LICENSE → LICENSE} +1 -1
- package/bin/create-quasar.js +368 -0
- package/lib/cli-pkg.js +3 -0
- package/lib/create-project-folder.js +163 -0
- package/lib/ensure-outside-project.js +25 -0
- package/lib/running-pm.js +2 -0
- package/{utils → lib}/template.js +76 -43
- package/lib/utils.js +418 -0
- package/package.json +12 -17
- package/templates/ae/create-quasar-script.js +91 -0
- package/templates/ae/js/BASE/README.md +43 -0
- package/templates/ae/js/BASE/_.gitignore +24 -0
- package/templates/{app/quasar-v2/js-webpack-4 → ae/js}/BASE/_.vscode/extensions.json +3 -2
- package/templates/ae/js/BASE/_.vscode/settings.json +17 -0
- package/templates/ae/js/BASE/_package.json +30 -0
- package/templates/ae/js/BASE/_pnpm-workspace.yaml +23 -0
- package/templates/{app-extension/ae-js/BASE → ae/js/BASE/ae}/README.md +15 -14
- package/templates/ae/js/BASE/ae/_package.json +38 -0
- package/templates/ae/js/BASE/ae/src/index.js +15 -0
- package/templates/ae/js/BASE/ae/src/runtime/MyComponent.vue +16 -0
- package/templates/ae/js/BASE/ae/src/runtime/boot.register.js +6 -0
- package/templates/ae/js/BASE/playground/_package.json +29 -0
- package/templates/ae/js/BASE/playground/index.html +20 -0
- package/templates/ae/js/BASE/playground/quasar.config.js +25 -0
- package/templates/ae/js/BASE/playground/quasar.extensions.json +3 -0
- package/templates/ae/js/BASE/playground/src/components/DrawerLink.vue +14 -0
- package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-webpack → ae/js/BASE/playground}/src/css/quasar.variables.scss +1 -1
- package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-vite/src/pages/ErrorNotFound.vue → ae/js/BASE/playground/src/pages/[...path].vue} +2 -2
- package/templates/ae/js/BASE/playground/src/pages/index/(index).vue +11 -0
- package/templates/ae/js/BASE/playground/src/pages/index/test1.vue +9 -0
- package/templates/ae/js/BASE/playground/src/pages/index/test2.vue +7 -0
- package/templates/ae/js/BASE/playground/src/pages/index.vue +51 -0
- package/templates/ae/js/BASE/playground/src/router/index.js +42 -0
- package/templates/ae/js/install/ae/src/install.js +9 -0
- package/templates/ae/js/oxlint/_.oxfmtrc.json +25 -0
- package/templates/ae/js/oxlint/_.oxlintrc.json +34 -0
- package/templates/ae/js/prompts/ae/src/prompts.js +38 -0
- package/templates/ae/js/uninstall/ae/src/uninstall.js +9 -0
- package/templates/ae/ts/BASE/README.md +43 -0
- package/templates/ae/ts/BASE/_.gitignore +24 -0
- package/templates/{app/quasar-v2/js-vite-2 → ae/ts}/BASE/_.vscode/extensions.json +3 -2
- package/templates/ae/ts/BASE/_.vscode/settings.json +18 -0
- package/templates/ae/ts/BASE/_package.json +34 -0
- package/templates/ae/ts/BASE/_pnpm-workspace.yaml +23 -0
- package/templates/ae/ts/BASE/ae/README.md +37 -0
- package/templates/ae/ts/BASE/ae/_package.json +38 -0
- package/templates/ae/ts/BASE/ae/_tsconfig.json +23 -0
- package/templates/ae/ts/BASE/ae/src/index.ts +15 -0
- package/templates/ae/ts/BASE/ae/src/runtime/MyComponent.vue +16 -0
- package/templates/ae/ts/BASE/ae/src/runtime/_env.d.ts +15 -0
- package/templates/ae/ts/BASE/ae/src/runtime/_shims-vue.d.ts +5 -0
- package/templates/ae/ts/BASE/ae/src/runtime/boot.register.ts +6 -0
- package/templates/ae/ts/BASE/playground/_package.json +29 -0
- package/templates/ae/ts/BASE/playground/env.d.ts +15 -0
- package/templates/ae/ts/BASE/playground/index.html +20 -0
- package/templates/ae/ts/BASE/playground/quasar.config.ts +25 -0
- package/templates/ae/ts/BASE/playground/quasar.extensions.json +3 -0
- package/templates/ae/ts/BASE/playground/src/components/DrawerLink.vue +19 -0
- package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-vite → ae/ts/BASE/playground}/src/css/quasar.variables.scss +1 -1
- package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-webpack/src/pages/ErrorNotFound.vue → ae/ts/BASE/playground/src/pages/[...path].vue} +2 -2
- package/templates/ae/ts/BASE/playground/src/pages/index/(index).vue +11 -0
- package/templates/ae/ts/BASE/playground/src/pages/index/test1.vue +9 -0
- package/templates/ae/ts/BASE/playground/src/pages/index/test2.vue +7 -0
- package/templates/ae/ts/BASE/playground/src/pages/index.vue +51 -0
- package/templates/ae/ts/BASE/playground/src/router/_typed-router.d.ts +131 -0
- package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-webpack → ae/ts/BASE/playground}/src/router/index.ts +13 -8
- package/templates/ae/ts/install/ae/src/install.ts +9 -0
- package/templates/ae/ts/oxlint/_oxfmt.config.ts +28 -0
- package/templates/ae/ts/oxlint/_oxlint.config.ts +39 -0
- package/templates/ae/ts/prompts/ae/src/prompts.ts +38 -0
- package/templates/ae/ts/uninstall/ae/src/uninstall.ts +9 -0
- package/templates/app/create-quasar-script.js +46 -2
- package/templates/app/vite-2/create-quasar-script.js +59 -0
- package/templates/app/vite-2/js/BASE/README.md +37 -0
- package/templates/app/{quasar-v2/ts-webpack-4 → vite-2/js}/BASE/_.gitignore +3 -10
- package/templates/app/{quasar-v2/ts-vite-2 → vite-2/js}/BASE/_.vscode/extensions.json +4 -2
- package/templates/app/vite-2/js/BASE/_.vscode/settings.json +12 -0
- package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/BASE/_package.json +22 -15
- package/templates/app/vite-2/js/BASE/_pnpm-workspace.yaml +11 -0
- package/templates/app/{quasar-v2/ts-vite-2 → vite-2/js}/BASE/index.html +4 -4
- package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/BASE/quasar.config.js +20 -22
- package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/BASE/src/components/EssentialLink.vue +1 -1
- package/templates/app/{quasar-v2/js-webpack-4 → vite-2/js}/BASE/src/layouts/MainLayout.vue +7 -7
- package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/BASE/src/router/index.js +1 -1
- package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/eslint/_eslint.config.js +3 -3
- package/templates/app/vite-2/ts/BASE/README.md +37 -0
- package/templates/app/{quasar-v2/js-vite-2 → vite-2/ts}/BASE/_.gitignore +3 -10
- package/templates/app/{quasar-v2/ts-webpack-4 → vite-2/ts}/BASE/_.vscode/extensions.json +4 -2
- package/templates/{app-extension/ae-ts → app/vite-2/ts}/BASE/_.vscode/settings.json +8 -7
- package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/BASE/_package.json +22 -15
- package/templates/app/vite-2/ts/BASE/_pnpm-workspace.yaml +11 -0
- package/templates/app/{quasar-v2/ts-webpack-4 → vite-2/ts}/BASE/index.html +4 -4
- package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/BASE/quasar.config.ts +20 -22
- package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/BASE/src/components/EssentialLink.vue +2 -2
- package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/BASE/src/layouts/MainLayout.vue +8 -8
- package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/BASE/src/router/index.ts +1 -1
- package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/eslint/_eslint.config.js +3 -3
- package/templates/app/vite-3/create-quasar-script.js +94 -0
- package/templates/app/vite-3/js/BASE/README.md +39 -0
- package/templates/app/vite-3/js/BASE/_.editorconfig +7 -0
- package/templates/app/{quasar-v2/js-webpack-4 → vite-3/js}/BASE/_.gitignore +3 -10
- package/templates/app/vite-3/js/BASE/_.vscode/extensions.json +19 -0
- package/templates/app/vite-3/js/BASE/_.vscode/settings.json +24 -0
- package/templates/app/vite-3/js/BASE/_jsconfig.json +3 -0
- package/templates/app/vite-3/js/BASE/_package.json +62 -0
- package/templates/app/vite-3/js/BASE/_pnpm-workspace.yaml +10 -0
- package/templates/app/{quasar-v2/js-webpack-4 → vite-3/js}/BASE/index.html +10 -4
- package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-vite/postcss.config.cjs → app/vite-3/js/BASE/postcss.config.js} +9 -6
- package/templates/app/{quasar-v2/js-webpack-4 → vite-3/js}/BASE/quasar.config.js +83 -73
- package/templates/app/{quasar-v2/js-webpack-4 → vite-3/js}/BASE/src/components/EssentialLink.vue +1 -1
- package/templates/app/{quasar-v2/js-webpack-4 → vite-3/js}/eslint/_eslint.config.js +8 -5
- package/templates/app/vite-3/js/filenameBasedRouting/src/pages/[...path].vue +21 -0
- package/templates/app/vite-3/js/filenameBasedRouting/src/pages/index/(index).vue +23 -0
- package/templates/app/vite-3/js/filenameBasedRouting/src/pages/index/second.vue +9 -0
- package/templates/app/vite-3/js/filenameBasedRouting/src/pages/index.vue +92 -0
- package/templates/app/vite-3/js/filenameBasedRouting/src/router/index.js +40 -0
- package/templates/app/{quasar-v2/js-webpack-4 → vite-3/js}/i18n/src/boot/i18n.js +2 -2
- package/templates/app/{quasar-v2/js-webpack-4 → vite-3/js}/i18n/src/i18n/index.js +1 -1
- package/templates/app/{quasar-v2/js-vite-2/BASE → vite-3/js/manualRouting}/src/layouts/MainLayout.vue +8 -8
- package/templates/app/vite-3/js/manualRouting/src/pages/IndexPage.vue +23 -0
- package/templates/app/vite-3/js/manualRouting/src/pages/SecondPage.vue +9 -0
- package/templates/app/{quasar-v2/ts-webpack-4/BASE/src/router/index.ts → vite-3/js/manualRouting/src/router/index.js} +11 -10
- package/templates/app/vite-3/js/manualRouting/src/router/routes.js +19 -0
- package/templates/app/vite-3/js/oxlint/_.oxfmtrc.json +24 -0
- package/templates/app/vite-3/js/oxlint/_.oxlintrc.json +33 -0
- package/templates/app/vite-3/js/pinia/src/stores/example-store.js +21 -0
- package/templates/app/{quasar-v2/js-webpack-4 → vite-3/js}/pinia/src/stores/index.js +1 -1
- package/templates/app/vite-3/js/sass/src/css/app.scss +1 -0
- package/templates/app/vite-3/ts/BASE/README.md +39 -0
- package/templates/app/vite-3/ts/BASE/_.editorconfig +7 -0
- package/templates/app/{quasar-v2/ts-vite-2 → vite-3/ts}/BASE/_.gitignore +3 -10
- package/templates/app/vite-3/ts/BASE/_.vscode/extensions.json +19 -0
- package/templates/app/vite-3/ts/BASE/_.vscode/settings.json +25 -0
- package/templates/app/vite-3/ts/BASE/_package.json +67 -0
- package/templates/app/vite-3/ts/BASE/_pnpm-workspace.yaml +10 -0
- package/templates/app/vite-3/ts/BASE/_tsconfig.json +3 -0
- package/templates/app/vite-3/ts/BASE/env.d.ts +15 -0
- package/templates/app/{quasar-v2/js-vite-2 → vite-3/ts}/BASE/index.html +10 -4
- package/templates/app/vite-3/ts/BASE/postcss.config.js +29 -0
- package/templates/app/{quasar-v2/ts-webpack-4 → vite-3/ts}/BASE/quasar.config.ts +87 -80
- package/templates/app/{quasar-v2/ts-webpack-4 → vite-3/ts}/BASE/src/components/EssentialLink.vue +2 -2
- package/templates/app/{quasar-v2/ts-webpack-4 → vite-3/ts}/eslint/_eslint.config.js +9 -7
- package/templates/app/vite-3/ts/filenameBasedRouting/src/pages/[...path].vue +21 -0
- package/templates/app/vite-3/ts/filenameBasedRouting/src/pages/index/(index).vue +23 -0
- package/templates/app/vite-3/ts/filenameBasedRouting/src/pages/index/second.vue +9 -0
- package/templates/app/vite-3/ts/filenameBasedRouting/src/pages/index.vue +94 -0
- package/templates/app/vite-3/ts/filenameBasedRouting/src/router/_typed-router.d.ts +116 -0
- package/templates/app/vite-3/ts/filenameBasedRouting/src/router/index.ts +40 -0
- package/templates/app/{quasar-v2/ts-webpack-4 → vite-3/ts}/i18n/src/boot/i18n.ts +3 -3
- package/templates/app/{quasar-v2/ts-webpack-4/BASE → vite-3/ts/manualRouting}/src/layouts/MainLayout.vue +9 -9
- package/templates/app/vite-3/ts/manualRouting/src/pages/IndexPage.vue +23 -0
- package/templates/app/vite-3/ts/manualRouting/src/pages/SecondPage.vue +9 -0
- package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-vite → app/vite-3/ts/manualRouting}/src/router/index.ts +4 -6
- package/templates/app/vite-3/ts/manualRouting/src/router/routes.ts +21 -0
- package/templates/app/vite-3/ts/oxlint/_oxfmt.config.ts +27 -0
- package/templates/app/vite-3/ts/oxlint/_oxlint.config.ts +38 -0
- package/templates/app/{quasar-v2/ts-webpack-4 → vite-3/ts}/pinia/src/stores/example-store.ts +7 -1
- package/templates/app/{quasar-v2/ts-webpack-4 → vite-3/ts}/pinia/src/stores/index.ts +1 -1
- package/templates/app/vite-3/ts/sass/src/css/app.scss +1 -0
- package/assets/logo.art +0 -10
- package/index.js +0 -192
- package/scripts/create-test-project.ts +0 -64
- package/scripts/tsconfig.json +0 -18
- package/templates/__eslint.config.base.js +0 -148
- package/templates/app/__eslint.config.js +0 -64
- package/templates/app/quasar-v2/create-quasar-script.js +0 -39
- package/templates/app/quasar-v2/js-vite-2/BASE/README.md +0 -40
- package/templates/app/quasar-v2/js-vite-2/BASE/_.vscode/settings.json +0 -10
- package/templates/app/quasar-v2/js-vite-2/BASE/_pnpm-workspace.yaml +0 -6
- package/templates/app/quasar-v2/js-vite-2/__.eslintrc.cjs +0 -24
- package/templates/app/quasar-v2/js-vite-2/create-quasar-script.js +0 -53
- package/templates/app/quasar-v2/js-webpack-4/BASE/README.md +0 -40
- package/templates/app/quasar-v2/js-webpack-4/BASE/_.vscode/settings.json +0 -10
- package/templates/app/quasar-v2/js-webpack-4/BASE/_package.json +0 -59
- package/templates/app/quasar-v2/js-webpack-4/BASE/_pnpm-workspace.yaml +0 -6
- package/templates/app/quasar-v2/js-webpack-4/BASE/babel.config.js +0 -12
- package/templates/app/quasar-v2/js-webpack-4/BASE/postcss.config.js +0 -9
- package/templates/app/quasar-v2/js-webpack-4/BASE/src/pages/IndexPage.vue +0 -9
- package/templates/app/quasar-v2/js-webpack-4/BASE/src/router/index.js +0 -30
- package/templates/app/quasar-v2/js-webpack-4/BASE/src/router/routes.js +0 -18
- package/templates/app/quasar-v2/js-webpack-4/__.eslintrc.cjs +0 -24
- package/templates/app/quasar-v2/js-webpack-4/create-quasar-script.js +0 -53
- package/templates/app/quasar-v2/js-webpack-4/pinia/src/stores/example-store.js +0 -15
- package/templates/app/quasar-v2/js-webpack-4/pinia/src/stores/store-flag.d.ts +0 -13
- package/templates/app/quasar-v2/ts-vite-2/BASE/README.md +0 -40
- package/templates/app/quasar-v2/ts-vite-2/BASE/_.vscode/settings.json +0 -11
- package/templates/app/quasar-v2/ts-vite-2/BASE/_pnpm-workspace.yaml +0 -6
- package/templates/app/quasar-v2/ts-vite-2/BASE/public/icons/favicon-128x128.png +0 -0
- package/templates/app/quasar-v2/ts-vite-2/BASE/public/icons/favicon-16x16.png +0 -0
- package/templates/app/quasar-v2/ts-vite-2/BASE/public/icons/favicon-32x32.png +0 -0
- package/templates/app/quasar-v2/ts-vite-2/BASE/public/icons/favicon-96x96.png +0 -0
- package/templates/app/quasar-v2/ts-vite-2/BASE/src/assets/quasar-logo-vertical.svg +0 -15
- package/templates/app/quasar-v2/ts-vite-2/BASE/src/env.d.ts +0 -7
- package/templates/app/quasar-v2/ts-vite-2/__.eslintrc.cjs +0 -20
- package/templates/app/quasar-v2/ts-vite-2/create-quasar-script.js +0 -53
- package/templates/app/quasar-v2/ts-webpack-4/BASE/README.md +0 -40
- package/templates/app/quasar-v2/ts-webpack-4/BASE/_.vscode/settings.json +0 -11
- package/templates/app/quasar-v2/ts-webpack-4/BASE/_package.json +0 -63
- package/templates/app/quasar-v2/ts-webpack-4/BASE/_pnpm-workspace.yaml +0 -6
- package/templates/app/quasar-v2/ts-webpack-4/BASE/babel.config.cjs +0 -12
- package/templates/app/quasar-v2/ts-webpack-4/BASE/postcss.config.cjs +0 -8
- package/templates/app/quasar-v2/ts-webpack-4/BASE/public/icons/favicon-128x128.png +0 -0
- package/templates/app/quasar-v2/ts-webpack-4/BASE/public/icons/favicon-16x16.png +0 -0
- package/templates/app/quasar-v2/ts-webpack-4/BASE/public/icons/favicon-32x32.png +0 -0
- package/templates/app/quasar-v2/ts-webpack-4/BASE/public/icons/favicon-96x96.png +0 -0
- package/templates/app/quasar-v2/ts-webpack-4/BASE/src/assets/quasar-logo-vertical.svg +0 -15
- package/templates/app/quasar-v2/ts-webpack-4/BASE/src/components/ExampleComponent.vue +0 -37
- package/templates/app/quasar-v2/ts-webpack-4/BASE/src/components/models.ts +0 -8
- package/templates/app/quasar-v2/ts-webpack-4/BASE/src/env.d.ts +0 -7
- package/templates/app/quasar-v2/ts-webpack-4/BASE/src/pages/IndexPage.vue +0 -43
- package/templates/app/quasar-v2/ts-webpack-4/BASE/src/router/routes.ts +0 -18
- package/templates/app/quasar-v2/ts-webpack-4/__.eslintrc.cjs +0 -20
- package/templates/app/quasar-v2/ts-webpack-4/create-quasar-script.js +0 -53
- package/templates/app-extension/__eslint.config.js +0 -63
- package/templates/app-extension/ae-js/BASE/_.gitignore +0 -14
- package/templates/app-extension/ae-js/BASE/_package.json +0 -17
- package/templates/app-extension/ae-js/BASE/src/index.js +0 -10
- package/templates/app-extension/ae-js/create-quasar-script.js +0 -68
- package/templates/app-extension/ae-js/install-script/src/install.js +0 -9
- package/templates/app-extension/ae-js/prompts-script/src/prompts.js +0 -44
- package/templates/app-extension/ae-js/uninstall-script/src/uninstall.js +0 -9
- package/templates/app-extension/ae-ts/BASE/README.md +0 -35
- package/templates/app-extension/ae-ts/BASE/_.gitignore +0 -8
- package/templates/app-extension/ae-ts/BASE/_.vscode/extensions.json +0 -9
- package/templates/app-extension/ae-ts/BASE/_eslint.config.js +0 -108
- package/templates/app-extension/ae-ts/BASE/_package.json +0 -39
- package/templates/app-extension/ae-ts/BASE/_tsconfig.json +0 -30
- package/templates/app-extension/ae-ts/BASE/app-extension/README.md +0 -52
- package/templates/app-extension/ae-ts/BASE/app-extension/_.npmignore +0 -5
- package/templates/app-extension/ae-ts/BASE/app-extension/_package.json +0 -51
- package/templates/app-extension/ae-ts/BASE/app-extension/_tsconfig.json +0 -10
- package/templates/app-extension/ae-ts/BASE/app-extension/src/index.ts +0 -36
- package/templates/app-extension/ae-ts/BASE/app-extension/src/quasar.d.ts +0 -24
- package/templates/app-extension/ae-ts/BASE/app-extension/src/runtime/README.md +0 -46
- package/templates/app-extension/ae-ts/BASE/app-extension/src/runtime/boot/register.ts +0 -6
- package/templates/app-extension/ae-ts/BASE/app-extension/src/runtime/components/MyButton.vue +0 -37
- package/templates/app-extension/ae-ts/BASE/app-extension/src/runtime/components/types.ts +0 -19
- package/templates/app-extension/ae-ts/BASE/app-extension/src/runtime/index.ts +0 -9
- package/templates/app-extension/ae-ts/BASE/app-extension/src/runtime/quasar.d.ts +0 -7
- package/templates/app-extension/ae-ts/BASE/app-extension/src/runtime/shims-vue.d.ts +0 -10
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/README.md +0 -67
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/_.gitignore +0 -37
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/_package.json +0 -29
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/_tsconfig.json +0 -9
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/index.html +0 -44
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/quasar.config.ts +0 -202
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/quasar.extensions.json +0 -3
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/src/components/EssentialLink.vue +0 -26
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/src/css/app.scss +0 -1
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/src/layouts/MainLayout.vue +0 -94
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/src/pages/IndexPage.vue +0 -5
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/src/quasar.d.ts +0 -10
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/src/router/routes.ts +0 -18
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/src/shims-vue.d.ts +0 -10
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/README.md +0 -67
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/_.gitignore +0 -32
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/_package.json +0 -40
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/_tsconfig.json +0 -9
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/babel.config.cjs +0 -12
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/index.html +0 -44
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/postcss.config.cjs +0 -8
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/quasar.config.ts +0 -205
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/quasar.extensions.json +0 -3
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/src/components/EssentialLink.vue +0 -26
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/src/css/app.scss +0 -1
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/src/env.d.ts +0 -7
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/src/layouts/MainLayout.vue +0 -92
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/src/pages/IndexPage.vue +0 -5
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/src/quasar.d.ts +0 -10
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/src/router/routes.ts +0 -18
- package/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/src/shims-vue.d.ts +0 -8
- package/templates/app-extension/ae-ts/create-quasar-script.js +0 -86
- package/templates/app-extension/ae-ts/install-script/app-extension/src/install.ts +0 -25
- package/templates/app-extension/ae-ts/install-script/app-extension/src/templates/README.md +0 -27
- package/templates/app-extension/ae-ts/pnpm/_pnpm-workspace.yaml +0 -3
- package/templates/app-extension/ae-ts/prompts-script/app-extension/src/prompts.ts +0 -46
- package/templates/app-extension/ae-ts/uninstall-script/app-extension/src/uninstall.ts +0 -11
- package/templates/app-extension/create-quasar-script.js +0 -17
- package/templates/ui-kit/__eslint.config.js +0 -70
- package/templates/ui-kit/create-quasar-script.js +0 -108
- package/templates/ui-kit/quasar-v2/BASE/README.md +0 -16
- package/templates/ui-kit/quasar-v2/BASE/_.gitignore +0 -16
- package/templates/ui-kit/quasar-v2/BASE/_jsconfig.json +0 -9
- package/templates/ui-kit/quasar-v2/BASE/ui/README.md +0 -156
- package/templates/ui-kit/quasar-v2/BASE/ui/_.npmignore +0 -21
- package/templates/ui-kit/quasar-v2/BASE/ui/_package.json +0 -54
- package/templates/ui-kit/quasar-v2/BASE/ui/build/config.js +0 -13
- package/templates/ui-kit/quasar-v2/BASE/ui/build/index.js +0 -19
- package/templates/ui-kit/quasar-v2/BASE/ui/build/script.clean.js +0 -6
- package/templates/ui-kit/quasar-v2/BASE/ui/build/script.css.js +0 -75
- package/templates/ui-kit/quasar-v2/BASE/ui/build/script.javascript.js +0 -212
- package/templates/ui-kit/quasar-v2/BASE/ui/build/script.open-umd.js +0 -6
- package/templates/ui-kit/quasar-v2/BASE/ui/build/utils.js +0 -55
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/README.md +0 -3
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/_.editorconfig +0 -9
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/_.gitignore +0 -20
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/_.postcssrc.js +0 -8
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/_package.json +0 -30
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/babel.config.js +0 -5
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/quasar.config.js +0 -73
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/App.vue +0 -9
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/boot/register.js +0 -6
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/components/_.gitkeep +0 -0
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/css/app.sass +0 -2
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/css/quasar.variables.sass +0 -22
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/index.template.html +0 -21
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/layouts/MyLayout.vue +0 -39
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/pages/Error404.vue +0 -31
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/pages/Index.vue +0 -40
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/pages/Test1.vue +0 -18
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/router/index.js +0 -48
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/router/pages.js +0 -27
- package/templates/ui-kit/quasar-v2/BASE/ui/dev/src/router/routes.js +0 -25
- package/templates/ui-kit/quasar-v2/BASE/ui/src/index.common.js +0 -2
- package/templates/ui-kit/quasar-v2/BASE/ui/src/index.esm.js +0 -5
- package/templates/ui-kit/quasar-v2/BASE/ui/src/index.sass +0 -7
- package/templates/ui-kit/quasar-v2/BASE/ui/src/index.umd.js +0 -3
- package/templates/ui-kit/quasar-v2/BASE/ui/src/vue-plugin.js +0 -16
- package/templates/ui-kit/quasar-v2/BASE/ui/umd-test.html +0 -59
- package/templates/ui-kit/quasar-v2/ae/app-extension/README.md +0 -33
- package/templates/ui-kit/quasar-v2/ae/app-extension/_.npmignore +0 -17
- package/templates/ui-kit/quasar-v2/ae/app-extension/_package.json +0 -16
- package/templates/ui-kit/quasar-v2/ae/app-extension/src/boot/register.js +0 -6
- package/templates/ui-kit/quasar-v2/ae/app-extension/src/index.js +0 -48
- package/templates/ui-kit/quasar-v2/ae/app-extension/src/templates/_.gitkeep +0 -0
- package/templates/ui-kit/quasar-v2/ae-install/app-extension/src/install.js +0 -19
- package/templates/ui-kit/quasar-v2/ae-prompts/app-extension/src/prompts.js +0 -44
- package/templates/ui-kit/quasar-v2/ae-uninstall/app-extension/src/uninstall.js +0 -9
- package/templates/ui-kit/quasar-v2/create-quasar-script.js +0 -21
- package/templates/ui-kit/quasar-v2/ui-ae/ui/build/script.app-ext.js +0 -60
- package/templates/ui-kit/quasar-v2/ui-component/ui/src/components/Component.js +0 -13
- package/templates/ui-kit/quasar-v2/ui-component/ui/src/components/Component.sass +0 -2
- package/templates/ui-kit/quasar-v2/ui-directive/ui/src/directives/Directive.js +0 -7
- package/templates/ui-kit/quasar-v2/ui-directive/ui/src/directives/Directive.sass +0 -2
- package/utils/index.js +0 -401
- package/utils/logger.js +0 -159
- /package/templates/{app/quasar-v2/js-vite-2 → ae/js}/BASE/_.editorconfig +0 -0
- /package/templates/{app-extension/ae-js/BASE → ae/js/BASE/ae}/src/templates/_.gitkeep +0 -0
- /package/templates/{app/quasar-v2/js-vite-2/BASE → ae/js/BASE/playground}/_jsconfig.json +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-vite → ae/js/BASE/playground}/public/favicon.ico +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-vite → ae/js/BASE/playground}/src/App.vue +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-vite/src/boot → ae/js/BASE/playground/src/assets}/_.gitkeep +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-webpack → ae/js/BASE/playground}/src/boot/_.gitkeep +0 -0
- /package/templates/{app/quasar-v2/js-vite-2/sass → ae/js/BASE/playground}/src/css/app.scss +0 -0
- /package/templates/{app/quasar-v2/js-webpack-4 → ae/ts}/BASE/_.editorconfig +0 -0
- /package/templates/{app-extension/ae-ts/install-script/app-extension → ae/ts/BASE/ae}/src/templates/_.gitkeep +0 -0
- /package/templates/{app/quasar-v2/ts-vite-2/BASE → ae/ts/BASE/playground}/_tsconfig.json +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-webpack → ae/ts/BASE/playground}/public/favicon.ico +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-webpack → ae/ts/BASE/playground}/src/App.vue +0 -0
- /package/templates/{app-extension/ae-ts/install-script/app-extension/src/templates/base → ae/ts/BASE/playground/src/assets}/_.gitkeep +0 -0
- /package/templates/{app/quasar-v2/js-vite-2/BASE → ae/ts/BASE/playground}/src/boot/_.gitkeep +0 -0
- /package/templates/{app/quasar-v2/js-webpack-4/sass → ae/ts/BASE/playground}/src/css/app.scss +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-2/js}/BASE/_.editorconfig +0 -0
- /package/templates/app/{quasar-v2/js-webpack-4 → vite-2/js}/BASE/_jsconfig.json +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/BASE/postcss.config.js +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/BASE/public/favicon.ico +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-vite → app/vite-2/js/BASE}/public/icons/favicon-128x128.png +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-vite → app/vite-2/js/BASE}/public/icons/favicon-16x16.png +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-vite → app/vite-2/js/BASE}/public/icons/favicon-32x32.png +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-vite → app/vite-2/js/BASE}/public/icons/favicon-96x96.png +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/BASE/src/App.vue +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-vite → app/vite-2/js/BASE}/src/assets/quasar-logo-vertical.svg +0 -0
- /package/templates/app/{quasar-v2/js-webpack-4 → vite-2/js}/BASE/src/boot/_.gitkeep +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/BASE/src/pages/ErrorNotFound.vue +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/BASE/src/pages/IndexPage.vue +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/BASE/src/router/routes.js +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/css/src/css/app.css +0 -0
- /package/templates/app/{quasar-v2/js-vite-2/prettier → vite-2/js/eslint}/_.prettierrc.json +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/i18n/src/boot/i18n.js +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/i18n/src/i18n/en-US/index.js +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/i18n/src/i18n/index.js +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/pinia/src/stores/example-store.js +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/pinia/src/stores/index.js +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-2/js}/sass/src/css/app.scss +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-2/js}/sass/src/css/quasar.variables.scss +0 -0
- /package/templates/app/{quasar-v2/ts-webpack-4 → vite-2/ts}/BASE/_.editorconfig +0 -0
- /package/templates/app/{quasar-v2/ts-webpack-4 → vite-2/ts}/BASE/_tsconfig.json +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/BASE/postcss.config.js +0 -0
- /package/templates/app/{quasar-v2/js-webpack-4 → vite-2/ts}/BASE/public/favicon.ico +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-webpack → app/vite-2/ts/BASE}/public/icons/favicon-128x128.png +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-webpack → app/vite-2/ts/BASE}/public/icons/favicon-16x16.png +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-webpack → app/vite-2/ts/BASE}/public/icons/favicon-32x32.png +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-webpack → app/vite-2/ts/BASE}/public/icons/favicon-96x96.png +0 -0
- /package/templates/app/{quasar-v2/js-webpack-4 → vite-2/ts}/BASE/src/App.vue +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-webpack → app/vite-2/ts/BASE}/src/assets/quasar-logo-vertical.svg +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/BASE/src/boot/_.gitkeep +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/BASE/src/components/ExampleComponent.vue +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/BASE/src/components/models.ts +0 -0
- /package/templates/{app-extension/ae-ts/BASE/playground/quasar-cli-vite → app/vite-2/ts/BASE}/src/env.d.ts +0 -0
- /package/templates/app/{quasar-v2/js-webpack-4 → vite-2/ts}/BASE/src/pages/ErrorNotFound.vue +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/BASE/src/pages/IndexPage.vue +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/BASE/src/router/routes.ts +0 -0
- /package/templates/app/{quasar-v2/js-webpack-4 → vite-2/ts}/css/src/css/app.css +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2/prettier → vite-2/ts/eslint}/_.prettierrc.json +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/i18n/src/boot/i18n.ts +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/i18n/src/i18n/en-US/index.ts +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/i18n/src/i18n/index.ts +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/pinia/src/stores/example-store.ts +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-2/ts}/pinia/src/stores/index.ts +0 -0
- /package/templates/app/{quasar-v2/ts-webpack-4 → vite-2/ts}/sass/src/css/app.scss +0 -0
- /package/templates/app/{quasar-v2/js-webpack-4 → vite-2/ts}/sass/src/css/quasar.variables.scss +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-3/js}/BASE/public/favicon.ico +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-3/js}/BASE/public/icons/favicon-128x128.png +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-3/js}/BASE/public/icons/favicon-16x16.png +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-3/js}/BASE/public/icons/favicon-32x32.png +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-3/js}/BASE/public/icons/favicon-96x96.png +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-3/js}/BASE/src/App.vue +0 -0
- /package/templates/app/{quasar-v2/js-vite-2 → vite-3/js}/BASE/src/assets/quasar-logo-vertical.svg +0 -0
- /package/templates/app/{quasar-v2/ts-webpack-4 → vite-3/js}/BASE/src/boot/_.gitkeep +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-3/js}/css/src/css/app.css +0 -0
- /package/templates/app/{quasar-v2/js-webpack-4/prettier → vite-3/js/eslint}/_.prettierrc.json +0 -0
- /package/templates/app/{quasar-v2/js-webpack-4 → vite-3/js}/i18n/src/i18n/en-US/index.js +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2/BASE → vite-3/js/manualRouting}/src/pages/ErrorNotFound.vue +0 -0
- /package/templates/app/{quasar-v2/ts-vite-2 → vite-3/js}/sass/src/css/quasar.variables.scss +0 -0
- /package/templates/app/{quasar-v2/ts-webpack-4 → vite-3/ts}/BASE/public/favicon.ico +0 -0
- /package/templates/app/{quasar-v2/js-webpack-4 → vite-3/ts}/BASE/public/icons/favicon-128x128.png +0 -0
- /package/templates/app/{quasar-v2/js-webpack-4 → vite-3/ts}/BASE/public/icons/favicon-16x16.png +0 -0
- /package/templates/app/{quasar-v2/js-webpack-4 → vite-3/ts}/BASE/public/icons/favicon-32x32.png +0 -0
- /package/templates/app/{quasar-v2/js-webpack-4 → vite-3/ts}/BASE/public/icons/favicon-96x96.png +0 -0
- /package/templates/app/{quasar-v2/ts-webpack-4 → vite-3/ts}/BASE/src/App.vue +0 -0
- /package/templates/app/{quasar-v2/js-webpack-4 → vite-3/ts}/BASE/src/assets/quasar-logo-vertical.svg +0 -0
- /package/templates/{ui-kit/quasar-v2/BASE/ui/dev/src/assets → app/vite-3/ts/BASE/src/boot}/_.gitkeep +0 -0
- /package/templates/app/{quasar-v2/ts-webpack-4 → vite-3/ts}/css/src/css/app.css +0 -0
- /package/templates/app/{quasar-v2/ts-webpack-4/prettier → vite-3/ts/eslint}/_.prettierrc.json +0 -0
- /package/templates/app/{quasar-v2/ts-webpack-4 → vite-3/ts}/i18n/src/i18n/en-US/index.ts +0 -0
- /package/templates/app/{quasar-v2/ts-webpack-4 → vite-3/ts}/i18n/src/i18n/index.ts +0 -0
- /package/templates/app/{quasar-v2/ts-webpack-4/BASE → vite-3/ts/manualRouting}/src/pages/ErrorNotFound.vue +0 -0
- /package/templates/app/{quasar-v2/ts-webpack-4 → vite-3/ts}/sass/src/css/quasar.variables.scss +0 -0
|
@@ -14,12 +14,14 @@ const defaultParseOptions = {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
const newlineRE = /\n/
|
|
17
|
+
const multipleNewlineRE = /\r\n|\n|\r/g
|
|
17
18
|
const newlineTrimRE = /^(?:\r\n|\n|\r)/
|
|
18
19
|
const escapeRegexpRE = /[.*+\-?^${}()|[\]\\]/g
|
|
19
20
|
const templateLitReg =
|
|
20
21
|
/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g
|
|
21
22
|
const singleQuoteReg = /'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g
|
|
22
23
|
const doubleQuoteReg = /"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g
|
|
24
|
+
const strEscapeRE = /\\|'/g
|
|
23
25
|
|
|
24
26
|
function throwParseError(message, str, index) {
|
|
25
27
|
const whitespace = str.slice(0, index).split(newlineRE)
|
|
@@ -36,8 +38,7 @@ function throwParseError(message, str, index) {
|
|
|
36
38
|
' ' +
|
|
37
39
|
str.split(newlineRE)[lineNo - 1] +
|
|
38
40
|
'\n' +
|
|
39
|
-
'
|
|
40
|
-
Array(colNo).join(' ') +
|
|
41
|
+
' '.repeat(colNo + 1) +
|
|
41
42
|
'^'
|
|
42
43
|
|
|
43
44
|
throw new Error(message)
|
|
@@ -45,14 +46,14 @@ function throwParseError(message, str, index) {
|
|
|
45
46
|
|
|
46
47
|
function escapeRegExp(str) {
|
|
47
48
|
// From MDN
|
|
48
|
-
return str.replace(escapeRegexpRE,
|
|
49
|
+
return str.replace(escapeRegexpRE, String.raw`\$&`) // $& means the whole matched string
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
function trimWS(str, wsLeft, wsRight) {
|
|
52
53
|
// Slightly confusing,
|
|
53
54
|
// but _}} will trim the left side of the following string
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
const leftTrim = wsLeft || wsLeft === false ? wsLeft : 'nl'
|
|
56
|
+
const rightTrim = wsRight || wsRight === false ? wsRight : false
|
|
56
57
|
|
|
57
58
|
if (!rightTrim && !leftTrim) return str
|
|
58
59
|
|
|
@@ -81,7 +82,7 @@ function trimWS(str, wsLeft, wsRight) {
|
|
|
81
82
|
|
|
82
83
|
// opts: { exec, interpolate, raw, tagStart, tagEnd }
|
|
83
84
|
function getAST(str, opts) {
|
|
84
|
-
|
|
85
|
+
const ast = []
|
|
85
86
|
let trimLeftOfNextStr = false
|
|
86
87
|
let lastIndex = 0
|
|
87
88
|
|
|
@@ -103,7 +104,9 @@ function getAST(str, opts) {
|
|
|
103
104
|
// replace \ with \\, ' with \'
|
|
104
105
|
// we're going to convert all CRLF to LF so it doesn't take more than one replace
|
|
105
106
|
|
|
106
|
-
strng = strng
|
|
107
|
+
strng = strng
|
|
108
|
+
.replaceAll(strEscapeRE, String.raw`\$&`)
|
|
109
|
+
.replaceAll(multipleNewlineRE, String.raw`\n`)
|
|
107
110
|
|
|
108
111
|
ast.push(strng)
|
|
109
112
|
}
|
|
@@ -117,16 +120,18 @@ function getAST(str, opts) {
|
|
|
117
120
|
} else if (prefix) {
|
|
118
121
|
// accumulator is falsy
|
|
119
122
|
return escapeRegExp(prefix)
|
|
120
|
-
} else {
|
|
121
|
-
// prefix and accumulator are both falsy
|
|
122
|
-
return accumulator
|
|
123
123
|
}
|
|
124
|
+
// prefix and accumulator are both falsy
|
|
125
|
+
return accumulator
|
|
124
126
|
},
|
|
125
127
|
''
|
|
126
128
|
)
|
|
127
129
|
|
|
128
130
|
const parseOpenReg = new RegExp(
|
|
129
|
-
escapeRegExp(opts.tagStart) +
|
|
131
|
+
escapeRegExp(opts.tagStart) +
|
|
132
|
+
String.raw`(-|_)?\s*(` +
|
|
133
|
+
prefixes +
|
|
134
|
+
String.raw`)?\s*`,
|
|
130
135
|
'g'
|
|
131
136
|
)
|
|
132
137
|
|
|
@@ -135,8 +140,14 @@ function getAST(str, opts) {
|
|
|
135
140
|
'g'
|
|
136
141
|
)
|
|
137
142
|
|
|
138
|
-
|
|
143
|
+
const parseRawCloseReg = opts.raw
|
|
144
|
+
? new RegExp(
|
|
145
|
+
String.raw`(\s*(-|_)?` + escapeRegExp(opts.raw + opts.tagEnd) + ')',
|
|
146
|
+
'g'
|
|
147
|
+
)
|
|
148
|
+
: parseCloseReg
|
|
139
149
|
|
|
150
|
+
let m
|
|
140
151
|
while ((m = parseOpenReg.exec(str))) {
|
|
141
152
|
const precedingString = str.slice(lastIndex, m.index)
|
|
142
153
|
|
|
@@ -147,15 +158,17 @@ function getAST(str, opts) {
|
|
|
147
158
|
|
|
148
159
|
pushString(precedingString, wsLeft)
|
|
149
160
|
|
|
150
|
-
|
|
161
|
+
const endReg = prefix === opts.raw ? parseRawCloseReg : parseCloseReg
|
|
162
|
+
endReg.lastIndex = lastIndex
|
|
163
|
+
|
|
151
164
|
let closeTag
|
|
152
165
|
let currentObj = false
|
|
153
166
|
|
|
154
|
-
while ((closeTag =
|
|
167
|
+
while ((closeTag = endReg.exec(str))) {
|
|
155
168
|
if (closeTag[1]) {
|
|
156
169
|
const content = str.slice(lastIndex, closeTag.index)
|
|
157
170
|
|
|
158
|
-
parseOpenReg.lastIndex = lastIndex =
|
|
171
|
+
parseOpenReg.lastIndex = lastIndex = endReg.lastIndex
|
|
159
172
|
|
|
160
173
|
trimLeftOfNextStr = closeTag[2]
|
|
161
174
|
|
|
@@ -173,18 +186,18 @@ function getAST(str, opts) {
|
|
|
173
186
|
} else {
|
|
174
187
|
const char = closeTag[0]
|
|
175
188
|
if (char === '/*') {
|
|
176
|
-
const commentCloseInd = str.indexOf('*/',
|
|
189
|
+
const commentCloseInd = str.indexOf('*/', endReg.lastIndex)
|
|
177
190
|
|
|
178
191
|
if (commentCloseInd === -1) {
|
|
179
192
|
throwParseError('unclosed comment', str, closeTag.index)
|
|
180
193
|
}
|
|
181
|
-
|
|
194
|
+
endReg.lastIndex = commentCloseInd
|
|
182
195
|
} else if (char === "'") {
|
|
183
196
|
singleQuoteReg.lastIndex = closeTag.index
|
|
184
197
|
|
|
185
198
|
const singleQuoteMatch = singleQuoteReg.exec(str)
|
|
186
199
|
if (singleQuoteMatch) {
|
|
187
|
-
|
|
200
|
+
endReg.lastIndex = singleQuoteReg.lastIndex
|
|
188
201
|
} else {
|
|
189
202
|
throwParseError('unclosed string', str, closeTag.index)
|
|
190
203
|
}
|
|
@@ -193,7 +206,7 @@ function getAST(str, opts) {
|
|
|
193
206
|
const doubleQuoteMatch = doubleQuoteReg.exec(str)
|
|
194
207
|
|
|
195
208
|
if (doubleQuoteMatch) {
|
|
196
|
-
|
|
209
|
+
endReg.lastIndex = doubleQuoteReg.lastIndex
|
|
197
210
|
} else {
|
|
198
211
|
throwParseError('unclosed string', str, closeTag.index)
|
|
199
212
|
}
|
|
@@ -201,7 +214,7 @@ function getAST(str, opts) {
|
|
|
201
214
|
templateLitReg.lastIndex = closeTag.index
|
|
202
215
|
const templateLitMatch = templateLitReg.exec(str)
|
|
203
216
|
if (templateLitMatch) {
|
|
204
|
-
|
|
217
|
+
endReg.lastIndex = templateLitReg.lastIndex
|
|
205
218
|
} else {
|
|
206
219
|
throwParseError('unclosed string', str, closeTag.index)
|
|
207
220
|
}
|
|
@@ -215,40 +228,47 @@ function getAST(str, opts) {
|
|
|
215
228
|
}
|
|
216
229
|
}
|
|
217
230
|
|
|
218
|
-
pushString(str.slice(lastIndex
|
|
231
|
+
pushString(str.slice(lastIndex), false)
|
|
219
232
|
return ast
|
|
220
233
|
}
|
|
221
234
|
|
|
235
|
+
const rawContentRE = /[$`\\"]/g
|
|
236
|
+
function parseRawContent(content) {
|
|
237
|
+
return '"' + content.replaceAll(rawContentRE, String.raw`\$&`) + '"'
|
|
238
|
+
}
|
|
239
|
+
|
|
222
240
|
// opts: { varName, header }
|
|
223
241
|
function compileBody(ast, opts) {
|
|
224
242
|
let i = 0
|
|
225
243
|
const astLength = ast.length
|
|
226
|
-
let returnStr = `${opts.header}\nlet ${fnAccumulator} = ''
|
|
244
|
+
let returnStr = `${opts.header}\nlet ${fnAccumulator} = ''\n`
|
|
227
245
|
|
|
228
246
|
for (; i < astLength; i++) {
|
|
229
247
|
const currentBlock = ast[i]
|
|
230
248
|
|
|
231
249
|
if (typeof currentBlock === 'string') {
|
|
232
|
-
returnStr += `${fnAccumulator}+='${currentBlock}'
|
|
250
|
+
returnStr += `${fnAccumulator}+='${currentBlock}'\n`
|
|
233
251
|
continue
|
|
234
252
|
}
|
|
235
253
|
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
254
|
+
const content = currentBlock.val ?? ''
|
|
255
|
+
if (content !== '') {
|
|
256
|
+
const type = currentBlock.t // "r", "e", or "i"
|
|
257
|
+
|
|
258
|
+
if (type === 'e') {
|
|
259
|
+
// execute
|
|
260
|
+
returnStr += content + '\n'
|
|
261
|
+
} else if (type === 'r') {
|
|
262
|
+
// raw
|
|
263
|
+
returnStr += `${fnAccumulator}+=${parseRawContent(content)}\n`
|
|
264
|
+
} else if (type === 'i') {
|
|
265
|
+
// interpolate
|
|
266
|
+
returnStr += `${fnAccumulator}+=${content}\n`
|
|
267
|
+
}
|
|
248
268
|
}
|
|
249
269
|
}
|
|
250
270
|
|
|
251
|
-
return returnStr
|
|
271
|
+
return `${returnStr}\nreturn ${fnAccumulator}`
|
|
252
272
|
}
|
|
253
273
|
|
|
254
274
|
export function compileTemplateToFile(str, rawOpts = {}) {
|
|
@@ -262,19 +282,32 @@ export function compileTemplateToFn(str, rawOpts = {}) {
|
|
|
262
282
|
const opts = { ...defaultParseOptions, ...rawOpts }
|
|
263
283
|
const ast = getAST(str, opts)
|
|
264
284
|
const body = compileBody(ast, opts)
|
|
285
|
+
|
|
286
|
+
// oxlint-disable-next-line no-new-func
|
|
265
287
|
return new Function(opts.varName, body)
|
|
266
288
|
}
|
|
267
289
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
if (opts?.varName === false) {
|
|
271
|
-
opts.varName = defaultParseOptions.varName
|
|
290
|
+
function getRenderTemplateOpts(rawOpts, scope) {
|
|
291
|
+
if (rawOpts?.varName === false) {
|
|
272
292
|
const keys = Object.keys(scope)
|
|
273
|
-
|
|
274
|
-
|
|
293
|
+
return {
|
|
294
|
+
...rawOpts,
|
|
295
|
+
varName: defaultParseOptions.varName,
|
|
296
|
+
header:
|
|
297
|
+
keys.length !== 0
|
|
298
|
+
? `const { ${keys.join(', ')} } = ${defaultParseOptions.varName}`
|
|
299
|
+
: ''
|
|
275
300
|
}
|
|
276
301
|
}
|
|
277
302
|
|
|
278
|
-
|
|
303
|
+
return rawOpts
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export function renderTemplate(str, scope, rawOpts) {
|
|
307
|
+
const templateFn = compileTemplateToFn(
|
|
308
|
+
str,
|
|
309
|
+
getRenderTemplateOpts(rawOpts, scope)
|
|
310
|
+
)
|
|
311
|
+
|
|
279
312
|
return templateFn(scope)
|
|
280
313
|
}
|
package/lib/utils.js
ADDED
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync } from 'node:fs'
|
|
2
|
+
import { styleText } from 'node:util'
|
|
3
|
+
import { fileURLToPath } from 'node:url'
|
|
4
|
+
import { dirname, extname, join, resolve } from 'node:path'
|
|
5
|
+
import { execSync as exec } from 'node:child_process'
|
|
6
|
+
import { sync as spawnSync } from 'cross-spawn'
|
|
7
|
+
import {
|
|
8
|
+
copySync,
|
|
9
|
+
emptyDirSync,
|
|
10
|
+
ensureDirSync,
|
|
11
|
+
ensureFileSync
|
|
12
|
+
} from 'fs-extra/esm'
|
|
13
|
+
import { globSync } from 'tinyglobby'
|
|
14
|
+
import {
|
|
15
|
+
box,
|
|
16
|
+
cancel,
|
|
17
|
+
confirm,
|
|
18
|
+
group,
|
|
19
|
+
groupMultiselect,
|
|
20
|
+
intro,
|
|
21
|
+
isCancel,
|
|
22
|
+
log,
|
|
23
|
+
multiselect,
|
|
24
|
+
note,
|
|
25
|
+
outro,
|
|
26
|
+
select,
|
|
27
|
+
taskLog,
|
|
28
|
+
text
|
|
29
|
+
} from '@clack/prompts'
|
|
30
|
+
|
|
31
|
+
import { renderTemplate as renderTemplateFn } from './template.js'
|
|
32
|
+
|
|
33
|
+
const prompts = {
|
|
34
|
+
text,
|
|
35
|
+
confirm,
|
|
36
|
+
select,
|
|
37
|
+
multiselect,
|
|
38
|
+
groupMultiselect,
|
|
39
|
+
group,
|
|
40
|
+
|
|
41
|
+
intro,
|
|
42
|
+
outro,
|
|
43
|
+
taskLog,
|
|
44
|
+
log,
|
|
45
|
+
note: (msg, title) => {
|
|
46
|
+
/**
|
|
47
|
+
* Bug in @clack/prompts note formatting,
|
|
48
|
+
* so we need to reset the color for each line
|
|
49
|
+
*/
|
|
50
|
+
const formattedMsg = msg
|
|
51
|
+
.split('\n')
|
|
52
|
+
.map(line => styleText('reset', line))
|
|
53
|
+
.join('\n')
|
|
54
|
+
|
|
55
|
+
note(formattedMsg, title)
|
|
56
|
+
},
|
|
57
|
+
box
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const TEMPLATING_FILE_EXTENSIONS = [
|
|
61
|
+
'',
|
|
62
|
+
'.json',
|
|
63
|
+
'.js',
|
|
64
|
+
'.cjs',
|
|
65
|
+
'.ts',
|
|
66
|
+
'.vue',
|
|
67
|
+
'.md',
|
|
68
|
+
'.html',
|
|
69
|
+
'.sass'
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
function cancelScaffolding({
|
|
73
|
+
message = 'Scaffolding cancelled',
|
|
74
|
+
exit = true
|
|
75
|
+
} = {}) {
|
|
76
|
+
cancel(message)
|
|
77
|
+
if (exit !== false) process.exit(exit === true ? 1 : exit)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function exitOnCancel(val) {
|
|
81
|
+
if (isCancel(val)) cancelScaffolding()
|
|
82
|
+
return val
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async function promptUser(
|
|
86
|
+
scope,
|
|
87
|
+
questions,
|
|
88
|
+
onCancel = () => cancelScaffolding()
|
|
89
|
+
) {
|
|
90
|
+
for (const key in questions) {
|
|
91
|
+
// if it came pre-filled
|
|
92
|
+
if (scope[key] !== void 0) continue
|
|
93
|
+
|
|
94
|
+
scope[key] = await questions[key]()
|
|
95
|
+
if (isCancel(scope[key])) {
|
|
96
|
+
onCancel()
|
|
97
|
+
return
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function createTargetDir(scope) {
|
|
103
|
+
const fn = scope.overwrite ? emptyDirSync : ensureDirSync
|
|
104
|
+
fn(scope.projectFolder)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function convertArrayToObject(arr) {
|
|
108
|
+
const acc = {}
|
|
109
|
+
arr.forEach(key => {
|
|
110
|
+
acc[key] = true
|
|
111
|
+
})
|
|
112
|
+
return acc
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function getCallerPath() {
|
|
116
|
+
const _prepareStackTrace = Error.prepareStackTrace
|
|
117
|
+
Error.prepareStackTrace = (_, stack) => stack
|
|
118
|
+
const stack = new Error('err').stack.slice(1)
|
|
119
|
+
Error.prepareStackTrace = _prepareStackTrace
|
|
120
|
+
const filename = stack[1].getFileName()
|
|
121
|
+
return dirname(
|
|
122
|
+
filename.startsWith('file://') ? fileURLToPath(filename) : filename
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function renderTemplate(relativePath, scope) {
|
|
127
|
+
const templateDir = join(getCallerPath(), relativePath)
|
|
128
|
+
const files = globSync(['**/*'], { cwd: templateDir })
|
|
129
|
+
|
|
130
|
+
for (const rawPath of files) {
|
|
131
|
+
const targetRelativePath = rawPath
|
|
132
|
+
.split('/')
|
|
133
|
+
.map(name => (name.startsWith('_') ? name.slice(1) : name))
|
|
134
|
+
.join('/')
|
|
135
|
+
|
|
136
|
+
const targetPath = resolve(scope.projectFolder, targetRelativePath)
|
|
137
|
+
const sourcePath = resolve(templateDir, rawPath)
|
|
138
|
+
const extension = extname(targetRelativePath)
|
|
139
|
+
|
|
140
|
+
ensureFileSync(targetPath)
|
|
141
|
+
|
|
142
|
+
if (TEMPLATING_FILE_EXTENSIONS.includes(extension)) {
|
|
143
|
+
const rawContent = readFileSync(sourcePath, 'utf8')
|
|
144
|
+
|
|
145
|
+
let newContent = renderTemplateFn(rawContent, scope)
|
|
146
|
+
if (extension === '.json') {
|
|
147
|
+
try {
|
|
148
|
+
// try to format the JSON
|
|
149
|
+
newContent = JSON.stringify(JSON.parse(newContent), null, 2)
|
|
150
|
+
} catch {
|
|
151
|
+
// noop, the JSON might be containing comments, leave it unformatted
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
writeFileSync(targetPath, newContent, 'utf8')
|
|
156
|
+
} else {
|
|
157
|
+
copySync(sourcePath, targetPath)
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function waitForKey() {
|
|
163
|
+
const { stdin } = process
|
|
164
|
+
|
|
165
|
+
// Are we in a real terminal?
|
|
166
|
+
// If not (e.g., CI pipeline), resolve immediately so the script doesn't hang forever.
|
|
167
|
+
if (!stdin.isTTY) return Promise.resolve()
|
|
168
|
+
|
|
169
|
+
process.stdout.write('Press any key to continue...')
|
|
170
|
+
|
|
171
|
+
const { promise, resolve: resolvePromise } = Promise.withResolvers()
|
|
172
|
+
|
|
173
|
+
// Enable raw mode to bypass the 'Enter' key requirement
|
|
174
|
+
stdin.setRawMode(true)
|
|
175
|
+
stdin.resume()
|
|
176
|
+
stdin.setEncoding('utf8')
|
|
177
|
+
|
|
178
|
+
const handleKey = key => {
|
|
179
|
+
stdin.off('data', handleKey)
|
|
180
|
+
stdin.setRawMode(false)
|
|
181
|
+
stdin.pause()
|
|
182
|
+
|
|
183
|
+
// Explicitly handle Ctrl+C
|
|
184
|
+
if (key === '\u0003') {
|
|
185
|
+
console.log('\nProcess cancelled by user (Ctrl+C)\n')
|
|
186
|
+
process.exit(1)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
resolvePromise()
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
stdin.on('data', handleKey)
|
|
193
|
+
return promise
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function enterAlternateScreen(message) {
|
|
197
|
+
// if we're not in a real terminal
|
|
198
|
+
if (!process.stdin.isTTY) {
|
|
199
|
+
if (message) console.log(`>>> ${message}\n`)
|
|
200
|
+
return
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Enter Alternate Screen Buffer (hides current terminal history)
|
|
204
|
+
process.stdout.write('\u001B[?1049h')
|
|
205
|
+
// Move cursor to top left
|
|
206
|
+
process.stdout.write('\u001B[H')
|
|
207
|
+
|
|
208
|
+
if (message) console.log(`>>> ${message}\n`)
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function exitAlternateScreen() {
|
|
212
|
+
// if we're not in a real terminal
|
|
213
|
+
if (!process.stdin.isTTY) return
|
|
214
|
+
|
|
215
|
+
process.stdout.write('\u001B[?1049l')
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
async function runCommand({
|
|
219
|
+
cmd,
|
|
220
|
+
args,
|
|
221
|
+
cwd,
|
|
222
|
+
message,
|
|
223
|
+
successMessage,
|
|
224
|
+
errorMessage
|
|
225
|
+
}) {
|
|
226
|
+
const logTask = taskLog({ title: message })
|
|
227
|
+
enterAlternateScreen(`Running command: ${cmd} ${args.join(' ')}`)
|
|
228
|
+
|
|
229
|
+
const runner = spawnSync(cmd, args, {
|
|
230
|
+
cwd,
|
|
231
|
+
args,
|
|
232
|
+
stdio: 'inherit',
|
|
233
|
+
// Force colors so the captured error formatting isn't lost
|
|
234
|
+
env: { ...process.env, FORCE_COLOR: '1' }
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
if (runner.error || runner.status) {
|
|
238
|
+
const msg = `⚠️ ⚠️ ⚠️ ${errorMessage} ⚠️ ⚠️ ⚠️ `
|
|
239
|
+
|
|
240
|
+
console.log()
|
|
241
|
+
console.error(msg)
|
|
242
|
+
console.log()
|
|
243
|
+
|
|
244
|
+
await waitForKey()
|
|
245
|
+
exitAlternateScreen()
|
|
246
|
+
logTask.error(msg)
|
|
247
|
+
|
|
248
|
+
return true
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
exitAlternateScreen()
|
|
252
|
+
logTask.success(successMessage)
|
|
253
|
+
|
|
254
|
+
return false
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
async function installDeps(scope) {
|
|
258
|
+
const hadError = await runCommand({
|
|
259
|
+
cmd: scope.install,
|
|
260
|
+
args: ['install'],
|
|
261
|
+
cwd: scope.projectFolder,
|
|
262
|
+
message: `Installing dependencies using ${scope.install.toUpperCase()}...`,
|
|
263
|
+
successMessage: 'Dependencies installed successfully!',
|
|
264
|
+
errorMessage:
|
|
265
|
+
'Could not auto install dependencies. Probably a temporary npm registry issue?'
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
if (hadError) {
|
|
269
|
+
scope.install = false
|
|
270
|
+
return false
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return true
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// returns a Promise!
|
|
277
|
+
// depends on install
|
|
278
|
+
function lintFolder(scope) {
|
|
279
|
+
return runCommand({
|
|
280
|
+
cmd: scope.install,
|
|
281
|
+
args: ['run', 'lint'],
|
|
282
|
+
cwd: scope.projectFolder,
|
|
283
|
+
message: 'Linting & Formatting the project folder...',
|
|
284
|
+
successMessage: 'Project linted & formatted successfully!',
|
|
285
|
+
errorMessage: 'Could not auto lint & format the project folder.'
|
|
286
|
+
})
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function hasGit() {
|
|
290
|
+
try {
|
|
291
|
+
exec('git --version')
|
|
292
|
+
return true
|
|
293
|
+
} catch {}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function folderHasGit(cwd) {
|
|
297
|
+
try {
|
|
298
|
+
exec('git status', { stdio: 'ignore', cwd })
|
|
299
|
+
return true
|
|
300
|
+
} catch {}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function initializeGit(projectFolder) {
|
|
304
|
+
if (hasGit() !== true) {
|
|
305
|
+
log.info(
|
|
306
|
+
'Git is not installed on the system, so skipping Git repo initialization.'
|
|
307
|
+
)
|
|
308
|
+
return
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (folderHasGit(projectFolder)) {
|
|
312
|
+
log.info(
|
|
313
|
+
'A parent of the project folder is already a Git repository, so skipping Git initialization.'
|
|
314
|
+
)
|
|
315
|
+
return
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const logTask = taskLog({
|
|
319
|
+
title: 'Initializing Git repository...'
|
|
320
|
+
})
|
|
321
|
+
|
|
322
|
+
try {
|
|
323
|
+
exec('git init', { cwd: projectFolder })
|
|
324
|
+
exec('git add -A', { cwd: projectFolder })
|
|
325
|
+
|
|
326
|
+
// Provide useful feedback to the user if they have GPG signing
|
|
327
|
+
// enabled to avoid feeling that the process is hanging
|
|
328
|
+
try {
|
|
329
|
+
const needsSigning = exec('git config --get commit.gpgsign', {
|
|
330
|
+
cwd: projectFolder
|
|
331
|
+
})
|
|
332
|
+
.toString()
|
|
333
|
+
.trim()
|
|
334
|
+
if (needsSigning === 'true') {
|
|
335
|
+
logTask.message('Creating initial commit (waiting for GPG signing)...')
|
|
336
|
+
}
|
|
337
|
+
} catch {}
|
|
338
|
+
|
|
339
|
+
exec('git commit -m "Initialize the project 🚀" --no-verify', {
|
|
340
|
+
cwd: projectFolder
|
|
341
|
+
})
|
|
342
|
+
} catch {
|
|
343
|
+
logTask.error(
|
|
344
|
+
'Could not initialize Git repository. Please do this manually.'
|
|
345
|
+
)
|
|
346
|
+
return
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
logTask.success('Initialized Git repository 🚀')
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
async function getGitUser() {
|
|
353
|
+
let name
|
|
354
|
+
let email
|
|
355
|
+
|
|
356
|
+
const { execSync } = await import('node:child_process')
|
|
357
|
+
|
|
358
|
+
try {
|
|
359
|
+
name = execSync('git config --get user.name')
|
|
360
|
+
email = execSync('git config --get user.email')
|
|
361
|
+
} catch {}
|
|
362
|
+
|
|
363
|
+
if (!name && !email) return // user will be prompted
|
|
364
|
+
|
|
365
|
+
return (
|
|
366
|
+
(name ? JSON.stringify(name.toString().trim()).slice(1, -1) : '') +
|
|
367
|
+
(email ? ' <' + email.toString().trim() + '>' : '')
|
|
368
|
+
)
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
const definitions = {
|
|
372
|
+
projectFolder: {
|
|
373
|
+
default: 'quasar-project'
|
|
374
|
+
},
|
|
375
|
+
|
|
376
|
+
name: {
|
|
377
|
+
default: projectFolderName =>
|
|
378
|
+
projectFolderName
|
|
379
|
+
.trim()
|
|
380
|
+
.toLowerCase()
|
|
381
|
+
.replaceAll(/\s+/g, '-')
|
|
382
|
+
.replace(/^[._]/, '')
|
|
383
|
+
.replaceAll(/[^a-z0-9-~]+/g, '-'),
|
|
384
|
+
|
|
385
|
+
isValid: name =>
|
|
386
|
+
/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(name)
|
|
387
|
+
},
|
|
388
|
+
|
|
389
|
+
product: {
|
|
390
|
+
default: 'Quasar App'
|
|
391
|
+
},
|
|
392
|
+
|
|
393
|
+
template: {
|
|
394
|
+
default: 'app'
|
|
395
|
+
},
|
|
396
|
+
|
|
397
|
+
engine: {
|
|
398
|
+
default: 'vite-3'
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export default {
|
|
403
|
+
cancelScaffolding,
|
|
404
|
+
exitOnCancel,
|
|
405
|
+
|
|
406
|
+
promptUser,
|
|
407
|
+
prompts,
|
|
408
|
+
definitions,
|
|
409
|
+
convertArrayToObject,
|
|
410
|
+
|
|
411
|
+
createTargetDir,
|
|
412
|
+
renderTemplate,
|
|
413
|
+
|
|
414
|
+
installDeps,
|
|
415
|
+
lintFolder,
|
|
416
|
+
initializeGit,
|
|
417
|
+
getGitUser
|
|
418
|
+
}
|