lucy-cli 2.0.0-alpha.11 → 2.0.0-alpha.12
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/dist/Gulpfile.d.ts +35 -0
- package/dist/Gulpfile.js +132 -0
- package/dist/Gulpfile.js.map +1 -0
- package/dist/args.d.ts +1 -6
- package/dist/args.js +18 -5
- package/dist/args.js.map +1 -0
- package/dist/commands/checks.d.ts +7 -0
- package/dist/commands/checks.js +47 -0
- package/dist/commands/checks.js.map +1 -0
- package/dist/commands/cleanup copy.d.ts +4 -0
- package/dist/commands/cleanup copy.js +10 -0
- package/dist/commands/cleanup copy.js.map +1 -0
- package/dist/commands/cleanup.d.ts +4 -0
- package/dist/commands/cleanup.js +10 -0
- package/dist/commands/cleanup.js.map +1 -0
- package/dist/commands/copy.d.ts +5 -0
- package/dist/commands/copy.js +12 -0
- package/dist/commands/copy.js.map +1 -0
- package/dist/commands/edit.d.ts +10 -0
- package/dist/commands/edit.js +69 -0
- package/dist/commands/edit.js.map +1 -0
- package/dist/commands/exec copy.d.ts +3 -0
- package/dist/commands/exec copy.js +20 -0
- package/dist/commands/exec copy.js.map +1 -0
- package/dist/commands/exec.d.ts +5 -0
- package/dist/commands/exec.js +40 -0
- package/dist/commands/exec.js.map +1 -0
- package/dist/commands/git.d.ts +8 -0
- package/dist/commands/git.js +104 -0
- package/dist/commands/git.js.map +1 -0
- package/dist/commands/home.d.ts +4 -0
- package/dist/commands/home.js +18 -0
- package/dist/commands/home.js.map +1 -0
- package/dist/commands/install.d.ts +8 -0
- package/dist/commands/install.js +110 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/read.d.ts +5 -0
- package/dist/commands/read.js +34 -0
- package/dist/commands/read.js.map +1 -0
- package/dist/commands/write.d.ts +5 -0
- package/dist/commands/write.js +16 -0
- package/dist/commands/write.js.map +1 -0
- package/dist/commands.js +1 -0
- package/dist/commands.js.map +1 -0
- package/dist/config.d.ts +11 -6
- package/dist/config.js +40 -4
- package/dist/config.js.map +1 -0
- package/dist/error.d.ts +1 -9
- package/dist/error.js +1 -2
- package/dist/error.js.map +1 -0
- package/dist/gulp/backend.d.ts +3 -0
- package/dist/gulp/backend.js +92 -0
- package/dist/gulp/backend.js.map +1 -0
- package/dist/gulp/checks.d.ts +3 -0
- package/dist/gulp/checks.js +194 -0
- package/dist/gulp/checks.js.map +1 -0
- package/dist/gulp/clean.d.ts +3 -0
- package/dist/gulp/clean.js +33 -0
- package/dist/gulp/clean.js.map +1 -0
- package/dist/gulp/copy.d.ts +2 -0
- package/dist/gulp/copy.js +34 -0
- package/dist/gulp/copy.js.map +1 -0
- package/dist/gulp/helpers.d.ts +2 -0
- package/dist/gulp/helpers.js +21 -0
- package/dist/gulp/helpers.js.map +1 -0
- package/dist/gulp/pages.d.ts +2 -0
- package/dist/gulp/pages.js +39 -0
- package/dist/gulp/pages.js.map +1 -0
- package/dist/gulp/pipeline.d.ts +1 -0
- package/dist/gulp/pipeline.js +29 -0
- package/dist/gulp/pipeline.js.map +1 -0
- package/dist/gulp/public.d.ts +2 -0
- package/dist/gulp/public.js +50 -0
- package/dist/gulp/public.js.map +1 -0
- package/dist/gulp/styles.d.ts +2 -0
- package/dist/gulp/styles.js +40 -0
- package/dist/gulp/styles.js.map +1 -0
- package/dist/gulp/templates.d.ts +2 -0
- package/dist/gulp/templates.js +33 -0
- package/dist/gulp/templates.js.map +1 -0
- package/dist/gulp/types.d.ts +4 -0
- package/dist/gulp/types.js +289 -0
- package/dist/gulp/types.js.map +1 -0
- package/dist/gulp/watchers.d.ts +9 -0
- package/dist/gulp/watchers.js +57 -0
- package/dist/gulp/watchers.js.map +1 -0
- package/dist/helpers.js +1 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.js +38 -7
- package/dist/index.js.map +1 -0
- package/dist/init/blocks.d.ts +5 -0
- package/dist/init/blocks.js +60 -0
- package/dist/init/blocks.js.map +1 -0
- package/dist/init/cargo copy.d.ts +2 -0
- package/dist/init/cargo copy.js +16 -0
- package/dist/init/cargo copy.js.map +1 -0
- package/dist/init/cargo.d.ts +2 -0
- package/dist/init/cargo.js +19 -0
- package/dist/init/cargo.js.map +1 -0
- package/dist/init/expo copy.d.ts +5 -0
- package/dist/init/expo copy.js +48 -0
- package/dist/init/expo copy.js.map +1 -0
- package/dist/init/expo.d.ts +5 -0
- package/dist/init/expo.js +50 -0
- package/dist/init/expo.js.map +1 -0
- package/dist/init/gitModules.d.ts +2 -0
- package/dist/init/gitModules.js +13 -0
- package/dist/init/gitModules.js.map +1 -0
- package/dist/init/index.d.ts +4 -0
- package/dist/init/index.js +64 -0
- package/dist/init/index.js.map +1 -0
- package/dist/init/lucy.d.ts +1 -0
- package/dist/init/lucy.js +2 -0
- package/dist/init/monorepo copy.d.ts +4 -0
- package/dist/init/monorepo copy.js +28 -0
- package/dist/init/monorepo copy.js.map +1 -0
- package/dist/init/monorepo.d.ts +4 -0
- package/dist/init/monorepo.js +35 -0
- package/dist/init/monorepo.js.map +1 -0
- package/dist/init/prepare.d.ts +8 -0
- package/dist/init/prepare.js +20 -0
- package/dist/init/prepare.js.map +1 -0
- package/dist/init/prepareVelo.d.ts +2 -0
- package/dist/init/prepareVelo.js +16 -0
- package/dist/init/prepareVelo.js.map +1 -0
- package/dist/init/sync.d.ts +2 -0
- package/dist/init/sync.js +88 -0
- package/dist/init/sync.js.map +1 -0
- package/dist/init/tauri.d.ts +5 -0
- package/dist/init/tauri.js +29 -0
- package/dist/init/tauri.js.map +1 -0
- package/dist/init/templates.d.ts +5 -0
- package/dist/init/templates.js +94 -0
- package/dist/init/templates.js.map +1 -0
- package/dist/init/velo.d.ts +5 -0
- package/dist/init/velo.js +58 -0
- package/dist/init/velo.js.map +1 -0
- package/dist/init/write.d.ts +5 -0
- package/dist/init/write.js +15 -0
- package/dist/models.js +1 -0
- package/dist/models.js.map +1 -0
- package/dist/policy.js +1 -0
- package/dist/policy.js.map +1 -0
- package/dist/prepare.js +1 -0
- package/dist/prepare.js.map +1 -0
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1 -0
- package/dist/runtime.js.map +1 -0
- package/dist/schemas/gulp.d.ts +16 -0
- package/dist/schemas/gulp.js +4 -0
- package/dist/schemas/gulp.js.map +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/lucy.d.ts +26 -0
- package/dist/schemas/lucy.js +39 -0
- package/dist/schemas/lucy.js.map +1 -0
- package/dist/schemas/models.d.ts +37 -0
- package/dist/schemas/models.js +2 -0
- package/dist/schemas/models.js.map +1 -0
- package/dist/schemas/tsconfig.d.ts +37 -0
- package/dist/schemas/tsconfig.js +2 -0
- package/dist/schemas/tsconfig.js.map +1 -0
- package/dist/schemas/types.d.ts +15 -0
- package/dist/schemas/types.js +3 -1
- package/dist/schemas/types.js.map +1 -0
- package/dist/states.js +1 -0
- package/dist/states.js.map +1 -0
- package/dist/sync/index.js +2 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/sync.js +88 -0
- package/dist/sync/sync.js.map +1 -0
- package/dist/tasks/Gulpfile.d.ts +35 -0
- package/dist/tasks/Gulpfile.js +135 -0
- package/dist/tasks/Gulpfile.js.map +1 -0
- package/dist/tasks/gulp/backend.d.ts +3 -0
- package/dist/tasks/gulp/backend.js +92 -0
- package/dist/tasks/gulp/backend.js.map +1 -0
- package/dist/tasks/gulp/checks.d.ts +3 -0
- package/dist/tasks/gulp/checks.js +195 -0
- package/dist/tasks/gulp/checks.js.map +1 -0
- package/dist/tasks/gulp/clean.d.ts +3 -0
- package/dist/tasks/gulp/clean.js +33 -0
- package/dist/tasks/gulp/clean.js.map +1 -0
- package/dist/tasks/gulp/copy.d.ts +2 -0
- package/dist/tasks/gulp/copy.js +34 -0
- package/dist/tasks/gulp/copy.js.map +1 -0
- package/dist/tasks/gulp/helpers.d.ts +2 -0
- package/dist/tasks/gulp/helpers.js +21 -0
- package/dist/tasks/gulp/helpers.js.map +1 -0
- package/dist/tasks/gulp/pages.d.ts +2 -0
- package/dist/tasks/gulp/pages.js +39 -0
- package/dist/tasks/gulp/pages.js.map +1 -0
- package/dist/tasks/gulp/pipeline.d.ts +1 -0
- package/dist/tasks/gulp/pipeline.js +29 -0
- package/dist/tasks/gulp/pipeline.js.map +1 -0
- package/dist/tasks/gulp/public.d.ts +2 -0
- package/dist/tasks/gulp/public.js +50 -0
- package/dist/tasks/gulp/public.js.map +1 -0
- package/dist/tasks/gulp/styles.d.ts +2 -0
- package/dist/tasks/gulp/styles.js +40 -0
- package/dist/tasks/gulp/styles.js.map +1 -0
- package/dist/tasks/gulp/templates.d.ts +2 -0
- package/dist/tasks/gulp/templates.js +45 -0
- package/dist/tasks/gulp/templates.js.map +1 -0
- package/dist/tasks/gulp/types.d.ts +4 -0
- package/dist/tasks/gulp/types.js +300 -0
- package/dist/tasks/gulp/types.js.map +1 -0
- package/dist/tasks/gulp/watchers.d.ts +9 -0
- package/dist/tasks/gulp/watchers.js +57 -0
- package/dist/tasks/gulp/watchers.js.map +1 -0
- package/dist/tasks/index.d.ts +4 -0
- package/dist/tasks/index.js +25 -0
- package/dist/tasks/index.js.map +1 -0
- package/dist/tasks/sync.d.ts +2 -0
- package/dist/tasks/sync.js +88 -0
- package/dist/tasks/sync.js.map +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/install.js +1 -0
- package/dist/utils/logger.d.ts +17 -0
- package/dist/utils/logger.js +37 -0
- package/dist/utils/logger.js.map +1 -0
- package/files/templates/block[D]/files/.stylelintrc.js +8 -0
- package/files/templates/block[D]/lucy.json +8 -0
- package/files/templates/cargo[D]/files/.env +1 -0
- package/files/templates/cargo[D]/files/Cargo.toml +238 -0
- package/files/templates/cargo[D]/files/Makefile.toml +4 -0
- package/files/templates/cargo[D]/files/build/main.rs +35 -0
- package/files/templates/cargo[D]/files/config/beta.json +19 -0
- package/files/templates/cargo[D]/files/config/ci.json +15 -0
- package/files/templates/cargo[D]/files/config/default.json +71 -0
- package/files/templates/cargo[D]/files/config/development.json +10 -0
- package/files/templates/cargo[D]/files/config/produktion.json +5 -0
- package/files/templates/cargo[D]/files/config/stage.json +4 -0
- package/files/templates/cargo[D]/files/locales/todo.yml +3 -0
- package/files/templates/cargo[D]/files/public/index.html +1 -0
- package/files/templates/cargo[D]/lucy.json +14 -0
- package/files/templates/expo[D]/files/.stylelintrc.js +8 -0
- package/files/templates/expo[D]/lucy.json +81 -0
- package/files/templates/monorepo[D]/files/.nvmrc +1 -0
- package/files/templates/monorepo[D]/files/.prettierignore +23 -0
- package/files/templates/monorepo[D]/files/.prettierrc.json +15 -0
- package/files/templates/monorepo[D]/files/.stylelintrc.js +8 -0
- package/files/templates/monorepo[D]/files/.yarnrc +1 -0
- package/files/templates/monorepo[D]/files/.yarnrc.yml +3 -0
- package/files/templates/monorepo[D]/files/README.md +137 -0
- package/files/templates/monorepo[D]/files/currents.config.ts +5 -0
- package/files/templates/monorepo[D]/files/package.json +39 -0
- package/files/templates/monorepo[D]/files/turbo.json +34 -0
- package/files/templates/monorepo[D]/files/typedoc.json +25 -0
- package/files/templates/monorepo[D]/files/vitest.config.ts +27 -0
- package/files/templates/monorepo[D]/lucy.json +45 -0
- package/files/templates/tauri[D]/lucy.json +8 -0
- package/files/templates/velo[D]/files/.prettierignore +23 -0
- package/files/templates/velo[D]/files/.prettierrc.js +16 -0
- package/files/templates/velo[D]/files/typescript/__mocks__/.gitkeep +0 -0
- package/files/templates/velo[D]/files/typescript/backend/data.ts +0 -0
- package/files/templates/velo[D]/files/typescript/backend/events.ts +0 -0
- package/files/templates/velo[D]/files/typescript/pages/.gitkeep +0 -0
- package/files/templates/velo[D]/files/typescript/public/.gitkeep +0 -0
- package/files/templates/velo[D]/files/typescript/public/scss/app.scss +0 -0
- package/files/templates/velo[D]/files/typescript/styles/.gitkeep +0 -0
- package/files/templates/velo[D]/files/typescript/styles/global.scss +0 -0
- package/files/templates/velo[D]/lucy.json +136 -0
- package/old/Gulpfile.d.ts +34 -0
- package/old/Gulpfile.js +116 -0
- package/old/Gulpfile.js.map +1 -0
- package/old/gulp/backend.d.ts +3 -0
- package/old/gulp/backend.js +92 -0
- package/old/gulp/backend.js.map +1 -0
- package/old/gulp/checks.d.ts +3 -0
- package/old/gulp/checks.js +205 -0
- package/old/gulp/checks.js.map +1 -0
- package/old/gulp/clean.d.ts +3 -0
- package/old/gulp/clean.js +29 -0
- package/old/gulp/clean.js.map +1 -0
- package/old/gulp/copy.d.ts +2 -0
- package/old/gulp/copy.js +34 -0
- package/old/gulp/copy.js.map +1 -0
- package/old/gulp/helpers.d.ts +2 -0
- package/old/gulp/helpers.js +25 -0
- package/old/gulp/helpers.js.map +1 -0
- package/old/gulp/pages.d.ts +2 -0
- package/old/gulp/pages.js +37 -0
- package/old/gulp/pages.js.map +1 -0
- package/old/gulp/pipeline.d.ts +1 -0
- package/old/gulp/pipeline.js +29 -0
- package/old/gulp/pipeline.js.map +1 -0
- package/old/gulp/public.d.ts +2 -0
- package/old/gulp/public.js +50 -0
- package/old/gulp/public.js.map +1 -0
- package/old/gulp/styles.d.ts +2 -0
- package/old/gulp/styles.js +40 -0
- package/old/gulp/styles.js.map +1 -0
- package/old/gulp/templates.d.ts +2 -0
- package/old/gulp/templates.js +33 -0
- package/old/gulp/templates.js.map +1 -0
- package/old/gulp/types.d.ts +4 -0
- package/old/gulp/types.js +289 -0
- package/old/gulp/types.js.map +1 -0
- package/old/gulp/watchers.d.ts +9 -0
- package/old/gulp/watchers.js +59 -0
- package/old/gulp/watchers.js.map +1 -0
- package/old/helpers.d.ts +32 -0
- package/old/helpers.js +267 -0
- package/old/helpers.js.map +1 -0
- package/{src copy/helpers.ts → old/helpers.ts} +1 -1
- package/old/index.d.ts +59 -0
- package/old/index.js +288 -0
- package/old/index.js.map +1 -0
- package/old/init.d.ts +8 -0
- package/old/init.js +165 -0
- package/old/init.js.map +1 -0
- package/old/models.d.ts +37 -0
- package/old/models.js +2 -0
- package/old/models.js.map +1 -0
- package/old/prepare.d.ts +8 -0
- package/old/prepare.js +20 -0
- package/old/prepare.js.map +1 -0
- package/old/schemas/index.d.ts +0 -0
- package/old/schemas/index.js +2 -0
- package/old/schemas/index.js.map +1 -0
- package/old/schemas/index.ts +0 -0
- package/old/schemas/types.d.ts +0 -0
- package/old/schemas/types.js +2 -0
- package/old/schemas/types.js.map +1 -0
- package/old/schemas/types.ts +0 -0
- package/old/sync.d.ts +2 -0
- package/old/sync.js +88 -0
- package/old/sync.js.map +1 -0
- package/package.json +3 -6
- package/src/args.ts +18 -17
- package/src/commands/checks.ts +51 -0
- package/src/commands/cleanup.ts +11 -0
- package/src/commands/copy.ts +16 -0
- package/src/commands/edit.ts +83 -0
- package/src/commands/exec.ts +37 -0
- package/src/commands/git.ts +113 -0
- package/src/commands/home.ts +22 -0
- package/src/commands/install.ts +186 -0
- package/src/commands/read.ts +37 -0
- package/src/commands/write.ts +24 -0
- package/src/config.ts +50 -10
- package/src/error.ts +1 -2
- package/src/index.ts +45 -9
- package/src/init/blocks.ts +82 -0
- package/src/init/cargo.ts +22 -0
- package/src/init/expo.ts +66 -0
- package/src/init/gitModules.ts +15 -0
- package/src/init/index.ts +69 -0
- package/src/init/monorepo.ts +39 -0
- package/src/init/prepareVelo.ts +19 -0
- package/src/init/tauri.ts +40 -0
- package/src/init/templates.ts +99 -0
- package/src/init/velo.ts +62 -0
- package/src/runtime.ts +1 -0
- package/src/schemas/gulp.ts +23 -0
- package/src/schemas/lucy.ts +39 -0
- package/src/schemas/types.ts +20 -0
- package/src/sync/index.ts +0 -0
- package/src/sync/sync.ts +96 -0
- package/src/tasks/Gulpfile.ts +252 -0
- package/src/tasks/gulp/backend.ts +112 -0
- package/src/tasks/gulp/checks.ts +214 -0
- package/src/tasks/gulp/clean.ts +38 -0
- package/src/tasks/gulp/copy.ts +43 -0
- package/src/tasks/gulp/helpers.ts +25 -0
- package/src/tasks/gulp/pages.ts +43 -0
- package/src/tasks/gulp/pipeline.ts +32 -0
- package/src/tasks/gulp/public.ts +60 -0
- package/src/tasks/gulp/styles.ts +46 -0
- package/src/tasks/gulp/templates.ts +53 -0
- package/src/tasks/gulp/types.ts +317 -0
- package/src/tasks/gulp/watchers.ts +100 -0
- package/src/tasks/index.ts +32 -0
- package/src/types.d.ts +1 -1
- package/src/utils/index.ts +0 -0
- package/src/utils/logger.ts +40 -0
- package/tsconfig.json +6 -5
- package/files/expo/lucy.json +0 -8
- package/src/init.ts +0 -392
- /package/{files/expo/components/.gitkeep → .turbo/cookies/1.cookie} +0 -0
- /package/{files/expo/components/ui/.gitkeep → .turbo/cookies/2.cookie} +0 -0
- /package/{files/velo/.gitmodules → .turbo/cookies/3.cookie} +0 -0
- /package/{files/velo/typescript/__mocks__/.gitkeep → .turbo/cookies/4.cookie} +0 -0
- /package/{files/velo/typescript/backend/data.ts → .turbo/cookies/5.cookie} +0 -0
- /package/{files/velo/typescript/backend/events.ts → .turbo/daemon/ee24a4f4ab6aa3c0-turbo.log.2025-07-31} +0 -0
- /package/{files/velo/typescript/pages/.gitkeep → dist/sync/index.d.ts} +0 -0
- /package/{files/velo/typescript/public/.gitkeep → dist/sync/sync.d.ts} +0 -0
- /package/{files/velo/typescript/public/scss/app.scss → dist/utils/index.d.ts} +0 -0
- /package/{files/velo/typescript/styles/.gitkeep → dist/utils/install.d.ts} +0 -0
- /package/files/{expo → templates/expo[D]/files}/.nvmrc +0 -0
- /package/files/{expo → templates/expo[D]/files}/.prettierignore +0 -0
- /package/files/{expo → templates/expo[D]/files}/.prettierrc.js +0 -0
- /package/files/{expo → templates/expo[D]/files}/.yarnrc +0 -0
- /package/files/{expo → templates/expo[D]/files}/.yarnrc.yml +0 -0
- /package/files/{expo → templates/expo[D]/files}/README.md +0 -0
- /package/files/{expo → templates/expo[D]/files}/assets/fonts/SpaceMono-Regular.ttf +0 -0
- /package/files/{expo → templates/expo[D]/files}/assets/images/adaptive-icon.png +0 -0
- /package/files/{expo → templates/expo[D]/files}/assets/images/favicon.png +0 -0
- /package/files/{expo → templates/expo[D]/files}/assets/images/icon.png +0 -0
- /package/files/{expo → templates/expo[D]/files}/assets/images/splash-icon.png +0 -0
- /package/files/{expo → templates/expo[D]/files}/babel.config.js +0 -0
- /package/files/{velo/typescript/styles/global.scss → templates/expo[D]/files/components/.gitkeep} +0 -0
- /package/{src copy/schemas/index.ts → files/templates/expo[D]/files/components/ui/.gitkeep} +0 -0
- /package/files/{expo → templates/expo[D]/files}/constants/theme.ts +0 -0
- /package/files/{expo → templates/expo[D]/files}/eas.json +0 -0
- /package/files/{expo → templates/expo[D]/files}/eslint.config.mjs +0 -0
- /package/files/{expo → templates/expo[D]/files}/global.css +0 -0
- /package/files/{expo → templates/expo[D]/files}/hooks/useColorScheme.ts +0 -0
- /package/files/{expo → templates/expo[D]/files}/index.ts +0 -0
- /package/files/{expo → templates/expo[D]/files}/lib/data.ts +0 -0
- /package/files/{expo → templates/expo[D]/files}/lib/utils/index.ts +0 -0
- /package/files/{expo → templates/expo[D]/files}/lib/utils/polyfills.ts +0 -0
- /package/files/{expo → templates/expo[D]/files}/lib/wix/client.ts +0 -0
- /package/files/{expo → templates/expo[D]/files}/lib/wix/error.ts +0 -0
- /package/files/{expo → templates/expo[D]/files}/lib/wix/index.ts +0 -0
- /package/files/{expo → templates/expo[D]/files}/metro.config.js +0 -0
- /package/files/{expo → templates/expo[D]/files}/nativewind-env.d.ts +0 -0
- /package/files/{expo → templates/expo[D]/files}/scripts/reset-project.ts +0 -0
- /package/files/{expo → templates/expo[D]/files}/tailwind.config.js +0 -0
- /package/files/{expo → templates/expo[D]/files}/tsconfig.json +0 -0
- /package/files/{expo → templates/expo[D]/files}/types/reset.d.ts +0 -0
- /package/{src copy/schemas/types.ts → files/templates/velo[D]/files/.gitmodules} +0 -0
- /package/files/{velo → templates/velo[D]/files}/.madgerc +0 -0
- /package/files/{velo → templates/velo[D]/files}/.nvmrc +0 -0
- /package/files/{velo → templates/velo[D]/files}/.stylelintrc.js +0 -0
- /package/files/{velo → templates/velo[D]/files}/.yarnrc.yml +0 -0
- /package/files/{velo → templates/velo[D]/files}/currents.config.js +0 -0
- /package/files/{velo → templates/velo[D]/files}/cypress/e2e/base/base.cy.ts +0 -0
- /package/files/{velo → templates/velo[D]/files}/cypress/fixtures/example.json +0 -0
- /package/files/{velo → templates/velo[D]/files}/cypress/support/commands.ts +0 -0
- /package/files/{velo → templates/velo[D]/files}/cypress/support/e2e.ts +0 -0
- /package/files/{velo → templates/velo[D]/files}/cypress/tsconfig.json +0 -0
- /package/files/{velo → templates/velo[D]/files}/cypress.config.mjs +0 -0
- /package/files/{velo → templates/velo[D]/files}/eslint.config.mjs +0 -0
- /package/files/{velo → templates/velo[D]/files}/local.tsconfig.json +0 -0
- /package/files/{velo → templates/velo[D]/files}/typedoc.json +0 -0
- /package/files/{velo → templates/velo[D]/files}/typescript/backend/http-functions.ts +0 -0
- /package/files/{velo → templates/velo[D]/files}/typescript/backend/lib/http-functions/sync.ts +0 -0
- /package/files/{velo → templates/velo[D]/files}/typescript/backend/permissions.json +0 -0
- /package/files/{velo → templates/velo[D]/files}/typescript/tsconfig.json +0 -0
- /package/files/{velo → templates/velo[D]/files}/vitest.config.ts +0 -0
- /package/{src copy → old}/Gulpfile.ts +0 -0
- /package/{src copy → old}/gulp/backend.ts +0 -0
- /package/{src copy → old}/gulp/checks.ts +0 -0
- /package/{src copy → old}/gulp/clean.ts +0 -0
- /package/{src copy → old}/gulp/copy.ts +0 -0
- /package/{src copy → old}/gulp/helpers.ts +0 -0
- /package/{src copy → old}/gulp/pages.ts +0 -0
- /package/{src copy → old}/gulp/pipeline.ts +0 -0
- /package/{src copy → old}/gulp/public.ts +0 -0
- /package/{src copy → old}/gulp/styles.ts +0 -0
- /package/{src copy → old}/gulp/templates.ts +0 -0
- /package/{src copy → old}/gulp/types.ts +0 -0
- /package/{src copy → old}/gulp/watchers.ts +0 -0
- /package/{src copy → old}/index.ts +0 -0
- /package/{src copy → old}/init.ts +0 -0
- /package/{src copy → old}/models.ts +0 -0
- /package/{src copy → old}/prepare.ts +0 -0
- /package/{src copy → old}/settings.json +0 -0
- /package/{src copy → old}/sync.ts +0 -0
- /package/{src copy → old}/types.d.ts +0 -0
- /package/src/{models.ts → schemas/tsconfig.ts} +0 -0
package/src/index.ts
CHANGED
@@ -5,32 +5,68 @@ import { get_args } from "./args.js";
|
|
5
5
|
import 'dotenv/config'
|
6
6
|
import { Config } from "./config.js";
|
7
7
|
import { ServiceInspectState } from "./states.js";
|
8
|
-
import { init } from "./init.js";
|
9
|
-
|
8
|
+
import { init } from "./init/index.js";
|
9
|
+
import { logger } from "./utils/logger.js";
|
10
|
+
import { AppError } from "./error.js";
|
11
|
+
import { open } from "./commands/exec.js";
|
12
|
+
import { runTask } from "./tasks/Gulpfile.js";
|
13
|
+
import { tasks } from "./tasks/index.js";
|
10
14
|
|
11
15
|
const lucyCLI = pipe(
|
12
16
|
Effect.gen(function* (_) {
|
13
17
|
const config = yield* Config;
|
18
|
+
const t = Config;
|
14
19
|
config.config.action.type;
|
15
|
-
if (config.config.action.type === undefined) {
|
16
|
-
return yield* Effect.fail("No Params Provided");
|
17
|
-
}
|
18
20
|
if (config.config.action.action === 'init') {
|
19
21
|
return yield* init();
|
20
22
|
}
|
21
|
-
|
23
|
+
if (config.config.action.action === 'open') {
|
24
|
+
return yield* open;
|
25
|
+
}
|
26
|
+
if (config.config.action.action === 'task') {
|
27
|
+
return yield* tasks();
|
28
|
+
}
|
22
29
|
|
23
30
|
}),
|
31
|
+
).pipe(
|
32
|
+
Effect.catchTags({
|
33
|
+
BadArgument: (error) => {
|
34
|
+
logger.error(JSON.stringify(error, null, 2));
|
35
|
+
return Effect.fail(new Error(error.message));
|
36
|
+
},
|
37
|
+
ParseError: (error) => {
|
38
|
+
logger.error("Failed to parse:", JSON.stringify(error, null, 2));
|
39
|
+
return Effect.fail(new Error("Failed to parse: " + error.message));
|
40
|
+
},
|
41
|
+
SystemError: (error) => {
|
42
|
+
logger.error("System error:", JSON.stringify(error, null, 2));
|
43
|
+
return Effect.fail(new Error("System error: " + error.message));
|
44
|
+
},
|
45
|
+
AppError: (error) => {
|
46
|
+
logger.error("Application error:", JSON.stringify(error, null, 2));
|
47
|
+
return Effect.fail(new Error("Application error: " + error.message));
|
48
|
+
}
|
49
|
+
})
|
24
50
|
)
|
25
51
|
|
26
52
|
async function main() {
|
27
53
|
const args = await get_args();
|
28
54
|
const runtime= build_runtime(args);
|
29
55
|
// The runtime will handle logging failures. This will catch unhandled defects.
|
30
|
-
|
56
|
+
const program = Effect.orDieWith(
|
57
|
+
lucyCLI,
|
58
|
+
(error) => new Error(`The application failed to run: ${error}`
|
59
|
+
)
|
60
|
+
)
|
61
|
+
await runtime.runPromise(program)
|
31
62
|
}
|
32
63
|
|
33
|
-
main().
|
34
|
-
|
64
|
+
main().then(() => {
|
65
|
+
process.exit(0);
|
66
|
+
}).catch((error) => {
|
67
|
+
if (error instanceof Error) {
|
68
|
+
logger.error(error.message);
|
69
|
+
console.debug(JSON.stringify(error, null, 2));
|
70
|
+
}
|
35
71
|
process.exit(1);
|
36
72
|
});
|
@@ -0,0 +1,82 @@
|
|
1
|
+
import { Effect, Schema } from "effect/index"
|
2
|
+
import { Config } from "../config.js";
|
3
|
+
import { Command, FileSystem, Path } from "@effect/platform"
|
4
|
+
import { JsonSchema } from "../schemas/index.js";
|
5
|
+
import { logger } from "../utils/logger.js";
|
6
|
+
import { mergeAdditions, mergeLucySettings2PackageJson, setInitialized } from "../commands/edit.js";
|
7
|
+
import { writeLucySettings, writePackageJson } from "../commands/write.js";
|
8
|
+
import { copyTemplateFiles } from "../commands/copy.js";
|
9
|
+
import { readPackageJson } from "../commands/read.js";
|
10
|
+
import { execCommand } from "../commands/exec.js";
|
11
|
+
import { installPackages } from "../commands/install.js";
|
12
|
+
import { AppError } from "../error.js";
|
13
|
+
import { cleanup } from "../commands/cleanup.js";
|
14
|
+
import { checkForDirty } from "../commands/checks.js";
|
15
|
+
|
16
|
+
export const init_blocks = () => {
|
17
|
+
return Effect.gen(function*() {
|
18
|
+
const config = yield* Config;
|
19
|
+
const fs = yield* FileSystem.FileSystem;
|
20
|
+
const path = yield* Path.Path;
|
21
|
+
|
22
|
+
logger.action("Initializing Blocks project...");
|
23
|
+
|
24
|
+
const configJsonRaw = yield* fs.readFile("wix.config.json").pipe(Effect.catchAll((error) => {
|
25
|
+
return Effect.succeed('{}');
|
26
|
+
}))
|
27
|
+
const configJson = Schema.decodeUnknownSync(JsonSchema)(configJsonRaw.toString()) as any;
|
28
|
+
const blocksAppReady = configJson.appId ? true : false;
|
29
|
+
|
30
|
+
yield* checkForDirty();
|
31
|
+
|
32
|
+
if(!blocksAppReady) {
|
33
|
+
const initBlocks = Command.make("npm", "create", "@wix/app@latest", config.config.projectName).pipe(
|
34
|
+
Command.stdin("inherit"),
|
35
|
+
Command.stdout("inherit"),
|
36
|
+
Command.stderr("inherit"),
|
37
|
+
Command.exitCode
|
38
|
+
)
|
39
|
+
if((yield* initBlocks) !== 0) {
|
40
|
+
yield* Effect.fail(new AppError({ message: "Failed to initialize Blocks project. Please check the error message above.", cause: new Error("Failed to initialize Blocks project") }));
|
41
|
+
}
|
42
|
+
const files = yield * fs.readDirectory(config.config.cwd, { recursive: false });
|
43
|
+
|
44
|
+
const allExcludes = ['.git', 'lucy.json'];
|
45
|
+
const filteredFiles = files.filter(file => !allExcludes.includes(file));
|
46
|
+
|
47
|
+
const t = yield* fs.stat(filteredFiles[0]);
|
48
|
+
t.type === 'Directory'
|
49
|
+
|
50
|
+
const directories = yield* Effect.filter(
|
51
|
+
filteredFiles,
|
52
|
+
(file) => Effect.gen(function*() {
|
53
|
+
const fullPath = path.join(config.config.cwd, file);
|
54
|
+
const stat = yield* fs.stat(fullPath);
|
55
|
+
return stat.type === "Directory";
|
56
|
+
})
|
57
|
+
);
|
58
|
+
const tempPath = directories[0];
|
59
|
+
|
60
|
+
const projectFiles = yield* fs.readDirectory(directories[0])
|
61
|
+
yield* Effect.forEach(
|
62
|
+
projectFiles.filter(file => file !== '.git'),
|
63
|
+
(file) => fs.copy(path.join(tempPath, file), path.join(config.config.cwd, file), { overwrite: true }),
|
64
|
+
{ discard: true }
|
65
|
+
)
|
66
|
+
yield* fs.remove(tempPath, { recursive: true })
|
67
|
+
}
|
68
|
+
|
69
|
+
yield* readPackageJson;
|
70
|
+
yield* mergeLucySettings2PackageJson;
|
71
|
+
yield* mergeAdditions;
|
72
|
+
yield* writeLucySettings;
|
73
|
+
yield* writePackageJson;
|
74
|
+
yield* copyTemplateFiles;
|
75
|
+
yield* execCommand;
|
76
|
+
yield* installPackages;
|
77
|
+
yield* cleanup;
|
78
|
+
yield* setInitialized;
|
79
|
+
|
80
|
+
logger.success("Blocks project initialized successfully!");
|
81
|
+
})
|
82
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { Effect } from "effect/index"
|
2
|
+
import { logger } from "../utils/logger.js";
|
3
|
+
import { writeLucySettings } from "../commands/write.js";
|
4
|
+
import { copyTemplateFiles } from "../commands/copy.js";
|
5
|
+
import { gitInit } from "../commands/git.js";
|
6
|
+
import { checkForDirty } from "../commands/checks.js";
|
7
|
+
import { setInitialized } from "../commands/edit.js";
|
8
|
+
|
9
|
+
export const init_cargo = () => {
|
10
|
+
return Effect.gen(function*() {
|
11
|
+
logger.action("Initializing Cargo project...");
|
12
|
+
|
13
|
+
yield* checkForDirty();
|
14
|
+
|
15
|
+
yield* copyTemplateFiles;
|
16
|
+
yield* writeLucySettings;
|
17
|
+
yield* gitInit();
|
18
|
+
yield* setInitialized;
|
19
|
+
|
20
|
+
logger.success("Cargo project initialized successfully!");
|
21
|
+
})
|
22
|
+
}
|
package/src/init/expo.ts
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
import { Effect, Schema } from "effect/index"
|
2
|
+
import { Config } from "../config.js";
|
3
|
+
import { Command, FileSystem, Path } from "@effect/platform"
|
4
|
+
import { JsonSchema } from "../schemas/index.js";
|
5
|
+
import { logger } from "../utils/logger.js";
|
6
|
+
import { mergeAdditions, mergeLucySettings2PackageJson, setInitialized } from "../commands/edit.js";
|
7
|
+
import { writeLucySettings, writePackageJson } from "../commands/write.js";
|
8
|
+
import { copyTemplateFiles } from "../commands/copy.js";
|
9
|
+
import { readPackageJson } from "../commands/read.js";
|
10
|
+
import { execCommand } from "../commands/exec.js";
|
11
|
+
import { installPackages } from "../commands/install.js";
|
12
|
+
import { AppError } from "../error.js";
|
13
|
+
import { cleanup } from "../commands/cleanup.js";
|
14
|
+
import { checkForDirty } from "../commands/checks.js";
|
15
|
+
|
16
|
+
export const init_expo = () => {
|
17
|
+
return Effect.gen(function*() {
|
18
|
+
const config = yield* Config;
|
19
|
+
const fs = yield* FileSystem.FileSystem;
|
20
|
+
const path = yield* Path.Path;
|
21
|
+
|
22
|
+
logger.action("Initializing Expo project...");
|
23
|
+
|
24
|
+
const appJsonRaw = yield* fs.readFile("app.json").pipe(Effect.catchAll((error) => {
|
25
|
+
return Effect.succeed('{}');
|
26
|
+
}))
|
27
|
+
const appJSON = Schema.decodeUnknownSync(JsonSchema)(appJsonRaw.toString()) as any;
|
28
|
+
const expoAppReady = appJSON.expo ? true : false;
|
29
|
+
|
30
|
+
yield* checkForDirty();
|
31
|
+
|
32
|
+
if(!expoAppReady) {
|
33
|
+
const initExpo = Command.make("npx", "create-expo-app@latest", config.config.projectName, "--template", "blank-typescript", "--no-install").pipe(
|
34
|
+
Command.stdout("inherit"),
|
35
|
+
Command.exitCode
|
36
|
+
)
|
37
|
+
if((yield* initExpo) !== 0) {
|
38
|
+
yield* Effect.fail(new AppError({ message: "Failed to initialize Expo project. Please check the error message above.", cause: new Error("Failed to initialize Expo project") }));
|
39
|
+
}
|
40
|
+
|
41
|
+
const tempPath = path.join(config.config.cwd, config.config.projectName)
|
42
|
+
|
43
|
+
const projectFiles = yield* fs.readDirectory(tempPath)
|
44
|
+
yield* Effect.forEach(
|
45
|
+
projectFiles.filter(file => file !== '.git'),
|
46
|
+
(file) => fs.copy(path.join(tempPath, file), path.join(config.config.cwd, file), { overwrite: true }),
|
47
|
+
{ discard: true }
|
48
|
+
)
|
49
|
+
yield* fs.remove(tempPath, { recursive: true })
|
50
|
+
}
|
51
|
+
|
52
|
+
yield* readPackageJson;
|
53
|
+
yield* mergeLucySettings2PackageJson;
|
54
|
+
yield* mergeAdditions;
|
55
|
+
yield* writeLucySettings;
|
56
|
+
yield* writePackageJson;
|
57
|
+
yield* copyTemplateFiles;
|
58
|
+
yield* execCommand;
|
59
|
+
yield* installPackages;
|
60
|
+
yield* cleanup;
|
61
|
+
yield* setInitialized;
|
62
|
+
|
63
|
+
logger.success("Expo project initialized successfully!");
|
64
|
+
|
65
|
+
})
|
66
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { Effect } from "effect/index"
|
2
|
+
import { logger } from "../utils/logger.js";
|
3
|
+
import { setInitialized } from "../commands/edit.js";
|
4
|
+
import { gitInit } from "../commands/git.js";
|
5
|
+
|
6
|
+
export const init_submodules = () => {
|
7
|
+
return Effect.gen(function*() {
|
8
|
+
logger.action("Initializing Git submodules project...");
|
9
|
+
|
10
|
+
yield* gitInit(true);
|
11
|
+
yield* setInitialized;
|
12
|
+
|
13
|
+
logger.success("GIT initialized successfully!");
|
14
|
+
})
|
15
|
+
}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import { Effect, Schema } from "effect/index"
|
2
|
+
import { Config } from "../config.js";
|
3
|
+
import { init_expo } from "./expo.js";
|
4
|
+
import { selectTemplate } from "./templates.js";
|
5
|
+
import Enquirer from "enquirer";
|
6
|
+
import { AppError } from "../error.js";
|
7
|
+
import { createLucyHome } from "../commands/home.js";
|
8
|
+
import { readLucyJsonFromTemplate } from "../commands/read.js";
|
9
|
+
import { init_monorepo } from "./monorepo.js";
|
10
|
+
import { init_cargo } from "./cargo.js";
|
11
|
+
import { init_blocks } from "./blocks.js";
|
12
|
+
import { init_velo } from "./velo.js";
|
13
|
+
import { init_submodules } from "./gitModules.js";
|
14
|
+
import { init_tauri } from "./tauri.js";
|
15
|
+
|
16
|
+
|
17
|
+
export const init = () => {
|
18
|
+
return Effect.gen(function* (_) {
|
19
|
+
const config = yield* Config;
|
20
|
+
if(config.config.action.type === undefined) {
|
21
|
+
return yield* Effect.fail(new AppError({ message: "No action type provided", cause: new Error("No action type provided") }));
|
22
|
+
}
|
23
|
+
yield* createLucyHome();
|
24
|
+
const projectName = config.config.cwd.split('/').pop() || 'expo-project';
|
25
|
+
|
26
|
+
const templateQuestion = new Enquirer();
|
27
|
+
const choice = yield* Effect.tryPromise({
|
28
|
+
try: () => templateQuestion.prompt({
|
29
|
+
type: 'input',
|
30
|
+
name: 'projectName',
|
31
|
+
message: 'Enter a project name',
|
32
|
+
initial: projectName,
|
33
|
+
validate: (value: string) => value.trim() !== '' ? true : 'Project name cannot be empty'
|
34
|
+
}),
|
35
|
+
catch: (e) => {
|
36
|
+
return new AppError({ cause: e, message: 'Error selecting template' });
|
37
|
+
}
|
38
|
+
})
|
39
|
+
const selectedName = yield* Schema.decodeUnknown(Schema.Struct({ projectName: Schema.String }))(choice)
|
40
|
+
config.config.projectName = selectedName.projectName.trim();
|
41
|
+
|
42
|
+
yield* selectTemplate();
|
43
|
+
yield* readLucyJsonFromTemplate;
|
44
|
+
|
45
|
+
if(config.config.action.type === 'expo') {
|
46
|
+
return yield* init_expo();
|
47
|
+
}
|
48
|
+
if(config.config.action.type === 'monorepo') {
|
49
|
+
return yield* init_monorepo();
|
50
|
+
}
|
51
|
+
if(config.config.action.type === 'cargo') {
|
52
|
+
return yield* init_cargo();
|
53
|
+
}
|
54
|
+
if(config.config.action.type === 'blocks') {
|
55
|
+
return yield* init_blocks();
|
56
|
+
}
|
57
|
+
if(config.config.action.type === 'tauri') {
|
58
|
+
return yield* init_tauri();
|
59
|
+
}
|
60
|
+
if(config.config.action.type === 'velo') {
|
61
|
+
return yield* init_velo();
|
62
|
+
}
|
63
|
+
if(config.config.action.type === 'submodules') {
|
64
|
+
return yield* init_submodules();
|
65
|
+
}
|
66
|
+
|
67
|
+
yield* Effect.fail(new AppError({ message: `Unsupported action type: ${config.config.action.type}`, cause: new Error(`Unsupported action type: ${config.config.action.type}`) }));
|
68
|
+
})
|
69
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { Effect, Schema } from "effect/index"
|
2
|
+
import { Config } from "../config.js";
|
3
|
+
import { FileSystem, Path } from "@effect/platform"
|
4
|
+
import { logger } from "../utils/logger.js";
|
5
|
+
import { mergeAdditions, mergeLucySettings2PackageJson, setInitialized, setProjectName, stringReplace } from "../commands/edit.js";
|
6
|
+
import { writeLucySettings, writePackageJson } from "../commands/write.js";
|
7
|
+
import { copyTemplateFiles } from "../commands/copy.js";
|
8
|
+
import { readPackageJson } from "../commands/read.js";
|
9
|
+
import { runYarn, yarnSetVersion } from "../commands/install.js";
|
10
|
+
import { cleanup } from "../commands/cleanup.js";
|
11
|
+
import { gitInit } from "../commands/git.js";
|
12
|
+
import { checkForDirty } from "../commands/checks.js";
|
13
|
+
|
14
|
+
export const init_monorepo = () => {
|
15
|
+
return Effect.gen(function*() {
|
16
|
+
const config = yield* Config;
|
17
|
+
const path = yield* Path.Path;
|
18
|
+
|
19
|
+
logger.action("Initializing monorepo...");
|
20
|
+
|
21
|
+
yield* checkForDirty();
|
22
|
+
|
23
|
+
yield* copyTemplateFiles;
|
24
|
+
yield* stringReplace(path.join(config.config.cwd, 'currents.config.ts'), ['__ProjectName__'], [config.config.projectName]);
|
25
|
+
yield* readPackageJson;
|
26
|
+
yield* setProjectName;
|
27
|
+
yield* mergeLucySettings2PackageJson;
|
28
|
+
yield* mergeAdditions;
|
29
|
+
yield* writeLucySettings;
|
30
|
+
yield* writePackageJson;
|
31
|
+
yield* gitInit();
|
32
|
+
yield* yarnSetVersion;
|
33
|
+
yield* runYarn;
|
34
|
+
yield* cleanup;
|
35
|
+
yield* setInitialized;
|
36
|
+
|
37
|
+
logger.success("Monorepo initialized successfully!");
|
38
|
+
})
|
39
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { Effect } from 'effect/index';
|
2
|
+
import { logger } from '../utils/logger.js';
|
3
|
+
import { checkForVelo } from '../commands/checks.js';
|
4
|
+
import { gitInit } from '../commands/git.js';
|
5
|
+
import { installVeloPackages, yarnSetVersion } from '../commands/install.js';
|
6
|
+
import { setInitialized } from '../commands/edit.js';
|
7
|
+
|
8
|
+
export const prepareVelo = Effect.gen(function*() {
|
9
|
+
logger.action("Initializing Tauri project...");
|
10
|
+
yield* checkForVelo();
|
11
|
+
|
12
|
+
yield* gitInit(true);
|
13
|
+
yield* yarnSetVersion;
|
14
|
+
yield* installVeloPackages
|
15
|
+
yield* setInitialized;
|
16
|
+
|
17
|
+
logger.success("Velo Prepared initialized successfully!");
|
18
|
+
|
19
|
+
})
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { Effect, Schema } from "effect/index"
|
2
|
+
import { logger } from "../utils/logger.js";
|
3
|
+
import { writeLucySettings } from "../commands/write.js";
|
4
|
+
import { copyTemplateFiles } from "../commands/copy.js";
|
5
|
+
import { gitInit } from "../commands/git.js";
|
6
|
+
import { checkForDirty } from "../commands/checks.js";
|
7
|
+
import { setInitialized } from "../commands/edit.js";
|
8
|
+
import { Config } from "../config.js";
|
9
|
+
import { Command, FileSystem, Path } from "@effect/platform"
|
10
|
+
import { JsonSchema } from "../schemas/index.js";
|
11
|
+
import { AppError } from "../error.js";
|
12
|
+
import { installPackages } from "../commands/install.js";
|
13
|
+
import { Terminal } from "@effect/platform"
|
14
|
+
|
15
|
+
export const init_tauri = () => {
|
16
|
+
return Effect.gen(function*() {
|
17
|
+
const config = yield* Config;
|
18
|
+
logger.action("Initializing Tauri project...");
|
19
|
+
|
20
|
+
yield* checkForDirty();
|
21
|
+
|
22
|
+
const initTauri = Command.make("yarn", "create", "tauri-app", config.config.projectName).pipe(
|
23
|
+
Command.stdin("inherit"),
|
24
|
+
Command.stdout("inherit"),
|
25
|
+
Command.stderr("inherit"),
|
26
|
+
Command.runInShell(true),
|
27
|
+
Command.exitCode
|
28
|
+
)
|
29
|
+
if((yield* initTauri) !== 0) {
|
30
|
+
yield* Effect.fail(new AppError({ message: "Failed to initialize Tauri project. Please check the error message above.", cause: new Error("Failed to initialize Tauri project") }));
|
31
|
+
}
|
32
|
+
yield* copyTemplateFiles;
|
33
|
+
yield* installPackages;
|
34
|
+
yield* writeLucySettings;
|
35
|
+
yield* gitInit();
|
36
|
+
yield* setInitialized;
|
37
|
+
|
38
|
+
logger.success("Tauri project initialized successfully!");
|
39
|
+
})
|
40
|
+
}
|
@@ -0,0 +1,99 @@
|
|
1
|
+
import { Effect, Schema } from "effect/index";
|
2
|
+
import { Config } from "../config.js";
|
3
|
+
import { orange, red, green, logger } from "../utils/logger.js";
|
4
|
+
import { FileSystem } from "@effect/platform"
|
5
|
+
import path, { join } from 'path';
|
6
|
+
import fsp from 'fs/promises';
|
7
|
+
import Enquirer from 'enquirer';
|
8
|
+
import { AppError } from "../error.js";
|
9
|
+
import { lucySettings } from "../schemas/lucy.js";
|
10
|
+
import { JsonSchema } from "../schemas/index.js";
|
11
|
+
|
12
|
+
export const selectTemplate = () => {
|
13
|
+
return Effect.gen(function*() {
|
14
|
+
const config = yield* Config
|
15
|
+
const fs = yield* FileSystem.FileSystem;
|
16
|
+
const templatesPath = join(config.config.lucyHome, 'templates');
|
17
|
+
const files = yield* Effect.tryPromise({
|
18
|
+
try: () => fsp.readdir(templatesPath, { withFileTypes: true }),
|
19
|
+
catch: (e) => {
|
20
|
+
console.log((`💩 ${red.underline.bold("=> Templates folder not found at =>")} ${orange(templatesPath)}`));
|
21
|
+
return new AppError({ cause: e, message: 'Templates folder not found' });
|
22
|
+
}
|
23
|
+
})
|
24
|
+
|
25
|
+
const templateChoices: string[] = [];
|
26
|
+
for (const dirent of files) {
|
27
|
+
if (dirent.isDirectory()) {
|
28
|
+
const lucyJsonPath = join(templatesPath, dirent.name, 'lucy.json');
|
29
|
+
const lucyRaw = yield* fs.readFileString(lucyJsonPath, 'utf-8');
|
30
|
+
const lucySettingsJSON = yield* Schema.decodeUnknown(JsonSchema)(lucyRaw);
|
31
|
+
const lucySetting = yield* Schema.decodeUnknown(lucySettings)(lucySettingsJSON)
|
32
|
+
if (lucySetting.type === config.config.action.type) {
|
33
|
+
templateChoices.push(dirent.name);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
if (templateChoices.length === 0) {
|
39
|
+
console.log((`💩 ${red.underline.bold("=> No templates found in =>")} ${orange(templatesPath)}`));
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
|
43
|
+
const templateQuestion = new Enquirer();
|
44
|
+
const choice = yield* Effect.tryPromise({
|
45
|
+
try: () => templateQuestion.prompt({
|
46
|
+
type: 'select',
|
47
|
+
name: 'template',
|
48
|
+
message: 'Select a project template',
|
49
|
+
choices: templateChoices
|
50
|
+
}),
|
51
|
+
catch: (e) => {
|
52
|
+
return new AppError({ cause: e, message: 'Error selecting template' });
|
53
|
+
}
|
54
|
+
})
|
55
|
+
|
56
|
+
const selectedTemplate = yield* Schema.decodeUnknown(Schema.Struct({ template: Schema.String }))(choice)
|
57
|
+
const templateDir = join(templatesPath, selectedTemplate.template );
|
58
|
+
const templateFilesDir = join(templateDir, 'files');
|
59
|
+
config.config.templateDir = templateDir;
|
60
|
+
config.config.templateFiles = templateFilesDir;
|
61
|
+
|
62
|
+
const templateSettingsPath = join(templateDir, 'lucy.json');
|
63
|
+
|
64
|
+
if (!(yield* fs.exists(templateSettingsPath))) {
|
65
|
+
logger.warning((`💩 ${red.underline.bold("=> Template is missing lucy.json at =>")} ${orange(templateSettingsPath)}`));
|
66
|
+
yield* Effect.fail(new AppError({ message: 'Template is missing lucy.json', cause: templateSettingsPath }));
|
67
|
+
}
|
68
|
+
const lucySettingsRaw = yield* fs.readFileString(templateSettingsPath, 'utf-8');
|
69
|
+
const newLucySettings = yield* Schema.decodeUnknown(lucySettings)(JSON.parse(lucySettingsRaw));
|
70
|
+
if( newLucySettings.type !== config.config.action.type) return yield* Effect.fail(new AppError({
|
71
|
+
message: `Template type ${newLucySettings.type} does not match action type ${config.config.action.type}`,
|
72
|
+
cause: newLucySettings.type
|
73
|
+
}));
|
74
|
+
if(config.config.lucySettings.initialized) {
|
75
|
+
const overwriteQuestion = new Enquirer();
|
76
|
+
|
77
|
+
const overwrite = yield* Effect.tryPromise({
|
78
|
+
try: () => overwriteQuestion.prompt({
|
79
|
+
type: 'confirm',
|
80
|
+
name: 'overwrite',
|
81
|
+
message: 'Overwrite existing lucy.json settings?',
|
82
|
+
}),
|
83
|
+
catch: (e) => {
|
84
|
+
return new AppError({
|
85
|
+
cause: e,
|
86
|
+
message: "Error overwriting settings",
|
87
|
+
});
|
88
|
+
}
|
89
|
+
})
|
90
|
+
const choice = yield* Schema.decodeUnknown(Schema.Struct({ overwrite: Schema.Boolean }))(overwrite);
|
91
|
+
if (choice.overwrite) {
|
92
|
+
config.config.lucySettings = newLucySettings;
|
93
|
+
} else {
|
94
|
+
logger.info(`Existing lucy.json settings will be used.`);
|
95
|
+
}
|
96
|
+
}
|
97
|
+
logger.success(`Selected template: ${green(selectedTemplate.template)}`);
|
98
|
+
});
|
99
|
+
}
|
package/src/init/velo.ts
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
import { Effect, Schema } from "effect/index"
|
2
|
+
import { Config } from "../config.js";
|
3
|
+
import { FileSystem, Path } from "@effect/platform"
|
4
|
+
import { logger } from "../utils/logger.js";
|
5
|
+
import { mergeAdditions, mergeLucySettings2PackageJson, setInitialized, setProjectName, stringReplace } from "../commands/edit.js";
|
6
|
+
import { writeLucySettings, writePackageJson } from "../commands/write.js";
|
7
|
+
import { copyTemplateFiles } from "../commands/copy.js";
|
8
|
+
import { readPackageJson } from "../commands/read.js";
|
9
|
+
import { installVeloPackages, runYarn, yarnSetVersion } from "../commands/install.js";
|
10
|
+
import { cleanup } from "../commands/cleanup.js";
|
11
|
+
import { gitInit } from "../commands/git.js";
|
12
|
+
import { checkForVelo } from "../commands/checks.js";
|
13
|
+
import { AppError } from "../error.js";
|
14
|
+
import Enquirer from "enquirer";
|
15
|
+
import { prepareVelo } from "./prepareVelo.js";
|
16
|
+
|
17
|
+
export const init_velo = () => {
|
18
|
+
return Effect.gen(function*() {
|
19
|
+
const config = yield* Config;
|
20
|
+
const path = yield* Path.Path;
|
21
|
+
|
22
|
+
logger.action("Initializing Velo...");
|
23
|
+
|
24
|
+
yield* checkForVelo();
|
25
|
+
|
26
|
+
if(config.config.lucySettings.initialized && !config.config.force) {
|
27
|
+
const question = new Enquirer();
|
28
|
+
const choice = yield* Effect.tryPromise({
|
29
|
+
try: () => question.prompt({
|
30
|
+
type: 'confirm',
|
31
|
+
name: 'prepare',
|
32
|
+
message: 'Do you want to prepare the velo project?(install packages, git init)',
|
33
|
+
}),
|
34
|
+
catch: (e) => {
|
35
|
+
return new AppError({ cause: e, message: 'Error selecting template' });
|
36
|
+
}
|
37
|
+
})
|
38
|
+
const prepare = yield* Schema.decodeUnknown(Schema.Struct({ prepare: Schema.Boolean }))(choice)
|
39
|
+
if(prepare.prepare) return yield* prepareVelo
|
40
|
+
}
|
41
|
+
|
42
|
+
|
43
|
+
if(config.config.lucySettings.initialized && !config.config.force) return yield* Effect.fail(new AppError({ message: "Lucy is already initialized in this directory. Use --force to reinitialize.", cause: new Error("Lucy is already initialized in this directory") }));
|
44
|
+
if ((config.config.lucySettings.initialized && config.config.force) || (config.config.lucySettings.initialized && config.config.force)) logger.alert("Forced initialization!");
|
45
|
+
|
46
|
+
yield* copyTemplateFiles;
|
47
|
+
yield* stringReplace(path.join(config.config.cwd, 'currents.config.js'), ['__ProjectName__'], [config.config.projectName]);
|
48
|
+
yield* readPackageJson;
|
49
|
+
yield* setProjectName;
|
50
|
+
yield* mergeLucySettings2PackageJson;
|
51
|
+
yield* mergeAdditions;
|
52
|
+
yield* writeLucySettings;
|
53
|
+
yield* writePackageJson;
|
54
|
+
yield* gitInit();
|
55
|
+
yield* yarnSetVersion;
|
56
|
+
yield* installVeloPackages;
|
57
|
+
yield* cleanup;
|
58
|
+
yield* setInitialized;
|
59
|
+
|
60
|
+
logger.success("Velo initialized successfully!");
|
61
|
+
})
|
62
|
+
}
|
package/src/runtime.ts
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
import { LucySettings } from "./lucy";
|
2
|
+
import * as dartSass from 'sass';
|
3
|
+
import gulpSass from 'gulp-sass';
|
4
|
+
|
5
|
+
const sass = gulpSass(dartSass);
|
6
|
+
|
7
|
+
export type ModuleSettings = {
|
8
|
+
packageRoot: string;
|
9
|
+
targetFolder: string;
|
10
|
+
wixConfigPath: string;
|
11
|
+
lucyConfigPath: string;
|
12
|
+
packageJsonPath: string;
|
13
|
+
settings: LucySettings;
|
14
|
+
force: boolean;
|
15
|
+
veloConfigName: string;
|
16
|
+
}
|
17
|
+
|
18
|
+
export type ProjectSettings = {
|
19
|
+
// packages?: Record<string, string>;
|
20
|
+
modules?: Record<string, any>;
|
21
|
+
lucySettings?: LucySettings;
|
22
|
+
packageJSON?: Record<string, any>;
|
23
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { Schema } from "effect/index";
|
2
|
+
import { types } from "./types.js";
|
3
|
+
|
4
|
+
export const lucySettings = Schema.Struct({
|
5
|
+
modules: Schema.Record({
|
6
|
+
key: Schema.String,
|
7
|
+
value: Schema.Struct({
|
8
|
+
source: Schema.String,
|
9
|
+
branch: Schema.String,
|
10
|
+
path: Schema.optional(Schema.String),
|
11
|
+
noCompile: Schema.optional(Schema.Boolean),
|
12
|
+
})}),
|
13
|
+
veloSettings: Schema.optional(Schema.NullOr(Schema.Struct({
|
14
|
+
compilerOptions: Schema.optional(Schema.Struct({
|
15
|
+
composite: Schema.Boolean,
|
16
|
+
noEmit: Schema.Boolean,
|
17
|
+
lib: Schema.Array(Schema.String),
|
18
|
+
jsx: Schema.String,
|
19
|
+
})),
|
20
|
+
exclude: Schema.optional(Schema.Array(Schema.String)),
|
21
|
+
}))),
|
22
|
+
initialized: Schema.Boolean,
|
23
|
+
type: Schema.Literal(...types),
|
24
|
+
dependencies: Schema.Record({
|
25
|
+
key: Schema.String,
|
26
|
+
value: Schema.String,
|
27
|
+
}),
|
28
|
+
devDependencies: Schema.Record({
|
29
|
+
key: Schema.String,
|
30
|
+
value: Schema.String,
|
31
|
+
}),
|
32
|
+
scripts: Schema.Record({
|
33
|
+
key: Schema.String,
|
34
|
+
value: Schema.String,
|
35
|
+
}),
|
36
|
+
additionalCommands: Schema.optional(Schema.Array(Schema.Array(Schema.String))),
|
37
|
+
additionalPkgProps: Schema.optional(Schema.Object),
|
38
|
+
});
|
39
|
+
export type LucySettings = typeof lucySettings.Type;
|