lucy-cli 0.7.1 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Gulpfile.js +2 -2
- package/dist/helpers.d.ts +1 -1
- package/dist/helpers.js +1 -1
- package/dist/index.d.ts +2 -6
- package/dist/index.js +34 -20
- package/dist/init.js +3 -1
- package/dist/prepare.js +7 -6
- package/dist/settings.json +30 -5
- package/package.json +1 -1
- package/src/Gulpfile.ts +2 -2
- package/src/helpers.ts +1 -1
- package/src/index.ts +39 -30
- package/src/init.ts +6 -2
- package/src/prepare.ts +7 -6
- package/src/settings.json +30 -5
- package/files/.drone/.drone.yml +0 -156
- package/files/.drone/mail_prod_build.hbs +0 -319
- package/files/.drone/mail_prod_deploy.hbs +0 -309
- package/files/.drone/mail_satges.hbs +0 -309
- package/files/.drone/telegram_prod_build.tpl +0 -23
- package/files/.drone/telegram_prod_deploy.tpl +0 -20
- package/files/.drone/telegram_stages.tpl +0 -20
- package/files/lucy.json +0 -29
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.
|
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
|
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
|
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:
|
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 {
|
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
|
-
|
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.
|
85
|
+
if (moduleSettings.force) {
|
83
86
|
console.log("❗️" + red.underline(' => Forcing'));
|
84
|
-
|
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
|
-
|
116
|
-
init(moduleSettings, projectSettings);
|
129
|
+
await prepare(moduleSettings, projectSettings);
|
117
130
|
return;
|
118
131
|
}
|
119
132
|
if (moduleSettings.args.includes('install')) {
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
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
|
-
|
146
|
+
runGulp(moduleSettings, projectSettings, 'dev');
|
133
147
|
return;
|
134
148
|
}
|
135
149
|
if (moduleSettings.args.includes('build-prod')) {
|
136
|
-
|
150
|
+
runGulp(moduleSettings, projectSettings, 'build-prod');
|
137
151
|
return;
|
138
152
|
}
|
139
153
|
if (moduleSettings.args.includes('fix')) {
|
140
|
-
|
154
|
+
runGulp(moduleSettings, projectSettings, 'fix-wix');
|
141
155
|
return;
|
142
156
|
}
|
143
157
|
console.log("🐕" + blue.underline.bold(' => Running dev'));
|
144
|
-
|
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,
|
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
|
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(
|
16
|
-
await gitInit(moduleSettings.targetFolder, projectSettings?.lucySettings?.modules
|
17
|
-
console.log(chalk.greenBright.underline('🐶 =>
|
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
|
}
|
package/dist/settings.json
CHANGED
@@ -10,11 +10,36 @@
|
|
10
10
|
"exclude": ["**/*.js"]
|
11
11
|
},
|
12
12
|
"initialized": false,
|
13
|
-
"wixPackages": {
|
14
|
-
"@hey-api/openapi-ts": "0.55.1"
|
15
|
-
},
|
13
|
+
"wixPackages": {},
|
16
14
|
"devPackages": {
|
17
|
-
"@wix/cli": "
|
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"
|
18
43
|
},
|
19
44
|
"scripts": {
|
20
45
|
"postinstall": "wix sync-types",
|
@@ -23,7 +48,7 @@
|
|
23
48
|
"lint": "eslint .",
|
24
49
|
"docs": "typedoc --tsconfig typescript/tsconfig.json --skipErrorChecking",
|
25
50
|
"build": "lucy-cli build-prod",
|
26
|
-
"fix-wix": "lucy-cli fix",
|
51
|
+
"fix-wix": "lucy-cli fix-wix",
|
27
52
|
"tsc": "tsc -p ./typescript/tsconfig.json --noEmit",
|
28
53
|
"test": "jest --config jest.config.ts --passWithNoTests",
|
29
54
|
"test:watch": "jest --config jest.config.ts --watch"
|
package/package.json
CHANGED
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.
|
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
|
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 {
|
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:
|
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
|
-
|
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.
|
141
|
+
if(moduleSettings.force) {
|
143
142
|
console.log("❗️" + red.underline(' => Forcing'));
|
144
|
-
|
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
|
-
|
210
|
+
runGulp(moduleSettings, projectSettings, 'dev');
|
202
211
|
|
203
212
|
return;
|
204
213
|
}
|
205
214
|
if(moduleSettings.args.includes('build-prod')){
|
206
|
-
|
215
|
+
runGulp(moduleSettings, projectSettings, 'build-prod');
|
207
216
|
|
208
217
|
return;
|
209
218
|
}
|
210
219
|
if(moduleSettings.args.includes('fix')){
|
211
|
-
|
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
|
-
|
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(
|
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,
|
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
|
}
|
package/src/prepare.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import chalk from 'chalk';
|
2
|
-
import { ModuleSettings, ProjectSettings, blue, green, orange, red } from './index.js';
|
2
|
+
import { ModuleSettings, ProjectSettings, blue, green, orange, red, magenta } from './index.js';
|
3
3
|
import { gitInit, installPackages } from './helpers.js';
|
4
4
|
|
5
5
|
/**
|
@@ -10,14 +10,15 @@ import { gitInit, installPackages } from './helpers.js';
|
|
10
10
|
*/
|
11
11
|
export async function prepare(moduleSettings: ModuleSettings, projectSettings: ProjectSettings) {
|
12
12
|
|
13
|
-
if(projectSettings.lucySettings?.initialized) {
|
14
|
-
console.log((`💩 ${red.underline.bold("=> This project is
|
13
|
+
if(!projectSettings.lucySettings?.initialized) {
|
14
|
+
console.log((`💩 ${red.underline.bold("=> This project is not initialized =>")} ${orange(moduleSettings.targetFolder)}`));
|
15
|
+
console.log("🐕" + magenta.underline(' => Use init to initialize'));
|
15
16
|
return;
|
16
17
|
}
|
17
18
|
|
18
|
-
await installPackages(
|
19
|
+
await installPackages(projectSettings.lucySettings.wixPackages, projectSettings.lucySettings.devPackages, moduleSettings.targetFolder, moduleSettings.lockVersion);
|
19
20
|
|
20
|
-
await gitInit(moduleSettings.targetFolder, projectSettings?.lucySettings?.modules
|
21
|
+
await gitInit(moduleSettings.targetFolder, projectSettings?.lucySettings?.modules);
|
21
22
|
|
22
|
-
console.log(chalk.greenBright.underline('🐶 =>
|
23
|
+
console.log(chalk.greenBright.underline('🐶 => Prepare done!'));
|
23
24
|
}
|
package/src/settings.json
CHANGED
@@ -10,11 +10,36 @@
|
|
10
10
|
"exclude": ["**/*.js"]
|
11
11
|
},
|
12
12
|
"initialized": false,
|
13
|
-
"wixPackages": {
|
14
|
-
"@hey-api/openapi-ts": "0.55.1"
|
15
|
-
},
|
13
|
+
"wixPackages": {},
|
16
14
|
"devPackages": {
|
17
|
-
"@wix/cli": "
|
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"
|
18
43
|
},
|
19
44
|
"scripts": {
|
20
45
|
"postinstall": "wix sync-types",
|
@@ -23,7 +48,7 @@
|
|
23
48
|
"lint": "eslint .",
|
24
49
|
"docs": "typedoc --tsconfig typescript/tsconfig.json --skipErrorChecking",
|
25
50
|
"build": "lucy-cli build-prod",
|
26
|
-
"fix-wix": "lucy-cli fix",
|
51
|
+
"fix-wix": "lucy-cli fix-wix",
|
27
52
|
"tsc": "tsc -p ./typescript/tsconfig.json --noEmit",
|
28
53
|
"test": "jest --config jest.config.ts --passWithNoTests",
|
29
54
|
"test:watch": "jest --config jest.config.ts --watch"
|