taon 19.0.64 → 19.0.65
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/README.md +160 -160
- package/bin/start.js +281 -281
- package/bin/taon +6 -6
- package/bin/taon-debug +5 -5
- package/bin/taon-debug-brk +5 -5
- package/browser/README.md +24 -24
- package/browser/fesm2022/taon.mjs.map +1 -1
- package/browser/package.json +1 -1
- package/icon-menu-taon.svg +15 -15
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/package.json +1 -1
- package/websql/README.md +24 -24
- package/websql/fesm2022/taon.mjs.map +1 -1
- package/websql/package.json +1 -1
- package/lib/decorators/classes/controller-config.d.ts +0 -20
- package/lib/decorators/classes/controller-config.js +0 -21
- package/lib/decorators/classes/controller-config.js.map +0 -1
- package/lib/decorators/classes/controller-options.d.ts +0 -16
- package/lib/decorators/classes/controller-options.js +0 -20
- package/lib/decorators/classes/controller-options.js.map +0 -1
package/bin/start.js
CHANGED
|
@@ -1,281 +1,281 @@
|
|
|
1
|
-
//#region @backend
|
|
2
|
-
|
|
3
|
-
//#region quick fixes
|
|
4
|
-
// console.log('-- FIREDEV started... please wait. --')
|
|
5
|
-
// require('cache-require-paths');
|
|
6
|
-
Error.stackTraceLimit = 100;
|
|
7
|
-
// require('cache-require-paths');
|
|
8
|
-
// console.log(global.i0);
|
|
9
|
-
// process.exit(0)
|
|
10
|
-
|
|
11
|
-
// TODO QUIK_FIX
|
|
12
|
-
global.i0 = {
|
|
13
|
-
defineInjectable: function () { }
|
|
14
|
-
}
|
|
15
|
-
const process= require('process');
|
|
16
|
-
process.removeAllListeners('warning');
|
|
17
|
-
|
|
18
|
-
var ora = require('ora');
|
|
19
|
-
var spinner = ora();
|
|
20
|
-
global.spinner = spinner;
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
|
|
24
|
-
//#region resolve constants
|
|
25
|
-
const childprocsecretarg = '-childproc';
|
|
26
|
-
const isWinGitBash = (process.platform === 'win32');
|
|
27
|
-
const procType = (process.argv[1].endsWith('tnp') || process.argv[1].endsWith('taon')) ? 'root'
|
|
28
|
-
: ((process.argv.find(a => a.startsWith(childprocsecretarg)))
|
|
29
|
-
? 'child-of-root'
|
|
30
|
-
: 'child-of-child'
|
|
31
|
-
);
|
|
32
|
-
const debugMode = (process.argv[1].endsWith('-debug') || process.argv[1].endsWith('-debug-brk'))
|
|
33
|
-
global.spinnerInParentProcess = (procType === 'child-of-root');
|
|
34
|
-
const orgArgv = JSON.parse(JSON.stringify(process.argv));
|
|
35
|
-
global.tnpNonInteractive = (typeof process.argv.find(a => a.startsWith('--tnpNonInteractive')) !== 'undefined');
|
|
36
|
-
const spinnerIsDefault = !tnpNonInteractive;
|
|
37
|
-
const splited = crossPlatofrmPath(process.argv[1]).split('/');
|
|
38
|
-
global.frameworkName = 'taon';
|
|
39
|
-
|
|
40
|
-
global.restartWorker = (typeof (process.argv.find(a => a.startsWith('-restartWorker'))) !== 'undefined');
|
|
41
|
-
global.reinitDb = (typeof (process.argv.find(a => a.startsWith('-reinitDb'))) !== 'undefined');
|
|
42
|
-
global.globalSystemToolMode = true;
|
|
43
|
-
const verbose = process.argv.includes('-verbose')
|
|
44
|
-
global.hideLog = !verbose;
|
|
45
|
-
global.verboseLevel = 0;
|
|
46
|
-
global.useWorker = !(typeof process.argv.find(a => a.startsWith('-useWorker=false')) !== 'undefined');
|
|
47
|
-
global.useWebpackBackendBuild = (typeof process.argv.find(a => a.startsWith('-webpack')) !== 'undefined');
|
|
48
|
-
global.skipCoreCheck = (typeof process.argv.find(a => a.startsWith('--skipCoreCheck')) !== 'undefined');
|
|
49
|
-
const verboseLevelExists = (typeof process.argv.find(a => a.startsWith('-verbose=')) !== 'undefined');
|
|
50
|
-
global.verboseLevel = (verboseLevelExists ? Number(
|
|
51
|
-
process.argv.find(a => {
|
|
52
|
-
const v = a.startsWith('-verbose=');
|
|
53
|
-
if (v) {
|
|
54
|
-
return v.replace('-verbose=', '');
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
) : 0) || 0;
|
|
58
|
-
|
|
59
|
-
if (!verbose && verboseLevelExists) {
|
|
60
|
-
global.hideLog = false;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const distOnly = (process.argv.includes('-dist'));
|
|
64
|
-
const npmOnly = (process.argv.includes('-npm'));
|
|
65
|
-
const spinnerOnInArgs = process.argv.includes('-spinner');
|
|
66
|
-
const spinnerOffInArgs = (process.argv.includes('-spinner=false') || process.argv.includes('-spinner=off'));
|
|
67
|
-
//#endregion
|
|
68
|
-
|
|
69
|
-
//#region clear argument from variables
|
|
70
|
-
process.argv = process.argv.filter(a => !a.startsWith('-spinner'));
|
|
71
|
-
process.argv = process.argv.filter(a => a !== '-childproc');
|
|
72
|
-
process.argv = process.argv.filter(a => a !== '--skipCoreCheck');
|
|
73
|
-
process.argv = process.argv.filter(a => a !== '-dist');
|
|
74
|
-
process.argv = process.argv.filter(a => a !== '-npm');
|
|
75
|
-
process.argv = process.argv.filter(a => !a.startsWith('-verbose'));
|
|
76
|
-
//#endregion
|
|
77
|
-
|
|
78
|
-
//#region fix argument
|
|
79
|
-
process.argv = process.argv.map(a => {
|
|
80
|
-
if (a === '-websql') {
|
|
81
|
-
return '--websql'
|
|
82
|
-
}
|
|
83
|
-
return a;
|
|
84
|
-
})
|
|
85
|
-
//#endregion
|
|
86
|
-
|
|
87
|
-
//#region variables
|
|
88
|
-
let mode;
|
|
89
|
-
let start;
|
|
90
|
-
let startSpinner = spinnerIsDefault || spinnerOnInArgs;
|
|
91
|
-
if (spinnerOffInArgs) {
|
|
92
|
-
startSpinner = false;
|
|
93
|
-
}
|
|
94
|
-
if (procType === 'child-of-root' || debugMode) {
|
|
95
|
-
startSpinner = false;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// if (startSpinner) {
|
|
99
|
-
// const inspector = require('inspector');
|
|
100
|
-
// isNodeDebuggerEnabled = (inspector.url() !== undefined);
|
|
101
|
-
// startSpinner = !isNodeDebuggerEnabled;
|
|
102
|
-
// }
|
|
103
|
-
|
|
104
|
-
if (verbose || frameworkName === 'tnp' || global.skipCoreCheck) {
|
|
105
|
-
startSpinner = false;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
//#endregion
|
|
109
|
-
|
|
110
|
-
const path = require('path');
|
|
111
|
-
|
|
112
|
-
// console.log({
|
|
113
|
-
// ppid: process.ppid,
|
|
114
|
-
// pid: process.pid,
|
|
115
|
-
// procType
|
|
116
|
-
// })
|
|
117
|
-
|
|
118
|
-
// if(procType !== 'root') {
|
|
119
|
-
// var fn = process.stdout.write
|
|
120
|
-
|
|
121
|
-
// function write() {
|
|
122
|
-
// if((arguments.length > 0) && typeof arguments[0] === 'string') {
|
|
123
|
-
// arguments[0] = arguments[0].trim();
|
|
124
|
-
// }
|
|
125
|
-
// fn.apply(process.stdout, arguments);
|
|
126
|
-
// }
|
|
127
|
-
|
|
128
|
-
// process.stdout.write = write;
|
|
129
|
-
// }
|
|
130
|
-
|
|
131
|
-
if (procType === 'child-of-root') {
|
|
132
|
-
global.spinner = {
|
|
133
|
-
start() {
|
|
134
|
-
process.send && process.send('start-spinner')
|
|
135
|
-
},
|
|
136
|
-
stop() {
|
|
137
|
-
process.send && process.send('stop-spinner')
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (startSpinner) {
|
|
143
|
-
//#region start spinner in processs
|
|
144
|
-
spinner.start();
|
|
145
|
-
|
|
146
|
-
const child_process = require('child_process');
|
|
147
|
-
const orgArgvForChild = orgArgv.filter(a => !a.startsWith('-spinner'));
|
|
148
|
-
|
|
149
|
-
const env = {
|
|
150
|
-
...process.env,
|
|
151
|
-
FORCE_COLOR: '1'
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
const cwd = process.cwd();
|
|
155
|
-
const argsToCHildProc = (`${orgArgvForChild.slice(2).join(' ')} ${global.verbose ? '-verbose' : ''} ${global.skipCoreCheck ? '--skipCoreCheck' : ''} `
|
|
156
|
-
+ `${spinnerOnInArgs ? '-spinner' : (spinnerOffInArgs ? '-spinner=off' : '')} ${childprocsecretarg}`).split(' ');
|
|
157
|
-
|
|
158
|
-
const proc = child_process.fork(crossPlatofrmPath(__filename), argsToCHildProc, {
|
|
159
|
-
env,
|
|
160
|
-
stdio: [0, 1, 2, 'ipc'],
|
|
161
|
-
cwd,
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
proc.on('exit', (code) => {
|
|
165
|
-
spinner.stop();
|
|
166
|
-
setTimeout(() => {
|
|
167
|
-
process.exit(code);
|
|
168
|
-
})
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
proc.on('message', message => {
|
|
172
|
-
message = (message ? message : '').trimLeft();
|
|
173
|
-
if (message === 'start-spinner') {
|
|
174
|
-
spinner.start();
|
|
175
|
-
} else if (message === 'stop-spinner') {
|
|
176
|
-
spinner.stop();
|
|
177
|
-
} else if (message.startsWith('info::')) {
|
|
178
|
-
setText((message));
|
|
179
|
-
} else if (message.startsWith('success::')) {
|
|
180
|
-
setText((message));
|
|
181
|
-
} else if (message.startsWith('taskstart::')) {
|
|
182
|
-
setText((message));
|
|
183
|
-
} else if (message.startsWith('taskdone::')) {
|
|
184
|
-
setText((message));
|
|
185
|
-
} else if (message.startsWith('error::')) {
|
|
186
|
-
setText((message));
|
|
187
|
-
} else if (message.startsWith('log::')) {
|
|
188
|
-
setText((message), true);
|
|
189
|
-
} else if (message.startsWith('warn::')) {
|
|
190
|
-
setText((message));
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
// process.stdin.resume(); // not needed ?
|
|
195
|
-
//#endregion
|
|
196
|
-
} else {
|
|
197
|
-
//#region child or child of child
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
if (distOnly) {
|
|
201
|
-
//#region standalrd dist mode
|
|
202
|
-
mode = 'dist';
|
|
203
|
-
!global.hideLog && setText('- dist only -', true);
|
|
204
|
-
process.argv = process.argv.filter(f => !!f);
|
|
205
|
-
|
|
206
|
-
const pathToDistRun = path.join(__dirname, '../dist/cli.js');
|
|
207
|
-
start = require(pathToDistRun.replace(/\.js$/g, '')).start;
|
|
208
|
-
//#endregion
|
|
209
|
-
} else if (npmOnly) {
|
|
210
|
-
//#region npm mode (project as installable package)
|
|
211
|
-
mode = 'npm';
|
|
212
|
-
!global.hideLog && setText('- npm global only -', true);
|
|
213
|
-
// =========================== only dist ============================
|
|
214
|
-
process.argv = process.argv.filter(a => a !== '-npm');
|
|
215
|
-
process.argv = process.argv.filter(f => !!f);
|
|
216
|
-
|
|
217
|
-
const pathToDistRun = path.join(__dirname, '../cli.js');
|
|
218
|
-
start = require(pathToDistRun.replace(/\.js$/g, '')).start;
|
|
219
|
-
//#endregion
|
|
220
|
-
} else {
|
|
221
|
-
//#region uknow dist or npm mode
|
|
222
|
-
const fs = require('fs');
|
|
223
|
-
|
|
224
|
-
const pathToDistRun = path.join(__dirname, '../dist/cli.js');
|
|
225
|
-
const pathToIndexRun = path.join(__dirname, '../cli.js');
|
|
226
|
-
const distExist = fs.existsSync(pathToDistRun);
|
|
227
|
-
|
|
228
|
-
if (distExist) {
|
|
229
|
-
// console.log('USE /dist/cli.js')
|
|
230
|
-
mode = 'dist';
|
|
231
|
-
!global.hideLog && setText('- taon dist -', true);
|
|
232
|
-
// TODO TOOOO MUCH TIME !!!!!!
|
|
233
|
-
start = require(pathToDistRun.replace(/\.js$/g, '')).start;
|
|
234
|
-
} else {
|
|
235
|
-
// console.log('USE /cli.js')
|
|
236
|
-
mode = 'npm';
|
|
237
|
-
!global.hideLog && setText('- npm mode -', true);
|
|
238
|
-
start = require(pathToIndexRun.replace(/\.js$/g, '')).start;
|
|
239
|
-
}
|
|
240
|
-
//#endregion
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// global.start = start;
|
|
244
|
-
process.argv = process.argv.filter(f => !!f);
|
|
245
|
-
start(process.argv, global.frameworkName, mode);
|
|
246
|
-
//#endregion
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
function crossPlatofrmPath(p) {
|
|
250
|
-
if (isWinGitBash) {
|
|
251
|
-
return p.replace(/\\/g, '/');
|
|
252
|
-
}
|
|
253
|
-
return p;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
function setText(text, toSpiner = false) {
|
|
257
|
-
const spinner = global.spinner;
|
|
258
|
-
if (text) {
|
|
259
|
-
text = text.split('::').slice(1).join('::');
|
|
260
|
-
}
|
|
261
|
-
if (spinner) {
|
|
262
|
-
if (toSpiner) {
|
|
263
|
-
spinner.text = text.replace(/(?:\r\n|\r|\n)/g, ' ');
|
|
264
|
-
} else {
|
|
265
|
-
const wasSpinning = spinner.isSpinning;
|
|
266
|
-
if (wasSpinning) {
|
|
267
|
-
spinner.stop();
|
|
268
|
-
spinner.clear();
|
|
269
|
-
}
|
|
270
|
-
console.log(text);
|
|
271
|
-
if (wasSpinning) {
|
|
272
|
-
spinner.start()
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
} else {
|
|
276
|
-
console.log(text);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
//#endregion
|
|
1
|
+
//#region @backend
|
|
2
|
+
|
|
3
|
+
//#region quick fixes
|
|
4
|
+
// console.log('-- FIREDEV started... please wait. --')
|
|
5
|
+
// require('cache-require-paths');
|
|
6
|
+
Error.stackTraceLimit = 100;
|
|
7
|
+
// require('cache-require-paths');
|
|
8
|
+
// console.log(global.i0);
|
|
9
|
+
// process.exit(0)
|
|
10
|
+
|
|
11
|
+
// TODO QUIK_FIX
|
|
12
|
+
global.i0 = {
|
|
13
|
+
defineInjectable: function () { }
|
|
14
|
+
}
|
|
15
|
+
const process= require('process');
|
|
16
|
+
process.removeAllListeners('warning');
|
|
17
|
+
|
|
18
|
+
var ora = require('ora');
|
|
19
|
+
var spinner = ora();
|
|
20
|
+
global.spinner = spinner;
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
|
|
24
|
+
//#region resolve constants
|
|
25
|
+
const childprocsecretarg = '-childproc';
|
|
26
|
+
const isWinGitBash = (process.platform === 'win32');
|
|
27
|
+
const procType = (process.argv[1].endsWith('tnp') || process.argv[1].endsWith('taon')) ? 'root'
|
|
28
|
+
: ((process.argv.find(a => a.startsWith(childprocsecretarg)))
|
|
29
|
+
? 'child-of-root'
|
|
30
|
+
: 'child-of-child'
|
|
31
|
+
);
|
|
32
|
+
const debugMode = (process.argv[1].endsWith('-debug') || process.argv[1].endsWith('-debug-brk'))
|
|
33
|
+
global.spinnerInParentProcess = (procType === 'child-of-root');
|
|
34
|
+
const orgArgv = JSON.parse(JSON.stringify(process.argv));
|
|
35
|
+
global.tnpNonInteractive = (typeof process.argv.find(a => a.startsWith('--tnpNonInteractive')) !== 'undefined');
|
|
36
|
+
const spinnerIsDefault = !tnpNonInteractive;
|
|
37
|
+
const splited = crossPlatofrmPath(process.argv[1]).split('/');
|
|
38
|
+
global.frameworkName = 'taon';
|
|
39
|
+
|
|
40
|
+
global.restartWorker = (typeof (process.argv.find(a => a.startsWith('-restartWorker'))) !== 'undefined');
|
|
41
|
+
global.reinitDb = (typeof (process.argv.find(a => a.startsWith('-reinitDb'))) !== 'undefined');
|
|
42
|
+
global.globalSystemToolMode = true;
|
|
43
|
+
const verbose = process.argv.includes('-verbose')
|
|
44
|
+
global.hideLog = !verbose;
|
|
45
|
+
global.verboseLevel = 0;
|
|
46
|
+
global.useWorker = !(typeof process.argv.find(a => a.startsWith('-useWorker=false')) !== 'undefined');
|
|
47
|
+
global.useWebpackBackendBuild = (typeof process.argv.find(a => a.startsWith('-webpack')) !== 'undefined');
|
|
48
|
+
global.skipCoreCheck = (typeof process.argv.find(a => a.startsWith('--skipCoreCheck')) !== 'undefined');
|
|
49
|
+
const verboseLevelExists = (typeof process.argv.find(a => a.startsWith('-verbose=')) !== 'undefined');
|
|
50
|
+
global.verboseLevel = (verboseLevelExists ? Number(
|
|
51
|
+
process.argv.find(a => {
|
|
52
|
+
const v = a.startsWith('-verbose=');
|
|
53
|
+
if (v) {
|
|
54
|
+
return v.replace('-verbose=', '');
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
) : 0) || 0;
|
|
58
|
+
|
|
59
|
+
if (!verbose && verboseLevelExists) {
|
|
60
|
+
global.hideLog = false;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const distOnly = (process.argv.includes('-dist'));
|
|
64
|
+
const npmOnly = (process.argv.includes('-npm'));
|
|
65
|
+
const spinnerOnInArgs = process.argv.includes('-spinner');
|
|
66
|
+
const spinnerOffInArgs = (process.argv.includes('-spinner=false') || process.argv.includes('-spinner=off'));
|
|
67
|
+
//#endregion
|
|
68
|
+
|
|
69
|
+
//#region clear argument from variables
|
|
70
|
+
process.argv = process.argv.filter(a => !a.startsWith('-spinner'));
|
|
71
|
+
process.argv = process.argv.filter(a => a !== '-childproc');
|
|
72
|
+
process.argv = process.argv.filter(a => a !== '--skipCoreCheck');
|
|
73
|
+
process.argv = process.argv.filter(a => a !== '-dist');
|
|
74
|
+
process.argv = process.argv.filter(a => a !== '-npm');
|
|
75
|
+
process.argv = process.argv.filter(a => !a.startsWith('-verbose'));
|
|
76
|
+
//#endregion
|
|
77
|
+
|
|
78
|
+
//#region fix argument
|
|
79
|
+
process.argv = process.argv.map(a => {
|
|
80
|
+
if (a === '-websql') {
|
|
81
|
+
return '--websql'
|
|
82
|
+
}
|
|
83
|
+
return a;
|
|
84
|
+
})
|
|
85
|
+
//#endregion
|
|
86
|
+
|
|
87
|
+
//#region variables
|
|
88
|
+
let mode;
|
|
89
|
+
let start;
|
|
90
|
+
let startSpinner = spinnerIsDefault || spinnerOnInArgs;
|
|
91
|
+
if (spinnerOffInArgs) {
|
|
92
|
+
startSpinner = false;
|
|
93
|
+
}
|
|
94
|
+
if (procType === 'child-of-root' || debugMode) {
|
|
95
|
+
startSpinner = false;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// if (startSpinner) {
|
|
99
|
+
// const inspector = require('inspector');
|
|
100
|
+
// isNodeDebuggerEnabled = (inspector.url() !== undefined);
|
|
101
|
+
// startSpinner = !isNodeDebuggerEnabled;
|
|
102
|
+
// }
|
|
103
|
+
|
|
104
|
+
if (verbose || frameworkName === 'tnp' || global.skipCoreCheck) {
|
|
105
|
+
startSpinner = false;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
//#endregion
|
|
109
|
+
|
|
110
|
+
const path = require('path');
|
|
111
|
+
|
|
112
|
+
// console.log({
|
|
113
|
+
// ppid: process.ppid,
|
|
114
|
+
// pid: process.pid,
|
|
115
|
+
// procType
|
|
116
|
+
// })
|
|
117
|
+
|
|
118
|
+
// if(procType !== 'root') {
|
|
119
|
+
// var fn = process.stdout.write
|
|
120
|
+
|
|
121
|
+
// function write() {
|
|
122
|
+
// if((arguments.length > 0) && typeof arguments[0] === 'string') {
|
|
123
|
+
// arguments[0] = arguments[0].trim();
|
|
124
|
+
// }
|
|
125
|
+
// fn.apply(process.stdout, arguments);
|
|
126
|
+
// }
|
|
127
|
+
|
|
128
|
+
// process.stdout.write = write;
|
|
129
|
+
// }
|
|
130
|
+
|
|
131
|
+
if (procType === 'child-of-root') {
|
|
132
|
+
global.spinner = {
|
|
133
|
+
start() {
|
|
134
|
+
process.send && process.send('start-spinner')
|
|
135
|
+
},
|
|
136
|
+
stop() {
|
|
137
|
+
process.send && process.send('stop-spinner')
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (startSpinner) {
|
|
143
|
+
//#region start spinner in processs
|
|
144
|
+
spinner.start();
|
|
145
|
+
|
|
146
|
+
const child_process = require('child_process');
|
|
147
|
+
const orgArgvForChild = orgArgv.filter(a => !a.startsWith('-spinner'));
|
|
148
|
+
|
|
149
|
+
const env = {
|
|
150
|
+
...process.env,
|
|
151
|
+
FORCE_COLOR: '1'
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const cwd = process.cwd();
|
|
155
|
+
const argsToCHildProc = (`${orgArgvForChild.slice(2).join(' ')} ${global.verbose ? '-verbose' : ''} ${global.skipCoreCheck ? '--skipCoreCheck' : ''} `
|
|
156
|
+
+ `${spinnerOnInArgs ? '-spinner' : (spinnerOffInArgs ? '-spinner=off' : '')} ${childprocsecretarg}`).split(' ');
|
|
157
|
+
|
|
158
|
+
const proc = child_process.fork(crossPlatofrmPath(__filename), argsToCHildProc, {
|
|
159
|
+
env,
|
|
160
|
+
stdio: [0, 1, 2, 'ipc'],
|
|
161
|
+
cwd,
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
proc.on('exit', (code) => {
|
|
165
|
+
spinner.stop();
|
|
166
|
+
setTimeout(() => {
|
|
167
|
+
process.exit(code);
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
proc.on('message', message => {
|
|
172
|
+
message = (message ? message : '').trimLeft();
|
|
173
|
+
if (message === 'start-spinner') {
|
|
174
|
+
spinner.start();
|
|
175
|
+
} else if (message === 'stop-spinner') {
|
|
176
|
+
spinner.stop();
|
|
177
|
+
} else if (message.startsWith('info::')) {
|
|
178
|
+
setText((message));
|
|
179
|
+
} else if (message.startsWith('success::')) {
|
|
180
|
+
setText((message));
|
|
181
|
+
} else if (message.startsWith('taskstart::')) {
|
|
182
|
+
setText((message));
|
|
183
|
+
} else if (message.startsWith('taskdone::')) {
|
|
184
|
+
setText((message));
|
|
185
|
+
} else if (message.startsWith('error::')) {
|
|
186
|
+
setText((message));
|
|
187
|
+
} else if (message.startsWith('log::')) {
|
|
188
|
+
setText((message), true);
|
|
189
|
+
} else if (message.startsWith('warn::')) {
|
|
190
|
+
setText((message));
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
// process.stdin.resume(); // not needed ?
|
|
195
|
+
//#endregion
|
|
196
|
+
} else {
|
|
197
|
+
//#region child or child of child
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
if (distOnly) {
|
|
201
|
+
//#region standalrd dist mode
|
|
202
|
+
mode = 'dist';
|
|
203
|
+
!global.hideLog && setText('- dist only -', true);
|
|
204
|
+
process.argv = process.argv.filter(f => !!f);
|
|
205
|
+
|
|
206
|
+
const pathToDistRun = path.join(__dirname, '../dist/cli.js');
|
|
207
|
+
start = require(pathToDistRun.replace(/\.js$/g, '')).start;
|
|
208
|
+
//#endregion
|
|
209
|
+
} else if (npmOnly) {
|
|
210
|
+
//#region npm mode (project as installable package)
|
|
211
|
+
mode = 'npm';
|
|
212
|
+
!global.hideLog && setText('- npm global only -', true);
|
|
213
|
+
// =========================== only dist ============================
|
|
214
|
+
process.argv = process.argv.filter(a => a !== '-npm');
|
|
215
|
+
process.argv = process.argv.filter(f => !!f);
|
|
216
|
+
|
|
217
|
+
const pathToDistRun = path.join(__dirname, '../cli.js');
|
|
218
|
+
start = require(pathToDistRun.replace(/\.js$/g, '')).start;
|
|
219
|
+
//#endregion
|
|
220
|
+
} else {
|
|
221
|
+
//#region uknow dist or npm mode
|
|
222
|
+
const fs = require('fs');
|
|
223
|
+
|
|
224
|
+
const pathToDistRun = path.join(__dirname, '../dist/cli.js');
|
|
225
|
+
const pathToIndexRun = path.join(__dirname, '../cli.js');
|
|
226
|
+
const distExist = fs.existsSync(pathToDistRun);
|
|
227
|
+
|
|
228
|
+
if (distExist) {
|
|
229
|
+
// console.log('USE /dist/cli.js')
|
|
230
|
+
mode = 'dist';
|
|
231
|
+
!global.hideLog && setText('- taon dist -', true);
|
|
232
|
+
// TODO TOOOO MUCH TIME !!!!!!
|
|
233
|
+
start = require(pathToDistRun.replace(/\.js$/g, '')).start;
|
|
234
|
+
} else {
|
|
235
|
+
// console.log('USE /cli.js')
|
|
236
|
+
mode = 'npm';
|
|
237
|
+
!global.hideLog && setText('- npm mode -', true);
|
|
238
|
+
start = require(pathToIndexRun.replace(/\.js$/g, '')).start;
|
|
239
|
+
}
|
|
240
|
+
//#endregion
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// global.start = start;
|
|
244
|
+
process.argv = process.argv.filter(f => !!f);
|
|
245
|
+
start(process.argv, global.frameworkName, mode);
|
|
246
|
+
//#endregion
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function crossPlatofrmPath(p) {
|
|
250
|
+
if (isWinGitBash) {
|
|
251
|
+
return p.replace(/\\/g, '/');
|
|
252
|
+
}
|
|
253
|
+
return p;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function setText(text, toSpiner = false) {
|
|
257
|
+
const spinner = global.spinner;
|
|
258
|
+
if (text) {
|
|
259
|
+
text = text.split('::').slice(1).join('::');
|
|
260
|
+
}
|
|
261
|
+
if (spinner) {
|
|
262
|
+
if (toSpiner) {
|
|
263
|
+
spinner.text = text.replace(/(?:\r\n|\r|\n)/g, ' ');
|
|
264
|
+
} else {
|
|
265
|
+
const wasSpinning = spinner.isSpinning;
|
|
266
|
+
if (wasSpinning) {
|
|
267
|
+
spinner.stop();
|
|
268
|
+
spinner.clear();
|
|
269
|
+
}
|
|
270
|
+
console.log(text);
|
|
271
|
+
if (wasSpinning) {
|
|
272
|
+
spinner.start()
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
} else {
|
|
276
|
+
console.log(text);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
//#endregion
|
package/bin/taon
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
//#region @backend
|
|
3
|
-
//node --no-deprecation => args doesnt work on linux
|
|
4
|
-
// --stack-trace-limit=10000
|
|
5
|
-
require('./start');
|
|
6
|
-
//#endregion
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
//#region @backend
|
|
3
|
+
//node --no-deprecation => args doesnt work on linux
|
|
4
|
+
// --stack-trace-limit=10000
|
|
5
|
+
require('./start');
|
|
6
|
+
//#endregion
|
package/bin/taon-debug
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#!/usr/bin/env node --inspect --no-deprecation
|
|
2
|
-
//#region @backend
|
|
3
|
-
// --stack-trace-limit=10000
|
|
4
|
-
require('./start');
|
|
5
|
-
//#endregion
|
|
1
|
+
#!/usr/bin/env node --inspect --no-deprecation
|
|
2
|
+
//#region @backend
|
|
3
|
+
// --stack-trace-limit=10000
|
|
4
|
+
require('./start');
|
|
5
|
+
//#endregion
|
package/bin/taon-debug-brk
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#!/usr/bin/env node --inspect-brk --no-deprecation
|
|
2
|
-
//#region @backend
|
|
3
|
-
// --stack-trace-limit=10000
|
|
4
|
-
require('./start');
|
|
5
|
-
//#endregion
|
|
1
|
+
#!/usr/bin/env node --inspect-brk --no-deprecation
|
|
2
|
+
//#region @backend
|
|
3
|
+
// --stack-trace-limit=10000
|
|
4
|
+
require('./start');
|
|
5
|
+
//#endregion
|
package/browser/README.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
# MyLib
|
|
2
|
-
|
|
3
|
-
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
|
|
4
|
-
|
|
5
|
-
## Code scaffolding
|
|
6
|
-
|
|
7
|
-
Run `ng generate component component-name --project my-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project my-lib`.
|
|
8
|
-
> Note: Don't forget to add `--project my-lib` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
-
|
|
10
|
-
## Build
|
|
11
|
-
|
|
12
|
-
Run `ng build my-lib` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
-
|
|
14
|
-
## Publishing
|
|
15
|
-
|
|
16
|
-
After building your library with `ng build my-lib`, go to the dist folder `cd dist/my-lib` and run `npm publish`.
|
|
17
|
-
|
|
18
|
-
## Running unit tests
|
|
19
|
-
|
|
20
|
-
Run `ng test my-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
-
|
|
22
|
-
## Further help
|
|
23
|
-
|
|
24
|
-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
1
|
+
# MyLib
|
|
2
|
+
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Run `ng generate component component-name --project my-lib` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project my-lib`.
|
|
8
|
+
> Note: Don't forget to add `--project my-lib` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
+
|
|
10
|
+
## Build
|
|
11
|
+
|
|
12
|
+
Run `ng build my-lib` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
+
|
|
14
|
+
## Publishing
|
|
15
|
+
|
|
16
|
+
After building your library with `ng build my-lib`, go to the dist folder `cd dist/my-lib` and run `npm publish`.
|
|
17
|
+
|
|
18
|
+
## Running unit tests
|
|
19
|
+
|
|
20
|
+
Run `ng test my-lib` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
+
|
|
22
|
+
## Further help
|
|
23
|
+
|
|
24
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|