lucy-cli 1.2.4 → 2.0.0-alpha.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.
Files changed (173) hide show
  1. package/README.md +4 -3
  2. package/dist/args.d.ts +7 -0
  3. package/dist/args.js +23 -0
  4. package/dist/commands.d.ts +3 -0
  5. package/dist/commands.js +18 -0
  6. package/dist/config.d.ts +20 -0
  7. package/dist/config.js +39 -0
  8. package/dist/error.d.ts +17 -0
  9. package/dist/error.js +5 -0
  10. package/dist/helpers.d.ts +1 -32
  11. package/dist/helpers.js +6 -261
  12. package/dist/index.d.ts +2 -52
  13. package/dist/index.js +25 -282
  14. package/dist/init.d.ts +4 -8
  15. package/dist/init.js +245 -160
  16. package/dist/params.d.ts +7 -0
  17. package/dist/params.js +23 -0
  18. package/dist/policy.d.ts +3 -0
  19. package/dist/policy.js +5 -0
  20. package/dist/prepare.d.ts +0 -8
  21. package/dist/prepare.js +20 -19
  22. package/dist/runtime.d.ts +5 -0
  23. package/dist/runtime.js +11 -0
  24. package/dist/schemas/index.d.ts +2 -0
  25. package/dist/schemas/index.js +2 -0
  26. package/dist/schemas/types.js +1 -0
  27. package/dist/states.d.ts +10 -0
  28. package/dist/states.js +7 -0
  29. package/files/expo/.env +1 -0
  30. package/files/expo/.nvmrc +1 -0
  31. package/files/expo/.prettierignore +23 -0
  32. package/files/expo/.prettierrc.json +16 -0
  33. package/files/expo/.yarnrc +1 -0
  34. package/files/expo/.yarnrc.yml +3 -0
  35. package/files/expo/app/(tabs)/_layout.tsx +45 -0
  36. package/files/expo/app/_layout.tsx +45 -0
  37. package/files/expo/babel.config.js +9 -0
  38. package/files/expo/constants/Colors.ts +27 -0
  39. package/files/expo/constants/theme.ts +18 -0
  40. package/files/expo/eas.json +26 -0
  41. package/files/expo/eslint.config.js +185 -0
  42. package/files/expo/global.css +47 -0
  43. package/files/expo/hooks/useColorScheme.ts +11 -0
  44. package/files/expo/hooks/useColorScheme.web.ts +21 -0
  45. package/files/expo/hooks/useColorSchemeRN.ts +1 -0
  46. package/files/expo/hooks/useThemeColor.ts +21 -0
  47. package/files/expo/lib/data.ts +45 -0
  48. package/files/expo/lib/utils/index.ts +6 -0
  49. package/files/expo/lib/utils/polyfills.ts +29 -0
  50. package/files/expo/lib/wix/client.ts +14 -0
  51. package/files/expo/lib/wix/index.ts +1 -0
  52. package/files/expo/lucy.json +8 -0
  53. package/files/expo/readme.md +45 -0
  54. package/files/expo/tailwind.config.js +198 -0
  55. package/files/expo/tsconfig.json +40 -0
  56. package/files/expo/types/nativewind-env.d.ts +1 -0
  57. package/files/expo/types/reset.d.ts +1 -0
  58. package/files/velo/typescript/styles/global.scss +0 -0
  59. package/package.json +14 -11
  60. package/src/args.ts +36 -0
  61. package/src/commands.ts +21 -0
  62. package/src/config.ts +61 -0
  63. package/src/error.ts +4 -0
  64. package/src/helpers.ts +7 -305
  65. package/src/index.ts +29 -362
  66. package/src/init.ts +345 -177
  67. package/src/policy.ts +6 -0
  68. package/src/prepare.ts +19 -19
  69. package/src/runtime.ts +20 -0
  70. package/src/schemas/index.ts +3 -0
  71. package/src/schemas/types.ts +0 -0
  72. package/src/states.ts +15 -0
  73. package/{src/Gulpfile.ts → src copy/Gulpfile.ts } +3 -1
  74. package/{src/gulp/backend.ts → src copy/gulp/backend.ts } +3 -12
  75. package/{src/gulp/checks.ts → src copy/gulp/checks.ts } +2 -6
  76. package/{src/gulp/copy.ts → src copy/gulp/copy.ts } +1 -6
  77. package/src copy/gulp/helpers.ts +26 -0
  78. package/{src/gulp/public.ts → src copy/gulp/public.ts } +1 -6
  79. package/{src/gulp/styles.ts → src copy/gulp/styles.ts } +2 -7
  80. package/{src/gulp/templates.ts → src copy/gulp/templates.ts } +1 -6
  81. package/src copy/helpers.ts +307 -0
  82. package/src copy/index.ts +379 -0
  83. package/src copy/init.ts +183 -0
  84. package/src copy/models.ts +35 -0
  85. package/src copy/prepare.ts +24 -0
  86. package/src copy/schemas/index.ts +0 -0
  87. package/src copy/schemas/types.ts +0 -0
  88. package/src copy/settings.json +67 -0
  89. package/src copy/types.d.ts +8 -0
  90. package/dist/Gulpfile.d.ts +0 -33
  91. package/dist/Gulpfile.js +0 -114
  92. package/dist/cli.d.ts +0 -2
  93. package/dist/cli.js +0 -44
  94. package/dist/dev.d.ts +0 -2
  95. package/dist/dev.js +0 -14
  96. package/dist/gulp/backend copy.d.ts +0 -4
  97. package/dist/gulp/backend copy.js +0 -50
  98. package/dist/gulp/backend.d.ts +0 -3
  99. package/dist/gulp/backend.js +0 -101
  100. package/dist/gulp/checks.d.ts +0 -3
  101. package/dist/gulp/checks.js +0 -209
  102. package/dist/gulp/clean copy.d.ts +0 -2
  103. package/dist/gulp/clean copy.js +0 -19
  104. package/dist/gulp/clean.d.ts +0 -3
  105. package/dist/gulp/clean.js +0 -28
  106. package/dist/gulp/copy.d.ts +0 -2
  107. package/dist/gulp/copy.js +0 -38
  108. package/dist/gulp/docs.d.ts +0 -2
  109. package/dist/gulp/docs.js +0 -27
  110. package/dist/gulp/helpers.d.ts +0 -1
  111. package/dist/gulp/helpers.js +0 -7
  112. package/dist/gulp/pages copy.d.ts +0 -3
  113. package/dist/gulp/pages copy.js +0 -22
  114. package/dist/gulp/pages.d.ts +0 -2
  115. package/dist/gulp/pages.js +0 -36
  116. package/dist/gulp/pipeline.d.ts +0 -1
  117. package/dist/gulp/pipeline.js +0 -28
  118. package/dist/gulp/public.d.ts +0 -2
  119. package/dist/gulp/public.js +0 -54
  120. package/dist/gulp/styles.d.ts +0 -2
  121. package/dist/gulp/styles.js +0 -44
  122. package/dist/gulp/templates.d.ts +0 -2
  123. package/dist/gulp/templates.js +0 -37
  124. package/dist/gulp/test.d.ts +0 -2
  125. package/dist/gulp/test.js +0 -26
  126. package/dist/gulp/types.d.ts +0 -4
  127. package/dist/gulp/types.js +0 -288
  128. package/dist/gulp/watchers.d.ts +0 -9
  129. package/dist/gulp/watchers.js +0 -58
  130. package/dist/init copy.d.ts +0 -8
  131. package/dist/init copy.js +0 -167
  132. package/dist/install.d.ts +0 -2
  133. package/dist/install.js +0 -53
  134. package/dist/settings.json +0 -67
  135. package/dist/start_gulp.d.ts +0 -2
  136. package/dist/start_gulp.js +0 -14
  137. package/dist/sync.d.ts +0 -2
  138. package/dist/sync.js +0 -87
  139. package/src/gulp/helpers.ts +0 -9
  140. /package/{files/.gitmodules → dist/schemas/types.d.ts} +0 -0
  141. /package/files/{typescript/__mocks__/.gitkeep → velo/.gitmodules} +0 -0
  142. /package/files/{.madgerc → velo/.madgerc} +0 -0
  143. /package/files/{.nvmrc → velo/.nvmrc} +0 -0
  144. /package/files/{.stylelintrc.js → velo/.stylelintrc.js} +0 -0
  145. /package/files/{.yarnrc.yml → velo/.yarnrc.yml} +0 -0
  146. /package/files/{currents.config.js → velo/currents.config.js} +0 -0
  147. /package/files/{cypress → velo/cypress}/e2e/base/base.cy.ts +0 -0
  148. /package/files/{cypress → velo/cypress}/fixtures/example.json +0 -0
  149. /package/files/{cypress → velo/cypress}/support/commands.ts +0 -0
  150. /package/files/{cypress → velo/cypress}/support/e2e.ts +0 -0
  151. /package/files/{cypress → velo/cypress}/tsconfig.json +0 -0
  152. /package/files/{cypress.config.mjs → velo/cypress.config.mjs} +0 -0
  153. /package/files/{eslint.config.mjs → velo/eslint.config.mjs} +0 -0
  154. /package/files/{local.tsconfig.json → velo/local.tsconfig.json} +0 -0
  155. /package/files/{typedoc.json → velo/typedoc.json} +0 -0
  156. /package/files/{typescript/pages → velo/typescript/__mocks__}/.gitkeep +0 -0
  157. /package/files/{typescript → velo/typescript}/backend/data.ts +0 -0
  158. /package/files/{typescript → velo/typescript}/backend/events.ts +0 -0
  159. /package/files/{typescript → velo/typescript}/backend/http-functions.ts +0 -0
  160. /package/files/{typescript → velo/typescript}/backend/lib/http-functions/sync.ts +0 -0
  161. /package/files/{typescript → velo/typescript}/backend/permissions.json +0 -0
  162. /package/files/{typescript/public → velo/typescript/pages}/.gitkeep +0 -0
  163. /package/files/{typescript/styles → velo/typescript/public}/.gitkeep +0 -0
  164. /package/files/{typescript → velo/typescript}/public/scss/app.scss +0 -0
  165. /package/files/{typescript/styles/global.scss → velo/typescript/styles/.gitkeep} +0 -0
  166. /package/files/{typescript → velo/typescript}/tsconfig.json +0 -0
  167. /package/files/{vitest.config.ts → velo/vitest.config.ts} +0 -0
  168. /package/{src → src copy}/gulp/clean.ts +0 -0
  169. /package/{src → src copy}/gulp/pages.ts +0 -0
  170. /package/{src → src copy}/gulp/pipeline.ts +0 -0
  171. /package/{src → src copy}/gulp/types.ts +0 -0
  172. /package/{src → src copy}/gulp/watchers.ts +0 -0
  173. /package/{src → src copy}/sync.ts +0 -0
@@ -1,2 +0,0 @@
1
- import { ModuleSettings, ProjectSettings } from '.';
2
- export declare function dev(moduleSettings: ModuleSettings, projectSettings: ProjectSettings, task: string): Promise<void>;
@@ -1,14 +0,0 @@
1
- // https://www.sergevandenoever.nl/run-gulp4-tasks-programatically-from-node/
2
- import path from 'path';
3
- import { fileURLToPath } from 'url';
4
- export async function dev(moduleSettings, projectSettings, task) {
5
- // Get the directory name of the current module
6
- const __filename = fileURLToPath(import.meta.url);
7
- const __dirname = path.dirname(__filename);
8
- // Resolve the path to the Gulpfile
9
- const gulpfilePath = path.resolve(__dirname, 'Gulpfile.js');
10
- // Dynamically import the Gulpfile
11
- const gulpfile = await import(`file://${gulpfilePath}`);
12
- // Check if 'dev' task exists
13
- gulpfile.runTask('dev', moduleSettings, projectSettings);
14
- }
package/dist/sync.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { ModuleSettings, ProjectSettings } from "./index.js";
2
- export declare function sync(moduleSettings: ModuleSettings, projectSettings: ProjectSettings): Promise<void>;
package/dist/sync.js DELETED
@@ -1,87 +0,0 @@
1
- import chalk from "chalk";
2
- import { green, orange, red } from "./index.js";
3
- import readline from 'node:readline';
4
- import veloAPI from 'velo-sync/dist/velo/velo-api.js';
5
- import syncTask from 'velo-sync/dist/tasks/sync-task.js';
6
- import { readConfig, saveConfig } from "./helpers.js";
7
- import optimist from 'optimist';
8
- import migrateFileCache from 'velo-sync/dist/tasks/migrate-files-cache-task.js';
9
- function printUsage() {
10
- console.log('Usage: ');
11
- console.log('');
12
- console.log('Commands:');
13
- console.log(' init generates a config file for the import / export / sync process');
14
- console.log(' is-alive tests the config and the connection to the site');
15
- console.log(' sync runs the sync process');
16
- console.log(' import runs an import process');
17
- console.log(' migrate migrate existing nedb cache to sqlite cache (.upload-cache.db => .upload-cache.sqlite.db)');
18
- }
19
- function syncOrImportTask(importOnly) {
20
- let argv = optimist
21
- .usage(`Usage: $0 ${importOnly ? 'import' : 'sync'} -f <scv filename> -c <collection>`)
22
- .demand('f')
23
- .alias('f', 'filename')
24
- .describe('f', 'csv filename to import')
25
- .demand('c')
26
- .describe('c', 'the name of the collection to import into')
27
- .alias('c', 'collection')
28
- .demand('s')
29
- .describe('s', 'schema file describing the fields of the collection')
30
- .alias('s', 'schema')
31
- .describe('dry', 'dry-run that does not upload any data or files, and does not remove or update anything on the site')
32
- .alias('dry', 'dryrun')
33
- .parse(process.argv.slice(3));
34
- let filename = argv.filename;
35
- let collection = argv.collection;
36
- let schema = argv.schema;
37
- let dryrun = argv.dryrun;
38
- //@ts-ignore
39
- syncTask.default(filename, collection, schema, importOnly, dryrun);
40
- }
41
- export async function sync(moduleSettings, projectSettings) {
42
- if (moduleSettings.args.includes('-h') || moduleSettings.args.includes('help'))
43
- return printUsage();
44
- if (moduleSettings.args.includes('init')) {
45
- const rl = readline.createInterface({
46
- input: process.stdin,
47
- output: process.stdout,
48
- terminal: true
49
- });
50
- async function askQuestion(query) {
51
- return new Promise((resolve) => rl.question(query, (answer) => resolve(answer)));
52
- }
53
- console.log(chalk.yellow('hello to velo-sync init'));
54
- let siteUrl = await askQuestion(orange('what is the url of the site homepage? '));
55
- let secret = await askQuestion(orange('what is the velo-sync secret? '));
56
- rl.close();
57
- let config = { siteUrl, secret };
58
- await saveConfig(config, moduleSettings.veloConfigName);
59
- return console.log(chalk.green("🐕" + ' => config saved!'));
60
- }
61
- if (moduleSettings.args.includes('is-alive')) {
62
- try {
63
- let config = await readConfig(moduleSettings.veloConfigName);
64
- console.log("🐕" + green(` => checking if the API for site ${chalk.greenBright(config.siteUrl)} is alive...`));
65
- await veloAPI.isAlive(config);
66
- return console.log(chalk.green("🐕" + ` => API of site ${chalk.greenBright(config.siteUrl)} is working and alive!!!`));
67
- }
68
- catch (e) {
69
- if (e instanceof Error) {
70
- return console.log((`💩 ${red.underline.bold("=> Failed to check endpoint")} ${orange(e.message)}`));
71
- }
72
- }
73
- }
74
- if (moduleSettings.args.includes('sync')) {
75
- return syncOrImportTask(false);
76
- }
77
- if (moduleSettings.args.includes('import')) {
78
- return syncOrImportTask(true);
79
- }
80
- if (moduleSettings.args.includes('export')) {
81
- return console.log((`💩 ${red.underline.bold("=> Not implemented")}`));
82
- }
83
- if (moduleSettings.args.includes('migrate')) {
84
- //@ts-ignore
85
- migrateFileCache.default();
86
- }
87
- }
@@ -1,9 +0,0 @@
1
-
2
- import * as path from 'path';
3
- import * as fs from 'fs';
4
-
5
- export function getModulesSync(): Record<string, string> | undefined {
6
- const absolutePath = path.resolve('./lucy.json');
7
- const fileContent = fs.readFileSync(absolutePath, 'utf8') as any;
8
- return JSON.parse(fileContent).modules;
9
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes