lucy-cli 2.0.0-alpha.7 → 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 -1
- 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/.env +0 -1
- 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,56 @@
|
|
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_run = (program: Effect.Effect<never, AppError, never>) => {
|
11
|
+
return Effect.gen(function* (_) {
|
12
|
+
const config = yield* Config;
|
13
|
+
const prompter = new Enquirer();
|
14
|
+
|
15
|
+
const choice = yield* Effect.tryPromise({
|
16
|
+
try: () => prompter.prompt([
|
17
|
+
{
|
18
|
+
type: 'input',
|
19
|
+
name: 'siteId',
|
20
|
+
message: 'Enter the Wix SDK site ID',
|
21
|
+
initial: config.config.wixSDKSettings?.siteId || 'siteId',
|
22
|
+
validate: (value: string) => value.trim() !== '' ? true : 'Site ID cannot be empty'
|
23
|
+
},
|
24
|
+
{
|
25
|
+
type: 'input',
|
26
|
+
name: 'apiKey',
|
27
|
+
message: 'Enter the Wix SDK API key',
|
28
|
+
initial: config.config.wixSDKSettings?.apiKey || 'apiKey',
|
29
|
+
validate: (value: string) => value.trim() !== '' ? true : 'API key cannot be empty'
|
30
|
+
}
|
31
|
+
]),
|
32
|
+
catch: (e) => {
|
33
|
+
return new AppError({ cause: e, message: 'Error initializing wix-sdk settings' });
|
34
|
+
}
|
35
|
+
});
|
36
|
+
|
37
|
+
config.config.wixSDKSettings = yield* Schema.decodeUnknown(wixSDKSettings)(choice)
|
38
|
+
yield* writeWixSDKSettings
|
39
|
+
|
40
|
+
const question = new Enquirer();
|
41
|
+
const verify = yield* Effect.tryPromise({
|
42
|
+
try: () => question.prompt({
|
43
|
+
type: 'confirm',
|
44
|
+
name: 'verify',
|
45
|
+
message: 'Do you want to verify the wix-sdk settings?',
|
46
|
+
}),
|
47
|
+
catch: (e) => {
|
48
|
+
return new AppError({ cause: e, message: 'Error setting up wix-sdk settings' });
|
49
|
+
}
|
50
|
+
})
|
51
|
+
const verifySDK = yield* Schema.decodeUnknown(Schema.Struct({ verify: Schema.Boolean }))(verify)
|
52
|
+
if (verifySDK.verify) yield* wix_sdk_check
|
53
|
+
|
54
|
+
logger.success(`Velo-sync settings initialized successfully!`);
|
55
|
+
})
|
56
|
+
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import syncTask from 'velo-sync/dist/tasks/sync-task.js';
|
2
|
+
import { MigrateFileCache, SyncTaskType } from "../schemas/types";
|
3
|
+
import migrateFileCache from 'velo-sync/dist/tasks/migrate-files-cache-task.js';
|
4
|
+
|
5
|
+
export const runSyncTask = (syncTask as unknown as { default: SyncTaskType }).default;
|
6
|
+
export const migrateFileCacheTask = (migrateFileCache as unknown as { default: MigrateFileCache }).default;
|
@@ -0,0 +1,19 @@
|
|
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 { logger } from "../utils/logger.js";
|
6
|
+
import veloAPI from 'velo-sync/dist/velo/velo-api.js';
|
7
|
+
|
8
|
+
export const exportData = Effect.gen(function* (_) {
|
9
|
+
const config = yield* Config;
|
10
|
+
const veloSyncSettings = config.config.veloSyncSettings;
|
11
|
+
if (!veloSyncSettings) return yield* Effect.fail(new AppError({ message: 'Velo-sync settings not found', cause: new Error('Velo-sync settings not found') }));
|
12
|
+
|
13
|
+
logger.action(`Exporting data for site ${veloSyncSettings.siteUrl}...`);
|
14
|
+
|
15
|
+
logger.warning('Not implemented yet, please use the Velo Sync CLI for now.');
|
16
|
+
|
17
|
+
// logger.success(`Data for site ${veloSyncSettings.siteUrl} exported successfully!`);
|
18
|
+
return
|
19
|
+
})
|
@@ -0,0 +1,27 @@
|
|
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 { runSyncTask } from "./client.js";
|
6
|
+
|
7
|
+
export const importData = Effect.gen(function* (_) {
|
8
|
+
const config = yield* Config;
|
9
|
+
const veloSyncSettings = config.config.veloSyncSettings;
|
10
|
+
if (!veloSyncSettings) return yield* Effect.fail(new AppError({ message: 'Velo-sync settings not found', cause: new Error('Velo-sync settings not found') }));
|
11
|
+
|
12
|
+
logger.action(`Importing data for site ${veloSyncSettings.siteUrl}...`);
|
13
|
+
let filename = config.config.veloSyncArguments?.data || '';
|
14
|
+
let collection = config.config.veloSyncArguments?.collection || '';
|
15
|
+
let schema = config.config.veloSyncArguments?.schema || '';
|
16
|
+
let dryrun = config.config.veloSyncArguments?.dry || false;
|
17
|
+
let importOnly = true
|
18
|
+
const res = yield* Effect.tryPromise({
|
19
|
+
try: () => runSyncTask(filename, collection, schema, importOnly, dryrun),
|
20
|
+
catch: (e) => {
|
21
|
+
return new AppError({ cause: e, message: 'Error syncing data' });
|
22
|
+
}
|
23
|
+
})
|
24
|
+
|
25
|
+
logger.success(`Data for site ${veloSyncSettings.siteUrl} imported successfully!`);
|
26
|
+
return
|
27
|
+
})
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { Effect, Schema } from "effect/index"
|
2
|
+
import { Config } from "../config.js";
|
3
|
+
import { AppError } from "../error.js";
|
4
|
+
import { init } from "./init.js";
|
5
|
+
import { sync } from "./sync.js";
|
6
|
+
import { migrate } from "./migrate.js";
|
7
|
+
import { importData } from "./import.js";
|
8
|
+
import { exportData } from "./export.js";
|
9
|
+
import { is_alive } from "./is-alive.js";
|
10
|
+
|
11
|
+
|
12
|
+
export const wix_sync = Effect.gen(function* (_) {
|
13
|
+
const config = yield* Config;
|
14
|
+
if(config.config.action.syncAction === undefined) {
|
15
|
+
return yield* Effect.fail(new AppError({ message: "No sync action provided", cause: new Error("No sync action provided") }));
|
16
|
+
}
|
17
|
+
if(config.config.action.syncAction === 'init') {
|
18
|
+
return yield* init;
|
19
|
+
}
|
20
|
+
if(config.config.action.syncAction === 'sync') {
|
21
|
+
return yield* sync;
|
22
|
+
}
|
23
|
+
if(config.config.action.syncAction === 'migrate') {
|
24
|
+
return yield* migrate;
|
25
|
+
}
|
26
|
+
if(config.config.action.syncAction === 'import') {
|
27
|
+
return yield* importData;
|
28
|
+
}
|
29
|
+
if(config.config.action.syncAction === 'export') {
|
30
|
+
return yield* exportData;
|
31
|
+
}
|
32
|
+
if(config.config.action.syncAction === 'is-alive') {
|
33
|
+
return yield* is_alive;
|
34
|
+
}
|
35
|
+
yield* Effect.fail(new AppError({ message: `Unsupported sync action type: ${config.config.action.syncAction}`, cause: new Error(`Unsupported sync action type: ${config.config.action.syncAction}`) }));
|
36
|
+
})
|
@@ -0,0 +1,77 @@
|
|
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 { writeVeloSyncSettings } from "../commands/write.js";
|
6
|
+
import { veloSyncSettings } from "../schemas/index.js";
|
7
|
+
import { logger } from "../utils/logger.js";
|
8
|
+
import { is_alive } from "./is-alive.js";
|
9
|
+
import { copySyncFiles } from "../commands/copy.js";
|
10
|
+
|
11
|
+
export const init = Effect.gen(function* (_) {
|
12
|
+
const config = yield* Config;
|
13
|
+
const prompter = new Enquirer();
|
14
|
+
|
15
|
+
const choice = yield* Effect.tryPromise({
|
16
|
+
try: () => prompter.prompt([
|
17
|
+
{
|
18
|
+
type: 'input',
|
19
|
+
name: 'siteUrl',
|
20
|
+
message: 'Enter a project URL',
|
21
|
+
initial: config.config.veloSyncSettings?.siteUrl || 'https://example.com',
|
22
|
+
validate: (value: string) => {
|
23
|
+
const urlPattern = /^https:\/\/[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
24
|
+
if (!value.trim()) return 'Project URL cannot be empty';
|
25
|
+
if (!urlPattern.test(value.trim())) return 'URL must be in the format https://domain.com';
|
26
|
+
return true;
|
27
|
+
}
|
28
|
+
},
|
29
|
+
{
|
30
|
+
type: 'input',
|
31
|
+
name: 'secret',
|
32
|
+
message: 'Enter the velo-sync secret',
|
33
|
+
initial: config.config.veloSyncSettings?.secret || 'secret',
|
34
|
+
validate: (value: string) => value.trim() !== '' ? true : 'Secret cannot be empty'
|
35
|
+
}
|
36
|
+
]),
|
37
|
+
catch: (e) => {
|
38
|
+
return new AppError({ cause: e, message: 'Error initializing velo-sync settings' });
|
39
|
+
}
|
40
|
+
});
|
41
|
+
|
42
|
+
config.config.veloSyncSettings = yield* Schema.decodeUnknown(veloSyncSettings)(choice)
|
43
|
+
yield* writeVeloSyncSettings
|
44
|
+
|
45
|
+
const copyFilesQuestion = new Enquirer();
|
46
|
+
const copyFiles = yield* Effect.tryPromise({
|
47
|
+
try: () => copyFilesQuestion.prompt({
|
48
|
+
type: 'confirm',
|
49
|
+
name: 'copyFiles',
|
50
|
+
message: 'Do you want to copy the velo-sync files to your project?',
|
51
|
+
}),
|
52
|
+
catch: (e) => {
|
53
|
+
return new AppError({ cause: e, message: 'Error copying velo-sync files' });
|
54
|
+
}
|
55
|
+
})
|
56
|
+
const copy = yield* Schema.decodeUnknown(Schema.Struct({ copyFiles: Schema.Boolean }))(copyFiles)
|
57
|
+
if (copy.copyFiles) {
|
58
|
+
yield* copySyncFiles
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
const question = new Enquirer();
|
63
|
+
const verify = yield* Effect.tryPromise({
|
64
|
+
try: () => question.prompt({
|
65
|
+
type: 'confirm',
|
66
|
+
name: 'verify',
|
67
|
+
message: 'Do you want to verify the velo-sync settings?',
|
68
|
+
}),
|
69
|
+
catch: (e) => {
|
70
|
+
return new AppError({ cause: e, message: 'Error setting up velo-sync settings' });
|
71
|
+
}
|
72
|
+
})
|
73
|
+
const verifySync = yield* Schema.decodeUnknown(Schema.Struct({ verify: Schema.Boolean }))(verify)
|
74
|
+
if (verifySync.verify) yield* is_alive
|
75
|
+
|
76
|
+
logger.success(`Velo-sync settings initialized successfully!`);
|
77
|
+
})
|
@@ -0,0 +1,25 @@
|
|
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 { logger } from "../utils/logger.js";
|
6
|
+
import veloAPI from 'velo-sync/dist/velo/velo-api.js';
|
7
|
+
|
8
|
+
export const is_alive = Effect.gen(function* (_) {
|
9
|
+
const config = yield* Config;
|
10
|
+
const prompter = new Enquirer();
|
11
|
+
const veloSyncSettings = config.config.veloSyncSettings;
|
12
|
+
if (!veloSyncSettings) return yield* Effect.fail(new AppError({ message: 'Velo-sync settings not found', cause: new Error('Velo-sync settings not found') }));
|
13
|
+
|
14
|
+
logger.action(`Checking if the API for site ${veloSyncSettings.siteUrl} is alive...`);
|
15
|
+
|
16
|
+
const res = yield* Effect.tryPromise({
|
17
|
+
try: () => veloAPI.isAlive(veloSyncSettings),
|
18
|
+
catch: (e) => {
|
19
|
+
return new AppError({ cause: e, message: 'Error checking if the API is alive' });
|
20
|
+
}
|
21
|
+
})
|
22
|
+
|
23
|
+
logger.success(`API for site ${veloSyncSettings.siteUrl} is alive and working!`);
|
24
|
+
return
|
25
|
+
})
|
@@ -0,0 +1,23 @@
|
|
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 { migrateFileCacheTask } from "./client.js";
|
6
|
+
|
7
|
+
export const migrate = Effect.gen(function* (_) {
|
8
|
+
const config = yield* Config;
|
9
|
+
const veloSyncSettings = config.config.veloSyncSettings;
|
10
|
+
if (!veloSyncSettings) return yield* Effect.fail(new AppError({ message: 'Velo-sync settings not found', cause: new Error('Velo-sync settings not found') }));
|
11
|
+
|
12
|
+
logger.action(`Migrating file cache for site ${veloSyncSettings.siteUrl}...`);
|
13
|
+
|
14
|
+
const res = yield* Effect.tryPromise({
|
15
|
+
try: () => migrateFileCacheTask(),
|
16
|
+
catch: (e) => {
|
17
|
+
return new AppError({ cause: e, message: 'Error migrating file cache' });
|
18
|
+
}
|
19
|
+
})
|
20
|
+
|
21
|
+
logger.success(`File cache for site ${veloSyncSettings.siteUrl} migrated successfully!`);
|
22
|
+
return
|
23
|
+
})
|
@@ -0,0 +1,27 @@
|
|
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 { runSyncTask } from "./client.js";
|
6
|
+
|
7
|
+
export const sync = Effect.gen(function* (_) {
|
8
|
+
const config = yield* Config;
|
9
|
+
const veloSyncSettings = config.config.veloSyncSettings;
|
10
|
+
if (!veloSyncSettings) return yield* Effect.fail(new AppError({ message: 'Velo-sync settings not found', cause: new Error('Velo-sync settings not found') }));
|
11
|
+
|
12
|
+
logger.action(`Syncing data for site ${veloSyncSettings.siteUrl}...`);
|
13
|
+
let filename = config.config.veloSyncArguments?.data || '';
|
14
|
+
let collection = config.config.veloSyncArguments?.collection || '';
|
15
|
+
let schema = config.config.veloSyncArguments?.schema || '';
|
16
|
+
let dryrun = config.config.veloSyncArguments?.dry || false;
|
17
|
+
let importOnly = false
|
18
|
+
const res = yield* Effect.tryPromise({
|
19
|
+
try: () => runSyncTask(filename, collection, schema, importOnly, dryrun),
|
20
|
+
catch: (e) => {
|
21
|
+
return new AppError({ cause: e, message: 'Error syncing data' });
|
22
|
+
}
|
23
|
+
})
|
24
|
+
|
25
|
+
logger.success(`Data for site ${veloSyncSettings.siteUrl} synced successfully!`);
|
26
|
+
return
|
27
|
+
})
|
package/tsconfig.json
CHANGED
@@ -14,6 +14,7 @@
|
|
14
14
|
"declaration": true,
|
15
15
|
"strict": true,
|
16
16
|
"noEmitOnError": false,
|
17
|
+
"sourceMap": true,
|
17
18
|
"strictNullChecks": true,
|
18
19
|
"noImplicitAny": true,
|
19
20
|
"noImplicitReturns": true,
|
@@ -24,10 +25,10 @@
|
|
24
25
|
"strictPropertyInitialization": true,
|
25
26
|
"experimentalDecorators": true,
|
26
27
|
"esModuleInterop": true,
|
27
|
-
"resolveJsonModule": true
|
28
|
+
"resolveJsonModule": true
|
28
29
|
},
|
29
|
-
"exclude": ["
|
30
|
-
"include":[
|
31
|
-
"src/**/*.ts"
|
32
|
-
]
|
30
|
+
"exclude": ["node_modules", "old/**/*", "files/**/*", "dist/**/*"],
|
31
|
+
"include": [
|
32
|
+
"src/**/*.ts",
|
33
|
+
]
|
33
34
|
}
|
package/dist/init.d.ts
DELETED
@@ -1,4 +0,0 @@
|
|
1
|
-
import { Effect } from "effect/index";
|
2
|
-
import { Config } from "./config.js";
|
3
|
-
import { Terminal, FileSystem, Path } from "@effect/platform";
|
4
|
-
export declare const init: () => Effect.Effect<void, string | import("@effect/platform/Error").PlatformError, Config | Terminal.Terminal | FileSystem.FileSystem | Path.Path | import("@effect/platform/CommandExecutor").CommandExecutor>;
|
package/dist/init.js
DELETED
@@ -1,275 +0,0 @@
|
|
1
|
-
// import chalk from 'chalk';
|
2
|
-
// import { existsSync, mkdirSync, promises as fsPromises } from 'fs';
|
3
|
-
// import fse from 'fs-extra';
|
4
|
-
// import { join } from 'path';
|
5
|
-
// import fs from 'fs/promises';
|
6
|
-
// import path from 'path';
|
7
|
-
// import os from 'os';
|
8
|
-
// import enquirer from 'enquirer';
|
9
|
-
// import { ModuleSettings, ProjectSettings, blue, green, orange, red } from './index.js';
|
10
|
-
// import { createTemplateFolder, gitInit, installPackages } from './helpers.js';
|
11
|
-
import { Effect, Schema } from "effect/index";
|
12
|
-
import { Config } from "./config.js";
|
13
|
-
import { Command, Terminal, FileSystem, Path } from "@effect/platform";
|
14
|
-
import { JsonSchema } from "./schemas/index.js";
|
15
|
-
// const { Select } = enquirer as any;
|
16
|
-
// /**
|
17
|
-
// * Init Lucy project
|
18
|
-
// * @param {string} cwd Current working directory
|
19
|
-
// * @param {string} packageRoot Package root directory
|
20
|
-
// * @returns {void}
|
21
|
-
// */
|
22
|
-
// export async function init(moduleSettings: ModuleSettings, projectSettings: ProjectSettings) {
|
23
|
-
// if(projectSettings.packageJSON && projectSettings.packageJSON.wixLucy?.initialized && !moduleSettings.args.includes('-f')) {
|
24
|
-
// console.log((`💩 ${red.underline.bold("=> This project is already initialized =>")} ${orange(moduleSettings.targetFolder)}`));
|
25
|
-
// return;
|
26
|
-
// }
|
27
|
-
// const templatesPath = join(os.homedir(), '.lucy-cli');
|
28
|
-
// if (!existsSync(templatesPath)) {
|
29
|
-
// console.log(chalk.yellow(`Templates folder not found at ${orange(templatesPath)}. Creating it with a default template...`));
|
30
|
-
// await createTemplateFolder(moduleSettings);
|
31
|
-
// }
|
32
|
-
// const templateChoices = (await fs.readdir(templatesPath, { withFileTypes: true }))
|
33
|
-
// .filter(dirent => dirent.isDirectory())
|
34
|
-
// .map(dirent => dirent.name);
|
35
|
-
// if (templateChoices.length === 0) {
|
36
|
-
// console.log((`💩 ${red.underline.bold("=> No templates found in =>")} ${orange(templatesPath)}`));
|
37
|
-
// return;
|
38
|
-
// }
|
39
|
-
// const prompt = new Select({
|
40
|
-
// name: 'template',
|
41
|
-
// message: 'Select a project template',
|
42
|
-
// choices: templateChoices
|
43
|
-
// });
|
44
|
-
// const selectedTemplate = await prompt.run();
|
45
|
-
// const templateDir = join(templatesPath, selectedTemplate);
|
46
|
-
// const templateFilesDir = join(templateDir, 'files');
|
47
|
-
// const templateSettingsPath = join(templateDir, 'settings.json');
|
48
|
-
// if (!existsSync(templateSettingsPath)) {
|
49
|
-
// console.log((`💩 ${red.underline.bold("=> Template is missing settings.json at =>")} ${orange(templateSettingsPath)}`));
|
50
|
-
// return;
|
51
|
-
// }
|
52
|
-
// try {
|
53
|
-
// const templateSettingsRaw = await fs.readFile(templateSettingsPath, 'utf8');
|
54
|
-
// moduleSettings.settings = JSON.parse(templateSettingsRaw);
|
55
|
-
// } catch (e) {
|
56
|
-
// console.log((`💩 ${red.underline.bold("=> Error reading or parsing template settings =>")} ${orange(e)}`));
|
57
|
-
// return;
|
58
|
-
// }
|
59
|
-
// await copyFolder(templateFilesDir, moduleSettings.targetFolder);
|
60
|
-
// await editJson(moduleSettings.packageJsonPath, ['type', 'scripts'], ['module', moduleSettings.settings.scripts ]);
|
61
|
-
// await stringReplace(join(moduleSettings.targetFolder, 'currents.config.js'), ['__ProjectName__'], [path.basename(moduleSettings.targetFolder)]);
|
62
|
-
// await installPackages(moduleSettings.settings.wixPackages, moduleSettings.settings.devPackages, moduleSettings.targetFolder, moduleSettings.lockVersion);
|
63
|
-
// await editJson(join(moduleSettings.targetFolder, 'jsconfig.json'), ['compilerOptions', 'exclude'], [moduleSettings.settings.wixSettings.compilerOptions, moduleSettings.settings.wixSettings.exclude]);
|
64
|
-
// await editJson(join(moduleSettings.targetFolder, 'typedoc.json'), ['name'], [path.basename(moduleSettings.targetFolder)]);
|
65
|
-
// await gitInit(moduleSettings.targetFolder, moduleSettings.settings.modules, moduleSettings.force);
|
66
|
-
// moduleSettings.settings.initialized = true;
|
67
|
-
// const eslintrcPath = join(moduleSettings.targetFolder, '.eslintrc.json');
|
68
|
-
// if(existsSync(eslintrcPath)) {
|
69
|
-
// console.log((`🐕 ${blue.underline.bold("=> Deleting .eslintrc.json")}`));
|
70
|
-
// await fs.rm(join(eslintrcPath), { recursive: false }).catch(e => {
|
71
|
-
// console.log((`💩 ${red.underline.bold("=> Could not delete .eslintrc.json ")} ${red.bold("=> ", e)}`));
|
72
|
-
// });
|
73
|
-
// }
|
74
|
-
// console.log((`🐕 ${blue.underline.bold("=> Writing settings to lucy.json")}`));
|
75
|
-
// await fs.writeFile(join(moduleSettings.targetFolder, 'lucy.json'), JSON.stringify(moduleSettings.settings, null, 2));
|
76
|
-
// console.log(chalk.greenBright.underline('🐶 => Initialization done!'));
|
77
|
-
// }
|
78
|
-
// /**
|
79
|
-
// * Copy files from source to target
|
80
|
-
// * @param {string} source Source folder
|
81
|
-
// * @param {string} target Target folder
|
82
|
-
// * @returns {Promise<void>}
|
83
|
-
// */
|
84
|
-
// async function copyFolder(source: string, target: string): Promise<void> {
|
85
|
-
// if (!existsSync(target)){
|
86
|
-
// console.log((`💩 ${red.underline.bold("=> Target folder doesn't exist =>")} ${orange(target)}`));
|
87
|
-
// return;
|
88
|
-
// }
|
89
|
-
// try {
|
90
|
-
// const files = await fsPromises.readdir(source);
|
91
|
-
// for (const file of files){
|
92
|
-
// const sourcePath = join(source, file);
|
93
|
-
// const targetPath = join(target, file);
|
94
|
-
// if (file === 'lucy.json' && existsSync(targetPath)){
|
95
|
-
// continue;
|
96
|
-
// }
|
97
|
-
// const stats = await fsPromises.stat(sourcePath);
|
98
|
-
// if (stats.isDirectory()){
|
99
|
-
// if (!existsSync(file)){
|
100
|
-
// mkdirSync(file);
|
101
|
-
// }
|
102
|
-
// await fse.copySync(sourcePath, targetPath, { overwrite: true });
|
103
|
-
// } else {
|
104
|
-
// fse.copySync(sourcePath, targetPath, { overwrite: true });
|
105
|
-
// }
|
106
|
-
// }
|
107
|
-
// } catch (err){
|
108
|
-
// console.log((`💩 ${red.underline.bold("=> There was an error while copying files =>")} ${orange(err)}`));
|
109
|
-
// } finally {
|
110
|
-
// console.log("🐕" + blue.underline.bold(' => Copy files completed!'));
|
111
|
-
// }
|
112
|
-
// }
|
113
|
-
// /**
|
114
|
-
// * Edit Json files
|
115
|
-
// * @param {string} filePath File path
|
116
|
-
// * @param {string[]} keys Keys to edit
|
117
|
-
// * @param {string[]} values Values to edit
|
118
|
-
// * @returns {void}
|
119
|
-
// */
|
120
|
-
// async function editJson(filePath: string, keys: string[], values: string[] | Object[] ) {
|
121
|
-
// try {
|
122
|
-
// const data = await fs.readFile(filePath, 'utf8');
|
123
|
-
// let jsonData;
|
124
|
-
// try {
|
125
|
-
// jsonData = JSON.parse(data);
|
126
|
-
// } catch (parseError) {
|
127
|
-
// console.log((`💩 ${red.underline.bold("=> Error parsing JSON =>")} ${orange(parseError)}`));
|
128
|
-
// return;
|
129
|
-
// }
|
130
|
-
// for (const key of keys){
|
131
|
-
// const index = keys.indexOf(key);
|
132
|
-
// const value = values[index];
|
133
|
-
// jsonData[key] = value;
|
134
|
-
// }
|
135
|
-
// const updatedJsonData = JSON.stringify(jsonData, null, 2);
|
136
|
-
// await fs.writeFile(filePath, updatedJsonData, 'utf8');
|
137
|
-
// } catch (err) {
|
138
|
-
// console.log((`💩 ${red.underline.bold("=> Error editing JSON Data =>")} ${orange(err)}`));
|
139
|
-
// } finally {
|
140
|
-
// console.log("🐕" + blue.underline(` => Updated file ${orange(filePath)}`));
|
141
|
-
// }
|
142
|
-
// }
|
143
|
-
// async function stringReplace(filePath: string, keys: string[], values: string[]) {
|
144
|
-
// try {
|
145
|
-
// let modifiedContent: string = '';
|
146
|
-
// const data = await fs.readFile(filePath, 'utf8');
|
147
|
-
// for (const key of keys){
|
148
|
-
// const index = keys.indexOf(key);
|
149
|
-
// const value = values[index];
|
150
|
-
// const regex = new RegExp(`${key}`, 'g');
|
151
|
-
// modifiedContent = data.replace(regex, `${value}`);
|
152
|
-
// }
|
153
|
-
// await fs.writeFile(filePath, modifiedContent, 'utf8');
|
154
|
-
// } catch (err) {
|
155
|
-
// console.log((`💩 ${red.underline.bold("=> During string replace =>")} ${orange(err)}`));
|
156
|
-
// } finally {
|
157
|
-
// console.log(blue.underline(`🐕 => Updated file ${orange(filePath)}`));
|
158
|
-
// }
|
159
|
-
// }
|
160
|
-
const init_expo = () => {
|
161
|
-
return Effect.gen(function* () {
|
162
|
-
const config = yield* Config;
|
163
|
-
const terminal = yield* Terminal.Terminal;
|
164
|
-
const fs = yield* FileSystem.FileSystem;
|
165
|
-
const path = yield* Path.Path;
|
166
|
-
const yarn = Command.make("yarn", "add", "nativewind", "react-native-reanimated@~3.17.4", "react-native-safe-area-context@5.4.0", "@wix/sdk@1.15.24", "@wix/data", "expo-standard-web-crypto", "effect", "node-libs-react-native", "util", "events", "tailwindcss-animate").pipe(Command.stdout("inherit"), // Stream stdout to process.stdout
|
167
|
-
Command.exitCode // Get the exit code
|
168
|
-
);
|
169
|
-
const yarnVersion = Command.make("yarn", "set", "version", "berry").pipe(Command.stdout("inherit"), // Stream stdout to process.stdout
|
170
|
-
Command.exitCode // Get the exit code
|
171
|
-
);
|
172
|
-
const yarnDev = Command.make("yarn", "add", "--dev", "tailwindcss@^3.4.17", "prettier-plugin-tailwindcss@^0.5.11", "@styled/typescript-styled-plugin", "typescript-eslint-language-service", "eslint-config-prettier", "eslint-plugin-jsdoc", "eslint-plugin-named-import-spacing", "eslint-plugin-only-warn", "eslint-plugin-react", "eslint-plugin-react-hooks", "eslint-plugin-simple-import-sort", "@next/eslint-plugin-next", "@styled/typescript-styled-plugin", "@stylelint/postcss-css-in-js", "@typescript-eslint/parser", "typescript-eslint", "typescript-eslint-language-service", "@total-typescript/ts-reset", "expo-doctor", "tsx").pipe(Command.stdout("inherit"), // Stream stdout to process.stdout
|
173
|
-
Command.exitCode // Get the exit code
|
174
|
-
);
|
175
|
-
const npx = Command.make("npx", "expo", "install", "tailwindcss-animate", "class-variance-authority", "clsx", "tailwind-merge", "expo-crypto", "react-dom", "react-native-web", "@expo/metro-runtime", "expo-system-ui").pipe(Command.stdout("inherit"), // Stream stdout to process.stdout
|
176
|
-
Command.exitCode // Get the exit code
|
177
|
-
);
|
178
|
-
const projectName = config.config.cwd.split('/').pop() || 'expo-project';
|
179
|
-
const appJsonRaw = yield* fs.readFile("app.json").pipe(Effect.catchAll((error) => {
|
180
|
-
return Effect.succeed('{}');
|
181
|
-
}));
|
182
|
-
const lucyJsonRaw = yield* fs.readFile("lucy.json").pipe(Effect.catchAll((error) => {
|
183
|
-
return Effect.succeed('{}');
|
184
|
-
}));
|
185
|
-
const appJSON = Schema.decodeUnknownSync(JsonSchema)(appJsonRaw.toString());
|
186
|
-
const lucyJSON = Schema.decodeUnknownSync(JsonSchema)(lucyJsonRaw.toString());
|
187
|
-
const expoAppReady = appJSON.expo ? true : false;
|
188
|
-
const lucyInitialized = lucyJSON.initialized ? true : false;
|
189
|
-
const gitPresent = yield* fs.exists(config.config.cwd + '/.git');
|
190
|
-
const files = yield* fs.readDirectory(config.config.cwd);
|
191
|
-
const nonGitFiles = files.filter(file => file !== '.git');
|
192
|
-
if (!gitPresent)
|
193
|
-
return yield* Effect.logError("No git repository found. Please initialize a git repository before running this command.");
|
194
|
-
if (nonGitFiles.length > 0)
|
195
|
-
return yield* Effect.logError("The current directory is not empty. Please run this command in an empty directory.");
|
196
|
-
if (!expoAppReady) {
|
197
|
-
const initExpo = Command.make("npx", "create-expo-app@latest", projectName, "--template", "blank-typescript", "--no-install").pipe(Command.stdout("inherit"), // Stream stdout to process.stdout
|
198
|
-
Command.exitCode // Get the exit code
|
199
|
-
);
|
200
|
-
yield* initExpo;
|
201
|
-
const projectPath = path.join(config.config.cwd, projectName);
|
202
|
-
const projectFiles = yield* fs.readDirectory(projectPath);
|
203
|
-
yield* Effect.forEach(projectFiles.filter(file => file !== '.git'), (file) => fs.copy(path.join(projectPath, file), path.join(config.config.cwd, file), { overwrite: true }), { discard: true });
|
204
|
-
yield* fs.remove(projectPath, { recursive: true });
|
205
|
-
}
|
206
|
-
if (lucyInitialized)
|
207
|
-
return yield* Effect.logError("Lucy is already initialized in this project. Please run this command in an empty directory.");
|
208
|
-
const baseFiles = yield* fs.readDirectory(config.config.filesFolder + '/expo');
|
209
|
-
yield* Effect.forEach(baseFiles, (file) => fs.copy(path.join(config.config.filesFolder, 'expo', file), path.join(config.config.cwd, file), { overwrite: true }));
|
210
|
-
const newScripts = {
|
211
|
-
"dev": "expo start",
|
212
|
-
"start": "expo start",
|
213
|
-
"android": "expo start --android",
|
214
|
-
"ios": "expo start --ios",
|
215
|
-
"web": "expo start --web",
|
216
|
-
"reset": "tsx ./scripts/reset-project.ts",
|
217
|
-
"format": "prettier --write \"./*.json\" \"**/*.{ts,tsx,md,json,jsonc,json5}\"",
|
218
|
-
"prebuild": "expo prebuild",
|
219
|
-
"pods": "npxpod-install",
|
220
|
-
"build:dev": "eas build --local --profile development",
|
221
|
-
"build:sim": "eas build --local --profile ios-simulator",
|
222
|
-
"build:prev": "eas build --local --profile preview",
|
223
|
-
"build:prod": "eas build --local --profile production",
|
224
|
-
"build:web": "expo export --platform web",
|
225
|
-
"doctor": "expo-doctor",
|
226
|
-
"eas-build-pre-install": "corepack enable && yarn set version 4"
|
227
|
-
};
|
228
|
-
const packageJsonPath = path.join(config.config.cwd, "package.json");
|
229
|
-
const packageJsonRaw = yield* fs.readFile(packageJsonPath);
|
230
|
-
const packageJson = Schema.decodeUnknownSync(JsonSchema)(packageJsonRaw.toString());
|
231
|
-
packageJson.scripts = {
|
232
|
-
...packageJson.scripts,
|
233
|
-
...newScripts,
|
234
|
-
};
|
235
|
-
packageJson.resolutions = {
|
236
|
-
...packageJson.resolutions,
|
237
|
-
};
|
238
|
-
packageJson.expo = {
|
239
|
-
doctor: {
|
240
|
-
reactNativeDirectoryCheck: {
|
241
|
-
listUnknownPackages: false,
|
242
|
-
},
|
243
|
-
}
|
244
|
-
};
|
245
|
-
yield* fs.writeFileString(path.join(config.config.cwd, 'package.json'), JSON.stringify(packageJson, null, 2));
|
246
|
-
yield* fs.remove(path.join(config.config.cwd, "package-lock.json"), { force: true });
|
247
|
-
let res = yield* yarnVersion;
|
248
|
-
if (res !== 0) {
|
249
|
-
return yield* Effect.logError("Failed to set Yarn version. Please check the error message above.");
|
250
|
-
}
|
251
|
-
res = yield* yarn;
|
252
|
-
if (res !== 0) {
|
253
|
-
return yield* Effect.logError("Failed to install dependencies. Please check the error message above.");
|
254
|
-
}
|
255
|
-
res = yield* yarnDev;
|
256
|
-
if (res !== 0) {
|
257
|
-
return yield* Effect.logError("Failed to install dev dependencies. Please check the error message above.");
|
258
|
-
}
|
259
|
-
res = yield* npx;
|
260
|
-
if (res !== 0) {
|
261
|
-
return yield* Effect.logError("Failed to install Expo dependencies. Please check the error message above.");
|
262
|
-
}
|
263
|
-
});
|
264
|
-
};
|
265
|
-
export const init = () => {
|
266
|
-
return Effect.gen(function* (_) {
|
267
|
-
const config = yield* Config;
|
268
|
-
if (config.config.action.type === undefined) {
|
269
|
-
return yield* Effect.fail("No Params Provided");
|
270
|
-
}
|
271
|
-
if (config.config.action.type === 'expo') {
|
272
|
-
return yield* init_expo();
|
273
|
-
}
|
274
|
-
});
|
275
|
-
};
|
package/dist/models.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
package/dist/params.d.ts
DELETED
package/dist/params.js
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
import yargs from "yargs";
|
2
|
-
import { hideBin } from "yargs/helpers";
|
3
|
-
export async function get_args() {
|
4
|
-
const argv = await yargs(hideBin(process.argv))
|
5
|
-
.usage('Usage: $0 <command> [options]')
|
6
|
-
.command('init <type>', 'Initialize a new Lucy project', (yargs) => {
|
7
|
-
return yargs.positional('type', {
|
8
|
-
describe: 'The type of project to initialize',
|
9
|
-
choices: ['velo', 'expo', 'blocks'],
|
10
|
-
demandOption: true, // Makes this positional argument required
|
11
|
-
});
|
12
|
-
})
|
13
|
-
// Enforce that a command must be provided (e.g., 'init')
|
14
|
-
.demandCommand(1, 'You need to provide a command. Use --help for a list of commands.')
|
15
|
-
.help()
|
16
|
-
.alias('h', 'help')
|
17
|
-
.strict()
|
18
|
-
.wrap(yargs().terminalWidth()) // Wrap help text to terminal width
|
19
|
-
.epilogue('For more information, visit https://github.com/your-repo/wix-lucy-cli') // Example of a relevant epilogue
|
20
|
-
.parseAsync();
|
21
|
-
// The cast is now safer with the defined interface.
|
22
|
-
return argv;
|
23
|
-
}
|
package/files/expo/.env
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
EXPO_PUBLIC_WIX_CLIENT_ID=
|