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/gulp/backend.js
DELETED
@@ -1,91 +0,0 @@
|
|
1
|
-
import gulp from 'gulp';
|
2
|
-
import rename from 'gulp-rename';
|
3
|
-
import * as path from 'path';
|
4
|
-
import { blue, orange, red } from '../index.js';
|
5
|
-
import swc from 'gulp-swc';
|
6
|
-
const swcOptions = {
|
7
|
-
jsc: {
|
8
|
-
target: 'es2020',
|
9
|
-
parser: {
|
10
|
-
syntax: "typescript",
|
11
|
-
tsx: true,
|
12
|
-
decorators: true,
|
13
|
-
// preserveAllComments: true
|
14
|
-
},
|
15
|
-
preserveAllComments: false,
|
16
|
-
minify: {
|
17
|
-
compress: true // equivalent to {}
|
18
|
-
}
|
19
|
-
},
|
20
|
-
};
|
21
|
-
export function buildBackend(options) {
|
22
|
-
const folders = ['typescript', ...options.modulesSourcePaths];
|
23
|
-
const { outputDir } = options;
|
24
|
-
// Create tasks for each folder
|
25
|
-
const tasks = folders.map((folder) => {
|
26
|
-
const taskName = `build_Backend-${folder}`; // Create a unique name for each task
|
27
|
-
const task = () => gulp.src([
|
28
|
-
`${folder}/backend/**/*.ts`,
|
29
|
-
`${folder}/backend/**/*.tsx`,
|
30
|
-
`!${folder}/backend/**/*.jsw.ts`,
|
31
|
-
`!${folder}/backend/**/*.spec.ts`,
|
32
|
-
])
|
33
|
-
.pipe(swc(swcOptions))
|
34
|
-
.on('error', function (e) {
|
35
|
-
console.log("💩" + red.underline.bold(` => Build of Backend files for ${orange(folder)} failed!`));
|
36
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
37
|
-
this.emit('end');
|
38
|
-
})
|
39
|
-
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
40
|
-
.on('error', function (e) {
|
41
|
-
console.log("💩" + red.underline.bold(` => Build of Backend files for ${orange(folder)} failed!`));
|
42
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
43
|
-
this.emit('end');
|
44
|
-
})
|
45
|
-
.on('end', function () {
|
46
|
-
console.log("🐶" + blue.underline(` => Build of Backend files for ${orange(folder)} succeeded!`));
|
47
|
-
});
|
48
|
-
// Register the task with Gulp
|
49
|
-
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
50
|
-
return task;
|
51
|
-
});
|
52
|
-
// Run all tasks in parallel
|
53
|
-
return gulp.parallel(...tasks);
|
54
|
-
}
|
55
|
-
export function buildBackendJSW(options) {
|
56
|
-
const folders = ['typescript', ...options.modulesSourcePaths];
|
57
|
-
const swcOptions = {
|
58
|
-
jsc: {
|
59
|
-
target: 'es6',
|
60
|
-
},
|
61
|
-
};
|
62
|
-
const { outputDir } = options;
|
63
|
-
// Create tasks for each folder
|
64
|
-
const tasks = folders.map((folder) => {
|
65
|
-
const taskName = `build-${folder}`; // Create a unique name for each task
|
66
|
-
const task = () => gulp.src([
|
67
|
-
`${folder}/backend/**/*.jsw.ts`,
|
68
|
-
])
|
69
|
-
.pipe(swc(swcOptions))
|
70
|
-
.on('error', function (e) {
|
71
|
-
console.log("💩" + red.underline.bold(` => Build of Public files for ${orange(folder)} failed!`));
|
72
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
73
|
-
this.emit('end');
|
74
|
-
})
|
75
|
-
.pipe(rename({ extname: '' }))
|
76
|
-
.pipe(gulp.dest(path.join(outputDir, 'backend')))
|
77
|
-
.on('error', function (e) {
|
78
|
-
console.log("💩" + red.underline.bold(` => Build of JSW files for ${orange(folder)} failed!`));
|
79
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
80
|
-
this.emit('end');
|
81
|
-
})
|
82
|
-
.on('end', function () {
|
83
|
-
console.log("🐶" + blue.underline(` => Build of JSW files for ${orange(folder)} succeeded!`));
|
84
|
-
});
|
85
|
-
// Register the task with Gulp
|
86
|
-
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
87
|
-
return task;
|
88
|
-
});
|
89
|
-
// Run all tasks in parallel
|
90
|
-
return gulp.parallel(...tasks);
|
91
|
-
}
|
package/dist/gulp/checks.d.ts
DELETED
package/dist/gulp/checks.js
DELETED
@@ -1,204 +0,0 @@
|
|
1
|
-
import * as fs from 'fs';
|
2
|
-
import glob from 'glob';
|
3
|
-
import * as path from 'path';
|
4
|
-
import gulp from 'gulp';
|
5
|
-
import ts from 'gulp-typescript';
|
6
|
-
import { blue, green, magenta, orange, red, yellow } from '../index.js';
|
7
|
-
// /**
|
8
|
-
// * Extracts a match from a file
|
9
|
-
// * @param {string} filePath File path
|
10
|
-
// * @param {string} pattern Pattern to match
|
11
|
-
// */
|
12
|
-
// function extractMatchFromFile(filePath: string, pattern: string) {
|
13
|
-
// return new Promise((resolve, reject) => {
|
14
|
-
// fs.readFile(filePath, 'utf8', (err, data) => {
|
15
|
-
// if (err){
|
16
|
-
// reject(err);
|
17
|
-
// return;
|
18
|
-
// }
|
19
|
-
// const regex = new RegExp(pattern);
|
20
|
-
// const match = regex.exec(data);
|
21
|
-
// const capturedGroup = match ? match.groups?.page : null;
|
22
|
-
// resolve(capturedGroup);
|
23
|
-
// });
|
24
|
-
// });
|
25
|
-
// }
|
26
|
-
// async function readFilesInFolder(folderPath: string, pattern: string | null, globPattern: string): Promise<Object[]> {
|
27
|
-
// const files = await glob(path.join(folderPath, globPattern));
|
28
|
-
// const filenameList: Object[] = [];
|
29
|
-
// for (const file of files) {
|
30
|
-
// if (pattern) {
|
31
|
-
// const capturedGroup = await extractMatchFromFile(file, pattern);
|
32
|
-
// if (capturedGroup) {
|
33
|
-
// filenameList.push(capturedGroup);
|
34
|
-
// }
|
35
|
-
// } else {
|
36
|
-
// filenameList.push(path.basename(file));
|
37
|
-
// }
|
38
|
-
// }
|
39
|
-
// return filenameList;
|
40
|
-
// }
|
41
|
-
/**
|
42
|
-
* Extracts a match from a file
|
43
|
-
* @param {string} filePath File path
|
44
|
-
* @param {string} pattern Pattern to match
|
45
|
-
*/
|
46
|
-
function extractMatchFromFile(filePath, pattern) {
|
47
|
-
return new Promise((resolve, reject) => {
|
48
|
-
fs.readFile(filePath, 'utf8', (err, data) => {
|
49
|
-
if (err) {
|
50
|
-
reject(err);
|
51
|
-
return;
|
52
|
-
}
|
53
|
-
const regex = new RegExp(pattern);
|
54
|
-
const match = regex.exec(data);
|
55
|
-
const capturedGroup = match ? match.groups?.page : null;
|
56
|
-
resolve(capturedGroup);
|
57
|
-
});
|
58
|
-
});
|
59
|
-
}
|
60
|
-
/**
|
61
|
-
* Reads files in a folder
|
62
|
-
* @param {string} folderPath Folder path
|
63
|
-
* @param {string} pattern Pattern to match
|
64
|
-
* @param {string} globPattern Glob pattern
|
65
|
-
*/
|
66
|
-
function readFilesInFolder(folderPath, pattern, globPattern) {
|
67
|
-
return new Promise((resolve, reject) => {
|
68
|
-
glob(path.join(folderPath, globPattern), (err, files) => {
|
69
|
-
if (err) {
|
70
|
-
reject(err);
|
71
|
-
return;
|
72
|
-
}
|
73
|
-
const filenameList = [];
|
74
|
-
/**
|
75
|
-
* Traverse files
|
76
|
-
* @param {number} index Index
|
77
|
-
*/
|
78
|
-
function traverseFiles(index) {
|
79
|
-
if (index === files.length) {
|
80
|
-
resolve(filenameList);
|
81
|
-
return;
|
82
|
-
}
|
83
|
-
const file = files[index];
|
84
|
-
if (pattern) {
|
85
|
-
if (!file)
|
86
|
-
return;
|
87
|
-
extractMatchFromFile(file, pattern)
|
88
|
-
.then((capturedGroup) => {
|
89
|
-
if (capturedGroup) {
|
90
|
-
filenameList.push(capturedGroup);
|
91
|
-
}
|
92
|
-
traverseFiles(index + 1);
|
93
|
-
})
|
94
|
-
.catch(reject);
|
95
|
-
}
|
96
|
-
if (!pattern) {
|
97
|
-
if (!file)
|
98
|
-
return;
|
99
|
-
filenameList.push(path.basename(file));
|
100
|
-
traverseFiles(index + 1);
|
101
|
-
}
|
102
|
-
}
|
103
|
-
traverseFiles(0);
|
104
|
-
});
|
105
|
-
});
|
106
|
-
}
|
107
|
-
export async function checkPages(fail, force) {
|
108
|
-
console.log("🐕" + green.underline.bold(' => Checking pages...'));
|
109
|
-
return new Promise(async (resolve, reject) => {
|
110
|
-
try {
|
111
|
-
const sourcePages = await readFilesInFolder('./.wix/types/', '\\/pages\\/(?<page>.*\\.ts)', '**/*.json');
|
112
|
-
const tsPages = await readFilesInFolder('./typescript/pages', null, '**/*.ts');
|
113
|
-
const sourcePagesSet = new Set(sourcePages);
|
114
|
-
const tsPagesSet = new Set(tsPages);
|
115
|
-
const missingInTs = Array.from(sourcePagesSet).filter((item) => !tsPages.includes(item));
|
116
|
-
const obsoleteInTs = Array.from(tsPagesSet).filter((item) => !sourcePages.includes(item));
|
117
|
-
if (missingInTs.length > 0) {
|
118
|
-
if (!force) {
|
119
|
-
console.log("💩" + red.underline.bold(' => Missing pages in ts folder: '), '\n', missingInTs);
|
120
|
-
}
|
121
|
-
if (force) {
|
122
|
-
for (const page of missingInTs) {
|
123
|
-
console.log("🐶" + magenta.underline.bold(' => Creating missing page: '), page);
|
124
|
-
fs.writeFileSync(`./typescript/pages/${page}`, '');
|
125
|
-
}
|
126
|
-
}
|
127
|
-
}
|
128
|
-
if (obsoleteInTs.length > 0) {
|
129
|
-
if (!force) {
|
130
|
-
console.log("🦴" + yellow.underline.bold(' => Obsolete in ts folder'), '\n', obsoleteInTs);
|
131
|
-
}
|
132
|
-
if (force) {
|
133
|
-
for (const page of obsoleteInTs) {
|
134
|
-
console.log("🐶" + magenta.underline.bold(' => Deleting obsolete page: '), page);
|
135
|
-
fs.rmSync(`./typescript/pages/${page}`);
|
136
|
-
}
|
137
|
-
}
|
138
|
-
}
|
139
|
-
if (missingInTs.length === 0 && obsoleteInTs.length === 0) {
|
140
|
-
console.log("🐶" + blue.underline.bold(' => Pages are in-sync!'));
|
141
|
-
}
|
142
|
-
else if (fail) {
|
143
|
-
process.exit(1);
|
144
|
-
}
|
145
|
-
;
|
146
|
-
}
|
147
|
-
catch (error) {
|
148
|
-
reject(error);
|
149
|
-
}
|
150
|
-
});
|
151
|
-
}
|
152
|
-
const customReporter = {
|
153
|
-
error: (error, tsInstance) => {
|
154
|
-
if (!error.diagnostic) {
|
155
|
-
console.log(red(error.message));
|
156
|
-
return;
|
157
|
-
}
|
158
|
-
const { fullFilename, startPosition } = error;
|
159
|
-
const relativePath = path.relative(process.cwd(), fullFilename ?? '');
|
160
|
-
const line = startPosition ? startPosition.line + 1 : 0;
|
161
|
-
const col = startPosition ? startPosition.character + 1 : 0;
|
162
|
-
const message = tsInstance.flattenDiagnosticMessageText(error.diagnostic.messageText, '\n');
|
163
|
-
console.log(`${blue.underline(relativePath)}:${yellow(String(line))}:${yellow(String(col))}`);
|
164
|
-
console.log(` ${red('error')} ${yellow(`TS${error.diagnostic.code}`)}: ${message}`);
|
165
|
-
},
|
166
|
-
finish: (results) => {
|
167
|
-
const errorCount = results.transpileErrors + results.semanticErrors + results.declarationErrors;
|
168
|
-
if (errorCount > 0) {
|
169
|
-
console.log(`\n💥 ${red.bold(`Found ${errorCount} error${errorCount > 1 ? 's' : ''}.`)}`);
|
170
|
-
}
|
171
|
-
},
|
172
|
-
};
|
173
|
-
export function checkTs(options) {
|
174
|
-
const folders = ['typescript', ...options.modulesSourcePaths];
|
175
|
-
// Create tasks for each folder
|
176
|
-
const tasks = folders.map((folder) => {
|
177
|
-
const tsProject = ts.createProject(`./local.tsconfig.json`, { noEmit: true, declaration: false, skipDefaultLibCheck: true });
|
178
|
-
const taskName = `test-${folder}`; // Create a unique name for each task
|
179
|
-
const task = () => {
|
180
|
-
let hasError = false;
|
181
|
-
const stream = gulp.src([`${folder}/**/*.ts`, `!${folder}/types/**/*.ts`])
|
182
|
-
.pipe(tsProject(customReporter))
|
183
|
-
.on('error', () => {
|
184
|
-
hasError = true;
|
185
|
-
});
|
186
|
-
if (options.isWatching) {
|
187
|
-
stream.on('error', function () {
|
188
|
-
this.emit('end');
|
189
|
-
});
|
190
|
-
}
|
191
|
-
stream.on('end', () => {
|
192
|
-
if (!hasError) {
|
193
|
-
console.log("🐶" + blue.underline(` => Typescriptcheck for ${orange(folder)} succeeded!`));
|
194
|
-
}
|
195
|
-
});
|
196
|
-
return stream;
|
197
|
-
};
|
198
|
-
// Register the task with Gulp
|
199
|
-
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
200
|
-
return task;
|
201
|
-
});
|
202
|
-
// Run all tasks in parallel
|
203
|
-
return gulp.parallel(...tasks);
|
204
|
-
}
|
package/dist/gulp/clean copy.js
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
import chalk from 'chalk';
|
2
|
-
import gulp from 'gulp';
|
3
|
-
import { createGulpEsbuild } from 'gulp-esbuild';
|
4
|
-
import clean from 'gulp-clean';
|
5
|
-
export function cleanWix(options) {
|
6
|
-
const { outputDir, enableIncrementalBuild } = options;
|
7
|
-
const gulpEsbuild = createGulpEsbuild({
|
8
|
-
incremental: enableIncrementalBuild,
|
9
|
-
});
|
10
|
-
return () => {
|
11
|
-
return gulp.src('./.wix', { read: false, allowEmpty: true })
|
12
|
-
.pipe(clean({ force: true }))
|
13
|
-
.on('error', function () {
|
14
|
-
console.log(chalk.red.underline.bold('Cleaning of .wix failed!'));
|
15
|
-
this.emit('end');
|
16
|
-
})
|
17
|
-
.on('end', function () { console.log(chalk.blueBright.underline('Cleaning of .wix succeeded!')); });
|
18
|
-
};
|
19
|
-
}
|
package/dist/gulp/clean.d.ts
DELETED
package/dist/gulp/clean.js
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
import gulp from 'gulp';
|
2
|
-
import clean from 'gulp-clean';
|
3
|
-
import { blue, orange, red } from '../index.js';
|
4
|
-
export function cleanWix() {
|
5
|
-
return () => {
|
6
|
-
return gulp.src('./.wix', { read: false, allowEmpty: true })
|
7
|
-
.pipe(clean({ force: true }))
|
8
|
-
.on('error', function (e) {
|
9
|
-
console.log("💩" + red.underline.bold(' => Cleaning of .wix failed!'));
|
10
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
11
|
-
this.emit('end');
|
12
|
-
})
|
13
|
-
.on('end', function () { console.log("🐶" + blue.underline(' => Cleaning of .wix succeeded!')); });
|
14
|
-
};
|
15
|
-
}
|
16
|
-
export function cleanSrc(options) {
|
17
|
-
const { outputDir } = options;
|
18
|
-
return () => {
|
19
|
-
return gulp.src([`${outputDir}/pages`, `${outputDir}/public`, `${outputDir}/backend`], { read: false, allowEmpty: true })
|
20
|
-
.pipe(clean({ force: true }))
|
21
|
-
.on('error', function (e) {
|
22
|
-
console.log("💩" + red.underline.bold('Cleaning of output files failed!'));
|
23
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
24
|
-
this.emit('end');
|
25
|
-
})
|
26
|
-
.on('end', function () { console.log("🐶" + blue.underline(' => Cleaning of .src succeeded!')); });
|
27
|
-
};
|
28
|
-
}
|
package/dist/gulp/copy.d.ts
DELETED
package/dist/gulp/copy.js
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
import gulp from 'gulp';
|
2
|
-
import { blue, orange, red } from '../index.js';
|
3
|
-
export function copyFiles(options) {
|
4
|
-
const folders = ['typescript', ...options.modulesSourcePaths];
|
5
|
-
// Create tasks for each folder
|
6
|
-
const tasks = folders.map((folder) => {
|
7
|
-
const { outputDir } = options;
|
8
|
-
const taskName = `copy-${folder}`; // Create a unique name for each task
|
9
|
-
const task = () => gulp.src([
|
10
|
-
`${folder}/**/*`,
|
11
|
-
`!${folder}/*tsconfig.json`,
|
12
|
-
`!${folder}/**/*.ts`,
|
13
|
-
`!${folder}/**/*.tsx`,
|
14
|
-
`!${folder}/types/**/**`,
|
15
|
-
`!${folder}/__mocks__/**/**`,
|
16
|
-
`!${folder}/styles/**`,
|
17
|
-
])
|
18
|
-
.pipe(gulp.dest(outputDir))
|
19
|
-
.on('error', function (e) {
|
20
|
-
console.log("💩" + red.underline.bold(` => Copy of files for ${orange(folder)} failed!`));
|
21
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
22
|
-
this.emit('end');
|
23
|
-
})
|
24
|
-
.on('end', function () {
|
25
|
-
console.log("🐶" + blue.underline(` => Copy of files for ${orange(folder)} succeeded!`));
|
26
|
-
});
|
27
|
-
// Register the task with Gulp
|
28
|
-
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
29
|
-
return task;
|
30
|
-
});
|
31
|
-
// Run all tasks in parallel
|
32
|
-
return gulp.parallel(...tasks);
|
33
|
-
}
|
package/dist/gulp/docs.d.ts
DELETED
package/dist/gulp/docs.js
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
import gulp from 'gulp';
|
2
|
-
import { blue, red } from '../index.js';
|
3
|
-
import typedoc from 'gulp-typedoc';
|
4
|
-
export function generateDocs() {
|
5
|
-
// path.basename(options.cwd)
|
6
|
-
return gulp.src([
|
7
|
-
'typescript/backend/**/*.ts',
|
8
|
-
'typescript/backend/**/*.tsx',
|
9
|
-
'!typescript/backend/**/*.jsw.ts',
|
10
|
-
'!typescript/backend/**/*.spec.ts',
|
11
|
-
])
|
12
|
-
.pipe(typedoc({
|
13
|
-
out: "docs",
|
14
|
-
plugins: [
|
15
|
-
"typedoc-theme-hierarchy"
|
16
|
-
],
|
17
|
-
theme: "hierarchy",
|
18
|
-
name: "wix-development"
|
19
|
-
}))
|
20
|
-
.on('error', function () {
|
21
|
-
console.log("💩" + red.underline.bold(' => Build of Backend TS files failed!'));
|
22
|
-
this.emit('end');
|
23
|
-
})
|
24
|
-
.on('end', function () {
|
25
|
-
console.log("🐶" + blue.underline(' => Build of Backend TS files succeeded!'));
|
26
|
-
});
|
27
|
-
}
|
package/dist/gulp/helpers.d.ts
DELETED
package/dist/gulp/helpers.js
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
import * as path from 'path';
|
2
|
-
import * as fs from 'fs';
|
3
|
-
export function getModulesSync() {
|
4
|
-
const absolutePath = path.resolve('./lucy.json');
|
5
|
-
const fileContent = fs.readFileSync(absolutePath, 'utf8');
|
6
|
-
return JSON.parse(fileContent).modules;
|
7
|
-
}
|
8
|
-
export function getModulesSourcePaths() {
|
9
|
-
const absolutePath = path.resolve('./lucy.json');
|
10
|
-
const fileContent = fs.readFileSync(absolutePath, 'utf8');
|
11
|
-
const data = JSON.parse(fileContent).modules;
|
12
|
-
const paths = [];
|
13
|
-
for (const module of Object.keys(data)) {
|
14
|
-
if (!data[module].noCompile) {
|
15
|
-
if (data[module].path) {
|
16
|
-
paths.push(data[module].path);
|
17
|
-
}
|
18
|
-
else {
|
19
|
-
paths.push(module);
|
20
|
-
}
|
21
|
-
}
|
22
|
-
}
|
23
|
-
return paths;
|
24
|
-
}
|
package/dist/gulp/pages copy.js
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
import gulp from 'gulp';
|
2
|
-
import chalk from 'chalk';
|
3
|
-
import { createGulpEsbuild } from 'gulp-esbuild';
|
4
|
-
import * as path from 'path';
|
5
|
-
export function buildPages(options) {
|
6
|
-
const { outputDir, enableIncrementalBuild } = options;
|
7
|
-
const gulpEsbuild = createGulpEsbuild({
|
8
|
-
incremental: enableIncrementalBuild, // enables the esbuild's incremental build
|
9
|
-
});
|
10
|
-
return () => {
|
11
|
-
return gulp.src('typescript/pages/*.ts')
|
12
|
-
.pipe(gulpEsbuild({
|
13
|
-
bundle: false,
|
14
|
-
}))
|
15
|
-
.pipe(gulp.dest(path.join(outputDir, 'pages')))
|
16
|
-
.on('error', function () {
|
17
|
-
console.log(chalk.red.underline.bold('Build of Pages TS files failed!'));
|
18
|
-
this.emit('end');
|
19
|
-
})
|
20
|
-
.on('end', function () { console.log(chalk.blueBright.underline('Build of Pages TS files succeeded!')); });
|
21
|
-
};
|
22
|
-
}
|
package/dist/gulp/pages.d.ts
DELETED
package/dist/gulp/pages.js
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
import gulp from 'gulp';
|
2
|
-
import * as path from 'path';
|
3
|
-
import { blue, orange, red } from '../index.js';
|
4
|
-
import swc from 'gulp-swc';
|
5
|
-
const swcOptions = {
|
6
|
-
jsc: {
|
7
|
-
target: 'es2020',
|
8
|
-
parser: {
|
9
|
-
syntax: "typescript",
|
10
|
-
tsx: true,
|
11
|
-
},
|
12
|
-
preserveAllComments: false,
|
13
|
-
minify: {
|
14
|
-
compress: true // equivalent to {}
|
15
|
-
}
|
16
|
-
},
|
17
|
-
};
|
18
|
-
export function buildPages(options) {
|
19
|
-
const { outputDir } = options;
|
20
|
-
return () => {
|
21
|
-
return gulp.src('typescript/pages/*.ts')
|
22
|
-
.pipe(swc(swcOptions))
|
23
|
-
.on('error', function (e) {
|
24
|
-
console.log("💩" + red.underline.bold(` => Build of Pages files failed!`));
|
25
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
26
|
-
this.emit('end');
|
27
|
-
})
|
28
|
-
.pipe(gulp.dest(path.join(outputDir, 'pages')))
|
29
|
-
.on('error', function (e) {
|
30
|
-
console.log("💩" + red.underline.bold(' => Build of Pages TS files failed!'));
|
31
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
32
|
-
this.emit('end');
|
33
|
-
})
|
34
|
-
.on('end', function () { console.log("🐶" + blue.underline(' => Build of Pages TS files succeeded!')); });
|
35
|
-
};
|
36
|
-
}
|
package/dist/gulp/pipeline.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare function setProdConfig(): () => any;
|
package/dist/gulp/pipeline.js
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
import gulp from 'gulp';
|
2
|
-
import * as path from 'path';
|
3
|
-
import replace from 'gulp-string-replace';
|
4
|
-
import { blue, orange, red } from '../index.js';
|
5
|
-
export function setProdConfig() {
|
6
|
-
const tag = process.env.GIT_TAG || 'development';
|
7
|
-
const regexGit = /gitTag:\s*(.*),/g;
|
8
|
-
const regexDev = /devMode:\s*(.*),/g;
|
9
|
-
return () => {
|
10
|
-
return gulp
|
11
|
-
.src(['./typescript/public/constants/env.ts'])
|
12
|
-
.pipe(replace(regexGit, `gitTag: '${tag}',`))
|
13
|
-
.pipe(replace(regexDev, `devMode: false,`))
|
14
|
-
.pipe(gulp.dest((file) => {
|
15
|
-
const filePath = file.dirname;
|
16
|
-
const outputDir = path.dirname(filePath);
|
17
|
-
return path.join(`${outputDir}/constants`);
|
18
|
-
}))
|
19
|
-
.on('error', function (e) {
|
20
|
-
console.log("💩" + red.underline.bold(' => Setting the git tag failed!'));
|
21
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
22
|
-
this.emit('end');
|
23
|
-
})
|
24
|
-
.on('end', function () {
|
25
|
-
console.log("🐶" + blue.underline(' => Setting the git tag succeeded!'));
|
26
|
-
});
|
27
|
-
};
|
28
|
-
}
|
package/dist/gulp/public.d.ts
DELETED
package/dist/gulp/public.js
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
import gulp from 'gulp';
|
2
|
-
import * as path from 'path';
|
3
|
-
import { blue, orange, red } from '../index.js';
|
4
|
-
import swc from 'gulp-swc';
|
5
|
-
const swcOptions = {
|
6
|
-
jsc: {
|
7
|
-
target: 'es2020',
|
8
|
-
parser: {
|
9
|
-
syntax: "typescript",
|
10
|
-
tsx: true,
|
11
|
-
},
|
12
|
-
preserveAllComments: false,
|
13
|
-
minify: {
|
14
|
-
compress: true // equivalent to {}
|
15
|
-
}
|
16
|
-
},
|
17
|
-
};
|
18
|
-
export function buildPublic(options) {
|
19
|
-
const folders = ['typescript', ...options.modulesSourcePaths];
|
20
|
-
const { outputDir } = options;
|
21
|
-
// Create tasks for each folder
|
22
|
-
const tasks = folders.map((folder) => {
|
23
|
-
const taskName = `build_Public-${folder}`; // Create a unique name for each task
|
24
|
-
const task = () => gulp.src([
|
25
|
-
`${folder}/public/**/*.ts`,
|
26
|
-
`${folder}/public/**/*.tsx`,
|
27
|
-
])
|
28
|
-
.pipe(swc(swcOptions))
|
29
|
-
.on('error', function (e) {
|
30
|
-
console.log("💩" + red.underline.bold(` => Build of Public files for ${orange(folder)} failed!`));
|
31
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
32
|
-
this.emit('end');
|
33
|
-
})
|
34
|
-
.pipe(gulp.dest(path.join(outputDir, 'public')))
|
35
|
-
.on('error', function (e) {
|
36
|
-
console.log("💩" + red.underline.bold(` => Build of Public files for ${orange(folder)} failed!`));
|
37
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
38
|
-
this.emit('end');
|
39
|
-
})
|
40
|
-
.on('end', function () {
|
41
|
-
console.log("🐶" + blue.underline(` => Build of Public files for ${orange(folder)} succeeded!`));
|
42
|
-
});
|
43
|
-
// Register the task with Gulp
|
44
|
-
Object.defineProperty(task, 'name', { value: taskName }); // Set a unique name for debugging
|
45
|
-
return task;
|
46
|
-
});
|
47
|
-
// Run all tasks in parallel
|
48
|
-
return gulp.parallel(...tasks);
|
49
|
-
}
|
package/dist/gulp/styles.d.ts
DELETED
package/dist/gulp/styles.js
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
import gulp from 'gulp';
|
2
|
-
import { blue, orange, red } from '../index.js';
|
3
|
-
export function compileScss(options) {
|
4
|
-
const folders = ['typescript'];
|
5
|
-
const { sass, outputDir } = options;
|
6
|
-
const buildWixScss = () => gulp.src(['typescript/styles/global.scss'], { allowEmpty: true })
|
7
|
-
.pipe(sass().on('error', sass.logError))
|
8
|
-
.on('error', function (e) {
|
9
|
-
console.log("💩" + red.underline.bold(` => Build of SCSS files for ${orange('global.scs')} failed!`));
|
10
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
11
|
-
this.emit('end');
|
12
|
-
})
|
13
|
-
.pipe(gulp.dest(`${outputDir}/styles`))
|
14
|
-
.on('error', function (e) {
|
15
|
-
console.log("💩" + red.underline.bold(` => Compiling of scss files for ${orange('global.scs')} failed!`));
|
16
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
17
|
-
this.emit('end');
|
18
|
-
})
|
19
|
-
.on('end', function () {
|
20
|
-
console.log("🐶" + blue.underline(` => Compiling of scss files for ${orange('global.scs')} succeeded!`));
|
21
|
-
});
|
22
|
-
const buildScss = () => gulp.src(['typescript/public/scss/app.scss'], { allowEmpty: true })
|
23
|
-
.pipe(sass().on('error', sass.logError))
|
24
|
-
.on('error', function (e) {
|
25
|
-
console.log("💩" + red.underline.bold(` => Build of SCSS files for ${orange('app.scss')} failed!`));
|
26
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
27
|
-
this.emit('end');
|
28
|
-
})
|
29
|
-
.pipe(gulp.dest(`${outputDir}/public/css`))
|
30
|
-
.on('error', function (e) {
|
31
|
-
console.log("💩" + red.underline.bold(` => Compiling of scss files for ${orange('app.scss')} failed!`));
|
32
|
-
console.log("💩" + red.underline.bold(` => Error: ${orange(e.message)}`));
|
33
|
-
this.emit('end');
|
34
|
-
})
|
35
|
-
.on('end', function () {
|
36
|
-
console.log("🐶" + blue.underline(` => Compiling of scss files for ${orange('app.scss')} succeeded!`));
|
37
|
-
});
|
38
|
-
return gulp.parallel(buildWixScss, buildScss);
|
39
|
-
}
|
package/dist/gulp/templates.d.ts
DELETED