taon 19.0.32 → 19.0.35

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 (162) hide show
  1. package/README.md +160 -160
  2. package/bin/start.js +279 -279
  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 +29 -3
  8. package/browser/fesm2022/taon.mjs.map +1 -1
  9. package/browser/lib/base-classes/base-context.d.ts +1 -0
  10. package/browser/lib/base-classes/base.d.ts +1 -0
  11. package/browser/lib/create-context.d.ts +2 -0
  12. package/browser/lib/endpoint-context.d.ts +1 -0
  13. package/browser/lib/index.d.ts +3 -0
  14. package/browser/lib/models.d.ts +1 -0
  15. package/browser/package.json +1 -1
  16. package/cli.js.map +1 -1
  17. package/env.d.ts +3 -0
  18. package/environments/angular-node-app/env.angular-node-app.__.d.ts +3 -0
  19. package/environments/angular-node-app/env.angular-node-app.dev.d.ts +3 -0
  20. package/environments/angular-node-app/env.angular-node-app.localhost.d.ts +3 -0
  21. package/environments/angular-node-app/env.angular-node-app.prod.d.ts +3 -0
  22. package/environments/angular-node-app/env.angular-node-app.stage.d.ts +3 -0
  23. package/environments/docs-webapp/env.docs-webapp.__.d.ts +3 -0
  24. package/environments/electron-app/env.electron-app.__.d.ts +3 -0
  25. package/environments/electron-app/env.electron-app.prod.d.ts +3 -0
  26. package/environments/mobile-app/env.mobile-app.__.d.ts +3 -0
  27. package/environments/mobile-app/env.mobile-app.prod.d.ts +3 -0
  28. package/environments/npm-lib-and-cli-tool/env.npm-lib-and-cli-tool.__.d.ts +3 -0
  29. package/environments/npm-lib-and-cli-tool/env.npm-lib-and-cli-tool.prod.d.ts +3 -0
  30. package/environments/vscode-plugin/env.vscode-plugin.__.d.ts +6 -0
  31. package/environments/vscode-plugin/env.vscode-plugin.prod.d.ts +4 -0
  32. package/index.js.map +1 -1
  33. package/lib/base-classes/base-abstract-entity.js.map +1 -1
  34. package/lib/base-classes/base-angular-service.js.map +1 -1
  35. package/lib/base-classes/base-class.js.map +1 -1
  36. package/lib/base-classes/base-context.d.ts +1 -0
  37. package/lib/base-classes/base-context.js.map +1 -1
  38. package/lib/base-classes/base-controller.js.map +1 -1
  39. package/lib/base-classes/base-crud-controller.js.map +1 -1
  40. package/lib/base-classes/base-custom-repository.js.map +1 -1
  41. package/lib/base-classes/base-entity.js.map +1 -1
  42. package/lib/base-classes/base-injector.js.map +1 -1
  43. package/lib/base-classes/base-migration.js.map +1 -1
  44. package/lib/base-classes/base-provider.js.map +1 -1
  45. package/lib/base-classes/base-repository.js.map +1 -1
  46. package/lib/base-classes/base-subscriber-for-entity.js.map +1 -1
  47. package/lib/base-classes/base.d.ts +1 -0
  48. package/lib/base-classes/base.js.map +1 -1
  49. package/lib/build-info._auto-generated_.d.ts +2 -1
  50. package/lib/build-info._auto-generated_.js +3 -2
  51. package/lib/build-info._auto-generated_.js.map +1 -1
  52. package/lib/constants.js.map +1 -1
  53. package/lib/context-db-migrations.js.map +1 -1
  54. package/lib/create-context.d.ts +2 -0
  55. package/lib/create-context.js +3 -0
  56. package/lib/create-context.js.map +1 -1
  57. package/lib/decorators/classes/controller-decorator.js.map +1 -1
  58. package/lib/decorators/classes/entity-decorator.js.map +1 -1
  59. package/lib/decorators/classes/migration-decorator.js.map +1 -1
  60. package/lib/decorators/classes/provider-decorator.js.map +1 -1
  61. package/lib/decorators/classes/repository-decorator.js.map +1 -1
  62. package/lib/decorators/classes/subscriber-decorator.js.map +1 -1
  63. package/lib/decorators/http/http-decorators.js.map +1 -1
  64. package/lib/decorators/http/http-methods-decorators.js.map +1 -1
  65. package/lib/decorators/http/http-params-decorators.js.map +1 -1
  66. package/lib/dependency-injection/di-container.js.map +1 -1
  67. package/lib/endpoint-context.d.ts +1 -0
  68. package/lib/endpoint-context.js +23 -3
  69. package/lib/endpoint-context.js.map +1 -1
  70. package/lib/entity-process.js.map +1 -1
  71. package/lib/env/env.angular-node-app.d.ts +50 -1
  72. package/lib/env/env.angular-node-app.js +52 -2
  73. package/lib/env/env.angular-node-app.js.map +1 -1
  74. package/lib/env/env.docs-webapp.d.ts +50 -1
  75. package/lib/env/env.docs-webapp.js +52 -2
  76. package/lib/env/env.docs-webapp.js.map +1 -1
  77. package/lib/env/env.electron-app.d.ts +50 -1
  78. package/lib/env/env.electron-app.js +52 -2
  79. package/lib/env/env.electron-app.js.map +1 -1
  80. package/lib/env/env.mobile-app.d.ts +50 -1
  81. package/lib/env/env.mobile-app.js +52 -2
  82. package/lib/env/env.mobile-app.js.map +1 -1
  83. package/lib/env/env.npm-lib-and-cli-tool.d.ts +50 -1
  84. package/lib/env/env.npm-lib-and-cli-tool.js +52 -2
  85. package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
  86. package/lib/env/env.vscode-plugin.d.ts +50 -1
  87. package/lib/env/env.vscode-plugin.js +52 -2
  88. package/lib/env/env.vscode-plugin.js.map +1 -1
  89. package/lib/env/index.js.map +1 -1
  90. package/lib/env.js.map +1 -1
  91. package/lib/formly/formly-group-wrapper-component.js.map +1 -1
  92. package/lib/formly/formly-repeat-component.js.map +1 -1
  93. package/lib/formly/formly.models.js.map +1 -1
  94. package/lib/formly/fromly.js.map +1 -1
  95. package/lib/formly/type-from-entity.js.map +1 -1
  96. package/lib/get-response-value.js.map +1 -1
  97. package/lib/helpers/class-helpers.js.map +1 -1
  98. package/lib/helpers/taon-helpers.js.map +1 -1
  99. package/lib/index._auto-generated_.js.map +1 -1
  100. package/lib/index.d.ts +3 -0
  101. package/lib/index.js +1 -0
  102. package/lib/index.js.map +1 -1
  103. package/lib/inject.js.map +1 -1
  104. package/lib/models.d.ts +1 -0
  105. package/lib/models.js.map +1 -1
  106. package/lib/orm.js.map +1 -1
  107. package/lib/realtime/realtime-client.js.map +1 -1
  108. package/lib/realtime/realtime-core.js.map +1 -1
  109. package/lib/realtime/realtime-server.js.map +1 -1
  110. package/lib/realtime/realtime-strategy/index.js.map +1 -1
  111. package/lib/realtime/realtime-strategy/realtime-strategy-ipc.js.map +1 -1
  112. package/lib/realtime/realtime-strategy/realtime-strategy-mock.js.map +1 -1
  113. package/lib/realtime/realtime-strategy/realtime-strategy-socket-io.js.map +1 -1
  114. package/lib/realtime/realtime-strategy/realtime-strategy.js.map +1 -1
  115. package/lib/realtime/realtime-subs-manager.js.map +1 -1
  116. package/lib/realtime/realtime.models.js.map +1 -1
  117. package/lib/storage.js.map +1 -1
  118. package/lib/symbols.js.map +1 -1
  119. package/lib/ui/directives/index.js +2 -2
  120. package/lib/ui/directives/index.js.map +1 -1
  121. package/lib/ui/directives/view-mode.js.map +1 -1
  122. package/lib/ui/index.js +2 -2
  123. package/lib/ui/index.js.map +1 -1
  124. package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
  125. package/lib/ui/taon-admin-mode-configuration/index.js.map +1 -1
  126. package/lib/ui/taon-admin-mode-configuration/taon-admin.models.js.map +1 -1
  127. package/lib/ui/taon-github-fork-me-corner/index.js +2 -2
  128. package/lib/ui/taon-github-fork-me-corner/index.js.map +1 -1
  129. package/lib/ui/taon-github-fork-me-ribbon/index.js +2 -2
  130. package/lib/ui/taon-github-fork-me-ribbon/index.js.map +1 -1
  131. package/lib/ui/taon-notifications/index.js.map +1 -1
  132. package/lib/ui/taon-notifications/taon-notifications.models.js +2 -2
  133. package/lib/ui/taon-notifications/taon-notifications.models.js.map +1 -1
  134. package/lib/ui/taon-progress-bar/index.js +2 -2
  135. package/lib/ui/taon-progress-bar/index.js.map +1 -1
  136. package/lib/ui/taon-session-passcode/index.js +2 -2
  137. package/lib/ui/taon-session-passcode/index.js.map +1 -1
  138. package/lib/ui/taon-table/index.js +2 -2
  139. package/lib/ui/taon-table/index.js.map +1 -1
  140. package/lib/ui/taon.models.js.map +1 -1
  141. package/lib/validators.js.map +1 -1
  142. package/migrations/index.js.map +1 -1
  143. package/migrations/migrations_index._auto-generated_.js.map +1 -1
  144. package/old-app .js.map +1 -1
  145. package/package.json +1 -1
  146. package/playground.js.map +1 -1
  147. package/scss/vars.scss +2 -2
  148. package/tmp-environment.json +5 -12
  149. package/websql/README.md +24 -24
  150. package/websql/fesm2022/taon.mjs +29 -5
  151. package/websql/fesm2022/taon.mjs.map +1 -1
  152. package/websql/lib/base-classes/base-context.d.ts +1 -0
  153. package/websql/lib/base-classes/base.d.ts +1 -0
  154. package/websql/lib/create-context.d.ts +2 -0
  155. package/websql/lib/endpoint-context.d.ts +1 -0
  156. package/websql/lib/index.d.ts +3 -0
  157. package/websql/lib/models.d.ts +1 -0
  158. package/websql/package.json +1 -1
  159. package/client/package.json +0 -13
  160. package/lib/base-classes/base-repository copy.d.ts +0 -255
  161. package/lib/base-classes/base-repository copy.js +0 -653
  162. package/lib/base-classes/base-repository copy.js.map +0 -1
package/bin/start.js CHANGED
@@ -1,279 +1,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
- //#endregion
18
-
19
- //#region resolve constants
20
- const childprocsecretarg = '-childproc';
21
- const isWinGitBash = (process.platform === 'win32');
22
- const procType = (process.argv[1].endsWith('tnp') || process.argv[1].endsWith('taon')) ? 'root'
23
- : ((process.argv.find(a => a.startsWith(childprocsecretarg)))
24
- ? 'child-of-root'
25
- : 'child-of-child'
26
- );
27
- const debugMode = (process.argv[1].endsWith('-debug') || process.argv[1].endsWith('-debug-brk'))
28
- global.spinnerInParentProcess = (procType === 'child-of-root');
29
- const orgArgv = JSON.parse(JSON.stringify(process.argv));
30
- global.tnpNonInteractive = (typeof process.argv.find(a => a.startsWith('--tnpNonInteractive')) !== 'undefined');
31
- const spinnerIsDefault = !tnpNonInteractive;
32
- const splited = crossPlatofrmPath(process.argv[1]).split('/');
33
- global.frameworkName = 'taon';
34
-
35
- global.restartWorker = (typeof (process.argv.find(a => a.startsWith('-restartWorker'))) !== 'undefined');
36
- global.reinitDb = (typeof (process.argv.find(a => a.startsWith('-reinitDb'))) !== 'undefined');
37
- global.globalSystemToolMode = true;
38
- const verbose = process.argv.includes('-verbose')
39
- global.hideLog = !verbose;
40
- global.verboseLevel = 0;
41
- global.useWorker = !(typeof process.argv.find(a => a.startsWith('-useWorker=false')) !== 'undefined');
42
- global.useWebpackBackendBuild = (typeof process.argv.find(a => a.startsWith('-webpack')) !== 'undefined');
43
- global.skipCoreCheck = (typeof process.argv.find(a => a.startsWith('--skipCoreCheck')) !== 'undefined');
44
- const verboseLevelExists = (typeof process.argv.find(a => a.startsWith('-verbose=')) !== 'undefined');
45
- global.verboseLevel = (verboseLevelExists ? Number(
46
- process.argv.find(a => {
47
- const v = a.startsWith('-verbose=');
48
- if (v) {
49
- return v.replace('-verbose=', '');
50
- }
51
- })
52
- ) : 0) || 0;
53
-
54
- if (!verbose && verboseLevelExists) {
55
- global.hideLog = false;
56
- }
57
-
58
- const distOnly = (process.argv.includes('-dist'));
59
- const npmOnly = (process.argv.includes('-npm'));
60
- const spinnerOnInArgs = process.argv.includes('-spinner');
61
- const spinnerOffInArgs = (process.argv.includes('-spinner=false') || process.argv.includes('-spinner=off'));
62
- //#endregion
63
-
64
- //#region clear argument from variables
65
- process.argv = process.argv.filter(a => !a.startsWith('-spinner'));
66
- process.argv = process.argv.filter(a => a !== '-childproc');
67
- process.argv = process.argv.filter(a => a !== '--skipCoreCheck');
68
- process.argv = process.argv.filter(a => a !== '-dist');
69
- process.argv = process.argv.filter(a => a !== '-npm');
70
- process.argv = process.argv.filter(a => !a.startsWith('-verbose'));
71
- //#endregion
72
-
73
- //#region fix argument
74
- process.argv = process.argv.map(a => {
75
- if (a === '-websql') {
76
- return '--websql'
77
- }
78
- return a;
79
- })
80
- //#endregion
81
-
82
- //#region variables
83
- let mode;
84
- let start;
85
- let startSpinner = spinnerIsDefault || spinnerOnInArgs;
86
- if (spinnerOffInArgs) {
87
- startSpinner = false;
88
- }
89
- if (procType === 'child-of-root' || debugMode) {
90
- startSpinner = false;
91
- }
92
-
93
- // if (startSpinner) {
94
- // const inspector = require('inspector');
95
- // isNodeDebuggerEnabled = (inspector.url() !== undefined);
96
- // startSpinner = !isNodeDebuggerEnabled;
97
- // }
98
-
99
- if (verbose || frameworkName === 'tnp' || global.skipCoreCheck) {
100
- startSpinner = false;
101
- }
102
-
103
- //#endregion
104
-
105
- const path = require('path');
106
-
107
- // console.log({
108
- // ppid: process.ppid,
109
- // pid: process.pid,
110
- // procType
111
- // })
112
-
113
- // if(procType !== 'root') {
114
- // var fn = process.stdout.write
115
-
116
- // function write() {
117
- // if((arguments.length > 0) && typeof arguments[0] === 'string') {
118
- // arguments[0] = arguments[0].trim();
119
- // }
120
- // fn.apply(process.stdout, arguments);
121
- // }
122
-
123
- // process.stdout.write = write;
124
- // }
125
-
126
- if (procType === 'child-of-root') {
127
- global.spinner = {
128
- start() {
129
- process.send && process.send('start-spinner')
130
- },
131
- stop() {
132
- process.send && process.send('stop-spinner')
133
- }
134
- }
135
- }
136
-
137
- if (startSpinner) {
138
- //#region start spinner in processs
139
- var ora = require('ora');
140
- var spinner = ora();
141
- spinner.start();
142
- global.spinner = spinner;
143
-
144
- const child_process = require('child_process');
145
- const orgArgvForChild = orgArgv.filter(a => !a.startsWith('-spinner'));
146
-
147
- const env = {
148
- ...process.env,
149
- FORCE_COLOR: '1'
150
- };
151
-
152
- const cwd = process.cwd();
153
- const argsToCHildProc = (`${orgArgvForChild.slice(2).join(' ')} ${global.verbose ? '-verbose' : ''} ${global.skipCoreCheck ? '--skipCoreCheck' : ''} `
154
- + `${spinnerOnInArgs ? '-spinner' : (spinnerOffInArgs ? '-spinner=off' : '')} ${childprocsecretarg}`).split(' ');
155
-
156
- const proc = child_process.fork(crossPlatofrmPath(__filename), argsToCHildProc, {
157
- env,
158
- stdio: [0, 1, 2, 'ipc'],
159
- cwd,
160
- });
161
-
162
- proc.on('exit', (code) => {
163
- spinner.stop();
164
- setTimeout(() => {
165
- process.exit(code);
166
- })
167
- });
168
-
169
- proc.on('message', message => {
170
- message = (message ? message : '').trimLeft();
171
- if (message === 'start-spinner') {
172
- spinner.start();
173
- } else if (message === 'stop-spinner') {
174
- spinner.stop();
175
- } else if (message.startsWith('info::')) {
176
- setText((message));
177
- } else if (message.startsWith('success::')) {
178
- setText((message));
179
- } else if (message.startsWith('taskstart::')) {
180
- setText((message));
181
- } else if (message.startsWith('taskdone::')) {
182
- setText((message));
183
- } else if (message.startsWith('error::')) {
184
- setText((message));
185
- } else if (message.startsWith('log::')) {
186
- setText((message), true);
187
- } else if (message.startsWith('warn::')) {
188
- setText((message));
189
- }
190
- });
191
-
192
- // process.stdin.resume(); // not needed ?
193
- //#endregion
194
- } else {
195
- //#region child or child of child
196
-
197
-
198
- if (distOnly) {
199
- //#region standalrd dist mode
200
- mode = 'dist';
201
- !global.hideLog && setText('- dist only -', true);
202
- process.argv = process.argv.filter(f => !!f);
203
-
204
- const pathToDistRun = path.join(__dirname, '../dist/cli.js');
205
- start = require(pathToDistRun.replace(/\.js$/g, '')).start;
206
- //#endregion
207
- } else if (npmOnly) {
208
- //#region npm mode (project as installable package)
209
- mode = 'npm';
210
- !global.hideLog && setText('- npm global only -', true);
211
- // =========================== only dist ============================
212
- process.argv = process.argv.filter(a => a !== '-npm');
213
- process.argv = process.argv.filter(f => !!f);
214
-
215
- const pathToDistRun = path.join(__dirname, '../cli.js');
216
- start = require(pathToDistRun.replace(/\.js$/g, '')).start;
217
- //#endregion
218
- } else {
219
- //#region uknow dist or npm mode
220
- const fs = require('fs');
221
-
222
- const pathToDistRun = path.join(__dirname, '../dist/cli.js');
223
- const pathToIndexRun = path.join(__dirname, '../cli.js');
224
- const distExist = fs.existsSync(pathToDistRun);
225
-
226
- if (distExist) {
227
- // console.log('USE /dist/cli.js')
228
- mode = 'dist';
229
- !global.hideLog && setText('- taon dist -', true);
230
- // TODO TOOOO MUCH TIME !!!!!!
231
- start = require(pathToDistRun.replace(/\.js$/g, '')).start;
232
- } else {
233
- // console.log('USE /cli.js')
234
- mode = 'npm';
235
- !global.hideLog && setText('- npm mode -', true);
236
- start = require(pathToIndexRun.replace(/\.js$/g, '')).start;
237
- }
238
- //#endregion
239
- }
240
-
241
- // global.start = start;
242
- process.argv = process.argv.filter(f => !!f);
243
- start(process.argv, global.frameworkName, mode);
244
- //#endregion
245
- }
246
-
247
- function crossPlatofrmPath(p) {
248
- if (isWinGitBash) {
249
- return p.replace(/\\/g, '/');
250
- }
251
- return p;
252
- }
253
-
254
- function setText(text, toSpiner = false) {
255
- const spinner = global.spinner;
256
- if (text) {
257
- text = text.split('::').slice(1).join('::');
258
- }
259
- if (spinner) {
260
- if (toSpiner) {
261
- spinner.text = text.replace(/(?:\r\n|\r|\n)/g, ' ');
262
- } else {
263
- const wasSpinning = spinner.isSpinning;
264
- if (wasSpinning) {
265
- spinner.stop();
266
- spinner.clear();
267
- }
268
- console.log(text);
269
- if (wasSpinning) {
270
- spinner.start()
271
- }
272
- }
273
- } else {
274
- console.log(text);
275
- }
276
-
277
- }
278
-
279
- //#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
+ //#endregion
18
+
19
+ //#region resolve constants
20
+ const childprocsecretarg = '-childproc';
21
+ const isWinGitBash = (process.platform === 'win32');
22
+ const procType = (process.argv[1].endsWith('tnp') || process.argv[1].endsWith('taon')) ? 'root'
23
+ : ((process.argv.find(a => a.startsWith(childprocsecretarg)))
24
+ ? 'child-of-root'
25
+ : 'child-of-child'
26
+ );
27
+ const debugMode = (process.argv[1].endsWith('-debug') || process.argv[1].endsWith('-debug-brk'))
28
+ global.spinnerInParentProcess = (procType === 'child-of-root');
29
+ const orgArgv = JSON.parse(JSON.stringify(process.argv));
30
+ global.tnpNonInteractive = (typeof process.argv.find(a => a.startsWith('--tnpNonInteractive')) !== 'undefined');
31
+ const spinnerIsDefault = !tnpNonInteractive;
32
+ const splited = crossPlatofrmPath(process.argv[1]).split('/');
33
+ global.frameworkName = 'taon';
34
+
35
+ global.restartWorker = (typeof (process.argv.find(a => a.startsWith('-restartWorker'))) !== 'undefined');
36
+ global.reinitDb = (typeof (process.argv.find(a => a.startsWith('-reinitDb'))) !== 'undefined');
37
+ global.globalSystemToolMode = true;
38
+ const verbose = process.argv.includes('-verbose')
39
+ global.hideLog = !verbose;
40
+ global.verboseLevel = 0;
41
+ global.useWorker = !(typeof process.argv.find(a => a.startsWith('-useWorker=false')) !== 'undefined');
42
+ global.useWebpackBackendBuild = (typeof process.argv.find(a => a.startsWith('-webpack')) !== 'undefined');
43
+ global.skipCoreCheck = (typeof process.argv.find(a => a.startsWith('--skipCoreCheck')) !== 'undefined');
44
+ const verboseLevelExists = (typeof process.argv.find(a => a.startsWith('-verbose=')) !== 'undefined');
45
+ global.verboseLevel = (verboseLevelExists ? Number(
46
+ process.argv.find(a => {
47
+ const v = a.startsWith('-verbose=');
48
+ if (v) {
49
+ return v.replace('-verbose=', '');
50
+ }
51
+ })
52
+ ) : 0) || 0;
53
+
54
+ if (!verbose && verboseLevelExists) {
55
+ global.hideLog = false;
56
+ }
57
+
58
+ const distOnly = (process.argv.includes('-dist'));
59
+ const npmOnly = (process.argv.includes('-npm'));
60
+ const spinnerOnInArgs = process.argv.includes('-spinner');
61
+ const spinnerOffInArgs = (process.argv.includes('-spinner=false') || process.argv.includes('-spinner=off'));
62
+ //#endregion
63
+
64
+ //#region clear argument from variables
65
+ process.argv = process.argv.filter(a => !a.startsWith('-spinner'));
66
+ process.argv = process.argv.filter(a => a !== '-childproc');
67
+ process.argv = process.argv.filter(a => a !== '--skipCoreCheck');
68
+ process.argv = process.argv.filter(a => a !== '-dist');
69
+ process.argv = process.argv.filter(a => a !== '-npm');
70
+ process.argv = process.argv.filter(a => !a.startsWith('-verbose'));
71
+ //#endregion
72
+
73
+ //#region fix argument
74
+ process.argv = process.argv.map(a => {
75
+ if (a === '-websql') {
76
+ return '--websql'
77
+ }
78
+ return a;
79
+ })
80
+ //#endregion
81
+
82
+ //#region variables
83
+ let mode;
84
+ let start;
85
+ let startSpinner = spinnerIsDefault || spinnerOnInArgs;
86
+ if (spinnerOffInArgs) {
87
+ startSpinner = false;
88
+ }
89
+ if (procType === 'child-of-root' || debugMode) {
90
+ startSpinner = false;
91
+ }
92
+
93
+ // if (startSpinner) {
94
+ // const inspector = require('inspector');
95
+ // isNodeDebuggerEnabled = (inspector.url() !== undefined);
96
+ // startSpinner = !isNodeDebuggerEnabled;
97
+ // }
98
+
99
+ if (verbose || frameworkName === 'tnp' || global.skipCoreCheck) {
100
+ startSpinner = false;
101
+ }
102
+
103
+ //#endregion
104
+
105
+ const path = require('path');
106
+
107
+ // console.log({
108
+ // ppid: process.ppid,
109
+ // pid: process.pid,
110
+ // procType
111
+ // })
112
+
113
+ // if(procType !== 'root') {
114
+ // var fn = process.stdout.write
115
+
116
+ // function write() {
117
+ // if((arguments.length > 0) && typeof arguments[0] === 'string') {
118
+ // arguments[0] = arguments[0].trim();
119
+ // }
120
+ // fn.apply(process.stdout, arguments);
121
+ // }
122
+
123
+ // process.stdout.write = write;
124
+ // }
125
+
126
+ if (procType === 'child-of-root') {
127
+ global.spinner = {
128
+ start() {
129
+ process.send && process.send('start-spinner')
130
+ },
131
+ stop() {
132
+ process.send && process.send('stop-spinner')
133
+ }
134
+ }
135
+ }
136
+
137
+ if (startSpinner) {
138
+ //#region start spinner in processs
139
+ var ora = require('ora');
140
+ var spinner = ora();
141
+ spinner.start();
142
+ global.spinner = spinner;
143
+
144
+ const child_process = require('child_process');
145
+ const orgArgvForChild = orgArgv.filter(a => !a.startsWith('-spinner'));
146
+
147
+ const env = {
148
+ ...process.env,
149
+ FORCE_COLOR: '1'
150
+ };
151
+
152
+ const cwd = process.cwd();
153
+ const argsToCHildProc = (`${orgArgvForChild.slice(2).join(' ')} ${global.verbose ? '-verbose' : ''} ${global.skipCoreCheck ? '--skipCoreCheck' : ''} `
154
+ + `${spinnerOnInArgs ? '-spinner' : (spinnerOffInArgs ? '-spinner=off' : '')} ${childprocsecretarg}`).split(' ');
155
+
156
+ const proc = child_process.fork(crossPlatofrmPath(__filename), argsToCHildProc, {
157
+ env,
158
+ stdio: [0, 1, 2, 'ipc'],
159
+ cwd,
160
+ });
161
+
162
+ proc.on('exit', (code) => {
163
+ spinner.stop();
164
+ setTimeout(() => {
165
+ process.exit(code);
166
+ })
167
+ });
168
+
169
+ proc.on('message', message => {
170
+ message = (message ? message : '').trimLeft();
171
+ if (message === 'start-spinner') {
172
+ spinner.start();
173
+ } else if (message === 'stop-spinner') {
174
+ spinner.stop();
175
+ } else if (message.startsWith('info::')) {
176
+ setText((message));
177
+ } else if (message.startsWith('success::')) {
178
+ setText((message));
179
+ } else if (message.startsWith('taskstart::')) {
180
+ setText((message));
181
+ } else if (message.startsWith('taskdone::')) {
182
+ setText((message));
183
+ } else if (message.startsWith('error::')) {
184
+ setText((message));
185
+ } else if (message.startsWith('log::')) {
186
+ setText((message), true);
187
+ } else if (message.startsWith('warn::')) {
188
+ setText((message));
189
+ }
190
+ });
191
+
192
+ // process.stdin.resume(); // not needed ?
193
+ //#endregion
194
+ } else {
195
+ //#region child or child of child
196
+
197
+
198
+ if (distOnly) {
199
+ //#region standalrd dist mode
200
+ mode = 'dist';
201
+ !global.hideLog && setText('- dist only -', true);
202
+ process.argv = process.argv.filter(f => !!f);
203
+
204
+ const pathToDistRun = path.join(__dirname, '../dist/cli.js');
205
+ start = require(pathToDistRun.replace(/\.js$/g, '')).start;
206
+ //#endregion
207
+ } else if (npmOnly) {
208
+ //#region npm mode (project as installable package)
209
+ mode = 'npm';
210
+ !global.hideLog && setText('- npm global only -', true);
211
+ // =========================== only dist ============================
212
+ process.argv = process.argv.filter(a => a !== '-npm');
213
+ process.argv = process.argv.filter(f => !!f);
214
+
215
+ const pathToDistRun = path.join(__dirname, '../cli.js');
216
+ start = require(pathToDistRun.replace(/\.js$/g, '')).start;
217
+ //#endregion
218
+ } else {
219
+ //#region uknow dist or npm mode
220
+ const fs = require('fs');
221
+
222
+ const pathToDistRun = path.join(__dirname, '../dist/cli.js');
223
+ const pathToIndexRun = path.join(__dirname, '../cli.js');
224
+ const distExist = fs.existsSync(pathToDistRun);
225
+
226
+ if (distExist) {
227
+ // console.log('USE /dist/cli.js')
228
+ mode = 'dist';
229
+ !global.hideLog && setText('- taon dist -', true);
230
+ // TODO TOOOO MUCH TIME !!!!!!
231
+ start = require(pathToDistRun.replace(/\.js$/g, '')).start;
232
+ } else {
233
+ // console.log('USE /cli.js')
234
+ mode = 'npm';
235
+ !global.hideLog && setText('- npm mode -', true);
236
+ start = require(pathToIndexRun.replace(/\.js$/g, '')).start;
237
+ }
238
+ //#endregion
239
+ }
240
+
241
+ // global.start = start;
242
+ process.argv = process.argv.filter(f => !!f);
243
+ start(process.argv, global.frameworkName, mode);
244
+ //#endregion
245
+ }
246
+
247
+ function crossPlatofrmPath(p) {
248
+ if (isWinGitBash) {
249
+ return p.replace(/\\/g, '/');
250
+ }
251
+ return p;
252
+ }
253
+
254
+ function setText(text, toSpiner = false) {
255
+ const spinner = global.spinner;
256
+ if (text) {
257
+ text = text.split('::').slice(1).join('::');
258
+ }
259
+ if (spinner) {
260
+ if (toSpiner) {
261
+ spinner.text = text.replace(/(?:\r\n|\r|\n)/g, ' ');
262
+ } else {
263
+ const wasSpinning = spinner.isSpinning;
264
+ if (wasSpinning) {
265
+ spinner.stop();
266
+ spinner.clear();
267
+ }
268
+ console.log(text);
269
+ if (wasSpinning) {
270
+ spinner.start()
271
+ }
272
+ }
273
+ } else {
274
+ console.log(text);
275
+ }
276
+
277
+ }
278
+
279
+ //#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.