lucy-cli 0.7.2 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. package/.yarn/cache/@eslint-config-array-npm-0.18.0-bb4bc4e301-5ff748e178.zip +0 -0
  2. package/.yarn/cache/@eslint-core-npm-0.7.0-55f1b6f05c-91d4aa2805.zip +0 -0
  3. package/.yarn/cache/@eslint-eslintrc-npm-3.2.0-1f7efe7868-c898e4d12f.zip +0 -0
  4. package/.yarn/cache/@eslint-js-npm-9.14.0-778d6db19a-727767d3c8.zip +0 -0
  5. package/.yarn/cache/@eslint-object-schema-npm-2.1.4-0546250476-5a03094115.zip +0 -0
  6. package/.yarn/cache/@eslint-plugin-kit-npm-0.2.3-ade9cfccf5-b93b9c3f5b.zip +0 -0
  7. package/.yarn/cache/@humanfs-core-npm-0.19.1-e2e7aaeb6e-611e054514.zip +0 -0
  8. package/.yarn/cache/@humanfs-node-npm-0.16.6-6ee2cad587-f9cb52bb23.zip +0 -0
  9. package/.yarn/cache/@humanwhocodes-retry-npm-0.3.1-9d87bf92c6-7e5517bb51.zip +0 -0
  10. package/.yarn/cache/@humanwhocodes-retry-npm-0.4.1-44b0ee0d64-f11167c28e.zip +0 -0
  11. package/.yarn/cache/{@shikijs-core-npm-1.22.2-38c51b2d7e-a49c4b9307.zip → @shikijs-core-npm-1.23.0-7609e52b62-be923c4cc4.zip} +0 -0
  12. package/.yarn/cache/@shikijs-engine-javascript-npm-1.23.0-515fb3dce6-e6cc266d7c.zip +0 -0
  13. package/.yarn/cache/{@shikijs-engine-oniguruma-npm-1.22.2-81b296889f-cbda50d13c.zip → @shikijs-engine-oniguruma-npm-1.23.0-65532dc404-e617cb94d1.zip} +0 -0
  14. package/.yarn/cache/{@shikijs-types-npm-1.22.2-8d42cc576d-1e9b63aac5.zip → @shikijs-types-npm-1.23.0-70f4a67e0e-af6f9296c1.zip} +0 -0
  15. package/.yarn/cache/@types-estree-npm-1.0.6-b5e23f2ea2-8825d6e729.zip +0 -0
  16. package/.yarn/cache/@types-merge-stream-npm-2.0.0-4b83b0d4bf-a310412bbc.zip +0 -0
  17. package/.yarn/cache/@typescript-eslint-eslint-plugin-npm-8.14.0-55616f1385-5ba1dc4eef.zip +0 -0
  18. package/.yarn/cache/@typescript-eslint-parser-npm-8.14.0-3444f81ac4-11a2c52efc.zip +0 -0
  19. package/.yarn/cache/@typescript-eslint-scope-manager-npm-8.14.0-4e9e7df726-9c4011771e.zip +0 -0
  20. package/.yarn/cache/@typescript-eslint-type-utils-npm-8.14.0-32010c30a5-5717b26ddf.zip +0 -0
  21. package/.yarn/cache/@typescript-eslint-types-npm-8.14.0-56131dda9e-032f1adb48.zip +0 -0
  22. package/.yarn/cache/@typescript-eslint-typescript-estree-npm-8.14.0-2681614eed-9412bd801f.zip +0 -0
  23. package/.yarn/cache/@typescript-eslint-utils-npm-8.14.0-4742a7bfab-7c432f2e29.zip +0 -0
  24. package/.yarn/cache/@typescript-eslint-visitor-keys-npm-8.14.0-c83f7a80b3-5f1279bf7c.zip +0 -0
  25. package/.yarn/cache/electron-to-chromium-npm-1.5.60-b8368b2876-049764e0d3.zip +0 -0
  26. package/.yarn/cache/emoji-regex-xs-npm-1.0.0-f4e3bfb84a-c33be159da.zip +0 -0
  27. package/.yarn/cache/{es-abstract-npm-1.23.3-ffd85665f7-f840cf1612.zip → es-abstract-npm-1.23.5-24fac3af09-17c81f8a42.zip} +0 -0
  28. package/.yarn/cache/eslint-npm-9.14.0-04ed57b338-1b54112da2.zip +0 -0
  29. package/.yarn/cache/eslint-scope-npm-8.2.0-d74e314c9e-750eff4672.zip +0 -0
  30. package/.yarn/cache/file-entry-cache-npm-8.0.0-5b09d19a83-f67802d333.zip +0 -0
  31. package/.yarn/cache/flat-cache-npm-4.0.1-12bf2455f7-899fc86bf6.zip +0 -0
  32. package/.yarn/cache/globals-npm-14.0.0-5fc3d8d5da-534b821673.zip +0 -0
  33. package/.yarn/cache/immutable-npm-5.0.2-d7d3c3ff6b-4adbd70580.zip +0 -0
  34. package/.yarn/cache/oniguruma-to-es-npm-0.1.2-77eeaabda3-30d0a1396d.zip +0 -0
  35. package/.yarn/cache/regex-recursion-npm-4.2.1-9993a7204d-4f39d856e7.zip +0 -0
  36. package/.yarn/cache/regex-utilities-npm-2.3.0-e1d010839d-41408777df.zip +0 -0
  37. package/.yarn/cache/sass-npm-1.81.0-42587b1ed8-93db5b342c.zip +0 -0
  38. package/.yarn/cache/{shiki-npm-1.22.2-a98fa8d6e2-874448fb53.zip → shiki-npm-1.23.0-0cfd6f2b40-f23c2e86ae.zip} +0 -0
  39. package/.yarn/cache/streamx-npm-2.20.2-33b6d2172c-4e18ed425e.zip +0 -0
  40. package/.yarn/cache/ts-api-utils-npm-1.4.0-b091964d6e-477601317d.zip +0 -0
  41. package/.yarn/install-state.gz +0 -0
  42. package/dist/Gulpfile.js +2 -2
  43. package/dist/helpers.d.ts +1 -1
  44. package/dist/helpers.js +1 -1
  45. package/dist/index.d.ts +2 -6
  46. package/dist/index.js +34 -20
  47. package/dist/init.js +3 -1
  48. package/dist/prepare.js +7 -6
  49. package/dist/settings.json +29 -2
  50. package/package.json +6 -6
  51. package/src/Gulpfile.ts +2 -2
  52. package/src/helpers.ts +1 -1
  53. package/src/index.ts +39 -30
  54. package/src/init.ts +6 -2
  55. package/src/prepare.ts +7 -6
  56. package/src/settings.json +29 -2
  57. package/.yarn/cache/@eslint-eslintrc-npm-2.1.4-1ff4b5f908-10957c7592.zip +0 -0
  58. package/.yarn/cache/@eslint-js-npm-8.57.1-dec269f278-2afb77454c.zip +0 -0
  59. package/.yarn/cache/@humanwhocodes-config-array-npm-0.13.0-843095a032-eae69ff913.zip +0 -0
  60. package/.yarn/cache/@humanwhocodes-object-schema-npm-2.0.3-4f0e508cd9-d3b78f6c58.zip +0 -0
  61. package/.yarn/cache/@shikijs-engine-javascript-npm-1.22.2-7bfeb1cb65-162f089f7e.zip +0 -0
  62. package/.yarn/cache/@types-merge-stream-npm-1.1.5-ee972b7117-79b4b10b9b.zip +0 -0
  63. package/.yarn/cache/@typescript-eslint-eslint-plugin-npm-5.62.0-c48b9a5492-fc104b389c.zip +0 -0
  64. package/.yarn/cache/@typescript-eslint-parser-npm-5.62.0-c6b29fa302-d168f4c7f2.zip +0 -0
  65. package/.yarn/cache/@typescript-eslint-type-utils-npm-5.62.0-220216d668-fc41eece5f.zip +0 -0
  66. package/.yarn/cache/doctrine-npm-3.0.0-c6f1615f04-fd7673ca77.zip +0 -0
  67. package/.yarn/cache/electron-to-chromium-npm-1.5.56-9680391041-ef8213e353.zip +0 -0
  68. package/.yarn/cache/eslint-npm-8.57.1-dd20287a5a-e2489bb7f8.zip +0 -0
  69. package/.yarn/cache/eslint-scope-npm-7.2.2-53cb0df8e8-ec97dbf5fb.zip +0 -0
  70. package/.yarn/cache/espree-npm-9.6.1-a50722a5a9-eb8c149c7a.zip +0 -0
  71. package/.yarn/cache/file-entry-cache-npm-6.0.1-31965cf0af-f49701feaa.zip +0 -0
  72. package/.yarn/cache/flat-cache-npm-3.2.0-9a887f084e-e7e0f59801.zip +0 -0
  73. package/.yarn/cache/globals-npm-13.24.0-cc7713139c-56066ef058.zip +0 -0
  74. package/.yarn/cache/immutable-npm-4.3.7-a76ac3621b-1c50eb053b.zip +0 -0
  75. package/.yarn/cache/natural-compare-lite-npm-1.4.0-12b6b308ed-5222ac3986.zip +0 -0
  76. package/.yarn/cache/oniguruma-to-js-npm-0.4.3-d9beced012-563d2e3490.zip +0 -0
  77. package/.yarn/cache/sass-npm-1.80.6-30d57f2c14-1a81e0fe09.zip +0 -0
  78. package/.yarn/cache/streamx-npm-2.20.1-2a3f1504e4-48605ddd3a.zip +0 -0
  79. package/.yarn/cache/type-fest-npm-0.20.2-b36432617f-4fb3272df2.zip +0 -0
  80. package/files/.drone/.drone.yml +0 -156
  81. package/files/.drone/mail_prod_build.hbs +0 -319
  82. package/files/.drone/mail_prod_deploy.hbs +0 -309
  83. package/files/.drone/mail_satges.hbs +0 -309
  84. package/files/.drone/telegram_prod_build.tpl +0 -23
  85. package/files/.drone/telegram_prod_deploy.tpl +0 -20
  86. package/files/.drone/telegram_stages.tpl +0 -20
  87. package/files/lucy.json +0 -29
Binary file
package/dist/Gulpfile.js CHANGED
@@ -65,7 +65,7 @@ gulp.task('fix-wix', gulp.series(cleanWix(), 'sync-types', 'fix-wixtypes', 'add-
65
65
  gulp.task('build', gulp.parallel('build-backend', 'build-public', buildPages(taskOptions), compileScss(taskOptions), 'copy-files'));
66
66
  gulp.task('build-pipeline', gulp.series(cleanSrc(taskOptions), 'set-production', 'fix-wixtypes', 'add-wix-types', 'test', 'build'));
67
67
  gulp.task('build-prod', gulp.series((done) => checkPages(true, false).then(() => done(), (err) => done(err)), cleanSrc(taskOptions), 'set-production', 'fix-wix', 'build-backend', 'build-public', buildPages(taskOptions), 'copy-files', compileScss(taskOptions), 'gen-docs'));
68
- gulp.task('start-dev-env', gulp.parallel(watchAll(taskOptions), 'test', 'start-wix', (done) => checkPages(false, taskOptions.projectSettings?.force ?? false).then(() => done(), (err) => done(err))));
68
+ gulp.task('start-dev-env', gulp.parallel(watchAll(taskOptions), 'test', 'start-wix', (done) => checkPages(false, taskOptions.moduleSettings?.force ?? false).then(() => done(), (err) => done(err))));
69
69
  gulp.task('dev', gulp.series(cleanSrc(taskOptions), 'fix-wix', 'build', 'start-dev-env'));
70
70
  async function gulpTaskRunner(task) {
71
71
  return new Promise(function (resolve, reject) {
@@ -73,8 +73,8 @@ async function gulpTaskRunner(task) {
73
73
  resolve(true);
74
74
  done();
75
75
  })(function (err) {
76
- console.log((`💩 ${red.underline.bold("=> Error starting tasks =>")} ${orange(err)}`));
77
76
  if (err) {
77
+ console.log((`💩 ${red.underline.bold("=> Error starting tasks =>")} ${orange(err)}`));
78
78
  reject(err);
79
79
  }
80
80
  });
package/dist/helpers.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { ModuleSettings, ProjectSettings } from '.';
2
2
  export declare function installPackages(wixPackages: Record<string, string>, devPackages: Record<string, string>, cwd: string, locked: boolean): Promise<void>;
3
3
  export declare function gitInit(cwd: string, modules: Record<string, string>): Promise<void>;
4
- export declare function dev(moduleSettings: ModuleSettings, projectSettings: ProjectSettings, task: string): Promise<void>;
4
+ export declare function runGulp(moduleSettings: ModuleSettings, projectSettings: ProjectSettings, task: string): Promise<void>;
package/dist/helpers.js CHANGED
@@ -56,7 +56,7 @@ export async function gitInit(cwd, modules) {
56
56
  }
57
57
  console.log("🐶" + green.underline(' => All Modules cloned!'));
58
58
  }
59
- export async function dev(moduleSettings, projectSettings, task) {
59
+ export async function runGulp(moduleSettings, projectSettings, task) {
60
60
  // Get the directory name of the current module
61
61
  const __filename = fileURLToPath(import.meta.url);
62
62
  const __dirname = path.dirname(__filename);
package/dist/index.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  #!/usr/bin/env node --no-warnings
2
- import settings from './settings.json';
3
- import lucyJSON from '../files/lucy.json';
4
2
  export type LucySettings = {
5
3
  modules: {
6
4
  [llibName: string]: string;
@@ -32,16 +30,14 @@ export type ModuleSettings = {
32
30
  wixConfigPath: string;
33
31
  lucyConfigPath: string;
34
32
  packageJsonPath: string;
35
- settings: typeof settings;
36
- lucyJSON: typeof lucyJSON;
33
+ settings: LucySettings;
37
34
  lockVersion: boolean;
35
+ force: boolean;
38
36
  };
39
37
  export type ProjectSettings = {
40
38
  modules?: Record<string, string>;
41
39
  lucySettings?: LucySettings;
42
40
  packageJSON?: Record<string, any>;
43
- lucyJSON?: Record<string, any>;
44
- force: boolean;
45
41
  };
46
42
  export declare const orange: import("chalk").ChalkInstance;
47
43
  export declare const blue: import("chalk").ChalkInstance;
package/dist/index.js CHANGED
@@ -5,12 +5,11 @@ import { existsSync } from 'fs';
5
5
  import chalk from 'chalk';
6
6
  import settings from './settings.json' assert { type: 'json' };
7
7
  import projectPackageJSON from '../package.json' assert { type: 'json' };
8
- import lucyJSON from '../files/lucy.json' assert { type: 'json' };
9
8
  import { join } from 'path';
10
9
  import fs from 'fs/promises';
11
10
  import { init } from './init.js';
12
11
  import { sync } from './sync.js';
13
- import { dev, installPackages } from './helpers.js';
12
+ import { runGulp, installPackages } from './helpers.js';
14
13
  import { prepare } from './prepare.js';
15
14
  export const orange = chalk.hex('#FFA500');
16
15
  export const blue = chalk.blueBright;
@@ -27,6 +26,7 @@ const __dirname = dirname(__filename);
27
26
  * @returns {Promise<void>}
28
27
  */
29
28
  async function main() {
29
+ // INFO: Module settings
30
30
  const moduleSettings = {
31
31
  packageRoot: dirname(__dirname),
32
32
  targetFolder: process.cwd(),
@@ -35,12 +35,10 @@ async function main() {
35
35
  wixConfigPath: join(process.cwd(), 'wix.config.json'),
36
36
  lucyConfigPath: join(process.cwd(), 'lucy.json'),
37
37
  packageJsonPath: join(process.cwd(), 'package.json'),
38
- lucyJSON,
39
- lockVersion: false
40
- };
41
- let projectSettings = {
42
- force: false
38
+ force: false,
39
+ lockVersion: false,
43
40
  };
41
+ let projectSettings = {};
44
42
  if (moduleSettings.args.includes('version') || moduleSettings.args.includes('-v')) {
45
43
  console.log("🐾" + blue.bold(` => ${projectPackageJSON.version}`));
46
44
  return;
@@ -75,13 +73,18 @@ async function main() {
75
73
  console.log((`💩 ${red.underline.bold("=> This is not a WIX project =>")} ${orange(moduleSettings.targetFolder)}`));
76
74
  return;
77
75
  }
76
+ //INFO: Collect project settings
77
+ if (moduleSettings.args.includes('-f'))
78
+ moduleSettings.force = true;
79
+ if (moduleSettings.args.includes('-l'))
80
+ moduleSettings.lockVersion = true;
78
81
  if (existsSync(moduleSettings.packageJsonPath)) {
79
82
  const packageJSONraw = await fs.readFile(join(moduleSettings.packageJsonPath), 'utf8');
80
83
  try {
81
84
  projectSettings.packageJSON = JSON.parse(packageJSONraw);
82
- if (moduleSettings.args.includes('-f')) {
85
+ if (moduleSettings.force) {
83
86
  console.log("❗️" + red.underline(' => Forcing'));
84
- projectSettings.force = true;
87
+ moduleSettings.force = true;
85
88
  }
86
89
  }
87
90
  catch (parseError) {
@@ -104,24 +107,35 @@ async function main() {
104
107
  }
105
108
  ;
106
109
  }
110
+ if (!projectSettings.lucySettings?.initialized) {
111
+ if (!moduleSettings.args.includes('init')) {
112
+ return console.log(yellow.underline.bold('🐶 => Project not Initialized! Please initialize using "lucy-cli init"'));
113
+ }
114
+ }
107
115
  if (moduleSettings.args.includes('-l'))
108
116
  moduleSettings.lockVersion = true;
117
+ // INFO: Run commands
109
118
  if (moduleSettings.args.includes('init')) {
119
+ if (projectSettings.lucySettings?.initialized && !moduleSettings.force) {
120
+ console.log((`💩 ${red.underline.bold("=> This project is already initialized =>")} ${orange(moduleSettings.targetFolder)}`));
121
+ console.log("🐕" + magenta.underline(' => Use -f to force initialization'));
122
+ return;
123
+ }
110
124
  console.log("🐕" + magenta.underline(' => Initializing project'));
111
125
  init(moduleSettings, projectSettings);
112
126
  return;
113
127
  }
114
128
  if (moduleSettings.args.includes('prepare')) {
115
- console.log("🐕" + magenta.underline(' => Preparing project'));
116
- init(moduleSettings, projectSettings);
129
+ await prepare(moduleSettings, projectSettings);
117
130
  return;
118
131
  }
119
132
  if (moduleSettings.args.includes('install')) {
120
- await installPackages(moduleSettings.settings.wixPackages, moduleSettings.settings.devPackages, moduleSettings.targetFolder, moduleSettings.lockVersion);
121
- return;
122
- }
123
- if (moduleSettings.args.includes('prepare')) {
124
- await prepare(moduleSettings, projectSettings);
133
+ if (!projectSettings.lucySettings?.initialized) {
134
+ console.log((`💩 ${red.underline.bold("=> This project is not initialized =>")} ${orange(moduleSettings.targetFolder)}`));
135
+ console.log("🐕" + magenta.underline(' => Use init to initialize'));
136
+ return;
137
+ }
138
+ await installPackages(projectSettings.lucySettings.wixPackages, projectSettings.lucySettings.devPackages, moduleSettings.targetFolder, moduleSettings.lockVersion);
125
139
  return;
126
140
  }
127
141
  if (moduleSettings.args.includes('sync')) {
@@ -129,18 +143,18 @@ async function main() {
129
143
  return;
130
144
  }
131
145
  if (moduleSettings.args.includes('dev')) {
132
- dev(moduleSettings, projectSettings, 'dev');
146
+ runGulp(moduleSettings, projectSettings, 'dev');
133
147
  return;
134
148
  }
135
149
  if (moduleSettings.args.includes('build-prod')) {
136
- dev(moduleSettings, projectSettings, 'build-prod');
150
+ runGulp(moduleSettings, projectSettings, 'build-prod');
137
151
  return;
138
152
  }
139
153
  if (moduleSettings.args.includes('fix')) {
140
- dev(moduleSettings, projectSettings, 'fix');
154
+ runGulp(moduleSettings, projectSettings, 'fix-wix');
141
155
  return;
142
156
  }
143
157
  console.log("🐕" + blue.underline.bold(' => Running dev'));
144
- dev(moduleSettings, projectSettings, 'dev');
158
+ runGulp(moduleSettings, projectSettings, 'dev');
145
159
  }
146
160
  main();
package/dist/init.js CHANGED
@@ -23,7 +23,9 @@ export async function init(moduleSettings, projectSettings) {
23
23
  await installPackages(moduleSettings.settings.wixPackages, moduleSettings.settings.devPackages, moduleSettings.targetFolder, moduleSettings.lockVersion);
24
24
  await editJson(join(moduleSettings.targetFolder, 'jsconfig.json'), ['compilerOptions', 'exclude'], [moduleSettings.settings.wixSettings.compilerOptions, moduleSettings.settings.wixSettings.exclude]);
25
25
  await editJson(join(moduleSettings.targetFolder, 'typedoc.json'), ['name'], [path.basename(moduleSettings.targetFolder)]);
26
- await gitInit(moduleSettings.targetFolder, projectSettings?.lucySettings?.modules ? projectSettings?.lucySettings?.modules : moduleSettings.settings.modules);
26
+ await gitInit(moduleSettings.targetFolder, moduleSettings.settings.modules);
27
+ moduleSettings.settings.initialized = true;
28
+ fs.writeFile(join(moduleSettings.targetFolder, 'lucy.json'), JSON.stringify(moduleSettings.settings, null, 2));
27
29
  console.log(chalk.greenBright.underline('🐶 => Initialization done!'));
28
30
  }
29
31
  /**
package/dist/prepare.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import chalk from 'chalk';
2
- import { orange, red } from './index.js';
2
+ import { orange, red, magenta } from './index.js';
3
3
  import { gitInit, installPackages } from './helpers.js';
4
4
  /**
5
5
  * Init Lucy project
@@ -8,11 +8,12 @@ import { gitInit, installPackages } from './helpers.js';
8
8
  * @returns {void}
9
9
  */
10
10
  export async function prepare(moduleSettings, projectSettings) {
11
- if (projectSettings.lucySettings?.initialized) {
12
- console.log((`💩 ${red.underline.bold("=> This project is already initialized =>")} ${orange(moduleSettings.targetFolder)}`));
11
+ if (!projectSettings.lucySettings?.initialized) {
12
+ console.log((`💩 ${red.underline.bold("=> This project is not initialized =>")} ${orange(moduleSettings.targetFolder)}`));
13
+ console.log("🐕" + magenta.underline(' => Use init to initialize'));
13
14
  return;
14
15
  }
15
- await installPackages(moduleSettings.settings.wixPackages, moduleSettings.settings.devPackages, moduleSettings.targetFolder, moduleSettings.lockVersion);
16
- await gitInit(moduleSettings.targetFolder, projectSettings?.lucySettings?.modules ? projectSettings?.lucySettings?.modules : moduleSettings.settings.modules);
17
- console.log(chalk.greenBright.underline('🐶 => Initialization done!'));
16
+ await installPackages(projectSettings.lucySettings.wixPackages, projectSettings.lucySettings.devPackages, moduleSettings.targetFolder, moduleSettings.lockVersion);
17
+ await gitInit(moduleSettings.targetFolder, projectSettings?.lucySettings?.modules);
18
+ console.log(chalk.greenBright.underline('🐶 => Prepare done!'));
18
19
  }
@@ -12,7 +12,34 @@
12
12
  "initialized": false,
13
13
  "wixPackages": {},
14
14
  "devPackages": {
15
- "@wix/cli": "latest"
15
+ "@wix/cli": "latest",
16
+ "@styled/typescript-styled-plugin": "^1.0.1",
17
+ "@total-typescript/ts-reset": "0.6.1",
18
+ "@types/jest": "^29.5.3",
19
+ "@types/node": "22.9.0",
20
+ "@types/react": "^18.2.21",
21
+ "@typescript-eslint/parser": "8.14.0",
22
+ "@typescript-eslint/utils": "8.14.0",
23
+ "@wix/eslint-plugin-cli": "latest",
24
+ "cypress": "13.15.2",
25
+ "cypress-cloud": "^1.9.3",
26
+ "esbuild": "0.24.0",
27
+ "eslint": "9.14.0",
28
+ "eslint-plugin-import": "^2.27.5",
29
+ "eslint-plugin-jsdoc": "50.5.0",
30
+ "eslint-plugin-named-import-spacing": "^1.0.3",
31
+ "eslint-plugin-neverthrow": "^1.1.4",
32
+ "eslint-plugin-simple-import-sort": "12.1.1",
33
+ "jest": "^29.6.1",
34
+ "prettier": "^3.0.3",
35
+ "sass": "^1.65.1",
36
+ "ts-jest": "^29.1.1",
37
+ "ts-node": "^10.9.1",
38
+ "tsx": "4.19.2",
39
+ "typedoc": "0.26.11",
40
+ "typedoc-theme-hierarchy": "5.0.3",
41
+ "typescript": "^5.1.6",
42
+ "typescript-eslint-language-service": "^5.0.5"
16
43
  },
17
44
  "scripts": {
18
45
  "postinstall": "wix sync-types",
@@ -21,7 +48,7 @@
21
48
  "lint": "eslint .",
22
49
  "docs": "typedoc --tsconfig typescript/tsconfig.json --skipErrorChecking",
23
50
  "build": "lucy-cli build-prod",
24
- "fix-wix": "lucy-cli fix",
51
+ "fix-wix": "lucy-cli fix-wix",
25
52
  "tsc": "tsc -p ./typescript/tsconfig.json --noEmit",
26
53
  "test": "jest --config jest.config.ts --passWithNoTests",
27
54
  "test:watch": "jest --config jest.config.ts --watch"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "lucy-cli",
4
- "version": "0.7.2",
4
+ "version": "0.7.4",
5
5
  "description": "Lucy Framework for WIX Studio Editor",
6
6
  "main": ".dist/index.js",
7
7
  "scripts": {
@@ -76,13 +76,13 @@
76
76
  "@types/gulp-sass": "^5.0.4",
77
77
  "@types/gulp-tap": "^1.0.5",
78
78
  "@types/jest": "^29.5.3",
79
- "@types/merge-stream": "^1.1.5",
79
+ "@types/merge-stream": "2.0.0",
80
80
  "@types/merge2": "^1.4.4",
81
- "@typescript-eslint/eslint-plugin": "^5.61.0",
82
- "@typescript-eslint/parser": "^5.61.0",
83
- "@typescript-eslint/utils": "^5.61.0",
81
+ "@typescript-eslint/eslint-plugin": "8.14.0",
82
+ "@typescript-eslint/parser": "8.14.0",
83
+ "@typescript-eslint/utils": "8.14.0",
84
84
  "esbuild": "0.24.0",
85
- "eslint": "^8.25.0",
85
+ "eslint": "9.14.0",
86
86
  "eslint-plugin-import": "^2.27.5",
87
87
  "eslint-plugin-jsdoc": "50.5.0",
88
88
  "eslint-plugin-named-import-spacing": "^1.0.3",
package/src/Gulpfile.ts CHANGED
@@ -170,7 +170,7 @@ gulp.task('start-dev-env', gulp.parallel(
170
170
  watchAll(taskOptions),
171
171
  'test',
172
172
  'start-wix',
173
- (done) => checkPages(false, taskOptions.projectSettings?.force ?? false).then(() => done(), (err) => done(err)),
173
+ (done) => checkPages(false, taskOptions.moduleSettings?.force ?? false).then(() => done(), (err) => done(err)),
174
174
  ));
175
175
 
176
176
  gulp.task('dev', gulp.series(
@@ -187,8 +187,8 @@ async function gulpTaskRunner(task: string) {
187
187
  resolve(true);
188
188
  done();
189
189
  })(function (err) {
190
- console.log((`💩 ${red.underline.bold("=> Error starting tasks =>")} ${orange(err)}`));
191
190
  if (err) {
191
+ console.log((`💩 ${red.underline.bold("=> Error starting tasks =>")} ${orange(err)}`));
192
192
  reject(err);
193
193
  }
194
194
  });
package/src/helpers.ts CHANGED
@@ -63,7 +63,7 @@ export async function gitInit(cwd: string, modules: Record<string, string>) {
63
63
  }
64
64
 
65
65
 
66
- export async function dev(moduleSettings: ModuleSettings, projectSettings: ProjectSettings, task: string) {
66
+ export async function runGulp(moduleSettings: ModuleSettings, projectSettings: ProjectSettings, task: string) {
67
67
  // Get the directory name of the current module
68
68
  const __filename = fileURLToPath(import.meta.url);
69
69
  const __dirname = path.dirname(__filename);
package/src/index.ts CHANGED
@@ -5,14 +5,13 @@ import { existsSync } from 'fs';
5
5
  import chalk from 'chalk';
6
6
  import settings from './settings.json' assert { type: 'json' };
7
7
  import projectPackageJSON from '../package.json' assert { type: 'json' };
8
- import lucyJSON from '../files/lucy.json' assert { type: 'json' };
9
8
 
10
9
  import { join } from 'path';
11
10
  import fs from 'fs/promises';
12
11
 
13
12
  import { init } from './init.js';
14
13
  import { sync } from './sync.js';
15
- import { dev, installPackages } from './helpers.js';
14
+ import { runGulp, installPackages } from './helpers.js';
16
15
  import { prepare } from './prepare.js';
17
16
 
18
17
  export type LucySettings = {
@@ -47,9 +46,9 @@ export type ModuleSettings = {
47
46
  wixConfigPath: string;
48
47
  lucyConfigPath: string;
49
48
  packageJsonPath: string;
50
- settings: typeof settings;
51
- lucyJSON: typeof lucyJSON;
49
+ settings: LucySettings;
52
50
  lockVersion: boolean;
51
+ force: boolean;
53
52
  }
54
53
 
55
54
  export type ProjectSettings = {
@@ -57,8 +56,6 @@ export type ProjectSettings = {
57
56
  modules?: Record<string, string>;
58
57
  lucySettings?: LucySettings;
59
58
  packageJSON?: Record<string, any>;
60
- lucyJSON?: Record<string, any>;
61
- force: boolean;
62
59
  }
63
60
 
64
61
  export const orange = chalk.hex('#FFA500');
@@ -79,7 +76,7 @@ const __dirname = dirname(__filename);
79
76
  * @returns {Promise<void>}
80
77
  */
81
78
  async function main(): Promise<void> {
82
-
79
+ // INFO: Module settings
83
80
  const moduleSettings: ModuleSettings = {
84
81
  packageRoot: dirname(__dirname),
85
82
  targetFolder: process.cwd(),
@@ -88,13 +85,11 @@ async function main(): Promise<void> {
88
85
  wixConfigPath: join(process.cwd(), 'wix.config.json'),
89
86
  lucyConfigPath: join(process.cwd(), 'lucy.json'),
90
87
  packageJsonPath: join(process.cwd(), 'package.json'),
91
- lucyJSON,
92
- lockVersion: false
88
+ force: false,
89
+ lockVersion: false,
93
90
  }
94
91
 
95
- let projectSettings: ProjectSettings = {
96
- force: false
97
- };
92
+ let projectSettings: ProjectSettings = {};
98
93
 
99
94
  if(moduleSettings.args.includes('version') || moduleSettings.args.includes('-v')){
100
95
  console.log("🐾" + blue.bold(` => ${projectPackageJSON.version}`));
@@ -135,13 +130,17 @@ async function main(): Promise<void> {
135
130
  return;
136
131
  }
137
132
 
133
+ //INFO: Collect project settings
134
+ if(moduleSettings.args.includes('-f')) moduleSettings.force = true;
135
+ if(moduleSettings.args.includes('-l')) moduleSettings.lockVersion = true;
136
+
138
137
  if(existsSync(moduleSettings.packageJsonPath)) {
139
138
  const packageJSONraw = await fs.readFile(join(moduleSettings.packageJsonPath), 'utf8');
140
139
  try {
141
140
  projectSettings.packageJSON = JSON.parse(packageJSONraw);
142
- if(moduleSettings.args.includes('-f')) {
141
+ if(moduleSettings.force) {
143
142
  console.log("❗️" + red.underline(' => Forcing'));
144
- projectSettings.force = true;
143
+ moduleSettings.force = true;
145
144
  }
146
145
  } catch (parseError) {
147
146
  console.log((`💩 ${red.underline.bold("=> Error parsing package.json =>")} ${orange(parseError)}`));
@@ -162,27 +161,27 @@ async function main(): Promise<void> {
162
161
  };
163
162
  }
164
163
 
164
+ if(!projectSettings.lucySettings?.initialized) {
165
+ if(!moduleSettings.args.includes('init')) {
166
+ return console.log(yellow.underline.bold('🐶 => Project not Initialized! Please initialize using "lucy-cli init"'));
167
+ }
168
+ }
169
+
165
170
  if(moduleSettings.args.includes('-l')) moduleSettings.lockVersion = true;
166
171
 
172
+ // INFO: Run commands
167
173
  if(moduleSettings.args.includes('init')){
174
+ if(projectSettings.lucySettings?.initialized && !moduleSettings.force) {
175
+ console.log((`💩 ${red.underline.bold("=> This project is already initialized =>")} ${orange(moduleSettings.targetFolder)}`));
176
+ console.log("🐕" + magenta.underline(' => Use -f to force initialization'));
177
+ return;
178
+ }
168
179
  console.log("🐕" + magenta.underline(' => Initializing project'));
169
180
  init(moduleSettings, projectSettings);
170
181
 
171
182
  return;
172
183
  }
173
184
 
174
- if(moduleSettings.args.includes('prepare')){
175
- console.log("🐕" + magenta.underline(' => Preparing project'));
176
- init(moduleSettings, projectSettings);
177
-
178
- return;
179
- }
180
-
181
- if(moduleSettings.args.includes('install')){
182
- await installPackages( moduleSettings.settings.wixPackages, moduleSettings.settings.devPackages, moduleSettings.targetFolder, moduleSettings.lockVersion);
183
-
184
- return;
185
- }
186
185
 
187
186
  if(moduleSettings.args.includes('prepare')){
188
187
  await prepare( moduleSettings, projectSettings);
@@ -190,7 +189,17 @@ async function main(): Promise<void> {
190
189
  return;
191
190
  }
192
191
 
192
+ if(moduleSettings.args.includes('install')){
193
+ if(!projectSettings.lucySettings?.initialized) {
194
+ console.log((`💩 ${red.underline.bold("=> This project is not initialized =>")} ${orange(moduleSettings.targetFolder)}`));
195
+ console.log("🐕" + magenta.underline(' => Use init to initialize'));
196
+ return;
197
+ }
198
+ await installPackages(projectSettings.lucySettings.wixPackages, projectSettings.lucySettings.devPackages, moduleSettings.targetFolder, moduleSettings.lockVersion);
193
199
 
200
+ return;
201
+ }
202
+
194
203
  if(moduleSettings.args.includes('sync')){
195
204
  sync(moduleSettings, projectSettings);
196
205
 
@@ -198,23 +207,23 @@ async function main(): Promise<void> {
198
207
  }
199
208
 
200
209
  if(moduleSettings.args.includes('dev')){
201
- dev(moduleSettings, projectSettings, 'dev');
210
+ runGulp(moduleSettings, projectSettings, 'dev');
202
211
 
203
212
  return;
204
213
  }
205
214
  if(moduleSettings.args.includes('build-prod')){
206
- dev(moduleSettings, projectSettings, 'build-prod');
215
+ runGulp(moduleSettings, projectSettings, 'build-prod');
207
216
 
208
217
  return;
209
218
  }
210
219
  if(moduleSettings.args.includes('fix')){
211
- dev(moduleSettings, projectSettings, 'fix');
220
+ runGulp(moduleSettings, projectSettings, 'fix-wix');
212
221
 
213
222
  return;
214
223
  }
215
224
 
216
225
  console.log("🐕" + blue.underline.bold(' => Running dev'));
217
- dev(moduleSettings, projectSettings, 'dev');
226
+ runGulp(moduleSettings, projectSettings, 'dev');
218
227
  }
219
228
 
220
229
  main();
package/src/init.ts CHANGED
@@ -27,12 +27,16 @@ export async function init(moduleSettings: ModuleSettings, projectSettings: Proj
27
27
  await editJson(moduleSettings.packageJsonPath, ['type', 'scripts'], ['module', moduleSettings.settings.scripts ]);
28
28
  await stringReplace(join(moduleSettings.targetFolder, 'currents.config.js'), ['__ProjectName__'], [path.basename(moduleSettings.targetFolder)]);
29
29
 
30
- await installPackages( moduleSettings.settings.wixPackages, moduleSettings.settings.devPackages, moduleSettings.targetFolder, moduleSettings.lockVersion);
30
+ await installPackages(moduleSettings.settings.wixPackages, moduleSettings.settings.devPackages, moduleSettings.targetFolder, moduleSettings.lockVersion);
31
31
 
32
32
  await editJson(join(moduleSettings.targetFolder, 'jsconfig.json'), ['compilerOptions', 'exclude'], [moduleSettings.settings.wixSettings.compilerOptions, moduleSettings.settings.wixSettings.exclude]);
33
33
  await editJson(join(moduleSettings.targetFolder, 'typedoc.json'), ['name'], [path.basename(moduleSettings.targetFolder)]);
34
34
 
35
- await gitInit(moduleSettings.targetFolder, projectSettings?.lucySettings?.modules ? projectSettings?.lucySettings?.modules : moduleSettings.settings.modules);
35
+ await gitInit(moduleSettings.targetFolder, moduleSettings.settings.modules);
36
+
37
+ moduleSettings.settings.initialized = true;
38
+
39
+ fs.writeFile(join(moduleSettings.targetFolder, 'lucy.json'), JSON.stringify(moduleSettings.settings, null, 2));
36
40
 
37
41
  console.log(chalk.greenBright.underline('🐶 => Initialization done!'));
38
42
  }