taon 19.0.66 → 19.0.68

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.
Files changed (120) hide show
  1. package/README.md +160 -160
  2. package/bin/start.js +281 -281
  3. package/bin/taon +6 -6
  4. package/bin/taon-debug +5 -5
  5. package/bin/taon-debug-brk +5 -5
  6. package/browser/README.md +24 -24
  7. package/browser/fesm2022/taon.mjs +305 -89
  8. package/browser/fesm2022/taon.mjs.map +1 -1
  9. package/browser/lib/base-classes/base-class.d.ts +8 -1
  10. package/browser/lib/base-classes/base-controller.d.ts +56 -4
  11. package/browser/lib/base-classes/base-crud-controller.d.ts +5 -4
  12. package/browser/lib/base-classes/base-middleware.d.ts +2 -2
  13. package/browser/lib/base-classes/base-repository.d.ts +3 -0
  14. package/browser/lib/config/method-config.d.ts +1 -0
  15. package/browser/lib/decorators/http/http-decorators.d.ts +2 -1
  16. package/browser/lib/decorators/http/http-methods-decorators.d.ts +35 -4
  17. package/browser/lib/endpoint-context.d.ts +10 -4
  18. package/browser/lib/get-response-value.d.ts +1 -1
  19. package/browser/lib/helpers/taon-helpers.d.ts +1 -0
  20. package/browser/lib/index.d.ts +4 -0
  21. package/browser/lib/models.d.ts +4 -10
  22. package/browser/lib/realtime/realtime-client.d.ts +18 -14
  23. package/browser/lib/realtime/realtime-server.d.ts +28 -3
  24. package/browser/lib/realtime/realtime.models.d.ts +15 -2
  25. package/browser/package.json +1 -1
  26. package/icon-menu-taon.svg +15 -15
  27. package/lib/base-classes/base-class.d.ts +8 -1
  28. package/lib/base-classes/base-class.js +20 -2
  29. package/lib/base-classes/base-class.js.map +1 -1
  30. package/lib/base-classes/base-controller.d.ts +57 -5
  31. package/lib/base-classes/base-controller.js +83 -12
  32. package/lib/base-classes/base-controller.js.map +1 -1
  33. package/lib/base-classes/base-crud-controller.d.ts +5 -4
  34. package/lib/base-classes/base-crud-controller.js +16 -4
  35. package/lib/base-classes/base-crud-controller.js.map +1 -1
  36. package/lib/base-classes/base-middleware.d.ts +2 -2
  37. package/lib/base-classes/base-middleware.js +1 -0
  38. package/lib/base-classes/base-middleware.js.map +1 -1
  39. package/lib/base-classes/base-repository.d.ts +3 -0
  40. package/lib/base-classes/base-repository.js +3 -0
  41. package/lib/base-classes/base-repository.js.map +1 -1
  42. package/lib/build-info._auto-generated_.d.ts +1 -1
  43. package/lib/build-info._auto-generated_.js +1 -1
  44. package/lib/config/method-config.d.ts +1 -0
  45. package/lib/config/method-config.js.map +1 -1
  46. package/lib/decorators/classes/controller-config.d.ts +20 -0
  47. package/lib/decorators/classes/controller-config.js +21 -0
  48. package/lib/decorators/classes/controller-config.js.map +1 -0
  49. package/lib/decorators/classes/controller-options.d.ts +16 -0
  50. package/lib/decorators/classes/controller-options.js +20 -0
  51. package/lib/decorators/classes/controller-options.js.map +1 -0
  52. package/lib/decorators/http/http-decorators.d.ts +2 -1
  53. package/lib/decorators/http/http-decorators.js +2 -1
  54. package/lib/decorators/http/http-decorators.js.map +1 -1
  55. package/lib/decorators/http/http-methods-decorators.d.ts +35 -4
  56. package/lib/decorators/http/http-methods-decorators.js +34 -1
  57. package/lib/decorators/http/http-methods-decorators.js.map +1 -1
  58. package/lib/endpoint-context.d.ts +10 -4
  59. package/lib/endpoint-context.js +178 -141
  60. package/lib/endpoint-context.js.map +1 -1
  61. package/lib/env/env.angular-node-app.d.ts +1 -2
  62. package/lib/env/env.angular-node-app.js +3 -4
  63. package/lib/env/env.angular-node-app.js.map +1 -1
  64. package/lib/env/env.docs-webapp.d.ts +1 -2
  65. package/lib/env/env.docs-webapp.js +3 -4
  66. package/lib/env/env.docs-webapp.js.map +1 -1
  67. package/lib/env/env.electron-app.d.ts +1 -2
  68. package/lib/env/env.electron-app.js +3 -4
  69. package/lib/env/env.electron-app.js.map +1 -1
  70. package/lib/env/env.mobile-app.d.ts +1 -2
  71. package/lib/env/env.mobile-app.js +3 -4
  72. package/lib/env/env.mobile-app.js.map +1 -1
  73. package/lib/env/env.npm-lib-and-cli-tool.d.ts +1 -2
  74. package/lib/env/env.npm-lib-and-cli-tool.js +3 -4
  75. package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
  76. package/lib/env/env.vscode-plugin.d.ts +1 -2
  77. package/lib/env/env.vscode-plugin.js +3 -4
  78. package/lib/env/env.vscode-plugin.js.map +1 -1
  79. package/lib/get-response-value.d.ts +1 -1
  80. package/lib/get-response-value.js +0 -4
  81. package/lib/get-response-value.js.map +1 -1
  82. package/lib/helpers/taon-helpers.d.ts +1 -0
  83. package/lib/helpers/taon-helpers.js +6 -0
  84. package/lib/helpers/taon-helpers.js.map +1 -1
  85. package/lib/index.d.ts +4 -0
  86. package/lib/index.js +13 -2
  87. package/lib/index.js.map +1 -1
  88. package/lib/models.d.ts +4 -10
  89. package/lib/models.js +5 -23
  90. package/lib/models.js.map +1 -1
  91. package/lib/realtime/realtime-client.d.ts +18 -14
  92. package/lib/realtime/realtime-client.js +33 -25
  93. package/lib/realtime/realtime-client.js.map +1 -1
  94. package/lib/realtime/realtime-server.d.ts +28 -3
  95. package/lib/realtime/realtime-server.js +28 -2
  96. package/lib/realtime/realtime-server.js.map +1 -1
  97. package/lib/realtime/realtime.models.d.ts +15 -2
  98. package/lib/ui/index.js +2 -2
  99. package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
  100. package/package.json +1 -1
  101. package/websql/README.md +24 -24
  102. package/websql/fesm2022/taon.mjs +306 -91
  103. package/websql/fesm2022/taon.mjs.map +1 -1
  104. package/websql/lib/base-classes/base-class.d.ts +8 -1
  105. package/websql/lib/base-classes/base-controller.d.ts +56 -4
  106. package/websql/lib/base-classes/base-crud-controller.d.ts +5 -4
  107. package/websql/lib/base-classes/base-middleware.d.ts +2 -2
  108. package/websql/lib/base-classes/base-repository.d.ts +3 -0
  109. package/websql/lib/config/method-config.d.ts +1 -0
  110. package/websql/lib/decorators/http/http-decorators.d.ts +2 -1
  111. package/websql/lib/decorators/http/http-methods-decorators.d.ts +35 -4
  112. package/websql/lib/endpoint-context.d.ts +10 -4
  113. package/websql/lib/get-response-value.d.ts +1 -1
  114. package/websql/lib/helpers/taon-helpers.d.ts +1 -0
  115. package/websql/lib/index.d.ts +4 -0
  116. package/websql/lib/models.d.ts +4 -10
  117. package/websql/lib/realtime/realtime-client.d.ts +18 -14
  118. package/websql/lib/realtime/realtime-server.d.ts +28 -3
  119. package/websql/lib/realtime/realtime.models.d.ts +15 -2
  120. package/websql/package.json +1 -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
@@ -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.