taon 19.0.60 → 19.0.61
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 -279
- 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 +81 -24
- package/browser/fesm2022/taon.mjs.map +1 -1
- package/browser/lib/base-classes/base-context.d.ts +1 -6
- package/browser/lib/base-classes/base-controller.d.ts +18 -2
- package/browser/lib/base-classes/base-repository.d.ts +1 -1
- package/browser/lib/base-classes/base.d.ts +1 -6
- package/browser/lib/create-context.d.ts +2 -12
- package/browser/lib/endpoint-context.d.ts +3 -0
- package/browser/lib/index.d.ts +5 -18
- package/browser/lib/models.d.ts +6 -0
- package/browser/lib/realtime/realtime-client.d.ts +2 -2
- package/browser/package.json +1 -1
- package/lib/base-classes/base-context.d.ts +1 -6
- package/lib/base-classes/base-controller.d.ts +18 -2
- package/lib/base-classes/base-controller.js +25 -5
- package/lib/base-classes/base-controller.js.map +1 -1
- package/lib/base-classes/base-repository.d.ts +1 -1
- package/lib/base-classes/base-repository.js +12 -6
- package/lib/base-classes/base-repository.js.map +1 -1
- package/lib/base-classes/base.d.ts +1 -6
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/create-context.d.ts +2 -12
- package/lib/create-context.js +21 -11
- package/lib/create-context.js.map +1 -1
- package/lib/decorators/classes/controller-config.d.ts +0 -20
- package/lib/decorators/classes/controller-config.js +2 -18
- package/lib/decorators/classes/controller-config.js.map +1 -1
- package/lib/decorators/classes/controller-options.d.ts +0 -16
- package/lib/decorators/classes/controller-options.js +2 -17
- package/lib/decorators/classes/controller-options.js.map +1 -1
- package/lib/endpoint-context.d.ts +3 -0
- package/lib/endpoint-context.js +24 -6
- package/lib/endpoint-context.js.map +1 -1
- package/lib/env/env.angular-node-app.d.ts +2 -0
- package/lib/env/env.angular-node-app.js +4 -2
- package/lib/env/env.angular-node-app.js.map +1 -1
- package/lib/env/env.docs-webapp.d.ts +2 -0
- package/lib/env/env.docs-webapp.js +4 -2
- package/lib/env/env.docs-webapp.js.map +1 -1
- package/lib/env/env.electron-app.d.ts +2 -0
- package/lib/env/env.electron-app.js +4 -2
- package/lib/env/env.electron-app.js.map +1 -1
- package/lib/env/env.mobile-app.d.ts +2 -0
- package/lib/env/env.mobile-app.js +4 -2
- package/lib/env/env.mobile-app.js.map +1 -1
- package/lib/env/env.npm-lib-and-cli-tool.d.ts +2 -0
- package/lib/env/env.npm-lib-and-cli-tool.js +4 -2
- package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
- package/lib/env/env.vscode-plugin.d.ts +2 -0
- package/lib/env/env.vscode-plugin.js +4 -2
- package/lib/env/env.vscode-plugin.js.map +1 -1
- package/lib/env.d.ts +2 -0
- package/lib/env.js +7 -0
- package/lib/env.js.map +1 -0
- package/lib/index.d.ts +5 -18
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/models.d.ts +6 -0
- package/lib/models.js.map +1 -1
- package/lib/realtime/realtime-client.d.ts +2 -2
- package/lib/realtime/realtime-client.js +13 -7
- package/lib/realtime/realtime-client.js.map +1 -1
- package/lib/realtime/realtime-server.js +17 -14
- package/lib/realtime/realtime-server.js.map +1 -1
- package/lib/storage.d.ts +1 -0
- package/lib/storage.js +6 -0
- package/lib/storage.js.map +1 -0
- 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 +75 -20
- package/websql/fesm2022/taon.mjs.map +1 -1
- package/websql/lib/base-classes/base-context.d.ts +1 -6
- package/websql/lib/base-classes/base-controller.d.ts +18 -2
- package/websql/lib/base-classes/base-repository.d.ts +1 -1
- package/websql/lib/base-classes/base.d.ts +1 -6
- package/websql/lib/create-context.d.ts +2 -12
- package/websql/lib/endpoint-context.d.ts +3 -0
- package/websql/lib/index.d.ts +5 -18
- package/websql/lib/models.d.ts +6 -0
- package/websql/lib/realtime/realtime-client.d.ts +2 -2
- package/websql/package.json +1 -1
package/bin/start.js
CHANGED
|
@@ -1,279 +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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
global.
|
|
34
|
-
|
|
35
|
-
global.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
global.
|
|
41
|
-
global.
|
|
42
|
-
global.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
global.verboseLevel =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
process.argv
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
process.argv = process.argv.filter(a => !a.startsWith('-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
process.argv = process.argv.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
|
|
116
|
-
//
|
|
117
|
-
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
|
|
121
|
-
//
|
|
122
|
-
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
spinner.
|
|
175
|
-
} else if (message
|
|
176
|
-
|
|
177
|
-
} else if (message.startsWith('
|
|
178
|
-
setText((message));
|
|
179
|
-
} else if (message.startsWith('
|
|
180
|
-
setText((message));
|
|
181
|
-
} else if (message.startsWith('
|
|
182
|
-
setText((message));
|
|
183
|
-
} else if (message.startsWith('
|
|
184
|
-
setText((message));
|
|
185
|
-
} else if (message.startsWith('
|
|
186
|
-
setText((message)
|
|
187
|
-
} else if (message.startsWith('
|
|
188
|
-
setText((message));
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
//#
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
//#
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
//#
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
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
|