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/schemas/types.ts
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
export const types = ["velo", "expo", "blocks", "monorepo", "tauri", "cargo", 'submodules'] as const;
|
2
|
+
export const tasks = ["dev", "build", "build-prod", "build-pipeline"] as const;
|
3
|
+
|
4
|
+
export type Action = 'init' | 'open' | 'task';
|
5
|
+
|
6
|
+
export type Actions = {
|
7
|
+
action: Action;
|
8
|
+
type?: typeof types[number];
|
9
|
+
task?: typeof tasks[number];
|
10
|
+
}
|
11
|
+
|
12
|
+
export interface LucyArgs {
|
13
|
+
[x: string]: unknown;
|
14
|
+
// This will hold the command used, e.g., 'init'
|
15
|
+
_: Action[];
|
16
|
+
$0: string;
|
17
|
+
// Arguments for the 'init' command
|
18
|
+
type?: Actions['type'];
|
19
|
+
task?: Actions['task'];
|
20
|
+
}
|
File without changes
|
package/src/sync/sync.ts
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
// import chalk, { modifierNames } from "chalk";
|
2
|
+
// import readline from 'node:readline';
|
3
|
+
// import {createDataSync, LoggingStatistics, LoggerRejectsReporter} from 'velo-sync';
|
4
|
+
// import veloAPI from 'velo-sync/dist/velo/velo-api.js';
|
5
|
+
// import syncTask from 'velo-sync/dist/tasks/sync-task.js';
|
6
|
+
// import { readConfig, saveConfig, VeloSyncConfig } from "./helpers.js";
|
7
|
+
// import optimist from 'optimist';
|
8
|
+
// import migrateFileCache from 'velo-sync/dist/tasks/migrate-files-cache-task.js';
|
9
|
+
// function printUsage() {
|
10
|
+
// console.log('Usage: ');
|
11
|
+
// console.log('');
|
12
|
+
// console.log('Commands:');
|
13
|
+
// console.log(' init generates a config file for the import / export / sync process');
|
14
|
+
// console.log(' is-alive tests the config and the connection to the site');
|
15
|
+
// console.log(' sync runs the sync process');
|
16
|
+
// console.log(' import runs an import process');
|
17
|
+
// console.log(' migrate migrate existing nedb cache to sqlite cache (.upload-cache.db => .upload-cache.sqlite.db)');
|
18
|
+
// }
|
19
|
+
|
20
|
+
// function syncOrImportTask(importOnly: boolean) {
|
21
|
+
// let argv = optimist
|
22
|
+
// .usage(`Usage: $0 ${importOnly ? 'import' : 'sync'} -f <scv filename> -c <collection>`)
|
23
|
+
// .demand('f')
|
24
|
+
// .alias('f', 'filename')
|
25
|
+
// .describe('f', 'csv filename to import')
|
26
|
+
// .demand('c')
|
27
|
+
// .describe('c', 'the name of the collection to import into')
|
28
|
+
// .alias('c', 'collection')
|
29
|
+
// .demand('s')
|
30
|
+
// .describe('s', 'schema file describing the fields of the collection')
|
31
|
+
// .alias('s', 'schema')
|
32
|
+
// .describe('dry', 'dry-run that does not upload any data or files, and does not remove or update anything on the site')
|
33
|
+
// .alias('dry', 'dryrun')
|
34
|
+
// .parse(process.argv.slice(3));
|
35
|
+
// let filename = argv.filename;
|
36
|
+
// let collection = argv.collection;
|
37
|
+
// let schema = argv.schema;
|
38
|
+
// let dryrun = argv.dryrun;
|
39
|
+
// //@ts-ignore
|
40
|
+
// syncTask.default(filename, collection, schema, importOnly, dryrun);
|
41
|
+
// }
|
42
|
+
|
43
|
+
// export async function sync() {
|
44
|
+
|
45
|
+
// if(moduleSettings.args.includes('-h') || moduleSettings.args.includes('help')) return printUsage();
|
46
|
+
// if(moduleSettings.args.includes('init')) {
|
47
|
+
// const rl = readline.createInterface({
|
48
|
+
// input: process.stdin,
|
49
|
+
// output: process.stdout,
|
50
|
+
// terminal: true
|
51
|
+
// });
|
52
|
+
|
53
|
+
// async function askQuestion(query: string):Promise<string> {
|
54
|
+
// return new Promise((resolve) => rl.question(query, (answer) => resolve(answer)));
|
55
|
+
// }
|
56
|
+
|
57
|
+
// console.log(chalk.yellow('hello to velo-sync init'));
|
58
|
+
// let siteUrl = await askQuestion(orange('what is the url of the site homepage? '));
|
59
|
+
// let secret = await askQuestion(orange('what is the velo-sync secret? '));
|
60
|
+
// rl.close();
|
61
|
+
// let config: VeloSyncConfig = { siteUrl, secret };
|
62
|
+
// await saveConfig(config, moduleSettings.veloConfigName);
|
63
|
+
// return console.log(chalk.green("🐕" + ' => config saved!'));
|
64
|
+
// }
|
65
|
+
|
66
|
+
// if(moduleSettings.args.includes('is-alive')) {
|
67
|
+
// try {
|
68
|
+
// let config = await readConfig(moduleSettings.veloConfigName);
|
69
|
+
// console.log("🐕" + green(` => checking if the API for site ${chalk.greenBright(config.siteUrl)} is alive...`));
|
70
|
+
// await veloAPI.isAlive(config);
|
71
|
+
// return console.log(chalk.green("🐕" + ` => API of site ${chalk.greenBright(config.siteUrl)} is working and alive!!!`));
|
72
|
+
// }
|
73
|
+
// catch (e) {
|
74
|
+
// if(e instanceof Error) {
|
75
|
+
// return console.log((`💩 ${red.underline.bold("=> Failed to check endpoint")} ${orange(e.message)}`));
|
76
|
+
// }
|
77
|
+
// }
|
78
|
+
// }
|
79
|
+
// if(moduleSettings.args.includes('sync')) {
|
80
|
+
// return syncOrImportTask(false);
|
81
|
+
// }
|
82
|
+
|
83
|
+
// if(moduleSettings.args.includes('import')) {
|
84
|
+
// return syncOrImportTask(true);
|
85
|
+
// }
|
86
|
+
|
87
|
+
// if(moduleSettings.args.includes('export')) {
|
88
|
+
// return console.log((`💩 ${red.underline.bold("=> Not implemented")}`));
|
89
|
+
// }
|
90
|
+
|
91
|
+
// if(moduleSettings.args.includes('migrate')) {
|
92
|
+
// //@ts-ignore
|
93
|
+
// migrateFileCache.default();
|
94
|
+
// }
|
95
|
+
|
96
|
+
// }
|
@@ -0,0 +1,252 @@
|
|
1
|
+
import gulp from 'gulp';
|
2
|
+
import gulpSass from 'gulp-sass';
|
3
|
+
import shell from 'gulp-shell';
|
4
|
+
import * as os from 'os';
|
5
|
+
import * as dartSass from 'sass';
|
6
|
+
import { join } from "path";
|
7
|
+
|
8
|
+
import backendSettings from '../../settings/backend-settings.json' with { type: "json" };;
|
9
|
+
import masterSettings from '../../settings/master-settings.json' with { type: "json" };;
|
10
|
+
import pageSettings from '../../settings/page-settings.json' with { type: "json" };;
|
11
|
+
import publicSettings from '../../settings/public-settings.json' with { type: "json" };;
|
12
|
+
|
13
|
+
import { buildPublic } from './gulp/public.js';
|
14
|
+
import { buildBackend, buildBackendJSW } from './gulp/backend.js';
|
15
|
+
import { checkPages, checkTs } from './gulp/checks.js';
|
16
|
+
import { compileScss } from './gulp/styles.js';
|
17
|
+
import { buildPages } from './gulp/pages.js';
|
18
|
+
import { previewTemplates } from './gulp/templates.js';
|
19
|
+
import { copyFiles } from './gulp/copy.js';
|
20
|
+
import { cleanSrc, cleanWix } from './gulp/clean.js';
|
21
|
+
import { addTypes, updateWixTypes } from './gulp/types.js';
|
22
|
+
import { setProdConfig } from './gulp/pipeline.js';
|
23
|
+
import { watchAll } from './gulp/watchers.js';
|
24
|
+
import { getModulesSourcePaths } from './gulp/helpers.js';
|
25
|
+
import { LucySettings } from '../schemas/lucy.js';
|
26
|
+
import { logger } from '../utils/logger.js';
|
27
|
+
import { Effect } from 'effect/index';
|
28
|
+
import { ModuleSettings, ProjectSettings } from '../schemas/gulp.js';
|
29
|
+
import { LucyConfig } from '../config.js';
|
30
|
+
|
31
|
+
const sass = gulpSass(dartSass);
|
32
|
+
|
33
|
+
export type TaskOptions = {
|
34
|
+
moduleSettings?: ModuleSettings,
|
35
|
+
projectSettings?: ProjectSettings
|
36
|
+
enableIncrementalBuild: boolean;
|
37
|
+
outputDir: string;
|
38
|
+
sass: ReturnType<typeof gulpSass>;
|
39
|
+
userHomeDir: string;
|
40
|
+
replaceOptions: typeof replaceOptions;
|
41
|
+
backendSettings: typeof backendSettings,
|
42
|
+
masterSettings: typeof masterSettings,
|
43
|
+
pageSettings: typeof pageSettings,
|
44
|
+
publicSettings: typeof publicSettings,
|
45
|
+
// modulesSync: Record<string, string> | undefined;
|
46
|
+
modulesSourcePaths: string[];
|
47
|
+
cwd: string;
|
48
|
+
isWatching?: boolean;
|
49
|
+
}
|
50
|
+
|
51
|
+
export interface File {
|
52
|
+
path: string;
|
53
|
+
dirname: string;
|
54
|
+
// other properties...
|
55
|
+
}
|
56
|
+
|
57
|
+
const outputDir = './src';
|
58
|
+
const userHomeDir = os.homedir();
|
59
|
+
const replaceOptions = {
|
60
|
+
logs: {
|
61
|
+
enabled: false
|
62
|
+
}
|
63
|
+
};
|
64
|
+
export const taskOptions: TaskOptions = {
|
65
|
+
enableIncrementalBuild: false,
|
66
|
+
outputDir,
|
67
|
+
sass,
|
68
|
+
userHomeDir,
|
69
|
+
pageSettings,
|
70
|
+
publicSettings,
|
71
|
+
backendSettings,
|
72
|
+
masterSettings,
|
73
|
+
replaceOptions,
|
74
|
+
cwd: process.cwd(),
|
75
|
+
// modulesSync: getModulesSync(),
|
76
|
+
modulesSourcePaths: [],
|
77
|
+
}
|
78
|
+
|
79
|
+
const watchTaskOptions: TaskOptions = { ...taskOptions, isWatching: true };
|
80
|
+
|
81
|
+
gulp.task('check-ts', gulp.parallel(
|
82
|
+
checkTs(taskOptions),
|
83
|
+
));
|
84
|
+
|
85
|
+
gulp.task('scss', gulp.parallel(
|
86
|
+
compileScss(taskOptions),
|
87
|
+
));
|
88
|
+
|
89
|
+
gulp.task('build-backend', gulp.parallel(
|
90
|
+
buildBackend(taskOptions),
|
91
|
+
buildBackendJSW(taskOptions),
|
92
|
+
// buildBackendHTTP(taskOptions),
|
93
|
+
));
|
94
|
+
|
95
|
+
gulp.task('build-public', gulp.parallel(
|
96
|
+
buildPublic(taskOptions),
|
97
|
+
));
|
98
|
+
|
99
|
+
gulp.task('preview-templates', gulp.parallel(
|
100
|
+
previewTemplates(taskOptions),
|
101
|
+
));
|
102
|
+
|
103
|
+
gulp.task('copy-files', gulp.parallel(
|
104
|
+
copyFiles(taskOptions),
|
105
|
+
));
|
106
|
+
|
107
|
+
gulp.task('test', function () {
|
108
|
+
return shell.task(
|
109
|
+
['yarn test'],
|
110
|
+
{ ignoreErrors: true }
|
111
|
+
)().then(() => {
|
112
|
+
logger.success("Tests completed successfully.");
|
113
|
+
}).catch(err => {
|
114
|
+
logger.error("Error in test task!");
|
115
|
+
});
|
116
|
+
});
|
117
|
+
gulp.task('test-ci', function () {
|
118
|
+
return shell.task(
|
119
|
+
['yarn test --run'],
|
120
|
+
{ ignoreErrors: true }
|
121
|
+
)().then(() => {
|
122
|
+
logger.success("Tests completed successfully.");
|
123
|
+
}).catch(err => {
|
124
|
+
logger.error("Error in test task!");
|
125
|
+
});
|
126
|
+
});
|
127
|
+
|
128
|
+
gulp.task('sync-types', shell.task([
|
129
|
+
'yarn postinstall',
|
130
|
+
]));
|
131
|
+
|
132
|
+
gulp.task('fix-wixtypes', gulp.parallel(
|
133
|
+
updateWixTypes(taskOptions)
|
134
|
+
));
|
135
|
+
|
136
|
+
gulp.task('add-wix-types', function(done: gulp.TaskFunctionCallback) {
|
137
|
+
return addTypes(taskOptions, done);
|
138
|
+
});
|
139
|
+
|
140
|
+
gulp.task('set-production', gulp.parallel(
|
141
|
+
setProdConfig()
|
142
|
+
));
|
143
|
+
|
144
|
+
gulp.task('start-wix', shell.task([
|
145
|
+
'yarn wix:dev',
|
146
|
+
]));
|
147
|
+
|
148
|
+
gulp.task('gen-docs', shell.task([
|
149
|
+
'yarn docs',
|
150
|
+
]));
|
151
|
+
|
152
|
+
gulp.task('fix-wix', gulp.series(
|
153
|
+
cleanWix(),
|
154
|
+
'sync-types',
|
155
|
+
'fix-wixtypes',
|
156
|
+
'add-wix-types'
|
157
|
+
));
|
158
|
+
|
159
|
+
gulp.task('build', gulp.parallel(
|
160
|
+
'build-backend',
|
161
|
+
'build-public',
|
162
|
+
'preview-templates',
|
163
|
+
buildPages(taskOptions),
|
164
|
+
compileScss(taskOptions),
|
165
|
+
'copy-files'
|
166
|
+
)
|
167
|
+
);
|
168
|
+
|
169
|
+
gulp.task('build-pipeline', gulp.series(
|
170
|
+
cleanSrc(taskOptions),
|
171
|
+
'set-production',
|
172
|
+
'check-ts',
|
173
|
+
'fix-wixtypes',
|
174
|
+
'add-wix-types',
|
175
|
+
'test-ci',
|
176
|
+
'build',
|
177
|
+
));
|
178
|
+
|
179
|
+
gulp.task('build-prod', gulp.series(
|
180
|
+
(done) => checkPages(true, false).then(() => done(), (err) => done(err)),
|
181
|
+
cleanSrc(taskOptions),
|
182
|
+
'set-production',
|
183
|
+
'fix-wix',
|
184
|
+
'check-ts',
|
185
|
+
'test-ci',
|
186
|
+
'build-backend',
|
187
|
+
'build-public',
|
188
|
+
buildPages(taskOptions),
|
189
|
+
'copy-files',
|
190
|
+
compileScss(taskOptions),
|
191
|
+
// 'gen-docs'
|
192
|
+
));
|
193
|
+
|
194
|
+
|
195
|
+
gulp.task('start-dev-env', gulp.parallel(
|
196
|
+
watchAll(watchTaskOptions),
|
197
|
+
'test',
|
198
|
+
// 'start-wix',
|
199
|
+
'check-ts',
|
200
|
+
(done) => checkPages(false, taskOptions.moduleSettings?.force ?? false).then(() => done(), (err) => done(err)),
|
201
|
+
));
|
202
|
+
|
203
|
+
gulp.task('dev', gulp.series(
|
204
|
+
cleanSrc(taskOptions),
|
205
|
+
'fix-wix',
|
206
|
+
'build',
|
207
|
+
'start-dev-env',
|
208
|
+
)
|
209
|
+
);
|
210
|
+
|
211
|
+
async function gulpTaskRunner(task: string) {
|
212
|
+
return new Promise(function (resolve, reject) {
|
213
|
+
gulp.series(task, (done) => {
|
214
|
+
resolve(true);
|
215
|
+
done();
|
216
|
+
})(function (err) {
|
217
|
+
if (err) {
|
218
|
+
logger.error("Error starting tasks:", err);
|
219
|
+
reject(err);
|
220
|
+
}
|
221
|
+
});
|
222
|
+
});
|
223
|
+
}
|
224
|
+
|
225
|
+
export async function runTask(config: LucyConfig) {
|
226
|
+
taskOptions.cwd = config.cwd;
|
227
|
+
taskOptions.moduleSettings = {
|
228
|
+
packageRoot: config.packageRoot,
|
229
|
+
targetFolder: config.cwd,
|
230
|
+
force: config.force,
|
231
|
+
lucyConfigPath: join(config.cwd, "lucy.json"),
|
232
|
+
packageJsonPath: join(config.cwd, "package.json"),
|
233
|
+
settings: config.lucySettings,
|
234
|
+
wixConfigPath: join(config.cwd, "wix.config.json"),
|
235
|
+
veloConfigName: join(config.cwd, "jsconfig.json"),
|
236
|
+
};
|
237
|
+
taskOptions.modulesSourcePaths = getModulesSourcePaths(config);
|
238
|
+
taskOptions.projectSettings = {
|
239
|
+
modules: config.lucySettings.modules,
|
240
|
+
lucySettings: config.lucySettings,
|
241
|
+
packageJSON: config.packageJson,
|
242
|
+
};
|
243
|
+
const task = config.action.task || "dev";
|
244
|
+
logger.action(`Running task: ${task} with options:`, taskOptions);
|
245
|
+
try {
|
246
|
+
await gulpTaskRunner(task || 'dev');
|
247
|
+
} catch (err) {
|
248
|
+
logger.error("Error starting tasks:", err);
|
249
|
+
throw err;
|
250
|
+
}
|
251
|
+
logger.report("Task completed successfully:", task);
|
252
|
+
}
|
@@ -0,0 +1,112 @@
|
|
1
|
+
import gulp from 'gulp';
|
2
|
+
import rename from 'gulp-rename';
|
3
|
+
import * as path from 'path';
|
4
|
+
import { TaskOptions } from '../Gulpfile.js';
|
5
|
+
import swc from 'gulp-swc';
|
6
|
+
import { logger } from '../../utils/logger.js';
|
7
|
+
|
8
|
+
const swcOptions = {
|
9
|
+
jsc: {
|
10
|
+
target: 'es2020',
|
11
|
+
parser: {
|
12
|
+
syntax: "typescript",
|
13
|
+
tsx: true,
|
14
|
+
decorators: true,
|
15
|
+
// preserveAllComments: true
|
16
|
+
},
|
17
|
+
preserveAllComments: false,
|
18
|
+
minify: {
|
19
|
+
compress: true // equivalent to {}
|
20
|
+
}
|
21
|
+
},
|
22
|
+
};
|
23
|
+
|
24
|
+
export function buildBackend(options: TaskOptions) {
|
25
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
26
|
+
|
27
|
+
const { outputDir } = options;
|
28
|
+
|
29
|
+
// Create tasks for each folder
|
30
|
+
const tasks = folders.map((folder) => {
|
31
|
+
const taskName = `build_Backend-${folder}`; // Create a unique name for each task
|
32
|
+
|
33
|
+
const task = () =>
|
34
|
+
gulp.src([
|
35
|
+
`${folder}/backend/**/*.ts`,
|
36
|
+
`${folder}/backend/**/*.tsx`,
|
37
|
+
`!${folder}/backend/**/*.jsw.ts`,
|
38
|
+
`!${folder}/backend/**/*.spec.ts`,
|
39
|
+
])
|
40
|
+
.pipe(swc(swcOptions))
|
41
|
+
.on('error', function (e: Error) {
|
42
|
+
logger.error(` => Build of Backend files for ${folder} failed!`);
|
43
|
+
logger.error(` => Error: ${e.message}`);
|
44
|
+
|
45
|
+
this.emit('end');
|
46
|
+
})
|
47
|
+
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
48
|
+
.on('error', function (e: Error) {
|
49
|
+
logger.error(` => Build of Backend files for ${folder} failed!`);
|
50
|
+
logger.error(` => Error: ${e.message}`);
|
51
|
+
|
52
|
+
this.emit('end');
|
53
|
+
})
|
54
|
+
.on('end', function () {
|
55
|
+
logger.success(` => Build of Backend files for ${folder} succeeded!`);
|
56
|
+
});
|
57
|
+
|
58
|
+
// Register the task with Gulp
|
59
|
+
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
60
|
+
return task;
|
61
|
+
});
|
62
|
+
|
63
|
+
// Run all tasks in parallel
|
64
|
+
return gulp.parallel(...tasks);
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
export function buildBackendJSW(options: TaskOptions) {
|
69
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
70
|
+
|
71
|
+
const swcOptions = {
|
72
|
+
jsc: {
|
73
|
+
target: 'es6',
|
74
|
+
},
|
75
|
+
};
|
76
|
+
const { outputDir } = options;
|
77
|
+
|
78
|
+
// Create tasks for each folder
|
79
|
+
const tasks = folders.map((folder) => {
|
80
|
+
const taskName = `build-${folder}`; // Create a unique name for each task
|
81
|
+
|
82
|
+
const task = () =>
|
83
|
+
gulp.src([
|
84
|
+
`${folder}/backend/**/*.jsw.ts`,
|
85
|
+
])
|
86
|
+
.pipe(swc(swcOptions))
|
87
|
+
.on('error', function (e: Error) {
|
88
|
+
logger.error(` => Build of JSW files for ${folder} failed!`);
|
89
|
+
logger.error(` => Error: ${e.message}`);
|
90
|
+
|
91
|
+
this.emit('end');
|
92
|
+
})
|
93
|
+
.pipe(rename({ extname: '' }))
|
94
|
+
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
95
|
+
.on('error', function (e: Error) {
|
96
|
+
logger.error(` => Build of JSW files for ${folder} failed!`);
|
97
|
+
logger.error(` => Error: ${e.message}`);
|
98
|
+
|
99
|
+
this.emit('end');
|
100
|
+
})
|
101
|
+
.on('end', function () {
|
102
|
+
logger.success(` => Build of JSW files for ${folder} succeeded!`);
|
103
|
+
});
|
104
|
+
|
105
|
+
// Register the task with Gulp
|
106
|
+
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
107
|
+
return task;
|
108
|
+
});
|
109
|
+
|
110
|
+
// Run all tasks in parallel
|
111
|
+
return gulp.parallel(...tasks);
|
112
|
+
}
|
@@ -0,0 +1,214 @@
|
|
1
|
+
import * as fs from 'fs';
|
2
|
+
import { glob } from 'glob';
|
3
|
+
|
4
|
+
import * as path from 'path';
|
5
|
+
import gulp from 'gulp';
|
6
|
+
import ts from 'gulp-typescript';
|
7
|
+
import { TaskOptions } from '../Gulpfile.js';
|
8
|
+
import { blue, logger, red, yellow } from '../../utils/logger.js';
|
9
|
+
|
10
|
+
// /**
|
11
|
+
// * Extracts a match from a file
|
12
|
+
// * @param {string} filePath File path
|
13
|
+
// * @param {string} pattern Pattern to match
|
14
|
+
// */
|
15
|
+
// function extractMatchFromFile(filePath: string, pattern: string) {
|
16
|
+
// return new Promise((resolve, reject) => {
|
17
|
+
// fs.readFile(filePath, 'utf8', (err, data) => {
|
18
|
+
// if (err){
|
19
|
+
// reject(err);
|
20
|
+
|
21
|
+
// return;
|
22
|
+
// }
|
23
|
+
// const regex = new RegExp(pattern);
|
24
|
+
// const match = regex.exec(data);
|
25
|
+
// const capturedGroup = match ? match.groups?.page : null;
|
26
|
+
// resolve(capturedGroup);
|
27
|
+
// });
|
28
|
+
// });
|
29
|
+
// }
|
30
|
+
|
31
|
+
// async function readFilesInFolder(folderPath: string, pattern: string | null, globPattern: string): Promise<Object[]> {
|
32
|
+
// const files = await glob(path.join(folderPath, globPattern));
|
33
|
+
// const filenameList: Object[] = [];
|
34
|
+
|
35
|
+
// for (const file of files) {
|
36
|
+
// if (pattern) {
|
37
|
+
// const capturedGroup = await extractMatchFromFile(file, pattern);
|
38
|
+
// if (capturedGroup) {
|
39
|
+
// filenameList.push(capturedGroup);
|
40
|
+
// }
|
41
|
+
// } else {
|
42
|
+
// filenameList.push(path.basename(file));
|
43
|
+
// }
|
44
|
+
// }
|
45
|
+
|
46
|
+
// return filenameList;
|
47
|
+
// }
|
48
|
+
|
49
|
+
/**
|
50
|
+
* Extracts a match from a file
|
51
|
+
* @param {string} filePath File path
|
52
|
+
* @param {string} pattern Pattern to match
|
53
|
+
*/
|
54
|
+
function extractMatchFromFile(filePath: string, pattern: string) {
|
55
|
+
return new Promise((resolve, reject) => {
|
56
|
+
fs.readFile(filePath, 'utf8', (err, data) => {
|
57
|
+
if (err){
|
58
|
+
reject(err);
|
59
|
+
|
60
|
+
return;
|
61
|
+
}
|
62
|
+
const regex = new RegExp(pattern);
|
63
|
+
const match = regex.exec(data);
|
64
|
+
const capturedGroup = match ? match.groups?.page : null;
|
65
|
+
resolve(capturedGroup);
|
66
|
+
});
|
67
|
+
});
|
68
|
+
}
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Reads files in a folder
|
72
|
+
* @param {string} folderPath Folder path
|
73
|
+
* @param {string} pattern Pattern to match
|
74
|
+
* @param {string} globPattern Glob pattern
|
75
|
+
*/
|
76
|
+
async function readFilesInFolder(folderPath: string, pattern: string | null, globPattern: string,) {
|
77
|
+
const files = await glob.glob(path.join(folderPath, globPattern));
|
78
|
+
const filenameList: Object[] = [];
|
79
|
+
function traverseFiles(index: number) {
|
80
|
+
if (index === files.length){
|
81
|
+
return;
|
82
|
+
}
|
83
|
+
const file = files[index];
|
84
|
+
if(pattern){
|
85
|
+
if(!file) return
|
86
|
+
extractMatchFromFile(file, pattern)
|
87
|
+
.then((capturedGroup) => {
|
88
|
+
if (capturedGroup){
|
89
|
+
filenameList.push(capturedGroup);
|
90
|
+
}
|
91
|
+
traverseFiles(index + 1);
|
92
|
+
})
|
93
|
+
.catch(() => { throw new Error(`Error reading file: ${file}`); });
|
94
|
+
}
|
95
|
+
if(!pattern){
|
96
|
+
if(!file) return
|
97
|
+
filenameList.push(path.basename(file));
|
98
|
+
traverseFiles(index + 1);
|
99
|
+
}
|
100
|
+
}
|
101
|
+
traverseFiles(0);
|
102
|
+
|
103
|
+
return filenameList;
|
104
|
+
}
|
105
|
+
export async function checkPages(fail: boolean, force: boolean) {
|
106
|
+
logger.action('Checking pages...');
|
107
|
+
return new Promise<void>(async (resolve, reject) => {
|
108
|
+
try {
|
109
|
+
const sourcePages = await readFilesInFolder('./.wix/types/', '\\/pages\\/(?<page>.*\\.ts)', '**/*.json',) as string[];
|
110
|
+
const tsPages = await readFilesInFolder('./typescript/pages', null, '**/*.ts',) as string[];
|
111
|
+
|
112
|
+
const sourcePagesSet = new Set(sourcePages);
|
113
|
+
const tsPagesSet = new Set(tsPages);
|
114
|
+
const missingInTs = Array.from(sourcePagesSet).filter((item: string) => !tsPages.includes(item));
|
115
|
+
const obsoleteInTs = Array.from(tsPagesSet).filter((item: string) => !sourcePages.includes(item));
|
116
|
+
if (missingInTs.length > 0){
|
117
|
+
if(!force){
|
118
|
+
logger.error('Missing pages in ts folder:', '\n', missingInTs);
|
119
|
+
}
|
120
|
+
if(force) {
|
121
|
+
for (const page of missingInTs) {
|
122
|
+
logger.action('Creating missing page: ', page);
|
123
|
+
fs.writeFileSync(`./typescript/pages/${page}`, '');
|
124
|
+
}
|
125
|
+
}
|
126
|
+
}
|
127
|
+
if (obsoleteInTs.length > 0){
|
128
|
+
if(!force){
|
129
|
+
const formattedList = obsoleteInTs.map(page => ` • ${page}`).join('\n');
|
130
|
+
logger.error('Obsolete pages in TS folder:\n' + yellow(formattedList));
|
131
|
+
}
|
132
|
+
if(force) {
|
133
|
+
for (const page of obsoleteInTs) {
|
134
|
+
logger.action('Deleting obsolete page: ', page);
|
135
|
+
fs.rmSync(`./typescript/pages/${page}`);
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}
|
139
|
+
if (missingInTs.length === 0 && obsoleteInTs.length === 0) {
|
140
|
+
logger.info("All pages are in-sync!");
|
141
|
+
} else if(fail){
|
142
|
+
process.exit(1);
|
143
|
+
};
|
144
|
+
} catch (error) {
|
145
|
+
reject(error);
|
146
|
+
}
|
147
|
+
});
|
148
|
+
}
|
149
|
+
|
150
|
+
const customReporter: ts.reporter.Reporter = {
|
151
|
+
error: (error, tsInstance) => {
|
152
|
+
if (!error.diagnostic) {
|
153
|
+
logger.error(error.message);
|
154
|
+
return;
|
155
|
+
}
|
156
|
+
const { fullFilename, startPosition } = error;
|
157
|
+
const relativePath = path.relative(process.cwd(), fullFilename ?? '');
|
158
|
+
const line = startPosition ? startPosition.line + 1 : 0;
|
159
|
+
const col = startPosition ? startPosition.character + 1 : 0;
|
160
|
+
|
161
|
+
const message = tsInstance.flattenDiagnosticMessageText(error.diagnostic.messageText, '\n');
|
162
|
+
|
163
|
+
logger.info(`${blue.underline(relativePath)}:${yellow(String(line))}:${yellow(String(col))}`);
|
164
|
+
logger.error(` ${red('error')} ${yellow(`TS${error.diagnostic.code}`)}: ${message}`);
|
165
|
+
},
|
166
|
+
finish: (results) => {
|
167
|
+
const errorCount = results.transpileErrors + results.semanticErrors + results.declarationErrors;
|
168
|
+
if (errorCount > 0) {
|
169
|
+
logger.error(`\n${red.bold(`Found ${errorCount} error${errorCount > 1 ? 's' : ''}.`)}`);
|
170
|
+
}
|
171
|
+
},
|
172
|
+
};
|
173
|
+
|
174
|
+
export function checkTs(options: TaskOptions) {
|
175
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
176
|
+
|
177
|
+
|
178
|
+
// Create tasks for each folder
|
179
|
+
const tasks = folders.map((folder) => {
|
180
|
+
const tsProject = ts.createProject(`./local.tsconfig.json`, { noEmit: true, declaration: false, skipDefaultLibCheck: true });
|
181
|
+
|
182
|
+
const taskName = `test-${folder}`; // Create a unique name for each task
|
183
|
+
|
184
|
+
const task = () => {
|
185
|
+
let hasError = false;
|
186
|
+
const stream = gulp.src([`${folder}/**/*.ts`, `!${folder}/types/**/*.ts`])
|
187
|
+
.pipe(tsProject(customReporter))
|
188
|
+
.on('error', () => {
|
189
|
+
hasError = true;
|
190
|
+
});
|
191
|
+
|
192
|
+
if (options.isWatching) {
|
193
|
+
stream.on('error', function (this: NodeJS.ReadWriteStream) {
|
194
|
+
this.emit('end');
|
195
|
+
});
|
196
|
+
}
|
197
|
+
|
198
|
+
stream.on('end', () => {
|
199
|
+
if (!hasError) {
|
200
|
+
logger.success(`Typescript check for ${folder} succeeded!`);
|
201
|
+
}
|
202
|
+
});
|
203
|
+
|
204
|
+
return stream;
|
205
|
+
};
|
206
|
+
|
207
|
+
// Register the task with Gulp
|
208
|
+
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
209
|
+
return task;
|
210
|
+
});
|
211
|
+
|
212
|
+
// Run all tasks in parallel
|
213
|
+
return gulp.parallel(...tasks);
|
214
|
+
}
|