lucy-cli 2.0.0-alpha.9 → 2.0.0-beta.1
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/.yarnrc.yml +0 -1
- package/dist/args.d.ts +1 -6
- package/dist/args.js +62 -7
- 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.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 +6 -0
- package/dist/commands/copy.js +20 -0
- package/dist/commands/copy.js.map +1 -0
- package/dist/commands/edit.d.ts +10 -0
- package/dist/commands/edit.js +67 -0
- package/dist/commands/edit.js.map +1 -0
- package/dist/commands/exec.d.ts +7 -0
- package/dist/commands/exec.js +67 -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 +165 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/read.d.ts +6 -0
- package/dist/commands/read.js +40 -0
- package/dist/commands/read.js.map +1 -0
- package/dist/commands/write.d.ts +7 -0
- package/dist/commands/write.js +28 -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 +29 -7
- package/dist/config.js +90 -26
- 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/helpers.d.ts +9 -0
- package/dist/helpers.js +83 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +77 -9
- package/dist/index.js.map +1 -0
- package/dist/init/blocks.d.ts +5 -0
- package/dist/init/blocks.js +62 -0
- package/dist/init/blocks.js.map +1 -0
- package/dist/init/cargo.d.ts +2 -0
- package/dist/init/cargo.js +21 -0
- package/dist/init/cargo.js.map +1 -0
- package/dist/init/expo.d.ts +5 -0
- package/dist/init/expo.js +52 -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 +77 -0
- package/dist/init/index.js.map +1 -0
- package/dist/init/monorepo.d.ts +4 -0
- package/dist/init/monorepo.js +48 -0
- package/dist/init/monorepo.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/tauri.d.ts +5 -0
- package/dist/init/tauri.js +32 -0
- package/dist/init/tauri.js.map +1 -0
- package/dist/init/templates.d.ts +5 -0
- package/dist/init/templates.js +93 -0
- package/dist/init/templates.js.map +1 -0
- package/dist/init/velo.d.ts +5 -0
- package/dist/init/velo.js +60 -0
- package/dist/init/velo.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 +25 -0
- package/dist/schemas/gulp.js +8 -0
- package/dist/schemas/gulp.js.map +1 -0
- package/dist/schemas/index.d.ts +10 -0
- package/dist/schemas/index.js +9 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/lucy.d.ts +29 -0
- package/dist/schemas/lucy.js +42 -0
- package/dist/schemas/lucy.js.map +1 -0
- package/dist/schemas/tsconfig.js +2 -0
- package/dist/schemas/tsconfig.js.map +1 -0
- package/dist/schemas/types.d.ts +33 -0
- package/dist/schemas/types.js +5 -1
- package/dist/schemas/types.js.map +1 -0
- package/dist/states.js +1 -0
- package/dist/states.js.map +1 -0
- package/dist/tasks/Gulpfile.d.ts +4 -0
- package/dist/tasks/Gulpfile.js +111 -0
- package/dist/tasks/Gulpfile.js.map +1 -0
- package/dist/tasks/gulp/backend.d.ts +4 -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 +4 -0
- package/dist/tasks/gulp/checks.js +202 -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 +3 -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 +3 -0
- package/dist/tasks/gulp/helpers.js +19 -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 +3 -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 +3 -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 +293 -0
- package/dist/tasks/gulp/types.js.map +1 -0
- package/dist/tasks/gulp/watchers.d.ts +3 -0
- package/dist/tasks/gulp/watchers.js +59 -0
- package/dist/tasks/gulp/watchers.js.map +1 -0
- package/dist/tasks/index.d.ts +4 -0
- package/dist/tasks/index.js +23 -0
- package/dist/tasks/index.js.map +1 -0
- package/dist/tasks/syncSettings.d.ts +3 -0
- package/dist/tasks/syncSettings.js +18 -0
- package/dist/tasks/syncSettings.js.map +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +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/dist/wix-sdk/check.d.ts +4 -0
- package/dist/wix-sdk/check.js +23 -0
- package/dist/wix-sdk/check.js.map +1 -0
- package/dist/wix-sdk/client.d.ts +10 -0
- package/dist/wix-sdk/client.js +18 -0
- package/dist/wix-sdk/client.js.map +1 -0
- package/dist/wix-sdk/index.d.ts +4 -0
- package/dist/wix-sdk/index.js +15 -0
- package/dist/wix-sdk/index.js.map +1 -0
- package/dist/wix-sdk/init.d.ts +4 -0
- package/dist/wix-sdk/init.js +51 -0
- package/dist/wix-sdk/init.js.map +1 -0
- package/dist/wix-sdk/run.d.ts +4 -0
- package/dist/wix-sdk/run.js +53 -0
- package/dist/wix-sdk/run.js.map +1 -0
- package/dist/wix-sync/client.d.ts +3 -0
- package/dist/wix-sync/client.js +5 -0
- package/dist/wix-sync/client.js.map +1 -0
- package/dist/wix-sync/export.d.ts +4 -0
- package/dist/wix-sync/export.js +15 -0
- package/dist/wix-sync/export.js.map +1 -0
- package/dist/wix-sync/import.d.ts +4 -0
- package/dist/wix-sync/import.js +26 -0
- package/dist/wix-sync/import.js.map +1 -0
- package/dist/wix-sync/index.d.ts +4 -0
- package/dist/wix-sync/index.js +35 -0
- package/dist/wix-sync/index.js.map +1 -0
- package/dist/wix-sync/init.d.ts +4 -0
- package/dist/wix-sync/init.js +74 -0
- package/dist/wix-sync/init.js.map +1 -0
- package/dist/wix-sync/is-alive.d.ts +4 -0
- package/dist/wix-sync/is-alive.js +23 -0
- package/dist/wix-sync/is-alive.js.map +1 -0
- package/dist/wix-sync/migrate.d.ts +4 -0
- package/dist/wix-sync/migrate.js +21 -0
- package/dist/wix-sync/migrate.js.map +1 -0
- package/dist/wix-sync/sync.d.ts +4 -0
- package/dist/wix-sync/sync.js +26 -0
- package/dist/wix-sync/sync.js.map +1 -0
- package/files/sync-data/data/test.csv +17 -0
- package/files/sync-data/files/lucy.jpg +0 -0
- package/files/sync-data/schema/test.json +11 -0
- package/files/templates/block[D]/files/.stylelintrc.js +8 -0
- package/files/templates/block[D]/lucy.json +9 -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 +15 -0
- package/files/templates/expo[D]/files/.stylelintrc.js +8 -0
- package/files/{expo → templates/expo[D]/files}/eas.json +9 -3
- package/files/templates/expo[D]/files/lib/data.ts +197 -0
- package/files/{expo → templates/expo[D]/files}/metro.config.js +6 -0
- package/files/templates/expo[D]/files/pnpm-workspace.yaml +3 -0
- package/files/templates/expo[D]/lucy.json +86 -0
- package/files/templates/monorepo[D]/files/.editorconfig +10 -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 +109 -0
- package/files/templates/monorepo[D]/files/currents.config.ts +5 -0
- package/files/templates/monorepo[D]/files/nx.json +25 -0
- package/files/templates/monorepo[D]/files/pnpm-workspace.yaml +11 -0
- package/files/templates/monorepo[D]/files/tsconfig.json +6 -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 +69 -0
- package/files/templates/tauri[D]/lucy.json +9 -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]/lucy.json +137 -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.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 +18 -19
- package/patches/velo-sync+0.0.9.patch +13 -0
- package/src/args.ts +62 -17
- package/src/commands/checks.ts +51 -0
- package/src/commands/cleanup.ts +11 -0
- package/src/commands/copy.ts +28 -0
- package/src/commands/edit.ts +81 -0
- package/src/commands/exec.ts +69 -0
- package/src/commands/git.ts +113 -0
- package/src/commands/home.ts +22 -0
- package/src/commands/install.ts +249 -0
- package/src/commands/read.ts +45 -0
- package/src/commands/write.ts +45 -0
- package/src/config.ts +116 -35
- package/src/error.ts +1 -2
- package/src/helpers.ts +92 -0
- package/src/index.ts +88 -13
- package/src/init/blocks.ts +85 -0
- package/src/init/cargo.ts +25 -0
- package/src/init/expo.ts +69 -0
- package/src/init/gitModules.ts +15 -0
- package/src/init/index.ts +81 -0
- package/src/init/monorepo.ts +72 -0
- package/src/init/prepareVelo.ts +19 -0
- package/src/init/tauri.ts +42 -0
- package/src/init/templates.ts +98 -0
- package/src/init/velo.ts +65 -0
- package/src/runtime.ts +1 -0
- package/src/schemas/gulp.ts +31 -0
- package/src/schemas/index.ts +13 -1
- package/src/schemas/lucy.ts +43 -0
- package/src/schemas/types.ts +40 -0
- package/src/tasks/Gulpfile.ts +207 -0
- package/src/tasks/gulp/backend.ts +113 -0
- package/src/tasks/gulp/checks.ts +218 -0
- package/src/tasks/gulp/clean.ts +38 -0
- package/src/tasks/gulp/copy.ts +38 -0
- package/src/tasks/gulp/helpers.ts +18 -0
- package/src/tasks/gulp/pages.ts +43 -0
- package/src/tasks/gulp/pipeline.ts +31 -0
- package/src/tasks/gulp/public.ts +61 -0
- package/src/tasks/gulp/styles.ts +47 -0
- package/src/tasks/gulp/templates.ts +53 -0
- package/src/tasks/gulp/types.ts +310 -0
- package/src/tasks/gulp/watchers.ts +97 -0
- package/src/tasks/index.ts +24 -0
- package/src/tasks/syncSettings.ts +21 -0
- package/src/types.d.ts +1 -1
- package/src/utils/index.ts +0 -0
- package/src/utils/logger.ts +40 -0
- package/src/wix-sdk/check.ts +24 -0
- package/src/wix-sdk/client.ts +18 -0
- package/src/wix-sdk/index.ts +17 -0
- package/src/wix-sdk/init.ts +54 -0
- package/src/wix-sdk/run.ts +56 -0
- package/src/wix-sync/client.ts +6 -0
- package/src/wix-sync/export.ts +19 -0
- package/src/wix-sync/import.ts +27 -0
- package/src/wix-sync/index.ts +36 -0
- package/src/wix-sync/init.ts +77 -0
- package/src/wix-sync/is-alive.ts +25 -0
- package/src/wix-sync/migrate.ts +23 -0
- package/src/wix-sync/sync.ts +27 -0
- package/tsconfig.json +6 -5
- package/dist/init.d.ts +0 -4
- package/dist/init.js +0 -275
- package/dist/models.js +0 -1
- package/dist/params.d.ts +0 -7
- package/dist/params.js +0 -23
- package/files/expo/lib/data.ts +0 -48
- package/files/expo/lucy.json +0 -8
- package/src/init.ts +0 -392
- /package/dist/{models.d.ts → schemas/tsconfig.d.ts} +0 -0
- /package/{files/expo/components/.gitkeep → dist/utils/index.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/{expo/components/ui → templates/expo[D]/files/components}/.gitkeep +0 -0
- /package/files/{velo/typescript/__mocks__ → 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}/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/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}/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/files/{velo → 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/typescript/pages → templates/velo[D]/files/typescript/__mocks__}/.gitkeep +0 -0
- /package/files/{velo → templates/velo[D]/files}/typescript/backend/data.ts +0 -0
- /package/files/{velo → templates/velo[D]/files}/typescript/backend/events.ts +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/typescript/public → templates/velo[D]/files/typescript/pages}/.gitkeep +0 -0
- /package/files/{velo/typescript/styles → templates/velo[D]/files/typescript/public}/.gitkeep +0 -0
- /package/files/{velo → templates/velo[D]/files}/typescript/public/scss/app.scss +0 -0
- /package/files/{velo/typescript/styles/global.scss → templates/velo[D]/files/typescript/styles/.gitkeep} +0 -0
- /package/{src copy/schemas/index.ts → files/templates/velo[D]/files/typescript/styles/global.scss} +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/schemas/types.ts → old/schemas/index.d.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
@@ -0,0 +1,207 @@
|
|
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 { logger } from '../utils/logger.js';
|
26
|
+
import { Effect } from 'effect/index';
|
27
|
+
import { Config } from '../config.js';
|
28
|
+
import { AppError } from '../error.js';
|
29
|
+
import { TaskOptions } from '../schemas/gulp.js';
|
30
|
+
|
31
|
+
const sass = gulpSass(dartSass);
|
32
|
+
|
33
|
+
export const task_runGulp = Effect.gen(function* (_) {
|
34
|
+
const config = (yield* Config).config;
|
35
|
+
const task = config.action.tasksName || "dev";
|
36
|
+
|
37
|
+
const taskOptions: TaskOptions = {
|
38
|
+
enableIncrementalBuild: config.action.tasksName === 'dev' ? true : false,
|
39
|
+
outputDir: './src',
|
40
|
+
sass,
|
41
|
+
pageSettings,
|
42
|
+
publicSettings,
|
43
|
+
backendSettings,
|
44
|
+
masterSettings,
|
45
|
+
replaceOptions: {
|
46
|
+
logs: {
|
47
|
+
enabled: false
|
48
|
+
}
|
49
|
+
},
|
50
|
+
cwd: process.cwd(),
|
51
|
+
modulesSourcePaths: yield* getModulesSourcePaths,
|
52
|
+
};
|
53
|
+
|
54
|
+
|
55
|
+
logger.action(`Running task: ${task}`);
|
56
|
+
|
57
|
+
gulp.task('check-ts', gulp.parallel(
|
58
|
+
checkTs(taskOptions),
|
59
|
+
));
|
60
|
+
|
61
|
+
gulp.task('scss', gulp.parallel(
|
62
|
+
compileScss(taskOptions),
|
63
|
+
));
|
64
|
+
|
65
|
+
gulp.task('build-backend', gulp.parallel(
|
66
|
+
buildBackend(taskOptions),
|
67
|
+
buildBackendJSW(taskOptions),
|
68
|
+
// buildBackendHTTP(taskOptions),
|
69
|
+
));
|
70
|
+
|
71
|
+
gulp.task('build-public', gulp.parallel(
|
72
|
+
buildPublic(taskOptions),
|
73
|
+
));
|
74
|
+
|
75
|
+
gulp.task('preview-templates', gulp.parallel(
|
76
|
+
previewTemplates(taskOptions),
|
77
|
+
));
|
78
|
+
|
79
|
+
gulp.task('copy-files', gulp.parallel(
|
80
|
+
copyFiles(taskOptions),
|
81
|
+
));
|
82
|
+
|
83
|
+
gulp.task('test', function () {
|
84
|
+
return shell.task(
|
85
|
+
['yarn test'],
|
86
|
+
{ ignoreErrors: true }
|
87
|
+
)().then(() => {
|
88
|
+
logger.success("Tests completed successfully.");
|
89
|
+
}).catch(err => {
|
90
|
+
logger.error("Error in test task!");
|
91
|
+
});
|
92
|
+
});
|
93
|
+
gulp.task('test-ci', function () {
|
94
|
+
return shell.task(
|
95
|
+
['yarn test --run'],
|
96
|
+
{ ignoreErrors: true }
|
97
|
+
)().then(() => {
|
98
|
+
logger.success("Tests completed successfully.");
|
99
|
+
}).catch(err => {
|
100
|
+
logger.error("Error in test task!");
|
101
|
+
});
|
102
|
+
});
|
103
|
+
|
104
|
+
gulp.task('sync-types', shell.task([
|
105
|
+
'yarn postinstall',
|
106
|
+
]));
|
107
|
+
|
108
|
+
gulp.task('fix-wix-types', gulp.parallel(
|
109
|
+
updateWixTypes(taskOptions)
|
110
|
+
));
|
111
|
+
|
112
|
+
gulp.task('add-wix-types', function(done: gulp.TaskFunctionCallback) {
|
113
|
+
return addTypes(taskOptions, done);
|
114
|
+
});
|
115
|
+
|
116
|
+
gulp.task('set-production', gulp.parallel(
|
117
|
+
setProdConfig()
|
118
|
+
));
|
119
|
+
|
120
|
+
gulp.task('start-wix', shell.task([
|
121
|
+
'yarn wix:dev',
|
122
|
+
]));
|
123
|
+
|
124
|
+
gulp.task('gen-docs', shell.task([
|
125
|
+
'yarn docs',
|
126
|
+
]));
|
127
|
+
|
128
|
+
gulp.task('fix-wix', gulp.series(
|
129
|
+
cleanWix(),
|
130
|
+
'sync-types',
|
131
|
+
'fix-wix-types',
|
132
|
+
'add-wix-types'
|
133
|
+
));
|
134
|
+
|
135
|
+
gulp.task('build', gulp.parallel(
|
136
|
+
'build-backend',
|
137
|
+
'build-public',
|
138
|
+
'preview-templates',
|
139
|
+
buildPages(taskOptions),
|
140
|
+
compileScss(taskOptions),
|
141
|
+
'copy-files'
|
142
|
+
)
|
143
|
+
);
|
144
|
+
|
145
|
+
gulp.task('build-pipeline', gulp.series(
|
146
|
+
cleanSrc(taskOptions),
|
147
|
+
'set-production',
|
148
|
+
'check-ts',
|
149
|
+
'fix-wix-types',
|
150
|
+
'add-wix-types',
|
151
|
+
'test-ci',
|
152
|
+
'build',
|
153
|
+
));
|
154
|
+
|
155
|
+
gulp.task('build-prod', gulp.series(
|
156
|
+
(done) => checkPages(true, false).then(() => done(), (err) => done(err)),
|
157
|
+
cleanSrc(taskOptions),
|
158
|
+
'set-production',
|
159
|
+
'fix-wix',
|
160
|
+
'check-ts',
|
161
|
+
'test-ci',
|
162
|
+
'build-backend',
|
163
|
+
'build-public',
|
164
|
+
buildPages(taskOptions),
|
165
|
+
'copy-files',
|
166
|
+
compileScss(taskOptions),
|
167
|
+
// 'gen-docs'
|
168
|
+
));
|
169
|
+
|
170
|
+
gulp.task('start-dev-env', gulp.parallel(
|
171
|
+
watchAll(taskOptions),
|
172
|
+
'test',
|
173
|
+
'start-wix',
|
174
|
+
'check-ts',
|
175
|
+
(done) => checkPages(false, config.force).then(() => done(), (err) => done(err)),
|
176
|
+
));
|
177
|
+
|
178
|
+
gulp.task('dev', gulp.series(
|
179
|
+
cleanSrc(taskOptions),
|
180
|
+
'fix-wix',
|
181
|
+
'build',
|
182
|
+
'start-dev-env',
|
183
|
+
)
|
184
|
+
);
|
185
|
+
|
186
|
+
yield* Effect.tryPromise({
|
187
|
+
try: () => {
|
188
|
+
return new Promise(function (resolve, reject) {
|
189
|
+
gulp.series(task, (done) => {
|
190
|
+
resolve(true);
|
191
|
+
done();
|
192
|
+
})(function (err) {
|
193
|
+
if (err) {
|
194
|
+
logger.error("Error starting tasks:", err);
|
195
|
+
reject(err);
|
196
|
+
}
|
197
|
+
});
|
198
|
+
});
|
199
|
+
},
|
200
|
+
catch: (e) => {
|
201
|
+
logger.error("Error starting tasks:", e);
|
202
|
+
return new AppError({ message: 'Error starting tasks', cause: e });
|
203
|
+
}
|
204
|
+
})
|
205
|
+
|
206
|
+
logger.report("Task completed successfully:", task);
|
207
|
+
});
|
@@ -0,0 +1,113 @@
|
|
1
|
+
import gulp from 'gulp';
|
2
|
+
import rename from 'gulp-rename';
|
3
|
+
import * as path from 'path';
|
4
|
+
import swc from 'gulp-swc';
|
5
|
+
import { logger } from '../../utils/logger.js';
|
6
|
+
import { TaskOptions } from '../../schemas/gulp.js';
|
7
|
+
import { TaskType } from '../../schemas/types.js';
|
8
|
+
|
9
|
+
const swcOptions = {
|
10
|
+
jsc: {
|
11
|
+
target: 'es2020',
|
12
|
+
parser: {
|
13
|
+
syntax: "typescript",
|
14
|
+
tsx: true,
|
15
|
+
decorators: true,
|
16
|
+
// preserveAllComments: true
|
17
|
+
},
|
18
|
+
preserveAllComments: false,
|
19
|
+
minify: {
|
20
|
+
compress: true // equivalent to {}
|
21
|
+
}
|
22
|
+
},
|
23
|
+
};
|
24
|
+
|
25
|
+
export function buildBackend(options: TaskOptions): TaskType {
|
26
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
27
|
+
|
28
|
+
const { outputDir } = options;
|
29
|
+
|
30
|
+
// Create tasks for each folder
|
31
|
+
const tasks = folders.map((folder) => {
|
32
|
+
const taskName = `build_Backend-${folder}`; // Create a unique name for each task
|
33
|
+
|
34
|
+
const task = () =>
|
35
|
+
gulp.src([
|
36
|
+
`${folder}/backend/**/*.ts`,
|
37
|
+
`${folder}/backend/**/*.tsx`,
|
38
|
+
`!${folder}/backend/**/*.jsw.ts`,
|
39
|
+
`!${folder}/backend/**/*.spec.ts`,
|
40
|
+
])
|
41
|
+
.pipe(swc(swcOptions))
|
42
|
+
.on('error', function (e: Error) {
|
43
|
+
logger.error(`Build of Backend files for ${folder} failed!`);
|
44
|
+
logger.error(`Error: ${e.message}`);
|
45
|
+
|
46
|
+
this.emit('end');
|
47
|
+
})
|
48
|
+
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
49
|
+
.on('error', function (e: Error) {
|
50
|
+
logger.error(`Build of Backend files for ${folder} failed!`);
|
51
|
+
logger.error(`Error: ${e.message}`);
|
52
|
+
|
53
|
+
this.emit('end');
|
54
|
+
})
|
55
|
+
.on('end', function () {
|
56
|
+
logger.success(`Build of Backend files for ${folder} succeeded!`);
|
57
|
+
});
|
58
|
+
|
59
|
+
// Register the task with Gulp
|
60
|
+
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
61
|
+
return task;
|
62
|
+
});
|
63
|
+
|
64
|
+
// Run all tasks in parallel
|
65
|
+
return gulp.parallel(...tasks);
|
66
|
+
}
|
67
|
+
|
68
|
+
|
69
|
+
export function buildBackendJSW(options: TaskOptions): TaskType {
|
70
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
71
|
+
|
72
|
+
const swcOptions = {
|
73
|
+
jsc: {
|
74
|
+
target: 'es6',
|
75
|
+
},
|
76
|
+
};
|
77
|
+
const { outputDir } = options;
|
78
|
+
|
79
|
+
// Create tasks for each folder
|
80
|
+
const tasks = folders.map((folder) => {
|
81
|
+
const taskName = `build-${folder}`; // Create a unique name for each task
|
82
|
+
|
83
|
+
const task = () =>
|
84
|
+
gulp.src([
|
85
|
+
`${folder}/backend/**/*.jsw.ts`,
|
86
|
+
])
|
87
|
+
.pipe(swc(swcOptions))
|
88
|
+
.on('error', function (e: Error) {
|
89
|
+
logger.error(`Build of JSW files for ${folder} failed!`);
|
90
|
+
logger.error(`Error: ${e.message}`);
|
91
|
+
|
92
|
+
this.emit('end');
|
93
|
+
})
|
94
|
+
.pipe(rename({ extname: '' }))
|
95
|
+
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
96
|
+
.on('error', function (e: Error) {
|
97
|
+
logger.error(`Build of JSW files for ${folder} failed!`);
|
98
|
+
logger.error(`Error: ${e.message}`);
|
99
|
+
|
100
|
+
this.emit('end');
|
101
|
+
})
|
102
|
+
.on('end', function () {
|
103
|
+
logger.success(`Build of JSW files for ${folder} succeeded!`);
|
104
|
+
});
|
105
|
+
|
106
|
+
// Register the task with Gulp
|
107
|
+
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
108
|
+
return task;
|
109
|
+
});
|
110
|
+
|
111
|
+
// Run all tasks in parallel
|
112
|
+
return gulp.parallel(...tasks);
|
113
|
+
}
|
@@ -0,0 +1,218 @@
|
|
1
|
+
import * as fs from 'fs';
|
2
|
+
import { glob } from 'glob';
|
3
|
+
|
4
|
+
import * as path from 'path';
|
5
|
+
import gulp, { emit } from 'gulp';
|
6
|
+
import ts from 'gulp-typescript';
|
7
|
+
import { blue, logger, red, yellow } from '../../utils/logger.js';
|
8
|
+
import { TaskOptions } from '../../schemas/gulp.js';
|
9
|
+
import { TaskType } from '../../schemas/types.js';
|
10
|
+
|
11
|
+
// /**
|
12
|
+
// * Extracts a match from a file
|
13
|
+
// * @param {string} filePath File path
|
14
|
+
// * @param {string} pattern Pattern to match
|
15
|
+
// */
|
16
|
+
// function extractMatchFromFile(filePath: string, pattern: string) {
|
17
|
+
// return new Promise((resolve, reject) => {
|
18
|
+
// fs.readFile(filePath, 'utf8', (err, data) => {
|
19
|
+
// if (err){
|
20
|
+
// reject(err);
|
21
|
+
|
22
|
+
// return;
|
23
|
+
// }
|
24
|
+
// const regex = new RegExp(pattern);
|
25
|
+
// const match = regex.exec(data);
|
26
|
+
// const capturedGroup = match ? match.groups?.page : null;
|
27
|
+
// resolve(capturedGroup);
|
28
|
+
// });
|
29
|
+
// });
|
30
|
+
// }
|
31
|
+
|
32
|
+
// async function readFilesInFolder(folderPath: string, pattern: string | null, globPattern: string): Promise<Object[]> {
|
33
|
+
// const files = await glob(path.join(folderPath, globPattern));
|
34
|
+
// const filenameList: Object[] = [];
|
35
|
+
|
36
|
+
// for (const file of files) {
|
37
|
+
// if (pattern) {
|
38
|
+
// const capturedGroup = await extractMatchFromFile(file, pattern);
|
39
|
+
// if (capturedGroup) {
|
40
|
+
// filenameList.push(capturedGroup);
|
41
|
+
// }
|
42
|
+
// } else {
|
43
|
+
// filenameList.push(path.basename(file));
|
44
|
+
// }
|
45
|
+
// }
|
46
|
+
|
47
|
+
// return filenameList;
|
48
|
+
// }
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Extracts a match from a file
|
52
|
+
* @param {string} filePath File path
|
53
|
+
* @param {string} pattern Pattern to match
|
54
|
+
*/
|
55
|
+
function extractMatchFromFile(filePath: string, pattern: string) {
|
56
|
+
return new Promise((resolve, reject) => {
|
57
|
+
fs.readFile(filePath, 'utf8', (err, data) => {
|
58
|
+
if (err){
|
59
|
+
reject(err);
|
60
|
+
|
61
|
+
return;
|
62
|
+
}
|
63
|
+
const regex = new RegExp(pattern);
|
64
|
+
const match = regex.exec(data);
|
65
|
+
const capturedGroup = match ? match.groups?.page : null;
|
66
|
+
resolve(capturedGroup);
|
67
|
+
});
|
68
|
+
});
|
69
|
+
}
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Reads files in a folder
|
73
|
+
* @param {string} folderPath Folder path
|
74
|
+
* @param {string} pattern Pattern to match
|
75
|
+
* @param {string} globPattern Glob pattern
|
76
|
+
*/
|
77
|
+
async function readFilesInFolder(folderPath: string, pattern: string | null, globPattern: string,) {
|
78
|
+
const files = await glob.glob(path.join(folderPath, globPattern));
|
79
|
+
const filenameList: Object[] = [];
|
80
|
+
function traverseFiles(index: number) {
|
81
|
+
if (index === files.length){
|
82
|
+
return;
|
83
|
+
}
|
84
|
+
const file = files[index];
|
85
|
+
if(pattern){
|
86
|
+
if(!file) return
|
87
|
+
extractMatchFromFile(file, pattern)
|
88
|
+
.then((capturedGroup) => {
|
89
|
+
if (capturedGroup){
|
90
|
+
filenameList.push(capturedGroup);
|
91
|
+
}
|
92
|
+
traverseFiles(index + 1);
|
93
|
+
})
|
94
|
+
.catch(() => { throw new Error(`Error reading file: ${file}`); });
|
95
|
+
}
|
96
|
+
if(!pattern){
|
97
|
+
if(!file) return
|
98
|
+
filenameList.push(path.basename(file));
|
99
|
+
traverseFiles(index + 1);
|
100
|
+
}
|
101
|
+
}
|
102
|
+
traverseFiles(0);
|
103
|
+
|
104
|
+
return filenameList;
|
105
|
+
}
|
106
|
+
export async function checkPages(fail: boolean, force: boolean) {
|
107
|
+
logger.action('Checking pages...');
|
108
|
+
return new Promise<void>(async (resolve, reject) => {
|
109
|
+
try {
|
110
|
+
const sourcePages = await readFilesInFolder('./.wix/types/', '\\/pages\\/(?<page>.*\\.ts)', '**/*.json',) as string[];
|
111
|
+
const tsPages = await readFilesInFolder('./typescript/pages', null, '**/*.ts',) as string[];
|
112
|
+
|
113
|
+
const sourcePagesSet = new Set(sourcePages);
|
114
|
+
const tsPagesSet = new Set(tsPages);
|
115
|
+
const missingInTs = Array.from(sourcePagesSet).filter((item: string) => !tsPages.includes(item));
|
116
|
+
const obsoleteInTs = Array.from(tsPagesSet).filter((item: string) => !sourcePages.includes(item));
|
117
|
+
if (missingInTs.length > 0){
|
118
|
+
if(!force){
|
119
|
+
const formattedList = missingInTs.map(page => ` • ${page}`).join('\n');
|
120
|
+
logger.error('Missing pages in ts folder::\n' + yellow(formattedList));
|
121
|
+
}
|
122
|
+
if(force) {
|
123
|
+
for (const page of missingInTs) {
|
124
|
+
logger.action('Creating missing page: ', page);
|
125
|
+
fs.writeFileSync(`./typescript/pages/${page}`, '');
|
126
|
+
}
|
127
|
+
}
|
128
|
+
}
|
129
|
+
if (obsoleteInTs.length > 0){
|
130
|
+
if(!force){
|
131
|
+
const formattedList = obsoleteInTs.map(page => ` • ${page}`).join('\n');
|
132
|
+
logger.error('Obsolete pages in TS folder:\n' + yellow(formattedList));
|
133
|
+
}
|
134
|
+
if(force) {
|
135
|
+
for (const page of obsoleteInTs) {
|
136
|
+
logger.action('Deleting obsolete page: ', page);
|
137
|
+
fs.rmSync(`./typescript/pages/${page}`);
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
if (missingInTs.length === 0 && obsoleteInTs.length === 0) {
|
142
|
+
logger.success("All pages are in-sync!");
|
143
|
+
} else if(fail){
|
144
|
+
process.exit(1);
|
145
|
+
};
|
146
|
+
} catch (error) {
|
147
|
+
reject(error);
|
148
|
+
}
|
149
|
+
});
|
150
|
+
}
|
151
|
+
|
152
|
+
const customReporter: ts.reporter.Reporter = {
|
153
|
+
error: (error, tsInstance) => {
|
154
|
+
if (!error.diagnostic) {
|
155
|
+
logger.error(error.message);
|
156
|
+
return;
|
157
|
+
}
|
158
|
+
const { fullFilename, startPosition } = error;
|
159
|
+
const relativePath = path.relative(process.cwd(), fullFilename ?? '');
|
160
|
+
const line = startPosition ? startPosition.line + 1 : 0;
|
161
|
+
const col = startPosition ? startPosition.character + 1 : 0;
|
162
|
+
|
163
|
+
const message = tsInstance.flattenDiagnosticMessageText(error.diagnostic.messageText, '\n');
|
164
|
+
|
165
|
+
logger.error(`${red.underline(relativePath)}:${yellow(String(line))}:${yellow(String(col))}`);
|
166
|
+
logger.error(`${red('error')} ${yellow(`TS${error.diagnostic.code}`)}: ${message}`);
|
167
|
+
},
|
168
|
+
finish: (results) => {
|
169
|
+
const errorCount = results.transpileErrors + results.semanticErrors + results.declarationErrors;
|
170
|
+
if (errorCount > 0) {
|
171
|
+
logger.error(`${red.bold(`Found ${errorCount} error${errorCount > 1 ? 's' : ''}.`)}`);
|
172
|
+
}
|
173
|
+
},
|
174
|
+
};
|
175
|
+
|
176
|
+
export function checkTs(options: TaskOptions, watching: boolean = false): TaskType {
|
177
|
+
const folders = ["typescript", ...options.modulesSourcePaths];
|
178
|
+
|
179
|
+
const tasks = folders.map((folder) => {
|
180
|
+
const tsProject = ts.createProject(`./local.tsconfig.json`, {
|
181
|
+
noEmit: true,
|
182
|
+
declaration: false,
|
183
|
+
skipDefaultLibCheck: true,
|
184
|
+
});
|
185
|
+
const taskName = `test-${folder}`;
|
186
|
+
|
187
|
+
const task = (done: gulp.TaskFunctionCallback) => {
|
188
|
+
let hasError = false;
|
189
|
+
const stream = gulp
|
190
|
+
.src([`${folder}/**/*.ts`, `!${folder}/types/**/*.ts`])
|
191
|
+
.pipe(tsProject(customReporter))
|
192
|
+
.on("error", (error) => {
|
193
|
+
hasError = true;
|
194
|
+
logger.error(`Error in ${folder}: ${error.message}`);
|
195
|
+
if (watching) {
|
196
|
+
stream.emit("end");
|
197
|
+
} else {
|
198
|
+
logger.error(`TypeScript check failed for ${folder}.`);
|
199
|
+
process.exit(1); // Exit with error code
|
200
|
+
}
|
201
|
+
}
|
202
|
+
);
|
203
|
+
|
204
|
+
stream.on("end", () => {
|
205
|
+
if (!hasError) {
|
206
|
+
logger.success(`Typescript check for ${folder} succeeded!`);
|
207
|
+
}
|
208
|
+
stream.emit("finish");
|
209
|
+
});
|
210
|
+
return stream;
|
211
|
+
};
|
212
|
+
|
213
|
+
Object.defineProperty(task, "name", { value: taskName });
|
214
|
+
return task;
|
215
|
+
});
|
216
|
+
|
217
|
+
return gulp.parallel(...tasks);
|
218
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import gulp from 'gulp';
|
2
|
+
import clean from 'gulp-clean';
|
3
|
+
import { logger } from '../../utils/logger.js';
|
4
|
+
import { TaskOptions } from '../../schemas/gulp.js';
|
5
|
+
|
6
|
+
export function cleanWix() {
|
7
|
+
return () => {
|
8
|
+
return gulp.src('./.wix', { read: false, allowEmpty: true })
|
9
|
+
.pipe(clean({ force: true }))
|
10
|
+
.on('error', function (e: Error) {
|
11
|
+
logger.error('Cleaning of .wix failed!');
|
12
|
+
logger.error(`Error: ${e.message}`);
|
13
|
+
|
14
|
+
|
15
|
+
this.emit('end');
|
16
|
+
})
|
17
|
+
.on('end', function() {
|
18
|
+
logger.success("Cleaning of .wix succeeded!");
|
19
|
+
});
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
export function cleanSrc(options: TaskOptions) {
|
24
|
+
const { outputDir } = options;
|
25
|
+
|
26
|
+
return () => {
|
27
|
+
return gulp.src([`${outputDir}/pages`, `${outputDir}/public`, `${outputDir}/backend`], { read: false, allowEmpty: true })
|
28
|
+
.pipe(clean({ force: true }))
|
29
|
+
.on('error', function (e: Error) {
|
30
|
+
logger.error('Cleaning of output files failed!');
|
31
|
+
logger.error(`Error: ${e.message}`);
|
32
|
+
this.emit('end');
|
33
|
+
})
|
34
|
+
.on('end', function() {
|
35
|
+
logger.success('Cleaning of .src succeeded!');
|
36
|
+
});
|
37
|
+
}
|
38
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import gulp from 'gulp';
|
2
|
+
import { logger } from '../../utils/logger.js';
|
3
|
+
import { TaskOptions } from '../../schemas/gulp.js';
|
4
|
+
import { TaskType } from '../../schemas/types.js';
|
5
|
+
|
6
|
+
export function copyFiles(options: TaskOptions): TaskType {
|
7
|
+
const folders = ['typescript', ...options.modulesSourcePaths];
|
8
|
+
const tasks = folders.map((folder) => {
|
9
|
+
const { outputDir} = options;
|
10
|
+
const taskName = `copy-${folder}`; // Create a unique name for each task
|
11
|
+
const task = () =>
|
12
|
+
gulp.src([
|
13
|
+
`${folder}/**/*`,
|
14
|
+
`!${folder}/*tsconfig.json`,
|
15
|
+
`!${folder}/**/*.ts`,
|
16
|
+
`!${folder}/**/*.tsx`,
|
17
|
+
`!${folder}/types/**/**`,
|
18
|
+
`!${folder}/__mocks__/**/**`,
|
19
|
+
`!${folder}/styles/**`,
|
20
|
+
])
|
21
|
+
.pipe(gulp.dest(outputDir))
|
22
|
+
.on('error', function (e: Error) {
|
23
|
+
logger.error(`Copy of files for ${folder} failed!`);
|
24
|
+
logger.error(`Error: ${e.message}`);
|
25
|
+
this.emit('end');
|
26
|
+
})
|
27
|
+
.on('end', function () {
|
28
|
+
logger.success(`Copy of files for ${folder} succeeded!`);
|
29
|
+
});
|
30
|
+
|
31
|
+
// Register the task with Gulp
|
32
|
+
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
33
|
+
return task;
|
34
|
+
});
|
35
|
+
const t = gulp.parallel(...tasks);
|
36
|
+
// Run all tasks in parallel
|
37
|
+
return gulp.parallel(...tasks);
|
38
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { Effect } from 'effect/index';
|
2
|
+
import { Config } from '../../config.js';
|
3
|
+
|
4
|
+
export const getModulesSourcePaths = Effect.gen(function* () {
|
5
|
+
const config = yield* Config
|
6
|
+
const data = config.config.lucySettings.modules;
|
7
|
+
const paths: string[] = [];
|
8
|
+
for (const module of Object.keys(data)) {
|
9
|
+
if (!data[module].noCompile) {
|
10
|
+
if (data[module].path) {
|
11
|
+
paths.push(data[module].path);
|
12
|
+
} else {
|
13
|
+
paths.push(module);
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
return paths;
|
18
|
+
});
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import gulp from 'gulp';
|
2
|
+
import * as path from 'path';
|
3
|
+
import swc from 'gulp-swc';
|
4
|
+
import { logger } from '../../utils/logger.js';
|
5
|
+
import { TaskOptions } from '../../schemas/gulp.js';
|
6
|
+
|
7
|
+
const swcOptions = {
|
8
|
+
jsc: {
|
9
|
+
target: 'es2020',
|
10
|
+
parser: {
|
11
|
+
syntax: "typescript",
|
12
|
+
tsx: true,
|
13
|
+
},
|
14
|
+
preserveAllComments: false,
|
15
|
+
minify: {
|
16
|
+
compress: true // equivalent to {}
|
17
|
+
}
|
18
|
+
},
|
19
|
+
};
|
20
|
+
|
21
|
+
export function buildPages(options: TaskOptions) {
|
22
|
+
const { outputDir} = options;
|
23
|
+
|
24
|
+
return () => {
|
25
|
+
return gulp.src('typescript/pages/*.ts')
|
26
|
+
.pipe(swc(swcOptions))
|
27
|
+
.on('error', function (e: Error) {
|
28
|
+
logger.error('Build of Pages files failed!');
|
29
|
+
logger.error(`Error: ${e.message}`);
|
30
|
+
|
31
|
+
this.emit('end');
|
32
|
+
})
|
33
|
+
.pipe(gulp.dest(path.join(outputDir, 'pages')))
|
34
|
+
.on('error', function (e: Error) {
|
35
|
+
logger.error('Build of Pages TS files failed!');
|
36
|
+
logger.error(`Error: ${e.message}`);
|
37
|
+
this.emit('end');
|
38
|
+
})
|
39
|
+
.on('end', function() {
|
40
|
+
logger.success('Build of Pages TS files succeeded!');
|
41
|
+
});
|
42
|
+
};
|
43
|
+
}
|