lucy-cli 1.2.5 → 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.
- package/dist/args.d.ts +7 -0
- package/dist/args.js +23 -0
- package/dist/commands.d.ts +3 -0
- package/dist/commands.js +18 -0
- package/dist/config.d.ts +20 -0
- package/dist/config.js +39 -0
- package/dist/error.d.ts +17 -0
- package/dist/error.js +5 -0
- package/dist/helpers.d.ts +1 -32
- package/dist/helpers.js +6 -261
- package/dist/index.d.ts +2 -59
- package/dist/index.js +25 -282
- package/dist/init.d.ts +4 -8
- package/dist/init.js +245 -160
- package/dist/params.d.ts +7 -0
- package/dist/params.js +23 -0
- package/dist/policy.d.ts +3 -0
- package/dist/policy.js +5 -0
- package/dist/prepare.d.ts +0 -8
- package/dist/prepare.js +20 -19
- package/dist/runtime.d.ts +5 -0
- package/dist/runtime.js +11 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/types.js +1 -0
- package/dist/states.d.ts +10 -0
- package/dist/states.js +7 -0
- package/files/expo/.env +1 -0
- package/files/expo/.nvmrc +1 -0
- package/files/expo/.prettierignore +23 -0
- package/files/expo/.prettierrc.json +16 -0
- package/files/expo/.yarnrc +1 -0
- package/files/expo/.yarnrc.yml +3 -0
- package/files/expo/app/(tabs)/_layout.tsx +45 -0
- package/files/expo/app/_layout.tsx +45 -0
- package/files/expo/babel.config.js +9 -0
- package/files/expo/constants/Colors.ts +27 -0
- package/files/expo/constants/theme.ts +18 -0
- package/files/expo/eas.json +26 -0
- package/files/expo/eslint.config.js +185 -0
- package/files/expo/global.css +47 -0
- package/files/expo/hooks/useColorScheme.ts +11 -0
- package/files/expo/hooks/useColorScheme.web.ts +21 -0
- package/files/expo/hooks/useColorSchemeRN.ts +1 -0
- package/files/expo/hooks/useThemeColor.ts +21 -0
- package/files/expo/lib/data.ts +45 -0
- package/files/expo/lib/utils/index.ts +6 -0
- package/files/expo/lib/utils/polyfills.ts +29 -0
- package/files/expo/lib/wix/client.ts +14 -0
- package/files/expo/lib/wix/index.ts +1 -0
- package/files/expo/lucy.json +8 -0
- package/files/expo/readme.md +45 -0
- package/files/expo/tailwind.config.js +198 -0
- package/files/expo/tsconfig.json +40 -0
- package/files/expo/types/nativewind-env.d.ts +1 -0
- package/files/expo/types/reset.d.ts +1 -0
- package/files/velo/typescript/styles/global.scss +0 -0
- package/package.json +14 -11
- package/src/args.ts +36 -0
- package/src/commands.ts +21 -0
- package/src/config.ts +61 -0
- package/src/error.ts +4 -0
- package/src/helpers.ts +7 -305
- package/src/index.ts +29 -369
- package/src/init.ts +345 -177
- package/src/policy.ts +6 -0
- package/src/prepare.ts +19 -19
- package/src/runtime.ts +20 -0
- package/src/schemas/index.ts +3 -0
- package/src/schemas/types.ts +0 -0
- package/src/states.ts +15 -0
- package/src copy/helpers.ts +307 -0
- package/src copy/index.ts +379 -0
- package/src copy/init.ts +183 -0
- package/src copy/models.ts +35 -0
- package/src copy/prepare.ts +24 -0
- package/src copy/schemas/index.ts +0 -0
- package/src copy/schemas/types.ts +0 -0
- package/src copy/settings.json +67 -0
- package/src copy/types.d.ts +8 -0
- package/dist/Gulpfile.d.ts +0 -34
- package/dist/Gulpfile.js +0 -115
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -44
- package/dist/dev.d.ts +0 -2
- package/dist/dev.js +0 -14
- package/dist/gulp/backend copy.d.ts +0 -4
- package/dist/gulp/backend copy.js +0 -50
- package/dist/gulp/backend.d.ts +0 -3
- package/dist/gulp/backend.js +0 -91
- package/dist/gulp/checks.d.ts +0 -3
- package/dist/gulp/checks.js +0 -204
- package/dist/gulp/clean copy.d.ts +0 -2
- package/dist/gulp/clean copy.js +0 -19
- package/dist/gulp/clean.d.ts +0 -3
- package/dist/gulp/clean.js +0 -28
- package/dist/gulp/copy.d.ts +0 -2
- package/dist/gulp/copy.js +0 -33
- package/dist/gulp/docs.d.ts +0 -2
- package/dist/gulp/docs.js +0 -27
- package/dist/gulp/helpers.d.ts +0 -2
- package/dist/gulp/helpers.js +0 -24
- package/dist/gulp/pages copy.d.ts +0 -3
- package/dist/gulp/pages copy.js +0 -22
- package/dist/gulp/pages.d.ts +0 -2
- package/dist/gulp/pages.js +0 -36
- package/dist/gulp/pipeline.d.ts +0 -1
- package/dist/gulp/pipeline.js +0 -28
- package/dist/gulp/public.d.ts +0 -2
- package/dist/gulp/public.js +0 -49
- package/dist/gulp/styles.d.ts +0 -2
- package/dist/gulp/styles.js +0 -39
- package/dist/gulp/templates.d.ts +0 -2
- package/dist/gulp/templates.js +0 -32
- package/dist/gulp/test.d.ts +0 -2
- package/dist/gulp/test.js +0 -26
- package/dist/gulp/types.d.ts +0 -4
- package/dist/gulp/types.js +0 -288
- package/dist/gulp/watchers.d.ts +0 -9
- package/dist/gulp/watchers.js +0 -58
- package/dist/init copy.d.ts +0 -8
- package/dist/init copy.js +0 -167
- package/dist/install.d.ts +0 -2
- package/dist/install.js +0 -53
- package/dist/settings.json +0 -67
- package/dist/start_gulp.d.ts +0 -2
- package/dist/start_gulp.js +0 -14
- package/dist/sync.d.ts +0 -2
- package/dist/sync.js +0 -87
- /package/{files/.gitmodules → dist/schemas/types.d.ts} +0 -0
- /package/files/{typescript/__mocks__/.gitkeep → velo/.gitmodules} +0 -0
- /package/files/{.madgerc → velo/.madgerc} +0 -0
- /package/files/{.nvmrc → velo/.nvmrc} +0 -0
- /package/files/{.stylelintrc.js → velo/.stylelintrc.js} +0 -0
- /package/files/{.yarnrc.yml → velo/.yarnrc.yml} +0 -0
- /package/files/{currents.config.js → velo/currents.config.js} +0 -0
- /package/files/{cypress → velo/cypress}/e2e/base/base.cy.ts +0 -0
- /package/files/{cypress → velo/cypress}/fixtures/example.json +0 -0
- /package/files/{cypress → velo/cypress}/support/commands.ts +0 -0
- /package/files/{cypress → velo/cypress}/support/e2e.ts +0 -0
- /package/files/{cypress → velo/cypress}/tsconfig.json +0 -0
- /package/files/{cypress.config.mjs → velo/cypress.config.mjs} +0 -0
- /package/files/{eslint.config.mjs → velo/eslint.config.mjs} +0 -0
- /package/files/{local.tsconfig.json → velo/local.tsconfig.json} +0 -0
- /package/files/{typedoc.json → velo/typedoc.json} +0 -0
- /package/files/{typescript/pages → velo/typescript/__mocks__}/.gitkeep +0 -0
- /package/files/{typescript → velo/typescript}/backend/data.ts +0 -0
- /package/files/{typescript → velo/typescript}/backend/events.ts +0 -0
- /package/files/{typescript → velo/typescript}/backend/http-functions.ts +0 -0
- /package/files/{typescript → velo/typescript}/backend/lib/http-functions/sync.ts +0 -0
- /package/files/{typescript → velo/typescript}/backend/permissions.json +0 -0
- /package/files/{typescript/public → velo/typescript/pages}/.gitkeep +0 -0
- /package/files/{typescript/styles → velo/typescript/public}/.gitkeep +0 -0
- /package/files/{typescript → velo/typescript}/public/scss/app.scss +0 -0
- /package/files/{typescript/styles/global.scss → velo/typescript/styles/.gitkeep} +0 -0
- /package/files/{typescript → velo/typescript}/tsconfig.json +0 -0
- /package/files/{vitest.config.ts → velo/vitest.config.ts} +0 -0
- /package/{src → src copy}/Gulpfile.ts +0 -0
- /package/{src → src copy}/gulp/backend.ts +0 -0
- /package/{src → src copy}/gulp/checks.ts +0 -0
- /package/{src → src copy}/gulp/clean.ts +0 -0
- /package/{src → src copy}/gulp/copy.ts +0 -0
- /package/{src → src copy}/gulp/helpers.ts +0 -0
- /package/{src → src copy}/gulp/pages.ts +0 -0
- /package/{src → src copy}/gulp/pipeline.ts +0 -0
- /package/{src → src copy}/gulp/public.ts +0 -0
- /package/{src → src copy}/gulp/styles.ts +0 -0
- /package/{src → src copy}/gulp/templates.ts +0 -0
- /package/{src → src copy}/gulp/types.ts +0 -0
- /package/{src → src copy}/gulp/watchers.ts +0 -0
- /package/{src → src copy}/sync.ts +0 -0
package/dist/install.js
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
import chalk from 'chalk';
|
2
|
-
import { join } from 'path';
|
3
|
-
import { simpleGit } from 'simple-git';
|
4
|
-
import fs from 'fs/promises';
|
5
|
-
import { spawnSync } from 'child_process';
|
6
|
-
export async function installPackages(wixPackages, devPackages, cwd) {
|
7
|
-
const wixPackageNames = Object.keys(wixPackages);
|
8
|
-
const devPackageNames = Object.keys(devPackages);
|
9
|
-
const devPackageVersions = Object.values(devPackages);
|
10
|
-
const devPackageNamesAndVersions = devPackageNames.map((name, index) => `${name}@${devPackageVersions[index]}`);
|
11
|
-
let success = true;
|
12
|
-
wixPackageNames.forEach((name, index) => {
|
13
|
-
console.log(`🐕 => Installing ${orange(name)}`);
|
14
|
-
const wixInstall = `wix install ${name}`;
|
15
|
-
const wixres = spawnSync(wixInstall, { shell: true, stdio: 'inherit' });
|
16
|
-
if (wixres.error) {
|
17
|
-
console.log((`💩 ${red.underline.bold("=> Failed to install package =>")} ${orange(wixres.error.message)}`));
|
18
|
-
success = false;
|
19
|
-
}
|
20
|
-
else {
|
21
|
-
console.log("🐕" + blue.underline(` => Package installed!`));
|
22
|
-
}
|
23
|
-
});
|
24
|
-
const yarnAdd = `yarn add -D ${devPackageNamesAndVersions.join(' ')}`;
|
25
|
-
const yarnRes = spawnSync(yarnAdd, { shell: true, stdio: 'inherit' });
|
26
|
-
if (yarnRes.error) {
|
27
|
-
success = false;
|
28
|
-
console.log((`💩 ${red.underline.bold("=> Failed to install dev packages =>")} ${orange(yarnRes.error.message)}`));
|
29
|
-
}
|
30
|
-
if (success) {
|
31
|
-
await fs.writeFile(join(cwd, 'wixpkgs.json'), JSON.stringify(wixPackages, null, 2), 'utf8');
|
32
|
-
console.log("🐕" + blue.underline(` => All Packages installed!`));
|
33
|
-
}
|
34
|
-
else {
|
35
|
-
console.log("🐕" + red.underline(` => Some packages failed to install!`));
|
36
|
-
}
|
37
|
-
}
|
38
|
-
export async function gitInit(cwd, modules) {
|
39
|
-
const git = simpleGit({ baseDir: cwd });
|
40
|
-
for (const [name, url] of Object.entries(modules)) {
|
41
|
-
console.log(chalk.green.underline.bold(`Cloning ${name}`));
|
42
|
-
try {
|
43
|
-
await git.submoduleAdd(url, name);
|
44
|
-
}
|
45
|
-
catch (err) {
|
46
|
-
console.log((`💩 ${red.underline.bold("=> Command failed =>")} ${orange(err)}`));
|
47
|
-
}
|
48
|
-
finally {
|
49
|
-
console.log("🐕" + blue.underline(` => Cloned ${orange(name)}`));
|
50
|
-
}
|
51
|
-
}
|
52
|
-
console.log("🐶" + green.underline(' => All Modules cloned!'));
|
53
|
-
}
|
package/dist/settings.json
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"modules": {},
|
3
|
-
"wixSettings": {
|
4
|
-
"compilerOptions": {
|
5
|
-
"composite": true,
|
6
|
-
"noEmit": false,
|
7
|
-
"lib": [],
|
8
|
-
"jsx": "react-jsx"
|
9
|
-
},
|
10
|
-
"exclude": ["**/*.js"]
|
11
|
-
},
|
12
|
-
"initialized": false,
|
13
|
-
"wixPackages": {},
|
14
|
-
"devPackages": {
|
15
|
-
"@eslint/js": "^9.30.1",
|
16
|
-
"@styled/typescript-styled-plugin": "^1.0.1",
|
17
|
-
"@total-typescript/ts-reset": "^0.6.1",
|
18
|
-
"@types/node": "^24.0.10",
|
19
|
-
"@types/nodemailer": "^6.4.17",
|
20
|
-
"@types/react": "^19.1.8",
|
21
|
-
"madge": "^8.0.0",
|
22
|
-
"@typescript-eslint/eslint-plugin": "^8.35.1",
|
23
|
-
"@typescript-eslint/parser": "^8.35.1",
|
24
|
-
"@typescript-eslint/utils": "^8.35.1",
|
25
|
-
"@vitest/coverage-v8": "^3.2.4",
|
26
|
-
"@vitest/ui": "^3.2.4",
|
27
|
-
"@wix/cli": "^1.1.101",
|
28
|
-
"@wix/eslint-plugin-cli": "^1.0.2",
|
29
|
-
"cypress": "^14.5.1",
|
30
|
-
"cypress-cloud": "^1.13.1",
|
31
|
-
"esbuild": "^0.25.5",
|
32
|
-
"eslint": "^9.30.1",
|
33
|
-
"eslint-plugin-exception-handling": "^1.5.4",
|
34
|
-
"eslint-plugin-import": "^2.32.0",
|
35
|
-
"eslint-plugin-jsdoc": "^51.3.3",
|
36
|
-
"eslint-plugin-named-import-spacing": "^1.0.3",
|
37
|
-
"eslint-plugin-promise": "^7.2.1",
|
38
|
-
"eslint-plugin-simple-import-sort": "^12.1.1",
|
39
|
-
"prettier": "^3.6.2",
|
40
|
-
"sass": "^1.89.2",
|
41
|
-
"ts-node": "^10.9.2",
|
42
|
-
"tsx": "^4.20.3",
|
43
|
-
"typedoc": "^0.28.7",
|
44
|
-
"typedoc-github-theme": "^0.3.0",
|
45
|
-
"typescript": "^5.8.3",
|
46
|
-
"typescript-eslint": "^8.35.1",
|
47
|
-
"typescript-eslint-language-service": "^5.0.5",
|
48
|
-
"vite-tsconfig-paths": "^5.1.4",
|
49
|
-
"vitest": "^3.2.4",
|
50
|
-
"vitest-tsconfig-paths": "^3.4.1"
|
51
|
-
},
|
52
|
-
"scripts": {
|
53
|
-
"postinstall": "wix sync-types",
|
54
|
-
"wix:dev": "wix dev",
|
55
|
-
"dev": "lucy-cli dev",
|
56
|
-
"lint": "NODE_OPTIONS=\"--max-old-space-size=32768\" eslint .",
|
57
|
-
"docs": "typedoc --tsconfig typescript/tsconfig.json --skipErrorChecking",
|
58
|
-
"build": "lucy-cli build-prod",
|
59
|
-
"fix-wix": "lucy-cli fix-wix",
|
60
|
-
"tsc": "tsc -p ./typescript/tsconfig.json --noEmit",
|
61
|
-
"test": "vitest --ui --coverage",
|
62
|
-
"coverage": "vitest run --coverage",
|
63
|
-
"cypress": "cypress open",
|
64
|
-
"e2e": "cypress-cloud run --parallel --record",
|
65
|
-
"graph": "madge --image graph.svg src"
|
66
|
-
}
|
67
|
-
}
|
package/dist/start_gulp.d.ts
DELETED
package/dist/start_gulp.js
DELETED
@@ -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
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
|
-
}
|
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
|
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
|
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
|