lucy-cli 2.0.0-alpha.9 â 2.0.0-beta.2
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/README.md +117 -102
- package/dist/args.d.ts +1 -6
- package/dist/args.js +103 -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/lucy.jpg +0 -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 +103 -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,310 @@
|
|
1
|
+
import gulp from 'gulp';
|
2
|
+
import * as path from 'path';
|
3
|
+
import { File, TaskOptions } from '../../schemas/gulp.js';
|
4
|
+
import replace from 'gulp-string-replace';
|
5
|
+
import flatmap from 'gulp-flatmap';
|
6
|
+
import jeditor from 'gulp-json-editor';
|
7
|
+
import * as insert from 'gulp-insert';
|
8
|
+
import tap from 'gulp-tap';
|
9
|
+
import { TSConfig } from '../../schemas/tsconfig.js';
|
10
|
+
import { logger, orange, yellow } from '../../utils/logger.js';
|
11
|
+
|
12
|
+
export function updateWixTypes(options: TaskOptions) {
|
13
|
+
return () => {
|
14
|
+
const { publicSettings, backendSettings, masterSettings, pageSettings, replaceOptions } = options;
|
15
|
+
let count = 0;
|
16
|
+
|
17
|
+
|
18
|
+
// Add module to publicSettings
|
19
|
+
publicSettings.compilerOptions.paths['backend/*.web'] = [ "../../../typescript/backend/*.web.ts" ] as never;
|
20
|
+
publicSettings.compilerOptions.paths['backend/*.web.js'] = [ "../../../typescript/backend/*.web.ts" ] as never;
|
21
|
+
publicSettings.compilerOptions.paths['backend/*'] = [ "../../../typescript/backend/*.web.ts" ] as never;
|
22
|
+
publicSettings.compilerOptions.paths['backend/*.jsw'] = [ "../../../typescript/backend/*.jsw.ts" ] as never;
|
23
|
+
publicSettings.compilerOptions.paths.mocks = [ "../../../typescript/__mocks__/*" ] as never;
|
24
|
+
publicSettings.compilerOptions.paths['types/*'] = [ "../../../typescript/types/*" ] as never;
|
25
|
+
publicSettings.compilerOptions.paths['public/*'] = [ "../../../typescript/public/*.ts" ] as never;
|
26
|
+
publicSettings.include = [
|
27
|
+
"../../../typescript/public/**/*",
|
28
|
+
"../../../typescript/__mocks__/**/*",
|
29
|
+
// "../../../typescript/backend/**/*.jsw.ts",
|
30
|
+
// "../../../typescript/backend/**/*.web.ts",
|
31
|
+
// "../../../typescript/backend/**/*.web"
|
32
|
+
] as never;
|
33
|
+
|
34
|
+
// Add module to backendSettings
|
35
|
+
backendSettings.compilerOptions.paths.mocks = [ "../../../typescript/__mocks__/*" ] as never;
|
36
|
+
backendSettings.compilerOptions.paths['types/*'] = [ `../../../typescript/types/*` ] as never;
|
37
|
+
backendSettings.include = [
|
38
|
+
"../../../typescript/backend/**/*",
|
39
|
+
"../../../typescript/__mocks__/**/*",
|
40
|
+
// "../../../typescript/backend/**/*.jsw.ts",
|
41
|
+
// "../../../typescript/backend/**/*.web.ts",
|
42
|
+
// "../../../typescript/backend/**/*.web"
|
43
|
+
] as never;
|
44
|
+
// Add module to masterSettings
|
45
|
+
masterSettings.compilerOptions.paths['backend/*.web'] = [ "../../../typescript/backend/*.web.ts" ] as never;
|
46
|
+
masterSettings.compilerOptions.paths['backend/*.web.js'] = [ "../../../typescript/backend/*.web.ts" ] as never;
|
47
|
+
masterSettings.compilerOptions.paths['backend/*'] = [ "../../../typescript/backend/*.web.ts" ] as never;
|
48
|
+
masterSettings.compilerOptions.paths['backend/*.jsw'] = [ "../../../typescript/backend/*.jsw.ts" ] as never;
|
49
|
+
masterSettings.compilerOptions.paths['types/*'] = [ "../../../typescript/types/*" ] as never;
|
50
|
+
masterSettings.include = [
|
51
|
+
"../../../typescript/public/**/*",
|
52
|
+
"../../../typescript/__mocks__/**/*",
|
53
|
+
// "../../../typescript/backend/**/*.jsw.ts",
|
54
|
+
// "../../../typescript/backend/**/*.web.ts",
|
55
|
+
// "../../../typescript/backend/**/*.web"
|
56
|
+
] as never;
|
57
|
+
// Add module to pageSettings
|
58
|
+
pageSettings.compilerOptions.paths['backend/*.web'] = [ "../../../typescript/backend/*.web.ts" ] as never;
|
59
|
+
pageSettings.compilerOptions.paths['backend/*.web.js'] = [ "../../../typescript/backend/*.web.ts" ] as never;
|
60
|
+
pageSettings.compilerOptions.paths['backend/*'] = [ "../../../typescript/backend/*.web.ts" ] as never;
|
61
|
+
pageSettings.compilerOptions.paths['backend/*.jsw'] = [ "../../../typescript/backend/*.jsw.ts" ] as never;
|
62
|
+
pageSettings.compilerOptions.paths['types/*'] = [ "../../../typescript/types/*" ] as never;
|
63
|
+
pageSettings.compilerOptions.paths['backend/*.jsw'] = [ "../../../typescript/backend/*.jsw.ts" ] as never;
|
64
|
+
pageSettings.include = [
|
65
|
+
"../../../typescript/public/**/*",
|
66
|
+
"../../../typescript/__mocks__/**/*",
|
67
|
+
// "../../../typescript/backend/**/*.jsw.ts",
|
68
|
+
// "../../../typescript/backend/**/*.web.ts",
|
69
|
+
// "../../../typescript/backend/**/*.web"
|
70
|
+
] as never;
|
71
|
+
|
72
|
+
for (const name of options.modulesSourcePaths) {
|
73
|
+
// Add module to publicSettings
|
74
|
+
publicSettings.compilerOptions.paths['backend/*.web.js'].push(`../../../${name}/backend/*.web.ts` as never);
|
75
|
+
publicSettings.compilerOptions.paths['backend/*.web'].push(`../../../${name}/backend/*.web.ts` as never);
|
76
|
+
publicSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*.web.ts` as never);
|
77
|
+
publicSettings.compilerOptions.paths['backend/*.jsw'].push(`../../../${name}/backend/*.jsw.ts` as never);
|
78
|
+
publicSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
|
79
|
+
publicSettings.compilerOptions.paths.mocks.push(...[ `../../../${name}/__mocks__/*` as never ]);
|
80
|
+
publicSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
|
81
|
+
publicSettings.include.push(...[
|
82
|
+
`../../../${name}/public/**/*`,
|
83
|
+
`../../../${name}__mocks__/**/*`,
|
84
|
+
// `../../../${name}/backend/**/*.jsw.ts`,
|
85
|
+
// `../../../${name}/backend/**/*.web.ts`,
|
86
|
+
// `../../../${name}/backend/**/*.web`
|
87
|
+
] as never[]);
|
88
|
+
// Add module to backendSettings
|
89
|
+
backendSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
|
90
|
+
backendSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*` as never);
|
91
|
+
backendSettings.compilerOptions.paths.mocks.push(...[ `../../../${name}/__mocks__/*` ] as never[]);
|
92
|
+
backendSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
|
93
|
+
backendSettings.include.push(...[
|
94
|
+
`../../../${name}/public/**/*`,
|
95
|
+
`../../../${name}__mocks__/**/*`,
|
96
|
+
`../../../${name}/backend/**/*`,
|
97
|
+
// `../../../${name}/backend/**/*.jsw.ts`,
|
98
|
+
// `../../../${name}/backend/**/*.web.ts`,
|
99
|
+
// `../../../${name}/backend/**/*.web`
|
100
|
+
] as never[]);
|
101
|
+
// Add module to masterSettings
|
102
|
+
masterSettings.compilerOptions.paths['backend/*.web.js'].push(`../../../${name}/backend/*.web.ts` as never);
|
103
|
+
masterSettings.compilerOptions.paths['backend/*.web'].push(`../../../${name}/backend/*.web.ts` as never);
|
104
|
+
masterSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*.web.ts` as never);
|
105
|
+
masterSettings.compilerOptions.paths['backend/*.jsw'].push(`../../../${name}/backend/*.jsw.ts` as never);
|
106
|
+
masterSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
|
107
|
+
masterSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
|
108
|
+
masterSettings.include.push(...[
|
109
|
+
`../../../${name}/public/**/*`,
|
110
|
+
`../../../${name}__mocks__/**/*`,
|
111
|
+
// `../../../${name}/backend/**/*.jsw.ts`,
|
112
|
+
// `../../../${name}/backend/**/*.web.ts`,
|
113
|
+
// `../../../${name}/backend/**/*.web`
|
114
|
+
] as never[]);
|
115
|
+
// Add module to pageSettings
|
116
|
+
pageSettings.compilerOptions.paths['backend/*.web.js'].push(`../../../${name}/backend/*.web.ts` as never);
|
117
|
+
pageSettings.compilerOptions.paths['backend/*.web'].push(`../../../${name}/backend/*.web.ts` as never);
|
118
|
+
pageSettings.compilerOptions.paths['backend/*'].push(`../../../${name}/backend/*.web.ts` as never);
|
119
|
+
pageSettings.compilerOptions.paths['backend/*.jsw'].push(`../../../${name}/backend/*.jsw.ts` as never);
|
120
|
+
pageSettings.compilerOptions.paths['public/*'].push(`../../../${name}/public/*` as never);
|
121
|
+
pageSettings.compilerOptions.paths['types/*'].push(`../../../${name}/types/*` as never);
|
122
|
+
pageSettings.include.push(...[
|
123
|
+
`../../../${name}/public/**/*`,
|
124
|
+
`../../../${name}__mocks__/**/*`,
|
125
|
+
// `../../../${name}/backend/**/*.jsw.ts`,
|
126
|
+
// `../../../${name}/backend/**/*.web.ts`,
|
127
|
+
// `../../../${name}/backend/**/*.web`
|
128
|
+
] as never[]);
|
129
|
+
}
|
130
|
+
|
131
|
+
return gulp.src(['./.wix/types/**/*.json', '!./.wix/types/wix-code-types/**/*'])
|
132
|
+
.pipe(flatmap(function(stream: NodeJS.ReadableStream, file: File) {
|
133
|
+
count ++;
|
134
|
+
if (file.dirname.endsWith('public')) {
|
135
|
+
return stream.pipe(jeditor(publicSettings))
|
136
|
+
.pipe(jeditor((json: any) => cleanTsConfig(json)))
|
137
|
+
.pipe(jeditor((json: any) => processJson(json)))
|
138
|
+
.pipe(replace('"../backend.d.ts",', '', replaceOptions))
|
139
|
+
.pipe(replace('"../../../src/backend/\\*\\*/\\*.web.js",', '', replaceOptions));
|
140
|
+
}
|
141
|
+
if (file.dirname.endsWith('backend')) {
|
142
|
+
return stream.pipe(jeditor(backendSettings))
|
143
|
+
.pipe(jeditor((json: any) => cleanTsConfig(json)))
|
144
|
+
.pipe(jeditor((json: any) => processJson(json)))
|
145
|
+
};
|
146
|
+
if (file.dirname.endsWith('masterPage')) {
|
147
|
+
return stream.pipe(jeditor(masterSettings))
|
148
|
+
.pipe(jeditor((json: any) => cleanTsConfig(json)))
|
149
|
+
.pipe(jeditor((json: any) => processJson(json)))
|
150
|
+
.pipe(replace('"../backend.d.ts",', '', replaceOptions))
|
151
|
+
.pipe(replace('"../../../src/backend/\\*\\*/\\*.web.js",', '', replaceOptions));
|
152
|
+
};
|
153
|
+
|
154
|
+
return stream.pipe(jeditor(pageSettings))
|
155
|
+
.pipe(jeditor((json: any) => cleanTsConfig(json)))
|
156
|
+
.pipe(jeditor((json: any) => processJson(json)))
|
157
|
+
.pipe(replace('"../backend.d.ts",', '', replaceOptions))
|
158
|
+
.pipe(replace('"../../../src/backend/\\*\\*/\\*.web.js",', '', replaceOptions));
|
159
|
+
}))
|
160
|
+
.pipe(replace('masterPage.masterPage.js', 'masterPage.ts', replaceOptions))
|
161
|
+
.pipe(replace('/src/', '/typescript/', replaceOptions))
|
162
|
+
.pipe(replace('.js"', '.ts"', replaceOptions))
|
163
|
+
.pipe(tap(function(file) { // tap into the stream to log the output
|
164
|
+
// console.debug(file.contents?.toString() ?? 'no content'); TODO: Uncomment when needed
|
165
|
+
}))
|
166
|
+
.pipe(gulp.dest((file: File) => {
|
167
|
+
const filePath = file.dirname;
|
168
|
+
const outputDir = path.dirname(filePath);
|
169
|
+
|
170
|
+
return path.join(outputDir);
|
171
|
+
}))
|
172
|
+
.on('error', function (e: Error) {
|
173
|
+
logger.error('Modification of WIX configs failed!');
|
174
|
+
logger.error(`Error: ${orange(e.message)}`);
|
175
|
+
this.emit('end');
|
176
|
+
})
|
177
|
+
.on('end', function() { logger.success(`Modification of ${yellow(count)} WIX configs succeeded!`); });
|
178
|
+
}
|
179
|
+
}
|
180
|
+
|
181
|
+
export function addTypes(options: TaskOptions, done: gulp.TaskFunctionCallback) {
|
182
|
+
const { replaceOptions } = options;
|
183
|
+
|
184
|
+
// Regex to match keywords at the beginning of a line, capturing any leading whitespace.
|
185
|
+
// The 'm' flag is for multiline matching (^ matches start of line).
|
186
|
+
// The 'g' flag is for global matching (replace all instances).
|
187
|
+
const interfaceRegex = /^(\s*)interface\s/gm;
|
188
|
+
const enumRegex = /^(\s*)enum\s/gm;
|
189
|
+
const typeRegex = /^(\s*)type\s/gm;
|
190
|
+
|
191
|
+
const streams = [
|
192
|
+
// Stream for common types
|
193
|
+
gulp.src(['./.wix/types/wix-code-types/dist/types/common/*.d.ts', '!./.wix/types/wix-code-types/dist/types/common/$w.d.ts'])
|
194
|
+
.pipe(replace(interfaceRegex, 'export interface ', replaceOptions))
|
195
|
+
.pipe(replace(enumRegex, 'export enum ', replaceOptions))
|
196
|
+
.pipe(replace(typeRegex, 'export type ', replaceOptions))
|
197
|
+
.pipe(gulp.dest('./.wix/types/wix-code-types/dist/types/common/')),
|
198
|
+
|
199
|
+
// Stream for beta types
|
200
|
+
gulp.src(['./.wix/types/wix-code-types/dist/types/beta/common/*.d.ts', '!./.wix/types/wix-code-types/dist/types/beta/common/$w.d.ts'])
|
201
|
+
.pipe(replace(interfaceRegex, 'export interface ', replaceOptions))
|
202
|
+
.pipe(replace(enumRegex, 'export enum ', replaceOptions))
|
203
|
+
.pipe(replace(typeRegex, 'export type ', replaceOptions))
|
204
|
+
.pipe(gulp.dest('./.wix/types/wix-code-types/dist/types/beta/common/')),
|
205
|
+
|
206
|
+
// Stream for processing $w.d.ts
|
207
|
+
gulp.src(['./.wix/types/wix-code-types/dist/types/common/$w.d.ts'])
|
208
|
+
.pipe(insert.prepend("import '@total-typescript/ts-reset';\n"))
|
209
|
+
.pipe(gulp.dest('./.wix/types/wix-code-types/dist/types/common/'))
|
210
|
+
];
|
211
|
+
|
212
|
+
let completedStreams = 0;
|
213
|
+
let hasErrored = false;
|
214
|
+
|
215
|
+
streams.forEach(stream => {
|
216
|
+
stream.on('end', () => {
|
217
|
+
completedStreams++;
|
218
|
+
if (completedStreams === streams.length && !hasErrored) {
|
219
|
+
logger.success('Updating WIX succeeded!');
|
220
|
+
done();
|
221
|
+
}
|
222
|
+
});
|
223
|
+
stream.on('error', (e: Error) => {
|
224
|
+
if (!hasErrored) {
|
225
|
+
hasErrored = true;
|
226
|
+
logger.error('Updating WIX failed!');
|
227
|
+
logger.error(`Error: ${orange(e.message)}`);
|
228
|
+
done(e);
|
229
|
+
}
|
230
|
+
});
|
231
|
+
});
|
232
|
+
};
|
233
|
+
function makeHashable(obj: any): any {
|
234
|
+
if (Array.isArray(obj)) {
|
235
|
+
return obj.map(makeHashable);
|
236
|
+
} else if (obj && typeof obj === 'object') {
|
237
|
+
const sortedKeys = Object.keys(obj).sort();
|
238
|
+
const result: any = {};
|
239
|
+
for (const key of sortedKeys) {
|
240
|
+
result[key] = makeHashable(obj[key]);
|
241
|
+
}
|
242
|
+
return result;
|
243
|
+
} else {
|
244
|
+
return obj;
|
245
|
+
}
|
246
|
+
}
|
247
|
+
|
248
|
+
function removeDuplicatesFromArray(arr: any[]): any[] {
|
249
|
+
const seen = new Set<string>();
|
250
|
+
const newArr: any[] = [];
|
251
|
+
|
252
|
+
for (const item of arr) {
|
253
|
+
const processedItem = processJson(item); // Recursively process the item
|
254
|
+
const hashableItem = makeHashable(processedItem);
|
255
|
+
const serializedItem = JSON.stringify(hashableItem);
|
256
|
+
|
257
|
+
if (!seen.has(serializedItem)) {
|
258
|
+
seen.add(serializedItem);
|
259
|
+
newArr.push(processedItem);
|
260
|
+
}
|
261
|
+
}
|
262
|
+
return newArr;
|
263
|
+
}
|
264
|
+
|
265
|
+
function processJson(obj: any): any {
|
266
|
+
if (Array.isArray(obj)) {
|
267
|
+
// Process arrays and remove duplicate items
|
268
|
+
const uniqueArray = removeDuplicatesFromArray(obj);
|
269
|
+
return uniqueArray.length > 0 ? uniqueArray : undefined; // Remove empty arrays
|
270
|
+
} else if (obj && typeof obj === 'object') {
|
271
|
+
// Process objects, ensuring keys are unique
|
272
|
+
const result: any = {};
|
273
|
+
const seenKeys = new Set<string>();
|
274
|
+
|
275
|
+
for (const key in obj) {
|
276
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
277
|
+
if (!seenKeys.has(key)) {
|
278
|
+
const processedValue = processJson(obj[key]);
|
279
|
+
if (processedValue !== undefined) { // Remove keys with undefined values
|
280
|
+
seenKeys.add(key);
|
281
|
+
result[key] = processedValue;
|
282
|
+
}
|
283
|
+
}
|
284
|
+
}
|
285
|
+
}
|
286
|
+
|
287
|
+
// If all keys were empty or undefined, return undefined
|
288
|
+
return Object.keys(result).length > 0 ? result : undefined;
|
289
|
+
} else {
|
290
|
+
// Return primitive values as-is
|
291
|
+
return obj;
|
292
|
+
}
|
293
|
+
}
|
294
|
+
|
295
|
+
function cleanTsConfig(json: TSConfig): TSConfig {
|
296
|
+
// const paths: Record<string, string[]> = {};
|
297
|
+
if (json.compilerOptions?.paths) {
|
298
|
+
for (const [key, value] of Object.entries(json.compilerOptions.paths)) {
|
299
|
+
const uniquePaths = new Set(value);
|
300
|
+
json.compilerOptions.paths[key] = Array.from(uniquePaths);
|
301
|
+
// paths[key] = Array.from(uniquePaths);
|
302
|
+
}
|
303
|
+
// json.compilerOptions.paths = paths;
|
304
|
+
}
|
305
|
+
json.include = Array.from(new Set(json.include));
|
306
|
+
json.exclude = Array.from(new Set(json.exclude));
|
307
|
+
json.files = Array.from(new Set(json.files));
|
308
|
+
|
309
|
+
return json;
|
310
|
+
}
|
@@ -0,0 +1,97 @@
|
|
1
|
+
import gulp from 'gulp';
|
2
|
+
import { buildBackend } from './backend.js';
|
3
|
+
import { buildPublic } from './public.js';
|
4
|
+
import { buildPages } from './pages.js';
|
5
|
+
import { copyFiles } from './copy.js';
|
6
|
+
import { previewTemplates } from './templates.js';
|
7
|
+
import { checkTs } from './checks.js';
|
8
|
+
import { TaskOptions } from '../../schemas/gulp.js';
|
9
|
+
import { TaskType } from '../../schemas/types.js';
|
10
|
+
|
11
|
+
export function watchAll(options: TaskOptions): TaskType {
|
12
|
+
function watchSCSS() {
|
13
|
+
return gulp.watch([
|
14
|
+
'*/styles/**/*.scss'
|
15
|
+
],
|
16
|
+
gulp.parallel('scss')
|
17
|
+
);
|
18
|
+
}
|
19
|
+
|
20
|
+
function watchBackend() {
|
21
|
+
return gulp.watch([
|
22
|
+
'*/backend/**/*.ts',
|
23
|
+
'*/backend/**/*.tsx',
|
24
|
+
'!*/backend/**/*.jsw.ts',
|
25
|
+
'!src/**/*',
|
26
|
+
], gulp.parallel(
|
27
|
+
checkTs(options, true),
|
28
|
+
buildBackend(options),
|
29
|
+
));
|
30
|
+
}
|
31
|
+
|
32
|
+
function watchPublic() {
|
33
|
+
return gulp.watch([
|
34
|
+
'*/public/**/*.ts',
|
35
|
+
'*/public/**/*.tsx',
|
36
|
+
'!src/**/*',
|
37
|
+
], gulp.parallel(
|
38
|
+
checkTs(options),
|
39
|
+
buildPublic(options),
|
40
|
+
));
|
41
|
+
}
|
42
|
+
|
43
|
+
function watchPages() {
|
44
|
+
return gulp.watch(['typescript/pages/**/*.ts', '!src/**/*',],
|
45
|
+
gulp.parallel(
|
46
|
+
checkTs(options),
|
47
|
+
buildPages(options),
|
48
|
+
)
|
49
|
+
);
|
50
|
+
}
|
51
|
+
|
52
|
+
function watchFiles() {
|
53
|
+
return gulp.watch([
|
54
|
+
'*/backend/**/*',
|
55
|
+
'*/public/**/*',
|
56
|
+
'*/pages/**/*',
|
57
|
+
'!*/**/*.ts',
|
58
|
+
'!*/**/*.tsx',
|
59
|
+
'!src/**/*',
|
60
|
+
], gulp.parallel(copyFiles(options)));
|
61
|
+
}
|
62
|
+
|
63
|
+
function watchTemplates() {
|
64
|
+
return gulp.watch([
|
65
|
+
'*/backend/templates/**/*.tsx',
|
66
|
+
'*/backend/templates/data/*.json',
|
67
|
+
'!*/backend/templates/render.ts',
|
68
|
+
'!src/**/*',
|
69
|
+
], gulp.parallel(
|
70
|
+
previewTemplates(options),
|
71
|
+
checkTs(options),
|
72
|
+
)
|
73
|
+
);
|
74
|
+
}
|
75
|
+
|
76
|
+
function watchTypes() {
|
77
|
+
return gulp.watch([
|
78
|
+
'./.wix/types/**/*.d.ts',
|
79
|
+
'!./.wix/types/wix-code-types',
|
80
|
+
'!src/**/*',
|
81
|
+
],
|
82
|
+
gulp.series(
|
83
|
+
'fix-wix-types'
|
84
|
+
)
|
85
|
+
);
|
86
|
+
}
|
87
|
+
|
88
|
+
return gulp.parallel(
|
89
|
+
watchSCSS,
|
90
|
+
watchBackend,
|
91
|
+
watchPublic,
|
92
|
+
watchPages,
|
93
|
+
watchFiles,
|
94
|
+
watchTemplates,
|
95
|
+
watchTypes,
|
96
|
+
);
|
97
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { Effect } from "effect/index"
|
2
|
+
import { Config } from "../config.js";
|
3
|
+
import { AppError } from "../error.js";
|
4
|
+
import { task_runGulp } from "./Gulpfile.js";
|
5
|
+
import { task_syncSettings } from "./syncSettings.js";
|
6
|
+
import { setNeedsCleanup } from "../index.js";
|
7
|
+
export const tasks = Effect.gen(function* (_) {
|
8
|
+
const config = yield* Config;
|
9
|
+
if(config.config.action.tasksName === undefined) {
|
10
|
+
return yield* Effect.fail(new AppError({ message: "No task name provided", cause: new Error("No task name provided") }));
|
11
|
+
}
|
12
|
+
if(
|
13
|
+
config.config.action.tasksName === 'dev'
|
14
|
+
|| config.config.action.tasksName === 'build'
|
15
|
+
|| config.config.action.tasksName === 'build-prod'
|
16
|
+
|| config.config.action.tasksName === 'build-pipeline'
|
17
|
+
)
|
18
|
+
{
|
19
|
+
setNeedsCleanup(true);
|
20
|
+
return yield* task_runGulp;
|
21
|
+
}
|
22
|
+
if(config.config.action.tasksName === 'sync-settings') return yield* task_syncSettings;
|
23
|
+
yield* Effect.fail(new AppError({ message: `Unsupported task type: ${config.config.action.tasksName}`, cause: new Error(`Unsupported task type: ${config.config.action.tasksName}`) }));
|
24
|
+
})
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { Effect } from "effect/index"
|
2
|
+
import { logger } from "../utils/logger.js";
|
3
|
+
import { Config } from "../config.js";
|
4
|
+
import { writeLucySettings } from "../commands/write.js";
|
5
|
+
|
6
|
+
export const task_syncSettings = Effect.gen(function*() {
|
7
|
+
const config = yield* Config;
|
8
|
+
logger.action("Syncing settings...");
|
9
|
+
if(config.config.lucySettings.initialized){
|
10
|
+
config.config.lucySettings.dependencies = config.config.packageJson.dependencies
|
11
|
+
config.config.lucySettings.devDependencies = config.config.packageJson.devDependencies
|
12
|
+
config.config.lucySettings.scripts = config.config.packageJson.scripts;
|
13
|
+
yield* writeLucySettings;
|
14
|
+
|
15
|
+
logger.success("Settings synced successfully.");
|
16
|
+
return;
|
17
|
+
}
|
18
|
+
|
19
|
+
logger.error("Lucy settings are not initialized. Please run 'lucy init' first.");
|
20
|
+
})
|
21
|
+
|
package/src/types.d.ts
CHANGED
File without changes
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import chalk from "chalk";
|
2
|
+
import { error } from "effect/Brand";
|
3
|
+
import { info } from "sass";
|
4
|
+
|
5
|
+
export const orange = chalk.hex('#FFA500');
|
6
|
+
export const blue = chalk.blueBright;
|
7
|
+
export const green = chalk.greenBright;
|
8
|
+
export const red = chalk.redBright;
|
9
|
+
export const yellow = chalk.yellow;
|
10
|
+
export const magenta = chalk.magentaBright;
|
11
|
+
|
12
|
+
export const logger = {
|
13
|
+
success: (message: string, ...optionalParams: any[]) => {
|
14
|
+
console.log("đļ" + green.underline(' => ' + message + optionalParams.map(param => ' ' + param)), ' â
');
|
15
|
+
},
|
16
|
+
info: (message: string, ...optionalParams: any[]) => {
|
17
|
+
console.log("đļ" + blue.underline(' => ' + message + optionalParams.map(param => ' ' + param)), ' âšī¸');
|
18
|
+
},
|
19
|
+
action: (message: string, ...optionalParams: any[]) => {
|
20
|
+
console.log("đ" + blue.underline(' => ' + message + optionalParams.map(param => ' ' + param)));
|
21
|
+
},
|
22
|
+
exception: (message: string, ...optionalParams: any[]) => {
|
23
|
+
console.log("đĨ" + red(' => ' + message + optionalParams.map(param => ' ' + param)));
|
24
|
+
},
|
25
|
+
error: (message: string, ...optionalParams: any[]) => {
|
26
|
+
console.log("đ" + red(' => ' + message + optionalParams.map(param => ' ' + param)));
|
27
|
+
},
|
28
|
+
warning: (message: string, ...optionalParams: any[]) => {
|
29
|
+
console.log("â ī¸" + orange.underline(' => ' + message + optionalParams.map(param => ' ' + param)));
|
30
|
+
},
|
31
|
+
alert: (message: string, ...optionalParams: any[]) => {
|
32
|
+
console.log("đ¨" + yellow.underline(' => ' + message + optionalParams.map(param => ' ' + param)));
|
33
|
+
},
|
34
|
+
report : (message: string, ...optionalParams: any[]) => {
|
35
|
+
console.log("đ" + magenta.underline(' => ' + message + optionalParams.map(param => ' ' + param)));
|
36
|
+
},
|
37
|
+
kill : (message: string, ...optionalParams: any[]) => {
|
38
|
+
console.log("đĒ" + red.underline(' => ' + message + optionalParams.map(param => ' ' + param)));
|
39
|
+
}
|
40
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { Effect, Schema } from "effect/index";
|
2
|
+
import { Config } from "../config.js";
|
3
|
+
import { AppError } from "../error.js";
|
4
|
+
import { logger } from "../utils/logger.js";
|
5
|
+
import { createSDKClient } from "./client.js";
|
6
|
+
|
7
|
+
export const wix_sdk_check = Effect.gen(function* (_) {
|
8
|
+
const config = yield* Config;
|
9
|
+
const wixSDKSettings = config.config.wixSDKSettings;
|
10
|
+
if (!wixSDKSettings) return yield* Effect.fail(new AppError({ message: 'Wix SDK settings not found', cause: new Error('Wix SDK settings not found') }));
|
11
|
+
const client = yield* createSDKClient;
|
12
|
+
|
13
|
+
logger.action(`Checking if the SDK is working`);
|
14
|
+
|
15
|
+
const res = yield* Effect.tryPromise({
|
16
|
+
try: () => client.sites.countSites(),
|
17
|
+
catch: (e) => {
|
18
|
+
return new AppError({ cause: e, message: 'Error checking if the SDK is working' });
|
19
|
+
}
|
20
|
+
})
|
21
|
+
if(res.count) {
|
22
|
+
return logger.success(`SDK for site ${wixSDKSettings.siteId} is alive and working!`);
|
23
|
+
}
|
24
|
+
})
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { items, collections } from '@wix/data';
|
2
|
+
import { sites } from "@wix/sites";
|
3
|
+
import { createClient, ApiKeyStrategy } from '@wix/sdk';
|
4
|
+
import { Effect } from 'effect/index';
|
5
|
+
import { Config } from '../config.js';
|
6
|
+
import { AppError } from '../error.js';
|
7
|
+
|
8
|
+
export const createSDKClient = Effect.gen(function* (_) {
|
9
|
+
const config = yield* Config;
|
10
|
+
const wixSDKSettings = config.config.wixSDKSettings;
|
11
|
+
if (wixSDKSettings) {
|
12
|
+
return createClient({
|
13
|
+
modules: { items, collections, sites },
|
14
|
+
auth: ApiKeyStrategy(wixSDKSettings),
|
15
|
+
});
|
16
|
+
}
|
17
|
+
return yield* Effect.fail(new AppError({ message: "No API key provided", cause: new Error("No API key provided") }));
|
18
|
+
});
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Effect, Schema } from "effect/index"
|
2
|
+
import { Config } from "../config.js";
|
3
|
+
import { AppError } from "../error.js";
|
4
|
+
import { wix_sdk_init } from "./init.js";
|
5
|
+
|
6
|
+
|
7
|
+
export const wix_sdk = Effect.gen(function* (_) {
|
8
|
+
const config = yield* Config;
|
9
|
+
if(config.config.action.wixSDKAction === undefined) {
|
10
|
+
return yield* Effect.fail(new AppError({ message: "No wix-sdk action provided", cause: new Error("No wix-sdk action provided") }));
|
11
|
+
}
|
12
|
+
if(config.config.action.wixSDKAction === 'init')
|
13
|
+
{
|
14
|
+
return yield* wix_sdk_init;
|
15
|
+
}
|
16
|
+
yield* Effect.fail(new AppError({ message: `Unsupported wix-sdk action type: ${config.config.action.syncAction}`, cause: new Error(`Unsupported wix-sdk action type: ${config.config.action.syncAction}`) }));
|
17
|
+
})
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import { Effect, Schema } from "effect/index";
|
2
|
+
import { Config } from "../config.js";
|
3
|
+
import Enquirer from "enquirer";
|
4
|
+
import { AppError } from "../error.js";
|
5
|
+
import { writeWixSDKSettings } from "../commands/write.js";
|
6
|
+
import { wixSDKSettings } from "../schemas/index.js";
|
7
|
+
import { logger } from "../utils/logger.js";
|
8
|
+
import { wix_sdk_check } from "./check.js";
|
9
|
+
|
10
|
+
export const wix_sdk_init = Effect.gen(function* (_) {
|
11
|
+
const config = yield* Config;
|
12
|
+
const prompter = new Enquirer();
|
13
|
+
|
14
|
+
const choice = yield* Effect.tryPromise({
|
15
|
+
try: () => prompter.prompt([
|
16
|
+
{
|
17
|
+
type: 'input',
|
18
|
+
name: 'siteId',
|
19
|
+
message: 'Enter the Wix SDK site ID',
|
20
|
+
initial: config.config.wixSDKSettings?.siteId || 'siteId',
|
21
|
+
validate: (value: string) => value.trim() !== '' ? true : 'Site ID cannot be empty'
|
22
|
+
},
|
23
|
+
{
|
24
|
+
type: 'input',
|
25
|
+
name: 'apiKey',
|
26
|
+
message: 'Enter the Wix SDK API key',
|
27
|
+
initial: config.config.wixSDKSettings?.apiKey || 'apiKey',
|
28
|
+
validate: (value: string) => value.trim() !== '' ? true : 'API key cannot be empty'
|
29
|
+
}
|
30
|
+
]),
|
31
|
+
catch: (e) => {
|
32
|
+
return new AppError({ cause: e, message: 'Error initializing wix-sdk settings' });
|
33
|
+
}
|
34
|
+
});
|
35
|
+
|
36
|
+
config.config.wixSDKSettings = yield* Schema.decodeUnknown(wixSDKSettings)(choice)
|
37
|
+
yield* writeWixSDKSettings
|
38
|
+
|
39
|
+
const question = new Enquirer();
|
40
|
+
const verify = yield* Effect.tryPromise({
|
41
|
+
try: () => question.prompt({
|
42
|
+
type: 'confirm',
|
43
|
+
name: 'verify',
|
44
|
+
message: 'Do you want to verify the wix-sdk settings?',
|
45
|
+
}),
|
46
|
+
catch: (e) => {
|
47
|
+
return new AppError({ cause: e, message: 'Error setting up wix-sdk settings' });
|
48
|
+
}
|
49
|
+
})
|
50
|
+
const verifySDK = yield* Schema.decodeUnknown(Schema.Struct({ verify: Schema.Boolean }))(verify)
|
51
|
+
if (verifySDK.verify) yield* wix_sdk_check
|
52
|
+
|
53
|
+
logger.success(`Velo-sync settings initialized successfully!`);
|
54
|
+
})
|