tnp-helpers 19.0.5 → 19.0.6
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/browser/README.md +24 -24
- package/browser/fesm2022/tnp-helpers.mjs +1435 -139
- package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
- package/browser/lib/base/classes/base-node-modules.d.ts +1 -1
- package/browser/lib/base/linked-project.d.ts +4 -1
- package/browser/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +6 -6
- package/browser/lib/build-info._auto-generated_.d.ts +2 -1
- package/browser/lib/utils.d.ts +36 -20
- package/browser/package.json +1 -1
- package/client/README.md +24 -24
- package/client/fesm2022/tnp-helpers.mjs +1435 -139
- package/client/fesm2022/tnp-helpers.mjs.map +1 -1
- package/client/lib/base/classes/base-node-modules.d.ts +1 -1
- package/client/lib/base/linked-project.d.ts +4 -1
- package/client/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +6 -6
- package/client/lib/build-info._auto-generated_.d.ts +2 -1
- package/client/lib/utils.d.ts +36 -20
- package/client/package.json +1 -1
- package/index.js.map +1 -1
- package/lib/base/classes/base-bower-json.js +2 -2
- package/lib/base/classes/base-bower-json.js.map +1 -1
- package/lib/base/classes/base-cli-worker/base-cli-worker-config.js +2 -2
- package/lib/base/classes/base-cli-worker/base-cli-worker-config.js.map +1 -1
- package/lib/base/classes/base-cli-worker/base-cli-worker-controller.d.ts +1 -1
- package/lib/base/classes/base-cli-worker/base-cli-worker-controller.js +14 -14
- package/lib/base/classes/base-cli-worker/base-cli-worker-controller.js.map +1 -1
- package/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.js +10 -10
- package/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.js.map +1 -1
- package/lib/base/classes/base-cli-worker/base-cli-worker.d.ts +1 -1
- package/lib/base/classes/base-cli-worker/base-cli-worker.js +18 -18
- package/lib/base/classes/base-cli-worker/base-cli-worker.js.map +1 -1
- package/lib/base/classes/base-cli-worker/index.js.map +1 -1
- package/lib/base/classes/base-command-line-feature.backend.js +10 -10
- package/lib/base/classes/base-command-line-feature.backend.js.map +1 -1
- package/lib/base/classes/base-compiler-for-project.d.ts +1 -1
- package/lib/base/classes/base-compiler-for-project.js +13 -13
- package/lib/base/classes/base-compiler-for-project.js.map +1 -1
- package/lib/base/classes/base-db.js +7 -7
- package/lib/base/classes/base-db.js.map +1 -1
- package/lib/base/classes/base-debounce-compiler-for-project.d.ts +1 -1
- package/lib/base/classes/base-debounce-compiler-for-project.js +5 -5
- package/lib/base/classes/base-debounce-compiler-for-project.js.map +1 -1
- package/lib/base/classes/base-feature-for-project.js.map +1 -1
- package/lib/base/classes/base-git.js +24 -24
- package/lib/base/classes/base-git.js.map +1 -1
- package/lib/base/classes/base-global-command-line.backend.d.ts +3 -1
- package/lib/base/classes/base-global-command-line.backend.js +60 -49
- package/lib/base/classes/base-global-command-line.backend.js.map +1 -1
- package/lib/base/classes/base-ignore-hide.js +2 -2
- package/lib/base/classes/base-ignore-hide.js.map +1 -1
- package/lib/base/classes/base-json-file-reader.js +24 -24
- package/lib/base/classes/base-json-file-reader.js.map +1 -1
- package/lib/base/classes/base-library-build.js +52 -52
- package/lib/base/classes/base-library-build.js.map +1 -1
- package/lib/base/classes/base-linked-projects.js +23 -23
- package/lib/base/classes/base-linked-projects.js.map +1 -1
- package/lib/base/classes/base-node-modules.d.ts +1 -1
- package/lib/base/classes/base-node-modules.js +37 -37
- package/lib/base/classes/base-node-modules.js.map +1 -1
- package/lib/base/classes/base-npm-helpers.d.ts +1 -1
- package/lib/base/classes/base-npm-helpers.js +14 -14
- package/lib/base/classes/base-npm-helpers.js.map +1 -1
- package/lib/base/classes/base-package-json.d.ts +1 -1
- package/lib/base/classes/base-package-json.js +27 -27
- package/lib/base/classes/base-package-json.js.map +1 -1
- package/lib/base/classes/base-powershell.js +2 -2
- package/lib/base/classes/base-powershell.js.map +1 -1
- package/lib/base/classes/base-process-manager.js +8 -8
- package/lib/base/classes/base-process-manager.js.map +1 -1
- package/lib/base/classes/base-project-resolver.js +30 -30
- package/lib/base/classes/base-project-resolver.js.map +1 -1
- package/lib/base/classes/base-project.d.ts +2 -2
- package/lib/base/classes/base-project.js +62 -62
- package/lib/base/classes/base-project.js.map +1 -1
- package/lib/base/classes/base-quick-fixes.js +9 -9
- package/lib/base/classes/base-quick-fixes.js.map +1 -1
- package/lib/base/classes/base-release-process.d.ts +1 -1
- package/lib/base/classes/base-release-process.js +19 -19
- package/lib/base/classes/base-release-process.js.map +1 -1
- package/lib/base/classes/base-start-config.backend.js +13 -13
- package/lib/base/classes/base-start-config.backend.js.map +1 -1
- package/lib/base/classes/base-static-pages.js +6 -6
- package/lib/base/classes/base-static-pages.js.map +1 -1
- package/lib/base/classes/base-vscode.js +20 -20
- package/lib/base/classes/base-vscode.js.map +1 -1
- package/lib/base/classes/index.js.map +1 -1
- package/lib/base/commit-data.js +25 -25
- package/lib/base/commit-data.js.map +1 -1
- package/lib/base/config-database.js.map +1 -1
- package/lib/base/core-project.d.ts +1 -1
- package/lib/base/core-project.js +9 -9
- package/lib/base/core-project.js.map +1 -1
- package/lib/base/gh-temp-code.js +6 -6
- package/lib/base/gh-temp-code.js.map +1 -1
- package/lib/base/index-rebuilder.backend.js +1 -1
- package/lib/base/index-rebuilder.backend.js.map +1 -1
- package/lib/base/index.js.map +1 -1
- package/lib/base/linked-project.d.ts +4 -1
- package/lib/base/linked-project.js +18 -9
- package/lib/base/linked-project.js.map +1 -1
- package/lib/base/project-database.js.map +1 -1
- package/lib/base/tcp-udp-ports/index.js.map +1 -1
- package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
- package/lib/base/tcp-udp-ports/not-assignable-port.entity.js.map +1 -1
- package/lib/base/tcp-udp-ports/ports.controller.d.ts +1 -1
- package/lib/base/tcp-udp-ports/ports.controller.js +21 -21
- package/lib/base/tcp-udp-ports/ports.controller.js.map +1 -1
- package/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
- package/lib/base/tcp-udp-ports/ports.entity.js +10 -10
- package/lib/base/tcp-udp-ports/ports.entity.js.map +1 -1
- package/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +9 -9
- package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js +9 -9
- package/lib/base/tcp-udp-ports/tcp-udp-ports.context.js.map +1 -1
- package/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.js +18 -18
- package/lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.js.map +1 -1
- package/lib/base/tcp-udp-ports/tcp-upd-ports.worker.js.map +1 -1
- package/lib/base/translate.js.map +1 -1
- package/lib/build-info._auto-generated_.d.ts +2 -1
- package/lib/build-info._auto-generated_.js +3 -2
- package/lib/build-info._auto-generated_.js.map +1 -1
- package/lib/helpers/for-backend/helpers-cli-tool.backend.js +40 -40
- package/lib/helpers/for-backend/helpers-cli-tool.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-console-gui.js +2 -2
- package/lib/helpers/for-backend/helpers-console-gui.js.map +1 -1
- package/lib/helpers/for-backend/helpers-dependencies.backend.js +2 -2
- package/lib/helpers/for-backend/helpers-dependencies.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-file-folders.js +131 -131
- package/lib/helpers/for-backend/helpers-file-folders.js.map +1 -1
- package/lib/helpers/for-backend/helpers-git.backend.js +105 -105
- package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-network.backend.js +2 -3
- package/lib/helpers/for-backend/helpers-network.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-npm.backend.js +2 -2
- package/lib/helpers/for-backend/helpers-npm.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-path.backend.js +6 -6
- package/lib/helpers/for-backend/helpers-path.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-process.d.ts +1 -1
- package/lib/helpers/for-backend/helpers-process.js +41 -41
- package/lib/helpers/for-backend/helpers-process.js.map +1 -1
- package/lib/helpers/for-backend/helpers-system-terminal.backend.js +2 -2
- package/lib/helpers/for-backend/helpers-system-terminal.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-vscode.backend.d.ts +1 -1
- package/lib/helpers/for-backend/helpers-vscode.backend.js +2 -2
- package/lib/helpers/for-backend/helpers-vscode.backend.js.map +1 -1
- package/lib/helpers/for-browser/angular.helper.js +2 -2
- package/lib/helpers/for-browser/angular.helper.js.map +1 -1
- package/lib/helpers/for-browser/helpers-browser.js.map +1 -1
- package/lib/helpers/helpers-array-obj.js +10 -10
- package/lib/helpers/helpers-array-obj.js.map +1 -1
- package/lib/helpers/helpers-json5.backend.js +6 -6
- package/lib/helpers/helpers-json5.backend.js.map +1 -1
- package/lib/helpers/helpers-numbers.js.map +1 -1
- package/lib/helpers/helpers-strings-regexes.js +5 -5
- package/lib/helpers/helpers-strings-regexes.js.map +1 -1
- package/lib/helpers/helpers-strings.js +3 -3
- package/lib/helpers/helpers-strings.js.map +1 -1
- package/lib/helpers/helpers.js +28 -28
- package/lib/helpers/helpers.js.map +1 -1
- package/lib/index._auto-generated_.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/lowdb/adapters/Memory.js.map +1 -1
- package/lib/lowdb/adapters/browser/LocalStorage.js.map +1 -1
- package/lib/lowdb/adapters/browser/SessionStorage.js.map +1 -1
- package/lib/lowdb/adapters/browser/WebStorage.js.map +1 -1
- package/lib/lowdb/adapters/node/DataFile.js.map +1 -1
- package/lib/lowdb/adapters/node/JSONFile.js.map +1 -1
- package/lib/lowdb/adapters/node/TextFile.js +2 -2
- package/lib/lowdb/adapters/node/TextFile.js.map +1 -1
- package/lib/lowdb/adapters/node/steno.js.map +1 -1
- package/lib/lowdb/browser.js.map +1 -1
- package/lib/lowdb/core/Low.js.map +1 -1
- package/lib/lowdb/examples/browser.js.map +1 -1
- package/lib/lowdb/examples/cli.js.map +1 -1
- package/lib/lowdb/examples/in-memory.js.map +1 -1
- package/lib/lowdb/examples/server.js.map +1 -1
- package/lib/lowdb/index.js.map +1 -1
- package/lib/lowdb/node.js.map +1 -1
- package/lib/lowdb/presets/browser.js.map +1 -1
- package/lib/lowdb/presets/node.js.map +1 -1
- package/lib/models.d.ts +1 -1
- package/lib/models.js +8 -8
- package/lib/models.js.map +1 -1
- package/lib/old/base-component.js +2 -2
- package/lib/old/base-component.js.map +1 -1
- package/lib/old/base-formly-component.js +2 -2
- package/lib/old/base-formly-component.js.map +1 -1
- package/lib/old/condition-wait.js.map +1 -1
- package/lib/old/dual-component-ctrl.js +2 -2
- package/lib/old/dual-component-ctrl.js.map +1 -1
- package/lib/old/execute-command.js.map +1 -1
- package/lib/old/helpers.js +2 -2
- package/lib/old/helpers.js.map +1 -1
- package/lib/old/models.d.ts +1 -1
- package/lib/old/models.js.map +1 -1
- package/lib/utils.d.ts +36 -20
- package/lib/utils.js +288 -52
- package/lib/utils.js.map +1 -1
- package/lib/validators/validators-firedev.js +6 -6
- package/lib/validators/validators-firedev.js.map +1 -1
- package/lib/validators/validators-git.js.map +1 -1
- package/lib/validators/validators-network.js +2 -2
- package/lib/validators/validators-network.js.map +1 -1
- package/lib/validators/validators.js.map +1 -1
- package/migrations/1736198527297_init.d.ts +1 -1
- package/migrations/1736198527297_init.js +5 -5
- package/migrations/1736198527297_init.js.map +1 -1
- package/migrations/1736199486472_addingNotAssignablePorts.d.ts +1 -1
- package/migrations/1736199486472_addingNotAssignablePorts.js +8 -8
- package/migrations/1736199486472_addingNotAssignablePorts.js.map +1 -1
- package/migrations/1736454437350_addFreePorts.d.ts +1 -1
- package/migrations/1736454437350_addFreePorts.js +11 -11
- package/migrations/1736454437350_addFreePorts.js.map +1 -1
- package/migrations/index.js.map +1 -1
- package/migrations/migrations_index._auto-generated_.js.map +1 -1
- package/package.json +1 -1
- package/tmp-environment.json +4 -4
- package/websql/README.md +24 -24
- package/websql/fesm2022/tnp-helpers.mjs +1472 -143
- package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
- package/websql/lib/base/classes/base-node-modules.d.ts +1 -1
- package/websql/lib/base/linked-project.d.ts +4 -1
- package/websql/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +6 -6
- package/websql/lib/build-info._auto-generated_.d.ts +2 -1
- package/websql/lib/utils.d.ts +36 -20
- package/websql/package.json +1 -1
|
@@ -18,8 +18,6 @@ var ValidatorsGit;
|
|
|
18
18
|
}
|
|
19
19
|
ValidatorsGit.isValidRepoUrl = isValidRepoUrl;
|
|
20
20
|
})(ValidatorsGit || (ValidatorsGit = {}));
|
|
21
|
-
;
|
|
22
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/validators/validators-git.ts
|
|
23
21
|
|
|
24
22
|
var ValidatorsNetwork;
|
|
25
23
|
(function (ValidatorsNetwork) {
|
|
@@ -35,17 +33,14 @@ var ValidatorsNetwork;
|
|
|
35
33
|
}
|
|
36
34
|
ValidatorsNetwork.isValidIp = isValidIp;
|
|
37
35
|
})(ValidatorsNetwork || (ValidatorsNetwork = {}));
|
|
38
|
-
;
|
|
39
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/validators/validators-network.ts
|
|
40
36
|
|
|
41
37
|
var Validators;
|
|
42
38
|
(function (Validators) {
|
|
43
39
|
Validators.git = ValidatorsGit;
|
|
44
40
|
Validators.network = ValidatorsNetwork;
|
|
45
41
|
})(Validators || (Validators = {}));
|
|
46
|
-
;
|
|
47
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/validators/validators.ts
|
|
48
42
|
|
|
43
|
+
//#region @browser
|
|
49
44
|
const componentContextSymbol = Symbol();
|
|
50
45
|
const componentsDestroy$Subjects = {};
|
|
51
46
|
var HelpersAngular;
|
|
@@ -131,14 +126,18 @@ var HelpersAngular;
|
|
|
131
126
|
}
|
|
132
127
|
HelpersAngular.sassFile = sassFile;
|
|
133
128
|
})(HelpersAngular || (HelpersAngular = {}));
|
|
134
|
-
|
|
135
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/helpers/for-browser/angular.helper.ts
|
|
129
|
+
//#endregion
|
|
136
130
|
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region utils npm
|
|
137
133
|
var UtilsNpm;
|
|
138
134
|
(function (UtilsNpm) {
|
|
135
|
+
//#region is special version
|
|
139
136
|
UtilsNpm.isSpecialVersion = (version) => {
|
|
140
137
|
return CoreModels.NpmSpecialVersions.includes(version);
|
|
141
138
|
};
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region clear version
|
|
142
141
|
UtilsNpm.clearVersion = (version, options) => {
|
|
143
142
|
const { removePrefixes, removeSuffix } = options || {};
|
|
144
143
|
if (!version || UtilsNpm.isSpecialVersion(version)) {
|
|
@@ -156,6 +155,8 @@ var UtilsNpm;
|
|
|
156
155
|
}
|
|
157
156
|
return UtilsNpm.fixMajorVerNumber(`${major}.${minor}.${patch}${alphaOrBetaOrRc ? '.' + alphaOrBetaOrRc : ''}`);
|
|
158
157
|
};
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region fix major version number
|
|
159
160
|
UtilsNpm.fixMajorVerNumber = (version) => {
|
|
160
161
|
if (!version || UtilsNpm.isSpecialVersion(version)) {
|
|
161
162
|
return version;
|
|
@@ -174,9 +175,13 @@ var UtilsNpm;
|
|
|
174
175
|
}
|
|
175
176
|
return `${major}.${minor}.${patch}${alphaOrBetaOrRc ? '.' + alphaOrBetaOrRc : ''}`;
|
|
176
177
|
};
|
|
178
|
+
//#endregion
|
|
177
179
|
})(UtilsNpm || (UtilsNpm = {}));
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region utils typescript
|
|
178
182
|
var UtilsTypescript;
|
|
179
183
|
(function (UtilsTypescript) {
|
|
184
|
+
//#region remove region by name
|
|
180
185
|
/**
|
|
181
186
|
* Remove TypeScript region blocks by their name, including nested regions.
|
|
182
187
|
*
|
|
@@ -303,6 +308,9 @@ var UtilsTypescript;
|
|
|
303
308
|
/* */
|
|
304
309
|
return (void 0);
|
|
305
310
|
};
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region extract exports from a TypeScript file
|
|
313
|
+
//#region helper function to check if a node is exported
|
|
306
314
|
const isExported = (node) => {
|
|
307
315
|
/* */
|
|
308
316
|
/* */
|
|
@@ -402,6 +410,9 @@ var UtilsTypescript;
|
|
|
402
410
|
/* */
|
|
403
411
|
return (void 0);
|
|
404
412
|
};
|
|
413
|
+
//#endregion
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region extract class names from ts file or source code
|
|
405
416
|
UtilsTypescript.extractDefaultClassNameFromString = (sourceCode) => {
|
|
406
417
|
/* */
|
|
407
418
|
/* */
|
|
@@ -462,6 +473,8 @@ var UtilsTypescript;
|
|
|
462
473
|
/* */
|
|
463
474
|
return (void 0);
|
|
464
475
|
};
|
|
476
|
+
//#endregion
|
|
477
|
+
//#region format file(s) with prettier
|
|
465
478
|
UtilsTypescript.formatFile = (absPathToFile) => {
|
|
466
479
|
/* */
|
|
467
480
|
/* */
|
|
@@ -479,6 +492,49 @@ var UtilsTypescript;
|
|
|
479
492
|
return (void 0);
|
|
480
493
|
};
|
|
481
494
|
UtilsTypescript.formatAllFilesInsideFolder = (absPathToFolder) => {
|
|
495
|
+
/* */
|
|
496
|
+
/* */
|
|
497
|
+
/* */
|
|
498
|
+
/* */
|
|
499
|
+
/* */
|
|
500
|
+
/* */
|
|
501
|
+
/* */
|
|
502
|
+
/* */
|
|
503
|
+
/* */
|
|
504
|
+
/* */
|
|
505
|
+
/* */
|
|
506
|
+
/* */
|
|
507
|
+
return (void 0);
|
|
508
|
+
};
|
|
509
|
+
//#endregion
|
|
510
|
+
//#region lint file(s) with eslint
|
|
511
|
+
UtilsTypescript.eslintFixFile = (absPathToFile) => {
|
|
512
|
+
/* */
|
|
513
|
+
/* */
|
|
514
|
+
/* */
|
|
515
|
+
/* */
|
|
516
|
+
/* */
|
|
517
|
+
/* */
|
|
518
|
+
/* */
|
|
519
|
+
/* */
|
|
520
|
+
/* */
|
|
521
|
+
/* */
|
|
522
|
+
/* */
|
|
523
|
+
/* */
|
|
524
|
+
/* */
|
|
525
|
+
/* */
|
|
526
|
+
/* */
|
|
527
|
+
return (void 0);
|
|
528
|
+
};
|
|
529
|
+
UtilsTypescript.eslintFixAllFilesInsideFolder = (absPathToFolder) => {
|
|
530
|
+
/* */
|
|
531
|
+
/* */
|
|
532
|
+
/* */
|
|
533
|
+
/* */
|
|
534
|
+
/* */
|
|
535
|
+
/* */
|
|
536
|
+
/* */
|
|
537
|
+
/* */
|
|
482
538
|
/* */
|
|
483
539
|
/* */
|
|
484
540
|
/* */
|
|
@@ -490,6 +546,8 @@ var UtilsTypescript;
|
|
|
490
546
|
/* */
|
|
491
547
|
return (void 0);
|
|
492
548
|
};
|
|
549
|
+
//#endregion
|
|
550
|
+
//#region extract Taon contexts from file
|
|
493
551
|
UtilsTypescript.getTaonContextFromContent = (fileContent) => {
|
|
494
552
|
/* */
|
|
495
553
|
/* */
|
|
@@ -550,6 +608,8 @@ var UtilsTypescript;
|
|
|
550
608
|
/* */
|
|
551
609
|
return (void 0);
|
|
552
610
|
};
|
|
611
|
+
//#endregion
|
|
612
|
+
//#region extract selectors from Angular components class files
|
|
553
613
|
UtilsTypescript.extractAngularComponentSelectors = (fileAbsPath) => {
|
|
554
614
|
/* */
|
|
555
615
|
/* */
|
|
@@ -600,6 +660,8 @@ var UtilsTypescript;
|
|
|
600
660
|
/* */
|
|
601
661
|
return (void 0);
|
|
602
662
|
};
|
|
663
|
+
//#endregion
|
|
664
|
+
//#region wrap one line with comment
|
|
603
665
|
UtilsTypescript.wrapWithComment = (oneLineComment, absDestFilePath) => {
|
|
604
666
|
/* */
|
|
605
667
|
/* */
|
|
@@ -627,6 +689,16 @@ var UtilsTypescript;
|
|
|
627
689
|
/* */
|
|
628
690
|
return (void 0);
|
|
629
691
|
};
|
|
692
|
+
//#endregion
|
|
693
|
+
//#region ser or add exported variable with AST
|
|
694
|
+
// Helper to check if a node has 'export' in its modifiers
|
|
695
|
+
// const hasExportModifier = (
|
|
696
|
+
// modifiers: ts.NodeArray<ts.Modifier> | undefined,
|
|
697
|
+
// ) => {
|
|
698
|
+
// return (
|
|
699
|
+
// !!modifiers && modifiers.some(m => m.kind === SyntaxKind.ExportKeyword)
|
|
700
|
+
// );
|
|
701
|
+
// };
|
|
630
702
|
/**
|
|
631
703
|
* Attempts to set or add an exported const with given name and value.
|
|
632
704
|
*/
|
|
@@ -749,10 +821,34 @@ var UtilsTypescript;
|
|
|
749
821
|
/* */
|
|
750
822
|
return (void 0);
|
|
751
823
|
};
|
|
824
|
+
//#endregion
|
|
825
|
+
//#region recognize imports from file
|
|
826
|
+
//#region helpers / ts import export class
|
|
752
827
|
class TsImportExport {
|
|
828
|
+
//#endregion
|
|
829
|
+
//#region constructor
|
|
830
|
+
constructor(type, embeddedPathToFile, start, end, parenthesisType, importElements = []) {
|
|
831
|
+
this.importElements = [];
|
|
832
|
+
this.type = type;
|
|
833
|
+
this.isIsomorphic = false;
|
|
834
|
+
this.embeddedPathToFile = embeddedPathToFile;
|
|
835
|
+
this.cleanEmbeddedPathToFile =
|
|
836
|
+
this.removeStartEndQuotes(embeddedPathToFile);
|
|
837
|
+
this.embeddedPathToFileResult = embeddedPathToFile;
|
|
838
|
+
this.startRow = start.line + 1; // TypeScript lines are zero-based
|
|
839
|
+
this.startCol = start.character + 1;
|
|
840
|
+
this.endRow = end.line + 1;
|
|
841
|
+
this.endCol = end.character + 1;
|
|
842
|
+
this.parenthesisType = parenthesisType;
|
|
843
|
+
this.importElements = importElements;
|
|
844
|
+
}
|
|
845
|
+
//#endregion
|
|
846
|
+
//#region remove quotes
|
|
753
847
|
removeStartEndQuotes(str) {
|
|
754
848
|
return str.replace(/^['"`]/, '').replace(/['"`]$/, '');
|
|
755
849
|
}
|
|
850
|
+
//#endregion
|
|
851
|
+
//#region get string part
|
|
756
852
|
/**
|
|
757
853
|
* it will extract part of the file content
|
|
758
854
|
* that is between startRow, startCol and endRow, endCol
|
|
@@ -760,8 +856,10 @@ var UtilsTypescript;
|
|
|
760
856
|
*/
|
|
761
857
|
getStringPartFrom(wholeContentOfFile) {
|
|
762
858
|
const lines = wholeContentOfFile.split('\n');
|
|
859
|
+
// Convert 1-based row indices to 0-based
|
|
763
860
|
const startRowIndex = this.startRow - 1;
|
|
764
861
|
const endRowIndex = this.endRow - 1;
|
|
862
|
+
// Ensure indices are within bounds
|
|
765
863
|
if (startRowIndex >= lines.length || endRowIndex >= lines.length) {
|
|
766
864
|
throw new Error('Row index out of bounds.');
|
|
767
865
|
}
|
|
@@ -769,44 +867,38 @@ var UtilsTypescript;
|
|
|
769
867
|
for (let i = startRowIndex; i <= endRowIndex; i++) {
|
|
770
868
|
let line = lines[i];
|
|
771
869
|
if (i === startRowIndex && i === endRowIndex) {
|
|
870
|
+
// Same row: extract from startCol to endCol
|
|
772
871
|
extractedLines.push(line.substring(this.startCol - 1, this.endCol));
|
|
773
872
|
}
|
|
774
873
|
else if (i === startRowIndex) {
|
|
874
|
+
// First row: extract from startCol to end
|
|
775
875
|
extractedLines.push(line.substring(this.startCol - 1));
|
|
776
876
|
}
|
|
777
877
|
else if (i === endRowIndex) {
|
|
878
|
+
// Last row: extract from beginning to endCol
|
|
778
879
|
extractedLines.push(line.substring(0, this.endCol));
|
|
779
880
|
}
|
|
780
881
|
else {
|
|
882
|
+
// Whole row in between
|
|
781
883
|
extractedLines.push(line);
|
|
782
884
|
}
|
|
783
885
|
}
|
|
784
886
|
return extractedLines.join('\n');
|
|
785
887
|
}
|
|
888
|
+
//#endregion
|
|
889
|
+
//#region wrap in current parenthesis
|
|
786
890
|
wrapInParenthesis(str) {
|
|
787
891
|
return this.parenthesisType === 'single'
|
|
788
892
|
? `'${str}'`
|
|
789
893
|
: this.parenthesisType === 'double'
|
|
790
894
|
? `"${str}"`
|
|
791
895
|
: `\`${str}\``;
|
|
792
|
-
|
|
793
|
-
constructor(type, embeddedPathToFile, start, end, parenthesisType, importElements = []) {
|
|
794
|
-
this.importElements = [];
|
|
795
|
-
this.type = type;
|
|
796
|
-
this.isIsomorphic = false;
|
|
797
|
-
this.embeddedPathToFile = embeddedPathToFile;
|
|
798
|
-
this.cleanEmbeddedPathToFile =
|
|
799
|
-
this.removeStartEndQuotes(embeddedPathToFile);
|
|
800
|
-
this.embeddedPathToFileResult = embeddedPathToFile;
|
|
801
|
-
this.startRow = start.line + 1; // TypeScript lines are zero-based
|
|
802
|
-
this.startCol = start.character + 1;
|
|
803
|
-
this.endRow = end.line + 1;
|
|
804
|
-
this.endCol = end.character + 1;
|
|
805
|
-
this.parenthesisType = parenthesisType;
|
|
806
|
-
this.importElements = importElements;
|
|
896
|
+
//#endregion
|
|
807
897
|
}
|
|
808
898
|
}
|
|
809
899
|
UtilsTypescript.TsImportExport = TsImportExport;
|
|
900
|
+
//#endregion
|
|
901
|
+
//#region helpers / get quote type
|
|
810
902
|
const getQuoteType = (text) => {
|
|
811
903
|
if (text.startsWith('`'))
|
|
812
904
|
return 'tics';
|
|
@@ -814,15 +906,18 @@ var UtilsTypescript;
|
|
|
814
906
|
return 'single';
|
|
815
907
|
return 'double';
|
|
816
908
|
};
|
|
909
|
+
//#endregion
|
|
817
910
|
const extractImportExportElements = (node) => {
|
|
818
911
|
const elements = [];
|
|
819
912
|
if (isImportDeclaration(node) && node.importClause) {
|
|
913
|
+
// Check if there are named imports inside { }
|
|
820
914
|
if (node.importClause.namedBindings &&
|
|
821
915
|
isNamedImports(node.importClause.namedBindings)) {
|
|
822
916
|
elements.push(...node.importClause.namedBindings.elements.map(el => el.name.text));
|
|
823
917
|
}
|
|
824
918
|
}
|
|
825
919
|
else if (isExportDeclaration(node) && node.exportClause) {
|
|
920
|
+
// Check if there are named exports inside { }
|
|
826
921
|
if (isNamedExports(node.exportClause)) {
|
|
827
922
|
elements.push(...node.exportClause.elements.map(el => el.name.text));
|
|
828
923
|
}
|
|
@@ -922,9 +1017,258 @@ var UtilsTypescript;
|
|
|
922
1017
|
/* */
|
|
923
1018
|
return (void 0);
|
|
924
1019
|
};
|
|
1020
|
+
//#endregion
|
|
1021
|
+
//#region fix standalone ng 19
|
|
1022
|
+
/**
|
|
1023
|
+
* Transition methods ng18 => ng19
|
|
1024
|
+
* Remove standalone:true from component decorator
|
|
1025
|
+
* and add standalone: false if not exists
|
|
1026
|
+
*/
|
|
1027
|
+
function transformComponentStandaloneOption(sourceText) {
|
|
1028
|
+
/* */
|
|
1029
|
+
/* */
|
|
1030
|
+
/* */
|
|
1031
|
+
/* */
|
|
1032
|
+
/* */
|
|
1033
|
+
/* */
|
|
1034
|
+
/* */
|
|
1035
|
+
/* */
|
|
1036
|
+
/* */
|
|
1037
|
+
/* */
|
|
1038
|
+
/* */
|
|
1039
|
+
/* */
|
|
1040
|
+
/* */
|
|
1041
|
+
/* */
|
|
1042
|
+
/* */
|
|
1043
|
+
/* */
|
|
1044
|
+
/* */
|
|
1045
|
+
/* */
|
|
1046
|
+
/* */
|
|
1047
|
+
/* */
|
|
1048
|
+
/* */
|
|
1049
|
+
/* */
|
|
1050
|
+
/* */
|
|
1051
|
+
/* */
|
|
1052
|
+
/* */
|
|
1053
|
+
/* */
|
|
1054
|
+
/* */
|
|
1055
|
+
/* */
|
|
1056
|
+
/* */
|
|
1057
|
+
/* */
|
|
1058
|
+
/* */
|
|
1059
|
+
/* */
|
|
1060
|
+
/* */
|
|
1061
|
+
/* */
|
|
1062
|
+
/* */
|
|
1063
|
+
/* */
|
|
1064
|
+
/* */
|
|
1065
|
+
/* */
|
|
1066
|
+
/* */
|
|
1067
|
+
/* */
|
|
1068
|
+
/* */
|
|
1069
|
+
/* */
|
|
1070
|
+
/* */
|
|
1071
|
+
/* */
|
|
1072
|
+
/* */
|
|
1073
|
+
/* */
|
|
1074
|
+
/* */
|
|
1075
|
+
/* */
|
|
1076
|
+
/* */
|
|
1077
|
+
/* */
|
|
1078
|
+
/* */
|
|
1079
|
+
/* */
|
|
1080
|
+
/* */
|
|
1081
|
+
/* */
|
|
1082
|
+
/* */
|
|
1083
|
+
/* */
|
|
1084
|
+
/* */
|
|
1085
|
+
/* */
|
|
1086
|
+
/* */
|
|
1087
|
+
/* */
|
|
1088
|
+
/* */
|
|
1089
|
+
/* */
|
|
1090
|
+
/* */
|
|
1091
|
+
/* */
|
|
1092
|
+
/* */
|
|
1093
|
+
/* */
|
|
1094
|
+
/* */
|
|
1095
|
+
/* */
|
|
1096
|
+
/* */
|
|
1097
|
+
/* */
|
|
1098
|
+
/* */
|
|
1099
|
+
/* */
|
|
1100
|
+
/* */
|
|
1101
|
+
/* */
|
|
1102
|
+
/* */
|
|
1103
|
+
/* */
|
|
1104
|
+
/* */
|
|
1105
|
+
/* */
|
|
1106
|
+
/* */
|
|
1107
|
+
/* */
|
|
1108
|
+
/* */
|
|
1109
|
+
return (void 0);
|
|
1110
|
+
}
|
|
1111
|
+
UtilsTypescript.transformComponentStandaloneOption = transformComponentStandaloneOption;
|
|
1112
|
+
//#endregion
|
|
1113
|
+
//#region escape @ in html text
|
|
1114
|
+
const escapeAtInHtmlText = (fileContent) => {
|
|
1115
|
+
return fileContent.replace(/>([^<@]*?)@([^<]*)</g, (_match, before, after) => {
|
|
1116
|
+
return `>${before}@${after}<`;
|
|
1117
|
+
});
|
|
1118
|
+
};
|
|
1119
|
+
UtilsTypescript.fixHtmlTemplatesInDir = (directoryPath) => {
|
|
1120
|
+
/* */
|
|
1121
|
+
/* */
|
|
1122
|
+
/* */
|
|
1123
|
+
/* */
|
|
1124
|
+
/* */
|
|
1125
|
+
/* */
|
|
1126
|
+
/* */
|
|
1127
|
+
/* */
|
|
1128
|
+
/* */
|
|
1129
|
+
/* */
|
|
1130
|
+
/* */
|
|
1131
|
+
/* */
|
|
1132
|
+
/* */
|
|
1133
|
+
/* */
|
|
1134
|
+
/* */
|
|
1135
|
+
/* */
|
|
1136
|
+
/* */
|
|
1137
|
+
/* */
|
|
1138
|
+
/* */
|
|
1139
|
+
/* */
|
|
1140
|
+
return (void 0);
|
|
1141
|
+
};
|
|
1142
|
+
//#endregion
|
|
1143
|
+
//#region remove tagged imports/exports
|
|
1144
|
+
function removeTaggedImportExport(tsFileContent, tags) {
|
|
1145
|
+
/* */
|
|
1146
|
+
/* */
|
|
1147
|
+
/* */
|
|
1148
|
+
/* */
|
|
1149
|
+
/* */
|
|
1150
|
+
/* */
|
|
1151
|
+
/* */
|
|
1152
|
+
/* */
|
|
1153
|
+
/* */
|
|
1154
|
+
/* */
|
|
1155
|
+
/* */
|
|
1156
|
+
/* */
|
|
1157
|
+
/* */
|
|
1158
|
+
/* */
|
|
1159
|
+
/* */
|
|
1160
|
+
/* */
|
|
1161
|
+
/* */
|
|
1162
|
+
/* */
|
|
1163
|
+
/* */
|
|
1164
|
+
/* */
|
|
1165
|
+
/* */
|
|
1166
|
+
/* */
|
|
1167
|
+
/* */
|
|
1168
|
+
/* */
|
|
1169
|
+
/* */
|
|
1170
|
+
/* */
|
|
1171
|
+
/* */
|
|
1172
|
+
/* */
|
|
1173
|
+
/* */
|
|
1174
|
+
/* */
|
|
1175
|
+
/* */
|
|
1176
|
+
/* */
|
|
1177
|
+
/* */
|
|
1178
|
+
/* */
|
|
1179
|
+
/* */
|
|
1180
|
+
/* */
|
|
1181
|
+
/* */
|
|
1182
|
+
/* */
|
|
1183
|
+
/* */
|
|
1184
|
+
/* */
|
|
1185
|
+
/* */
|
|
1186
|
+
/* */
|
|
1187
|
+
/* */
|
|
1188
|
+
/* */
|
|
1189
|
+
/* */
|
|
1190
|
+
/* */
|
|
1191
|
+
/* */
|
|
1192
|
+
/* */
|
|
1193
|
+
/* */
|
|
1194
|
+
/* */
|
|
1195
|
+
/* */
|
|
1196
|
+
/* */
|
|
1197
|
+
/* */
|
|
1198
|
+
/* */
|
|
1199
|
+
/* */
|
|
1200
|
+
/* */
|
|
1201
|
+
/* */
|
|
1202
|
+
/* */
|
|
1203
|
+
return (void 0);
|
|
1204
|
+
}
|
|
1205
|
+
UtilsTypescript.removeTaggedImportExport = removeTaggedImportExport;
|
|
1206
|
+
//#endregion
|
|
1207
|
+
//#region wrap first imports in region
|
|
1208
|
+
UtilsTypescript.wrapFirstImportsInImportsRegion = (fileContent) => {
|
|
1209
|
+
/* */
|
|
1210
|
+
/* */
|
|
1211
|
+
/* */
|
|
1212
|
+
/* */
|
|
1213
|
+
/* */
|
|
1214
|
+
/* */
|
|
1215
|
+
/* */
|
|
1216
|
+
/* */
|
|
1217
|
+
/* */
|
|
1218
|
+
/* */
|
|
1219
|
+
/* */
|
|
1220
|
+
/* */
|
|
1221
|
+
/* */
|
|
1222
|
+
/* */
|
|
1223
|
+
/* */
|
|
1224
|
+
/* */
|
|
1225
|
+
/* */
|
|
1226
|
+
/* */
|
|
1227
|
+
/* */
|
|
1228
|
+
/* */
|
|
1229
|
+
/* */
|
|
1230
|
+
/* */
|
|
1231
|
+
/* */
|
|
1232
|
+
/* */
|
|
1233
|
+
/* */
|
|
1234
|
+
/* */
|
|
1235
|
+
/* */
|
|
1236
|
+
/* */
|
|
1237
|
+
/* */
|
|
1238
|
+
/* */
|
|
1239
|
+
/* */
|
|
1240
|
+
/* */
|
|
1241
|
+
/* */
|
|
1242
|
+
/* */
|
|
1243
|
+
/* */
|
|
1244
|
+
/* */
|
|
1245
|
+
/* */
|
|
1246
|
+
/* */
|
|
1247
|
+
/* */
|
|
1248
|
+
/* */
|
|
1249
|
+
/* */
|
|
1250
|
+
/* */
|
|
1251
|
+
/* */
|
|
1252
|
+
/* */
|
|
1253
|
+
/* */
|
|
1254
|
+
/* */
|
|
1255
|
+
/* */
|
|
1256
|
+
/* */
|
|
1257
|
+
/* */
|
|
1258
|
+
/* */
|
|
1259
|
+
/* */
|
|
1260
|
+
/* */
|
|
1261
|
+
/* */
|
|
1262
|
+
/* */
|
|
1263
|
+
return (void 0);
|
|
1264
|
+
};
|
|
1265
|
+
//#endregion
|
|
925
1266
|
})(UtilsTypescript || (UtilsTypescript = {}));
|
|
1267
|
+
//#endregion
|
|
1268
|
+
//#region utils http
|
|
926
1269
|
var UtilsHttp;
|
|
927
1270
|
(function (UtilsHttp) {
|
|
1271
|
+
//#region utils http / start http server
|
|
928
1272
|
UtilsHttp.startHttpServer = async (cwd, port) => {
|
|
929
1273
|
/* */
|
|
930
1274
|
/* */
|
|
@@ -955,7 +1299,10 @@ var UtilsHttp;
|
|
|
955
1299
|
/* */
|
|
956
1300
|
return (void 0);
|
|
957
1301
|
};
|
|
1302
|
+
//#endregion
|
|
958
1303
|
})(UtilsHttp || (UtilsHttp = {}));
|
|
1304
|
+
//#endregion
|
|
1305
|
+
//#region utils md
|
|
959
1306
|
var UtilsMd;
|
|
960
1307
|
(function (UtilsMd) {
|
|
961
1308
|
/**
|
|
@@ -1049,8 +1396,11 @@ var UtilsMd;
|
|
|
1049
1396
|
return (void 0);
|
|
1050
1397
|
};
|
|
1051
1398
|
})(UtilsMd || (UtilsMd = {}));
|
|
1399
|
+
//#endregion
|
|
1400
|
+
//#region utils quickfixes
|
|
1052
1401
|
var UtilsQuickFixes;
|
|
1053
1402
|
(function (UtilsQuickFixes) {
|
|
1403
|
+
//#region replace sql-wasm.js faulty code content
|
|
1054
1404
|
/**
|
|
1055
1405
|
*
|
|
1056
1406
|
* @param node_modules/sql.js/dist/sql-wasm.js
|
|
@@ -1072,17 +1422,20 @@ var UtilsQuickFixes;
|
|
|
1072
1422
|
/* */
|
|
1073
1423
|
return (void 0);
|
|
1074
1424
|
};
|
|
1425
|
+
//#endregion
|
|
1075
1426
|
/**
|
|
1076
1427
|
* for some reason electron is being bundled - and it is not needed for cli
|
|
1077
1428
|
*/
|
|
1078
1429
|
UtilsQuickFixes.replaceElectronWithNothing = (jsContent) => {
|
|
1430
|
+
/* */
|
|
1431
|
+
/* */
|
|
1432
|
+
/* */
|
|
1079
1433
|
/* */
|
|
1080
1434
|
/* */
|
|
1081
1435
|
return (void 0);
|
|
1082
1436
|
};
|
|
1083
1437
|
})(UtilsQuickFixes || (UtilsQuickFixes = {}));
|
|
1084
|
-
|
|
1085
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/utils.ts
|
|
1438
|
+
//#endregion
|
|
1086
1439
|
|
|
1087
1440
|
class HelpersArrayObj {
|
|
1088
1441
|
from(s) {
|
|
@@ -1144,10 +1497,13 @@ class HelpersArrayObj {
|
|
|
1144
1497
|
const targetIndex = newArray.findIndex(item => item === target);
|
|
1145
1498
|
const beforeIndex = newArray.findIndex(item => item === before);
|
|
1146
1499
|
if (targetIndex === -1 || beforeIndex === -1) {
|
|
1500
|
+
// Handle the case when either the target or before object is not found in the array
|
|
1147
1501
|
console.error('Target or Before object not found in the array');
|
|
1148
1502
|
return newArray;
|
|
1149
1503
|
}
|
|
1504
|
+
// Remove the target object from its current position
|
|
1150
1505
|
newArray.splice(targetIndex, 1);
|
|
1506
|
+
// Insert the target object before the before object
|
|
1151
1507
|
newArray.splice(beforeIndex, 0, target);
|
|
1152
1508
|
return newArray;
|
|
1153
1509
|
}
|
|
@@ -1156,10 +1512,13 @@ class HelpersArrayObj {
|
|
|
1156
1512
|
const targetIndex = newArray.findIndex(item => item === target);
|
|
1157
1513
|
const afterIndex = newArray.findIndex(item => item === after);
|
|
1158
1514
|
if (targetIndex === -1 || afterIndex === -1) {
|
|
1515
|
+
// Handle the case when either the target or after object is not found in the array
|
|
1159
1516
|
console.error('Target or After object not found in the array');
|
|
1160
1517
|
return newArray;
|
|
1161
1518
|
}
|
|
1519
|
+
// Remove the target object from its current position
|
|
1162
1520
|
newArray.splice(targetIndex, 1);
|
|
1521
|
+
// Insert the target object after the after object
|
|
1163
1522
|
newArray.splice(afterIndex + 1, 0, target);
|
|
1164
1523
|
return newArray;
|
|
1165
1524
|
}
|
|
@@ -1179,6 +1538,7 @@ class HelpersArrayObj {
|
|
|
1179
1538
|
* Fuzzy search
|
|
1180
1539
|
*/
|
|
1181
1540
|
fuzzy(query, list, valueFn) {
|
|
1541
|
+
// console.log('fuzzy search', query, list, valueFn)
|
|
1182
1542
|
const resultsFuzzy = fuzzy.filter(query, list.map(k => (valueFn ? valueFn(k) : k)));
|
|
1183
1543
|
const resultsFuzzyKebab = fuzzy.filter(_.kebabCase(query), list.map(k => _.kebabCase((valueFn ? valueFn(k) : k))));
|
|
1184
1544
|
const matches = resultsFuzzy.map(el => el.string);
|
|
@@ -1197,8 +1557,6 @@ class HelpersArrayObj {
|
|
|
1197
1557
|
return { matches, results };
|
|
1198
1558
|
}
|
|
1199
1559
|
}
|
|
1200
|
-
;
|
|
1201
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/helpers/helpers-array-obj.ts
|
|
1202
1560
|
|
|
1203
1561
|
class HelpersStringsRegexes {
|
|
1204
1562
|
escapeStringForRegEx(s) {
|
|
@@ -1247,8 +1605,6 @@ class HelpersStringsRegexes {
|
|
|
1247
1605
|
};
|
|
1248
1606
|
}
|
|
1249
1607
|
}
|
|
1250
|
-
;
|
|
1251
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/helpers/helpers-strings-regexes.ts
|
|
1252
1608
|
|
|
1253
1609
|
class HelpersStrings {
|
|
1254
1610
|
/**
|
|
@@ -1289,6 +1645,7 @@ class HelpersStrings {
|
|
|
1289
1645
|
* @returns number value
|
|
1290
1646
|
*/
|
|
1291
1647
|
numValue(pixelsCss) {
|
|
1648
|
+
// tslint:disable-next-line:radix
|
|
1292
1649
|
return parseInt(pixelsCss.replace('px', ''));
|
|
1293
1650
|
}
|
|
1294
1651
|
/**
|
|
@@ -1385,9 +1742,11 @@ class HelpersStrings {
|
|
|
1385
1742
|
'you',
|
|
1386
1743
|
'wood'
|
|
1387
1744
|
];
|
|
1745
|
+
// save some time in the case that singular and plural are the same
|
|
1388
1746
|
if (uncountable.indexOf(word.toLowerCase()) >= 0) {
|
|
1389
1747
|
return word;
|
|
1390
1748
|
}
|
|
1749
|
+
// check for irregular forms
|
|
1391
1750
|
for (const w in irregular) {
|
|
1392
1751
|
const pattern = new RegExp(`${w}$`, 'i');
|
|
1393
1752
|
const replace = irregular[w];
|
|
@@ -1395,6 +1754,7 @@ class HelpersStrings {
|
|
|
1395
1754
|
return word.replace(pattern, replace);
|
|
1396
1755
|
}
|
|
1397
1756
|
}
|
|
1757
|
+
// check for matches using regular expressions
|
|
1398
1758
|
for (const reg in plural) {
|
|
1399
1759
|
const pattern = new RegExp(reg, 'i');
|
|
1400
1760
|
if (pattern.test(word)) {
|
|
@@ -1484,9 +1844,11 @@ class HelpersStrings {
|
|
|
1484
1844
|
'you',
|
|
1485
1845
|
'wood'
|
|
1486
1846
|
];
|
|
1847
|
+
// save some time in the case that singular and plural are the same
|
|
1487
1848
|
if (uncountable.indexOf(word.toLowerCase()) >= 0) {
|
|
1488
1849
|
return word;
|
|
1489
1850
|
}
|
|
1851
|
+
// check for irregular forms
|
|
1490
1852
|
for (const w in irregular) {
|
|
1491
1853
|
const pattern = new RegExp(`${irregular[w]}$`, 'i');
|
|
1492
1854
|
const replace = w;
|
|
@@ -1494,6 +1856,7 @@ class HelpersStrings {
|
|
|
1494
1856
|
return word.replace(pattern, replace);
|
|
1495
1857
|
}
|
|
1496
1858
|
}
|
|
1859
|
+
// check for matches using regular expressions
|
|
1497
1860
|
for (const reg in singular) {
|
|
1498
1861
|
const pattern = new RegExp(reg, 'i');
|
|
1499
1862
|
if (pattern.test(word)) {
|
|
@@ -1503,10 +1866,10 @@ class HelpersStrings {
|
|
|
1503
1866
|
return word;
|
|
1504
1867
|
}
|
|
1505
1868
|
}
|
|
1506
|
-
;
|
|
1507
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/helpers/helpers-strings.ts
|
|
1508
1869
|
|
|
1870
|
+
//#endregion
|
|
1509
1871
|
class HelpersProcess {
|
|
1872
|
+
//#region restart application itself
|
|
1510
1873
|
async restartApplicationItself(nameOfApp) {
|
|
1511
1874
|
/* */
|
|
1512
1875
|
/* */
|
|
@@ -1524,6 +1887,8 @@ class HelpersProcess {
|
|
|
1524
1887
|
/* */
|
|
1525
1888
|
return (void 0);
|
|
1526
1889
|
}
|
|
1890
|
+
//#endregion
|
|
1891
|
+
//#region os is macos
|
|
1527
1892
|
osIsMacOs(versino) {
|
|
1528
1893
|
/* */
|
|
1529
1894
|
/* */
|
|
@@ -1535,6 +1900,8 @@ class HelpersProcess {
|
|
|
1535
1900
|
/* */
|
|
1536
1901
|
return (void 0);
|
|
1537
1902
|
}
|
|
1903
|
+
//#endregion
|
|
1904
|
+
//#region generate file wrap
|
|
1538
1905
|
generatedFileWrap(content) {
|
|
1539
1906
|
/* */
|
|
1540
1907
|
/* */
|
|
@@ -1543,6 +1910,8 @@ class HelpersProcess {
|
|
|
1543
1910
|
/* */
|
|
1544
1911
|
return (void 0);
|
|
1545
1912
|
}
|
|
1913
|
+
//#endregion
|
|
1914
|
+
//#region change cwd wrapper
|
|
1546
1915
|
async changeCwdWrapper(dir, functionToExecure, logLevel = Level.__NOTHING) {
|
|
1547
1916
|
/* */
|
|
1548
1917
|
/* */
|
|
@@ -1553,6 +1922,8 @@ class HelpersProcess {
|
|
|
1553
1922
|
/* */
|
|
1554
1923
|
return (void 0);
|
|
1555
1924
|
}
|
|
1925
|
+
//#endregion
|
|
1926
|
+
//#region change cwd
|
|
1556
1927
|
changeCwd(dir) {
|
|
1557
1928
|
/* */
|
|
1558
1929
|
/* */
|
|
@@ -1561,6 +1932,8 @@ class HelpersProcess {
|
|
|
1561
1932
|
/* */
|
|
1562
1933
|
return (void 0);
|
|
1563
1934
|
}
|
|
1935
|
+
//#endregion
|
|
1936
|
+
//#region go to dir
|
|
1564
1937
|
/**
|
|
1565
1938
|
* // TODO refactor this
|
|
1566
1939
|
* @deprecated
|
|
@@ -1594,6 +1967,8 @@ class HelpersProcess {
|
|
|
1594
1967
|
/* */
|
|
1595
1968
|
return (void 0);
|
|
1596
1969
|
}
|
|
1970
|
+
//#endregion
|
|
1971
|
+
//#region press key or wait
|
|
1597
1972
|
async pressKeyOrWait(message = 'Press enter try again', printWaitMessages = 0) {
|
|
1598
1973
|
/* */
|
|
1599
1974
|
/* */
|
|
@@ -1610,6 +1985,8 @@ class HelpersProcess {
|
|
|
1610
1985
|
/* */
|
|
1611
1986
|
return (void 0);
|
|
1612
1987
|
}
|
|
1988
|
+
//#endregion
|
|
1989
|
+
//#region press key and continue
|
|
1613
1990
|
/**
|
|
1614
1991
|
* @deprecated use UtilsTerminal.pressAnyKey
|
|
1615
1992
|
*/
|
|
@@ -1618,6 +1995,8 @@ class HelpersProcess {
|
|
|
1618
1995
|
/* */
|
|
1619
1996
|
return (void 0);
|
|
1620
1997
|
}
|
|
1998
|
+
//#endregion
|
|
1999
|
+
//#region list
|
|
1621
2000
|
/**
|
|
1622
2001
|
* @deprecated use UtilsTerminal.multiselect
|
|
1623
2002
|
*/
|
|
@@ -1646,6 +2025,8 @@ class HelpersProcess {
|
|
|
1646
2025
|
/* */
|
|
1647
2026
|
return (void 0);
|
|
1648
2027
|
}
|
|
2028
|
+
//#endregion
|
|
2029
|
+
//#region multiple choices ask
|
|
1649
2030
|
/**
|
|
1650
2031
|
* @deprecated use UtilsTerminal.multiselect
|
|
1651
2032
|
*/
|
|
@@ -1659,6 +2040,8 @@ class HelpersProcess {
|
|
|
1659
2040
|
/* */
|
|
1660
2041
|
return (void 0);
|
|
1661
2042
|
}
|
|
2043
|
+
//#endregion
|
|
2044
|
+
//#region input
|
|
1662
2045
|
/**
|
|
1663
2046
|
* @deprecated use UtilsTerminal.input
|
|
1664
2047
|
*/
|
|
@@ -1667,6 +2050,8 @@ class HelpersProcess {
|
|
|
1667
2050
|
/* */
|
|
1668
2051
|
return (void 0);
|
|
1669
2052
|
}
|
|
2053
|
+
//#endregion
|
|
2054
|
+
//#region select
|
|
1670
2055
|
/**
|
|
1671
2056
|
* @deprecated use UtilsTerminal.multiselect
|
|
1672
2057
|
* TODO wierd problem when pressing key like "i"
|
|
@@ -1705,6 +2090,8 @@ class HelpersProcess {
|
|
|
1705
2090
|
/* */
|
|
1706
2091
|
return (void 0);
|
|
1707
2092
|
}
|
|
2093
|
+
//#endregion
|
|
2094
|
+
//#region autocomplete ask
|
|
1708
2095
|
async autocompleteAsk(question, choices, pageSize = 10) {
|
|
1709
2096
|
/* */
|
|
1710
2097
|
/* */
|
|
@@ -1741,6 +2128,8 @@ class HelpersProcess {
|
|
|
1741
2128
|
/* */
|
|
1742
2129
|
return (void 0);
|
|
1743
2130
|
}
|
|
2131
|
+
//#endregion
|
|
2132
|
+
//#region get working dir of process
|
|
1744
2133
|
getWorkingDirOfProcess(PID) {
|
|
1745
2134
|
/* */
|
|
1746
2135
|
/* */
|
|
@@ -1754,6 +2143,8 @@ class HelpersProcess {
|
|
|
1754
2143
|
/* */
|
|
1755
2144
|
return (void 0);
|
|
1756
2145
|
}
|
|
2146
|
+
//#endregion
|
|
2147
|
+
//#region output to vscode
|
|
1757
2148
|
outputToVScode(data, disableEncode = false) {
|
|
1758
2149
|
/* */
|
|
1759
2150
|
/* */
|
|
@@ -1766,6 +2157,8 @@ class HelpersProcess {
|
|
|
1766
2157
|
/* */
|
|
1767
2158
|
return (void 0);
|
|
1768
2159
|
}
|
|
2160
|
+
//#endregion
|
|
2161
|
+
//#region action wrapper
|
|
1769
2162
|
async actionWrapper(fn, taskName = 'Task') {
|
|
1770
2163
|
/* */
|
|
1771
2164
|
/* */
|
|
@@ -1778,11 +2171,15 @@ class HelpersProcess {
|
|
|
1778
2171
|
/* */
|
|
1779
2172
|
return (void 0);
|
|
1780
2173
|
}
|
|
2174
|
+
//#endregion
|
|
2175
|
+
//#region terminal line
|
|
1781
2176
|
terminalLine() {
|
|
1782
2177
|
/* */
|
|
1783
2178
|
/* */
|
|
1784
2179
|
return (void 0);
|
|
1785
2180
|
}
|
|
2181
|
+
//#endregion
|
|
2182
|
+
//#region kill all node except current process
|
|
1786
2183
|
/**
|
|
1787
2184
|
* THIS DEOS NOT WORK !
|
|
1788
2185
|
* ! TOOD FIX THIS
|
|
@@ -1873,6 +2270,8 @@ class HelpersProcess {
|
|
|
1873
2270
|
/* */
|
|
1874
2271
|
return (void 0);
|
|
1875
2272
|
}
|
|
2273
|
+
//#endregion
|
|
2274
|
+
//#region kill all node
|
|
1876
2275
|
killAllNode() {
|
|
1877
2276
|
/* */
|
|
1878
2277
|
/* */
|
|
@@ -1895,6 +2294,8 @@ class HelpersProcess {
|
|
|
1895
2294
|
/* */
|
|
1896
2295
|
return (void 0);
|
|
1897
2296
|
}
|
|
2297
|
+
//#endregion
|
|
2298
|
+
//#region format path
|
|
1898
2299
|
formatPath(pathToFileOrFolder) {
|
|
1899
2300
|
/* */
|
|
1900
2301
|
/* */
|
|
@@ -1937,6 +2338,8 @@ class HelpersProcess {
|
|
|
1937
2338
|
/* */
|
|
1938
2339
|
return (void 0);
|
|
1939
2340
|
}
|
|
2341
|
+
//#endregion
|
|
2342
|
+
//#region prepare wathc command
|
|
1940
2343
|
/**
|
|
1941
2344
|
* @deprecated
|
|
1942
2345
|
*/
|
|
@@ -1945,6 +2348,8 @@ class HelpersProcess {
|
|
|
1945
2348
|
/* */
|
|
1946
2349
|
return (void 0);
|
|
1947
2350
|
}
|
|
2351
|
+
//#endregion
|
|
2352
|
+
//#region get string from
|
|
1948
2353
|
/**
|
|
1949
2354
|
* @deprecated
|
|
1950
2355
|
*/
|
|
@@ -1961,6 +2366,8 @@ class HelpersProcess {
|
|
|
1961
2366
|
/* */
|
|
1962
2367
|
return (void 0);
|
|
1963
2368
|
}
|
|
2369
|
+
//#endregion
|
|
2370
|
+
//#region wait for message in stdout
|
|
1964
2371
|
async waitForMessegeInStdout(proc, message) {
|
|
1965
2372
|
/* */
|
|
1966
2373
|
/* */
|
|
@@ -1995,8 +2402,6 @@ class HelpersProcess {
|
|
|
1995
2402
|
return (void 0);
|
|
1996
2403
|
}
|
|
1997
2404
|
}
|
|
1998
|
-
;
|
|
1999
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/helpers/for-backend/helpers-process.ts
|
|
2000
2405
|
|
|
2001
2406
|
class HelpersFileFolders {
|
|
2002
2407
|
/**
|
|
@@ -2082,6 +2487,11 @@ class HelpersFileFolders {
|
|
|
2082
2487
|
/* */
|
|
2083
2488
|
return (void 0);
|
|
2084
2489
|
}
|
|
2490
|
+
// renameFolder(from: string, to: string, cwd?: string) {
|
|
2491
|
+
// // const command = `mv ${from} ${to}`;
|
|
2492
|
+
// const command = `renamer --find ${from} --replace ${to} *`;
|
|
2493
|
+
// Helpers.run(command, { cwd }).sync()
|
|
2494
|
+
// }
|
|
2085
2495
|
/**
|
|
2086
2496
|
* @deprecated
|
|
2087
2497
|
*/
|
|
@@ -2135,6 +2545,53 @@ class HelpersFileFolders {
|
|
|
2135
2545
|
/* */
|
|
2136
2546
|
return (void 0);
|
|
2137
2547
|
}
|
|
2548
|
+
// createMultiplatformLink(target: string, link: string) {
|
|
2549
|
+
// if (this.isPlainFileOrFolder(link)) {
|
|
2550
|
+
// link = path.join(process.cwd(), link);
|
|
2551
|
+
// }
|
|
2552
|
+
// let command: string;
|
|
2553
|
+
// if (os.platform() === 'win32') {
|
|
2554
|
+
// if (target.startsWith('./')) {
|
|
2555
|
+
// target = path.win32.normalize(path.join(process.cwd(), path.basename(target)))
|
|
2556
|
+
// } else {
|
|
2557
|
+
// if (target === '.' || target === './') {
|
|
2558
|
+
// target = path.win32.normalize(path.join(process.cwd(), path.basename(link)))
|
|
2559
|
+
// } else {
|
|
2560
|
+
// target = path.win32.normalize(path.join(target, path.basename(link)))
|
|
2561
|
+
// }
|
|
2562
|
+
// }
|
|
2563
|
+
// if (fse.existsSync(target)) {
|
|
2564
|
+
// fse.unlinkSync(target);
|
|
2565
|
+
// }
|
|
2566
|
+
// target = path.win32.normalize(target)
|
|
2567
|
+
// if (link === '.' || link === './') {
|
|
2568
|
+
// link = process.cwd()
|
|
2569
|
+
// }
|
|
2570
|
+
// link = path.win32.normalize(link);
|
|
2571
|
+
// // if (path.resolve(target) === path.resolve(link)) { // TODO
|
|
2572
|
+
// // Helpers.warn(`[createMultiplatformLink][win32] Trying to link same location`);
|
|
2573
|
+
// // return;
|
|
2574
|
+
// // }
|
|
2575
|
+
// command = "mklink \/D "
|
|
2576
|
+
// + target
|
|
2577
|
+
// + " "
|
|
2578
|
+
// + link
|
|
2579
|
+
// + " >nul 2>&1 "
|
|
2580
|
+
// } else {
|
|
2581
|
+
// if (target.startsWith('./')) {
|
|
2582
|
+
// target = target.replace(/^\.\//g, '');
|
|
2583
|
+
// }
|
|
2584
|
+
// if (link === '.' || link === './') {
|
|
2585
|
+
// link = process.cwd()
|
|
2586
|
+
// }
|
|
2587
|
+
// if (path.resolve(target) === path.resolve(link)) {
|
|
2588
|
+
// Helpers.warn(`[createMultiplatformLink] Trying to link same location`);
|
|
2589
|
+
// return;
|
|
2590
|
+
// }
|
|
2591
|
+
// command = `ln -sf "${link}" "${target}"`;
|
|
2592
|
+
// }
|
|
2593
|
+
// child_process.execSync(command);
|
|
2594
|
+
// }
|
|
2138
2595
|
isPlainFileOrFolder(filePath) {
|
|
2139
2596
|
/* */
|
|
2140
2597
|
/* */
|
|
@@ -2303,6 +2760,19 @@ class HelpersFileFolders {
|
|
|
2303
2760
|
/* */
|
|
2304
2761
|
return (void 0);
|
|
2305
2762
|
}
|
|
2763
|
+
// private deleteFolderRecursive = (pathToFolder) => {
|
|
2764
|
+
// if (fs.existsSync(pathToFolder)) {
|
|
2765
|
+
// fs.readdirSync(pathToFolder).forEach((file, index) => {
|
|
2766
|
+
// const curPath = path.join(pathToFolder, file);
|
|
2767
|
+
// if (fs.lstatSync(curPath).isDirectory()) { // recurse
|
|
2768
|
+
// this.deleteFolderRecursive(curPath);
|
|
2769
|
+
// } else { // delete file
|
|
2770
|
+
// fs.unlinkSync(curPath);
|
|
2771
|
+
// }
|
|
2772
|
+
// });
|
|
2773
|
+
// fs.rmdirSync(pathToFolder);
|
|
2774
|
+
// }
|
|
2775
|
+
// };
|
|
2306
2776
|
move(from, to) {
|
|
2307
2777
|
/* */
|
|
2308
2778
|
/* */
|
|
@@ -3001,8 +3471,6 @@ class HelpersFileFolders {
|
|
|
3001
3471
|
return (void 0);
|
|
3002
3472
|
}
|
|
3003
3473
|
}
|
|
3004
|
-
;
|
|
3005
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/helpers/for-backend/helpers-file-folders.ts
|
|
3006
3474
|
|
|
3007
3475
|
class HelpersNumber {
|
|
3008
3476
|
constructor() {
|
|
@@ -3013,9 +3481,9 @@ class HelpersNumber {
|
|
|
3013
3481
|
this.randomInteger = (max, min) => Math.round(Math.random() * (max - min)) + min;
|
|
3014
3482
|
}
|
|
3015
3483
|
}
|
|
3016
|
-
;
|
|
3017
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/helpers/helpers-numbers.ts
|
|
3018
3484
|
|
|
3485
|
+
// session tab it
|
|
3486
|
+
// realtime session
|
|
3019
3487
|
const key = Symbol('[taon-helpers] helper browser key');
|
|
3020
3488
|
class HelpersBrowser {
|
|
3021
3489
|
static { this.callbacks = []; }
|
|
@@ -3037,6 +3505,7 @@ class HelpersBrowser {
|
|
|
3037
3505
|
}
|
|
3038
3506
|
HelpersBrowser.inst = win[key];
|
|
3039
3507
|
})();
|
|
3508
|
+
//#region @browser
|
|
3040
3509
|
win.addEventListener("beforeunload", (e) => {
|
|
3041
3510
|
win.sessionStorage.tabId = this.tabId;
|
|
3042
3511
|
return null;
|
|
@@ -3055,14 +3524,17 @@ class HelpersBrowser {
|
|
|
3055
3524
|
c(this);
|
|
3056
3525
|
});
|
|
3057
3526
|
});
|
|
3527
|
+
//#endregion
|
|
3058
3528
|
}
|
|
3059
3529
|
static get instance() {
|
|
3060
3530
|
return HelpersBrowser.inst;
|
|
3061
3531
|
}
|
|
3062
3532
|
}
|
|
3063
|
-
;
|
|
3064
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/helpers/for-browser/helpers-browser.ts
|
|
3065
3533
|
|
|
3534
|
+
//#region imports
|
|
3535
|
+
//#endregion
|
|
3536
|
+
//#endregion
|
|
3537
|
+
//#region class mixing helper
|
|
3066
3538
|
/**
|
|
3067
3539
|
* Mixing for multiclass inheritance
|
|
3068
3540
|
*
|
|
@@ -3084,6 +3556,7 @@ function applyMixins(derivedCtor, baseCtors) {
|
|
|
3084
3556
|
});
|
|
3085
3557
|
});
|
|
3086
3558
|
}
|
|
3559
|
+
//#endregion
|
|
3087
3560
|
class HelpersTaon extends CoreHelpers {
|
|
3088
3561
|
static get Instance() {
|
|
3089
3562
|
if (!HelpersTaon._instance) {
|
|
@@ -3091,6 +3564,8 @@ class HelpersTaon extends CoreHelpers {
|
|
|
3091
3564
|
}
|
|
3092
3565
|
return HelpersTaon._instance;
|
|
3093
3566
|
}
|
|
3567
|
+
//#endregion
|
|
3568
|
+
//#region constructor
|
|
3094
3569
|
constructor(
|
|
3095
3570
|
/* */
|
|
3096
3571
|
/* */
|
|
@@ -3103,21 +3578,33 @@ class HelpersTaon extends CoreHelpers {
|
|
|
3103
3578
|
/* */
|
|
3104
3579
|
/* */
|
|
3105
3580
|
/* */
|
|
3106
|
-
arrays = new HelpersArrayObj(), strings = new HelpersStrings(), numbers = new HelpersNumber(),
|
|
3581
|
+
arrays = new HelpersArrayObj(), strings = new HelpersStrings(), numbers = new HelpersNumber(),
|
|
3582
|
+
//#region @browser
|
|
3583
|
+
browser = HelpersBrowser.instance, ng = HelpersAngular) {
|
|
3107
3584
|
super();
|
|
3108
3585
|
this.arrays = arrays;
|
|
3109
3586
|
this.strings = strings;
|
|
3110
3587
|
this.numbers = numbers;
|
|
3111
3588
|
this.browser = browser;
|
|
3112
3589
|
this.ng = ng;
|
|
3590
|
+
//#endregion
|
|
3591
|
+
//#region methods & getters / apply mixins
|
|
3113
3592
|
this.applyMixins = applyMixins;
|
|
3593
|
+
//#endregion
|
|
3594
|
+
//#region methods & getters / is valid ip
|
|
3114
3595
|
this.isValidIp = Validators.network.isValidIp;
|
|
3596
|
+
//#endregion
|
|
3597
|
+
//#region methods & getters / is valid git repo url
|
|
3115
3598
|
this.isValidGitRepuUrl = Validators.git.isValidRepoUrl;
|
|
3116
3599
|
}
|
|
3600
|
+
//#endregion
|
|
3601
|
+
//#region methods & getters / cli wrap
|
|
3117
3602
|
CLIWRAP(f, name) {
|
|
3118
3603
|
CLASS.setName(f, name);
|
|
3119
3604
|
return f;
|
|
3120
3605
|
}
|
|
3606
|
+
//#endregion
|
|
3607
|
+
//#region methods & getters / uniqArray
|
|
3121
3608
|
/**
|
|
3122
3609
|
* Bundle file with node_modules into one file
|
|
3123
3610
|
* default strategy is cli
|
|
@@ -3219,6 +3706,14 @@ class HelpersTaon extends CoreHelpers {
|
|
|
3219
3706
|
/* */
|
|
3220
3707
|
return (void 0);
|
|
3221
3708
|
}
|
|
3709
|
+
//#endregion
|
|
3710
|
+
//#region methods & getters / replace invisible characters
|
|
3711
|
+
// replaceInvisibleCharacters(s: string) {
|
|
3712
|
+
// var reg = /[\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g;
|
|
3713
|
+
// return s.replace(reg, '');
|
|
3714
|
+
// }
|
|
3715
|
+
//#endregion
|
|
3716
|
+
//#region methods & getters / parse url
|
|
3222
3717
|
urlParse(portOrHost, forceDomain = false) {
|
|
3223
3718
|
let url;
|
|
3224
3719
|
if (portOrHost instanceof URL) {
|
|
@@ -3250,11 +3745,15 @@ class HelpersTaon extends CoreHelpers {
|
|
|
3250
3745
|
}
|
|
3251
3746
|
return url;
|
|
3252
3747
|
}
|
|
3748
|
+
//#endregion
|
|
3749
|
+
//#region methods & getters / slash
|
|
3253
3750
|
slash(pathFromWindowsOrUnixType) {
|
|
3254
3751
|
/* */
|
|
3255
3752
|
/* */
|
|
3256
3753
|
return (void 0);
|
|
3257
3754
|
}
|
|
3755
|
+
//#endregion
|
|
3756
|
+
//#region methods & getters / is elevated
|
|
3258
3757
|
async isElevated() {
|
|
3259
3758
|
/* */
|
|
3260
3759
|
/* */
|
|
@@ -3265,6 +3764,8 @@ class HelpersTaon extends CoreHelpers {
|
|
|
3265
3764
|
/* */
|
|
3266
3765
|
/* */
|
|
3267
3766
|
}
|
|
3767
|
+
//#endregion
|
|
3768
|
+
//#region methods & getters / get local ip addresses
|
|
3268
3769
|
/**
|
|
3269
3770
|
* TODO fix this methods
|
|
3270
3771
|
*/
|
|
@@ -3296,6 +3797,8 @@ class HelpersTaon extends CoreHelpers {
|
|
|
3296
3797
|
/* */
|
|
3297
3798
|
return (void 0);
|
|
3298
3799
|
}
|
|
3800
|
+
//#endregion
|
|
3801
|
+
//#region methods & getters / get all local ip addresses
|
|
3299
3802
|
allLocalIpAddresses() {
|
|
3300
3803
|
/* */
|
|
3301
3804
|
/* */
|
|
@@ -3317,6 +3820,8 @@ class HelpersTaon extends CoreHelpers {
|
|
|
3317
3820
|
/* */
|
|
3318
3821
|
return (void 0);
|
|
3319
3822
|
}
|
|
3823
|
+
//#endregion
|
|
3824
|
+
//#region methods & getters / mesure execution in ms
|
|
3320
3825
|
async mesureExectionInMs(description, functionToExecute, ...functionArguments) {
|
|
3321
3826
|
var start = new Date();
|
|
3322
3827
|
await Helpers.runSyncOrAsync({
|
|
@@ -3334,6 +3839,8 @@ class HelpersTaon extends CoreHelpers {
|
|
|
3334
3839
|
/* */
|
|
3335
3840
|
return end;
|
|
3336
3841
|
}
|
|
3842
|
+
//#endregion
|
|
3843
|
+
//#region methods & getters / mesure execution in ms (sync)
|
|
3337
3844
|
mesureExectionInMsSync(description, functionToExecute) {
|
|
3338
3845
|
var start = new Date();
|
|
3339
3846
|
functionToExecute();
|
|
@@ -3348,6 +3855,8 @@ class HelpersTaon extends CoreHelpers {
|
|
|
3348
3855
|
/* */
|
|
3349
3856
|
return end;
|
|
3350
3857
|
}
|
|
3858
|
+
//#endregion
|
|
3859
|
+
//#region methods & getters / wait for condition
|
|
3351
3860
|
waitForCondition(conditionFn, howOfftenCheckInMs = 1000) {
|
|
3352
3861
|
return new Promise(async (resolve, reject) => {
|
|
3353
3862
|
const result = await Helpers.runSyncOrAsync({ functionFn: conditionFn });
|
|
@@ -3363,6 +3872,8 @@ class HelpersTaon extends CoreHelpers {
|
|
|
3363
3872
|
}
|
|
3364
3873
|
});
|
|
3365
3874
|
}
|
|
3875
|
+
//#endregion
|
|
3876
|
+
//#region methods & getters / get methods name
|
|
3366
3877
|
getMethodName(classObject, method) {
|
|
3367
3878
|
var methodName = null;
|
|
3368
3879
|
Object.getOwnPropertyNames(classObject).forEach(prop => {
|
|
@@ -3379,6 +3890,8 @@ class HelpersTaon extends CoreHelpers {
|
|
|
3379
3890
|
}
|
|
3380
3891
|
return null;
|
|
3381
3892
|
}
|
|
3893
|
+
//#endregion
|
|
3894
|
+
//#region methods & getters / fix webpack config
|
|
3382
3895
|
/**
|
|
3383
3896
|
* @deprecated
|
|
3384
3897
|
*/
|
|
@@ -3391,6 +3904,8 @@ class HelpersTaon extends CoreHelpers {
|
|
|
3391
3904
|
env[k] = false;
|
|
3392
3905
|
});
|
|
3393
3906
|
}
|
|
3907
|
+
//#endregion
|
|
3908
|
+
//#region methods & getters / work calculate array
|
|
3394
3909
|
/**
|
|
3395
3910
|
* @deprecated
|
|
3396
3911
|
*/
|
|
@@ -3473,6 +3988,8 @@ class HelpersTaon extends CoreHelpers {
|
|
|
3473
3988
|
/* */
|
|
3474
3989
|
/* */
|
|
3475
3990
|
}
|
|
3991
|
+
//#endregion
|
|
3992
|
+
//#region methods & getters / check environment
|
|
3476
3993
|
checkEnvironment(deps) {
|
|
3477
3994
|
/* */
|
|
3478
3995
|
/* */
|
|
@@ -3484,14 +4001,15 @@ applyMixins(HelpersTaon, [
|
|
|
3484
4001
|
HelpersProcess,
|
|
3485
4002
|
HelpersFileFolders,
|
|
3486
4003
|
]);
|
|
3487
|
-
|
|
3488
|
-
|
|
4004
|
+
//#endregion
|
|
4005
|
+
// prettier-ignore-end
|
|
3489
4006
|
|
|
3490
4007
|
/* */
|
|
3491
4008
|
/* */
|
|
3492
4009
|
/* */
|
|
3493
4010
|
/* */
|
|
3494
4011
|
/* */
|
|
4012
|
+
//#endregion
|
|
3495
4013
|
class BaseDb {
|
|
3496
4014
|
constructor(ins, dbName, defaultDb) {
|
|
3497
4015
|
this.ins = ins;
|
|
@@ -3515,12 +4033,11 @@ class BaseDb {
|
|
|
3515
4033
|
return (void 0);
|
|
3516
4034
|
}
|
|
3517
4035
|
}
|
|
3518
|
-
;
|
|
3519
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-db.ts
|
|
3520
4036
|
|
|
3521
4037
|
/* */
|
|
3522
4038
|
/* */
|
|
3523
4039
|
/* */
|
|
4040
|
+
//#endregion
|
|
3524
4041
|
const defaultDb$2 = {
|
|
3525
4042
|
config: {},
|
|
3526
4043
|
};
|
|
@@ -3560,9 +4077,8 @@ class ConfigDatabase extends BaseDb {
|
|
|
3560
4077
|
return (void 0);
|
|
3561
4078
|
}
|
|
3562
4079
|
}
|
|
3563
|
-
;
|
|
3564
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/config-database.ts
|
|
3565
4080
|
|
|
4081
|
+
//#endregion
|
|
3566
4082
|
const defaultDb$1 = {
|
|
3567
4083
|
projects: [],
|
|
3568
4084
|
};
|
|
@@ -3577,8 +4093,6 @@ class ProjectDatabase extends BaseDb {
|
|
|
3577
4093
|
return (void 0);
|
|
3578
4094
|
}
|
|
3579
4095
|
}
|
|
3580
|
-
;
|
|
3581
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/project-database.ts
|
|
3582
4096
|
|
|
3583
4097
|
var Port_1;
|
|
3584
4098
|
const PortStatusArr = [
|
|
@@ -3606,22 +4120,29 @@ Port = Port_1 = __decorate([
|
|
|
3606
4120
|
uniqueKeyProp: 'port',
|
|
3607
4121
|
})
|
|
3608
4122
|
], Port);
|
|
3609
|
-
;
|
|
3610
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/tcp-udp-ports/ports.entity.ts
|
|
3611
4123
|
|
|
4124
|
+
//#region imports
|
|
4125
|
+
//#endregion
|
|
3612
4126
|
class BaseCliWorkerTerminalUI {
|
|
3613
4127
|
constructor(worker) {
|
|
3614
4128
|
this.worker = worker;
|
|
3615
4129
|
}
|
|
4130
|
+
//#region protected methods / text for header
|
|
3616
4131
|
async headerText() {
|
|
3617
4132
|
return _.startCase(this.worker.serviceID);
|
|
3618
4133
|
}
|
|
4134
|
+
//#endregion
|
|
4135
|
+
//#region protected methods / text header style
|
|
3619
4136
|
textHeaderStyle() {
|
|
3620
4137
|
return 'block';
|
|
3621
4138
|
}
|
|
4139
|
+
//#endregion
|
|
4140
|
+
//#region protected methods / header text align
|
|
3622
4141
|
headerTextAlign() {
|
|
3623
4142
|
return 'left';
|
|
3624
4143
|
}
|
|
4144
|
+
//#endregion
|
|
4145
|
+
//#region protected methods / header
|
|
3625
4146
|
/**
|
|
3626
4147
|
* override whole terminal header
|
|
3627
4148
|
*/
|
|
@@ -3645,6 +4166,8 @@ class BaseCliWorkerTerminalUI {
|
|
|
3645
4166
|
/* */
|
|
3646
4167
|
return (void 0);
|
|
3647
4168
|
}
|
|
4169
|
+
//#endregion
|
|
4170
|
+
//#region protected methods / info message below header
|
|
3648
4171
|
async infoMessageBelowHeader() {
|
|
3649
4172
|
/* */
|
|
3650
4173
|
/* */
|
|
@@ -3660,6 +4183,8 @@ class BaseCliWorkerTerminalUI {
|
|
|
3660
4183
|
/* */
|
|
3661
4184
|
return (void 0);
|
|
3662
4185
|
}
|
|
4186
|
+
//#endregion
|
|
4187
|
+
//#region protected methods / get back action
|
|
3663
4188
|
get backAction() {
|
|
3664
4189
|
return {
|
|
3665
4190
|
back: {
|
|
@@ -3667,6 +4192,8 @@ class BaseCliWorkerTerminalUI {
|
|
|
3667
4192
|
},
|
|
3668
4193
|
};
|
|
3669
4194
|
}
|
|
4195
|
+
//#endregion
|
|
4196
|
+
//#region protected methods / choose action
|
|
3670
4197
|
get chooseAction() {
|
|
3671
4198
|
return {
|
|
3672
4199
|
emptyAction: {
|
|
@@ -3675,6 +4202,8 @@ class BaseCliWorkerTerminalUI {
|
|
|
3675
4202
|
},
|
|
3676
4203
|
};
|
|
3677
4204
|
}
|
|
4205
|
+
//#endregion
|
|
4206
|
+
//#region protected methods / worker terminal actions
|
|
3678
4207
|
getWorkerTerminalActions(options) {
|
|
3679
4208
|
/* */
|
|
3680
4209
|
/* */
|
|
@@ -3715,6 +4244,8 @@ class BaseCliWorkerTerminalUI {
|
|
|
3715
4244
|
/* */
|
|
3716
4245
|
return (void 0);
|
|
3717
4246
|
}
|
|
4247
|
+
//#endregion
|
|
4248
|
+
//#region protected methods / info screen
|
|
3718
4249
|
async infoScreen(options) {
|
|
3719
4250
|
options = options || {};
|
|
3720
4251
|
while (true) {
|
|
@@ -3733,16 +4264,20 @@ class BaseCliWorkerTerminalUI {
|
|
|
3733
4264
|
}
|
|
3734
4265
|
}
|
|
3735
4266
|
}
|
|
4267
|
+
//#endregion
|
|
4268
|
+
//#region protected methods / display special worker ready message
|
|
3736
4269
|
displaySpecialWorkerReadyMessage() {
|
|
3737
4270
|
console.log(this.worker.SPECIAL_WORKER_READY_MESSAGE);
|
|
3738
4271
|
}
|
|
3739
4272
|
}
|
|
3740
|
-
;
|
|
3741
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.ts
|
|
3742
4273
|
|
|
4274
|
+
//#endregion
|
|
4275
|
+
//#region constants
|
|
3743
4276
|
const WORKER_INIT_START_TIME_LIMIT = 25; // 15 seconds max to start worker
|
|
3744
4277
|
const START_PORT_FOR_SERVICES = 3600;
|
|
4278
|
+
//#endregion
|
|
3745
4279
|
class BaseCliWorker {
|
|
4280
|
+
//#region fields & getters / path to process local info
|
|
3746
4281
|
get pathToProcessLocalInfoJson() {
|
|
3747
4282
|
/* */
|
|
3748
4283
|
/* */
|
|
@@ -3754,6 +4289,8 @@ class BaseCliWorker {
|
|
|
3754
4289
|
/* */
|
|
3755
4290
|
return (void 0);
|
|
3756
4291
|
}
|
|
4292
|
+
//#endregion
|
|
4293
|
+
//#region fields & getters / process local info json object
|
|
3757
4294
|
get processLocalInfoObj() {
|
|
3758
4295
|
/* */
|
|
3759
4296
|
/* */
|
|
@@ -3763,6 +4300,9 @@ class BaseCliWorker {
|
|
|
3763
4300
|
/* */
|
|
3764
4301
|
return (void 0);
|
|
3765
4302
|
}
|
|
4303
|
+
//#endregion
|
|
4304
|
+
//#endregion
|
|
4305
|
+
//#region constructor
|
|
3766
4306
|
constructor(
|
|
3767
4307
|
/**
|
|
3768
4308
|
* unique id for service
|
|
@@ -3779,10 +4319,13 @@ class BaseCliWorker {
|
|
|
3779
4319
|
this.serviceID = serviceID;
|
|
3780
4320
|
this.startCommand = startCommand;
|
|
3781
4321
|
this.serviceVersion = serviceVersion;
|
|
4322
|
+
//#region fields & getters
|
|
3782
4323
|
this.SPECIAL_WORKER_READY_MESSAGE = '$$$ WORKER_READY $$$';
|
|
3783
4324
|
// @ts-ignore TODO weird inheritance problem
|
|
3784
4325
|
this.terminalUI = new BaseCliWorkerTerminalUI(this);
|
|
3785
4326
|
}
|
|
4327
|
+
//#endregion
|
|
4328
|
+
//#region methods / start normally in current process
|
|
3786
4329
|
/**
|
|
3787
4330
|
* start normally process
|
|
3788
4331
|
* this will crash if process already started
|
|
@@ -3806,6 +4349,8 @@ class BaseCliWorker {
|
|
|
3806
4349
|
/* */
|
|
3807
4350
|
return (void 0);
|
|
3808
4351
|
}
|
|
4352
|
+
//#endregion
|
|
4353
|
+
//#region methods / get controller for remote connection
|
|
3809
4354
|
async getControllerForRemoteConnection() {
|
|
3810
4355
|
/* */
|
|
3811
4356
|
/* */
|
|
@@ -3836,6 +4381,8 @@ class BaseCliWorker {
|
|
|
3836
4381
|
/* */
|
|
3837
4382
|
return (void 0);
|
|
3838
4383
|
}
|
|
4384
|
+
//#endregion
|
|
4385
|
+
//#region public methods / start if needs to be started
|
|
3839
4386
|
async startDetachedIfNeedsToBeStarted(options) {
|
|
3840
4387
|
/* */
|
|
3841
4388
|
/* */
|
|
@@ -3855,6 +4402,8 @@ class BaseCliWorker {
|
|
|
3855
4402
|
/* */
|
|
3856
4403
|
return (void 0);
|
|
3857
4404
|
}
|
|
4405
|
+
//#endregion
|
|
4406
|
+
//#region public methods / kill
|
|
3858
4407
|
/**
|
|
3859
4408
|
* stop if started
|
|
3860
4409
|
*/
|
|
@@ -3881,6 +4430,8 @@ class BaseCliWorker {
|
|
|
3881
4430
|
/* */
|
|
3882
4431
|
return (void 0);
|
|
3883
4432
|
}
|
|
4433
|
+
//#endregion
|
|
4434
|
+
//#region public methods / restart
|
|
3884
4435
|
/**
|
|
3885
4436
|
* kill detached process and start again
|
|
3886
4437
|
* @param options.detached - default true
|
|
@@ -3899,6 +4450,8 @@ class BaseCliWorker {
|
|
|
3899
4450
|
await this.startNormallyInCurrentProcess();
|
|
3900
4451
|
}
|
|
3901
4452
|
}
|
|
4453
|
+
//#endregion
|
|
4454
|
+
//#region public methods / cli start
|
|
3902
4455
|
/**
|
|
3903
4456
|
* only for cli start
|
|
3904
4457
|
* @param cliParams on from cli
|
|
@@ -3926,6 +4479,8 @@ class BaseCliWorker {
|
|
|
3926
4479
|
/* */
|
|
3927
4480
|
return (void 0);
|
|
3928
4481
|
}
|
|
4482
|
+
//#endregion
|
|
4483
|
+
//#region prevent external config change
|
|
3929
4484
|
preventExternalConfigChange() {
|
|
3930
4485
|
/* */
|
|
3931
4486
|
/* */
|
|
@@ -3942,6 +4497,8 @@ class BaseCliWorker {
|
|
|
3942
4497
|
/* */
|
|
3943
4498
|
return (void 0);
|
|
3944
4499
|
}
|
|
4500
|
+
//#endregion
|
|
4501
|
+
//#region prevent prevent start if already started
|
|
3945
4502
|
async preventStartIfAlreadyStarted() {
|
|
3946
4503
|
/* */
|
|
3947
4504
|
/* */
|
|
@@ -3958,6 +4515,8 @@ class BaseCliWorker {
|
|
|
3958
4515
|
/* */
|
|
3959
4516
|
return (void 0);
|
|
3960
4517
|
}
|
|
4518
|
+
//#endregion
|
|
4519
|
+
//#region prevent kill worker with lower version
|
|
3961
4520
|
async killWorkerWithLowerVersion() {
|
|
3962
4521
|
/* */
|
|
3963
4522
|
/* */
|
|
@@ -3980,6 +4539,8 @@ class BaseCliWorker {
|
|
|
3980
4539
|
/* */
|
|
3981
4540
|
return (void 0);
|
|
3982
4541
|
}
|
|
4542
|
+
//#endregion
|
|
4543
|
+
//#region is service healthy
|
|
3983
4544
|
/**
|
|
3984
4545
|
* This has 2 purposes:
|
|
3985
4546
|
* - infinite check when when detached process finished starting
|
|
@@ -4062,6 +4623,8 @@ class BaseCliWorker {
|
|
|
4062
4623
|
/* */
|
|
4063
4624
|
return (void 0);
|
|
4064
4625
|
}
|
|
4626
|
+
//#endregion
|
|
4627
|
+
//#region start detached
|
|
4065
4628
|
/**
|
|
4066
4629
|
* start if not started detached process
|
|
4067
4630
|
*/
|
|
@@ -4097,6 +4660,8 @@ class BaseCliWorker {
|
|
|
4097
4660
|
/* */
|
|
4098
4661
|
return (void 0);
|
|
4099
4662
|
}
|
|
4663
|
+
//#endregion
|
|
4664
|
+
//#region save process info
|
|
4100
4665
|
saveProcessInfo(processConfig) {
|
|
4101
4666
|
/* */
|
|
4102
4667
|
/* */
|
|
@@ -4115,6 +4680,8 @@ class BaseCliWorker {
|
|
|
4115
4680
|
/* */
|
|
4116
4681
|
return (void 0);
|
|
4117
4682
|
}
|
|
4683
|
+
//#endregion
|
|
4684
|
+
//#region initialize worker
|
|
4118
4685
|
async initializeWorkerMetadata() {
|
|
4119
4686
|
/* */
|
|
4120
4687
|
/* */
|
|
@@ -4139,6 +4706,8 @@ class BaseCliWorker {
|
|
|
4139
4706
|
/* */
|
|
4140
4707
|
return (void 0);
|
|
4141
4708
|
}
|
|
4709
|
+
//#endregion
|
|
4710
|
+
//#region wait for process port saved to disk
|
|
4142
4711
|
async waitForProcessPortSavedToDisk() {
|
|
4143
4712
|
/* */
|
|
4144
4713
|
/* */
|
|
@@ -4164,6 +4733,8 @@ class BaseCliWorker {
|
|
|
4164
4733
|
/* */
|
|
4165
4734
|
return (void 0);
|
|
4166
4735
|
}
|
|
4736
|
+
//#endregion
|
|
4737
|
+
//#region get free port
|
|
4167
4738
|
async getServicePort() {
|
|
4168
4739
|
/* */
|
|
4169
4740
|
/* */
|
|
@@ -4183,9 +4754,8 @@ class BaseCliWorker {
|
|
|
4183
4754
|
return (void 0);
|
|
4184
4755
|
}
|
|
4185
4756
|
}
|
|
4186
|
-
;
|
|
4187
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-cli-worker/base-cli-worker.ts
|
|
4188
4757
|
|
|
4758
|
+
//#region base worker config
|
|
4189
4759
|
class BaseCliWorkerConfig {
|
|
4190
4760
|
static from(opt) {
|
|
4191
4761
|
return _.merge(new BaseCliWorkerConfig(), opt);
|
|
@@ -4219,8 +4789,7 @@ class BaseCliWorkerConfig {
|
|
|
4219
4789
|
return !this.serviceID && !this.port && !this.pid;
|
|
4220
4790
|
}
|
|
4221
4791
|
}
|
|
4222
|
-
|
|
4223
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-cli-worker/base-cli-worker-config.ts
|
|
4792
|
+
//#endregion
|
|
4224
4793
|
|
|
4225
4794
|
let BaseCliWorkerController = class BaseCliWorkerController extends Taon.Base
|
|
4226
4795
|
.Controller {
|
|
@@ -4231,7 +4800,9 @@ let BaseCliWorkerController = class BaseCliWorkerController extends Taon.Base
|
|
|
4231
4800
|
*/
|
|
4232
4801
|
this.cliWorkerServiceId = null;
|
|
4233
4802
|
this.cliWorkerServiceVersion = null;
|
|
4803
|
+
//#endregion
|
|
4234
4804
|
}
|
|
4805
|
+
//#region api methods / initialize metadata
|
|
4235
4806
|
baseCLiWorkerCommand_initializeMetadata(serviceId, serviceVersion) {
|
|
4236
4807
|
/* */
|
|
4237
4808
|
/* */
|
|
@@ -4240,6 +4811,8 @@ let BaseCliWorkerController = class BaseCliWorkerController extends Taon.Base
|
|
|
4240
4811
|
/* */
|
|
4241
4812
|
return (void 0);
|
|
4242
4813
|
}
|
|
4814
|
+
//#endregion
|
|
4815
|
+
//#region api methods / kill
|
|
4243
4816
|
baseCLiWorkerCommand_kill() {
|
|
4244
4817
|
/* */
|
|
4245
4818
|
/* */
|
|
@@ -4251,6 +4824,8 @@ let BaseCliWorkerController = class BaseCliWorkerController extends Taon.Base
|
|
|
4251
4824
|
/* */
|
|
4252
4825
|
return (void 0);
|
|
4253
4826
|
}
|
|
4827
|
+
//#endregion
|
|
4828
|
+
//#region api methods / info
|
|
4254
4829
|
info() {
|
|
4255
4830
|
/* */
|
|
4256
4831
|
/* */
|
|
@@ -4264,6 +4839,8 @@ let BaseCliWorkerController = class BaseCliWorkerController extends Taon.Base
|
|
|
4264
4839
|
/* */
|
|
4265
4840
|
return (void 0);
|
|
4266
4841
|
}
|
|
4842
|
+
//#endregion
|
|
4843
|
+
//#region api methods / is healthy
|
|
4267
4844
|
baseCLiWorkerCommand_isHealthy(checkingProcessConfig) {
|
|
4268
4845
|
/* */
|
|
4269
4846
|
/* */
|
|
@@ -4280,6 +4857,8 @@ let BaseCliWorkerController = class BaseCliWorkerController extends Taon.Base
|
|
|
4280
4857
|
/* */
|
|
4281
4858
|
return (void 0);
|
|
4282
4859
|
}
|
|
4860
|
+
//#endregion
|
|
4861
|
+
//#region api methods / has up to date version
|
|
4283
4862
|
baseCLiWorkerCommand_hasUpToDateVersion(checkingProcessConfig) {
|
|
4284
4863
|
/* */
|
|
4285
4864
|
/* */
|
|
@@ -4316,6 +4895,8 @@ __decorate([
|
|
|
4316
4895
|
__decorate([
|
|
4317
4896
|
Taon.Http.GET({
|
|
4318
4897
|
pathIsGlobal: true,
|
|
4898
|
+
// overrideContentType: 'text/html',
|
|
4899
|
+
// overridResponseType: 'text',
|
|
4319
4900
|
}),
|
|
4320
4901
|
__metadata("design:type", Function),
|
|
4321
4902
|
__metadata("design:paramtypes", []),
|
|
@@ -4340,19 +4921,21 @@ BaseCliWorkerController = __decorate([
|
|
|
4340
4921
|
className: 'BaseCliWorkerController',
|
|
4341
4922
|
})
|
|
4342
4923
|
], BaseCliWorkerController);
|
|
4343
|
-
;
|
|
4344
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-cli-worker/base-cli-worker-controller.ts
|
|
4345
|
-
|
|
4346
|
-
;
|
|
4347
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-cli-worker/index.ts
|
|
4348
4924
|
|
|
4925
|
+
//#endregion
|
|
4349
4926
|
let PortsController = class PortsController extends BaseCliWorkerController {
|
|
4350
4927
|
constructor() {
|
|
4351
4928
|
super(...arguments);
|
|
4929
|
+
//#region fields
|
|
4352
4930
|
this.START_PORT = 3000;
|
|
4353
4931
|
this.END_PORT = 6000;
|
|
4354
4932
|
this.portsCache = new Map();
|
|
4933
|
+
//#endregion
|
|
4934
|
+
//#endregion
|
|
4355
4935
|
}
|
|
4936
|
+
//#endregion
|
|
4937
|
+
//#region methods
|
|
4938
|
+
//#region methods / first free port
|
|
4356
4939
|
get firstFreePort() {
|
|
4357
4940
|
/* */
|
|
4358
4941
|
/* */
|
|
@@ -4363,6 +4946,8 @@ let PortsController = class PortsController extends BaseCliWorkerController {
|
|
|
4363
4946
|
/* */
|
|
4364
4947
|
return (void 0);
|
|
4365
4948
|
}
|
|
4949
|
+
//#endregion
|
|
4950
|
+
//#region methods / get first unassigned port more than
|
|
4366
4951
|
firstUnassignedPortMoreThan(port) {
|
|
4367
4952
|
/* */
|
|
4368
4953
|
/* */
|
|
@@ -4373,22 +4958,33 @@ let PortsController = class PortsController extends BaseCliWorkerController {
|
|
|
4373
4958
|
/* */
|
|
4374
4959
|
return (void 0);
|
|
4375
4960
|
}
|
|
4961
|
+
//#endregion
|
|
4962
|
+
//#endregion
|
|
4963
|
+
//#region public methods
|
|
4964
|
+
//#region public methods / get
|
|
4965
|
+
//#region public methods / get / first free port
|
|
4376
4966
|
getFirstFreePort() {
|
|
4377
4967
|
return async () => {
|
|
4378
4968
|
return this.firstFreePort;
|
|
4379
4969
|
};
|
|
4380
4970
|
}
|
|
4971
|
+
//#endregion
|
|
4972
|
+
//#region public methods / get / port by number
|
|
4381
4973
|
getPortByNumber(portNumber) {
|
|
4382
4974
|
return async () => {
|
|
4383
4975
|
portNumber = Number(portNumber);
|
|
4384
4976
|
return Array.from(this.portsCache.values()).find(f => f.port === portNumber);
|
|
4385
4977
|
};
|
|
4386
4978
|
}
|
|
4979
|
+
//#endregion
|
|
4980
|
+
//#region public methods / get / ports by status
|
|
4387
4981
|
getPortsByStatus(status) {
|
|
4388
4982
|
return async () => {
|
|
4389
4983
|
return Array.from(this.portsCache.values())
|
|
4390
4984
|
.filter(f => f.status === status)
|
|
4391
|
-
.sort(
|
|
4985
|
+
.sort(
|
|
4986
|
+
// sort by port number
|
|
4987
|
+
(a, b) => {
|
|
4392
4988
|
if (a.port < b.port) {
|
|
4393
4989
|
return -1;
|
|
4394
4990
|
}
|
|
@@ -4399,6 +4995,10 @@ let PortsController = class PortsController extends BaseCliWorkerController {
|
|
|
4399
4995
|
});
|
|
4400
4996
|
};
|
|
4401
4997
|
}
|
|
4998
|
+
//#endregion
|
|
4999
|
+
//#endregion
|
|
5000
|
+
//#region public methods / ports take by os
|
|
5001
|
+
//#region public methods / ports take by os / DELETE port (make it unassigned)
|
|
4402
5002
|
/**
|
|
4403
5003
|
* make it unassigned
|
|
4404
5004
|
*/
|
|
@@ -4428,6 +5028,8 @@ let PortsController = class PortsController extends BaseCliWorkerController {
|
|
|
4428
5028
|
/* */
|
|
4429
5029
|
return (void 0);
|
|
4430
5030
|
}
|
|
5031
|
+
//#endregion
|
|
5032
|
+
//#region public methods / ports take by os / UPDATE port unique id
|
|
4431
5033
|
/**
|
|
4432
5034
|
* make it unassigned
|
|
4433
5035
|
*/
|
|
@@ -4458,6 +5060,8 @@ let PortsController = class PortsController extends BaseCliWorkerController {
|
|
|
4458
5060
|
/* */
|
|
4459
5061
|
return (void 0);
|
|
4460
5062
|
}
|
|
5063
|
+
//#endregion
|
|
5064
|
+
//#region public methods / ports take by os / ADD port take by os
|
|
4461
5065
|
addTakeByOsPort(portNumber, uniqueId) {
|
|
4462
5066
|
/* */
|
|
4463
5067
|
/* */
|
|
@@ -4487,6 +5091,9 @@ let PortsController = class PortsController extends BaseCliWorkerController {
|
|
|
4487
5091
|
/* */
|
|
4488
5092
|
return (void 0);
|
|
4489
5093
|
}
|
|
5094
|
+
//#endregion
|
|
5095
|
+
//#endregion
|
|
5096
|
+
//#region public methods / register and assign port
|
|
4490
5097
|
/**
|
|
4491
5098
|
* @param uniqueServiceName unique service name
|
|
4492
5099
|
* @param startFrom start searching for free port from this number
|
|
@@ -4599,8 +5206,6 @@ PortsController = __decorate([
|
|
|
4599
5206
|
className: 'PortsController',
|
|
4600
5207
|
})
|
|
4601
5208
|
], PortsController);
|
|
4602
|
-
;
|
|
4603
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/tcp-udp-ports/ports.controller.ts
|
|
4604
5209
|
|
|
4605
5210
|
let MainContext_1736198527297_init = class MainContext_1736198527297_init extends Taon.Base.Migration {
|
|
4606
5211
|
/**
|
|
@@ -4610,8 +5215,10 @@ let MainContext_1736198527297_init = class MainContext_1736198527297_init extend
|
|
|
4610
5215
|
return false;
|
|
4611
5216
|
}
|
|
4612
5217
|
async up(queryRunner) {
|
|
5218
|
+
// do "something" in db
|
|
4613
5219
|
}
|
|
4614
5220
|
async down(queryRunner) {
|
|
5221
|
+
// revert this "something" in db
|
|
4615
5222
|
}
|
|
4616
5223
|
};
|
|
4617
5224
|
MainContext_1736198527297_init = __decorate([
|
|
@@ -4627,8 +5234,12 @@ let PortsContext_1736198527297_init = class PortsContext_1736198527297_init exte
|
|
|
4627
5234
|
return true;
|
|
4628
5235
|
}
|
|
4629
5236
|
async up(queryRunner) {
|
|
5237
|
+
// do "something" in db
|
|
5238
|
+
// console.log('Hello from migration UP!')
|
|
4630
5239
|
}
|
|
4631
5240
|
async down(queryRunner) {
|
|
5241
|
+
// revert this "something" in db
|
|
5242
|
+
// console.log('Hello from migration DOWN!')
|
|
4632
5243
|
}
|
|
4633
5244
|
};
|
|
4634
5245
|
PortsContext_1736198527297_init = __decorate([
|
|
@@ -4636,8 +5247,6 @@ PortsContext_1736198527297_init = __decorate([
|
|
|
4636
5247
|
className: 'PortsContext_1736198527297_init',
|
|
4637
5248
|
})
|
|
4638
5249
|
], PortsContext_1736198527297_init);
|
|
4639
|
-
;
|
|
4640
|
-
({}); // @--end-of-file-for-module=tnp-helpers migrations/1736198527297_init.ts
|
|
4641
5250
|
|
|
4642
5251
|
const portsWithDescription = {
|
|
4643
5252
|
3000: 'Commonly used for development servers',
|
|
@@ -4695,8 +5304,6 @@ PortsContext_1736199486472_addingNotAssignablePorts = __decorate([
|
|
|
4695
5304
|
className: 'PortsContext_1736199486472_addingNotAssignablePorts',
|
|
4696
5305
|
})
|
|
4697
5306
|
], PortsContext_1736199486472_addingNotAssignablePorts);
|
|
4698
|
-
;
|
|
4699
|
-
({}); // @--end-of-file-for-module=tnp-helpers migrations/1736199486472_addingNotAssignablePorts.ts
|
|
4700
5307
|
|
|
4701
5308
|
let PortsContext_1736454437350_addFreePorts = class PortsContext_1736454437350_addFreePorts extends Taon.Base
|
|
4702
5309
|
.Migration {
|
|
@@ -4723,6 +5330,7 @@ let PortsContext_1736454437350_addFreePorts = class PortsContext_1736454437350_a
|
|
|
4723
5330
|
}
|
|
4724
5331
|
}
|
|
4725
5332
|
async down(queryRunner) {
|
|
5333
|
+
// revert this "something" in db
|
|
4726
5334
|
const db = await queryRunner.manager.getRepository(Port);
|
|
4727
5335
|
await db.remove(await db.find({
|
|
4728
5336
|
where: {
|
|
@@ -4740,9 +5348,9 @@ PortsContext_1736454437350_addFreePorts = __decorate([
|
|
|
4740
5348
|
className: 'PortsContext_1736454437350_addFreePorts',
|
|
4741
5349
|
})
|
|
4742
5350
|
], PortsContext_1736454437350_addFreePorts);
|
|
4743
|
-
;
|
|
4744
|
-
({}); // @--end-of-file-for-module=tnp-helpers migrations/1736454437350_addFreePorts.ts
|
|
4745
5351
|
|
|
5352
|
+
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
5353
|
+
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
4746
5354
|
const MIGRATIONS_CLASSES_FOR_MainContext = {
|
|
4747
5355
|
/* 06-01-2025 22:22:07 */ MainContext_1736198527297_init,
|
|
4748
5356
|
};
|
|
@@ -4751,12 +5359,9 @@ const MIGRATIONS_CLASSES_FOR_PortsContext = {
|
|
|
4751
5359
|
/* 06-01-2025 22:38:06 */ PortsContext_1736199486472_addingNotAssignablePorts,
|
|
4752
5360
|
/* 09-01-2025 21:27:17 */ PortsContext_1736454437350_addFreePorts,
|
|
4753
5361
|
};
|
|
4754
|
-
|
|
4755
|
-
({}); // @--end-of-file-for-module=tnp-helpers migrations/migrations_index._auto-generated_.ts
|
|
5362
|
+
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
4756
5363
|
|
|
4757
5364
|
//@ts-nocheck
|
|
4758
|
-
;
|
|
4759
|
-
({}); // @--end-of-file-for-module=tnp-helpers migrations/index.ts
|
|
4760
5365
|
|
|
4761
5366
|
/* */
|
|
4762
5367
|
/* */
|
|
@@ -4783,16 +5388,21 @@ const PortsContextTemplate = Taon.createContextTemplate(() => ({
|
|
|
4783
5388
|
migrations: true,
|
|
4784
5389
|
},
|
|
4785
5390
|
}));
|
|
4786
|
-
;
|
|
4787
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/tcp-udp-ports/tcp-udp-ports.context.ts
|
|
4788
5391
|
|
|
5392
|
+
//#region imports
|
|
5393
|
+
//#endregion
|
|
4789
5394
|
class TcpUdpPortsTerminalUI extends BaseCliWorkerTerminalUI {
|
|
5395
|
+
//#region methods / header text
|
|
4790
5396
|
async headerText() {
|
|
4791
5397
|
return 'TCP/UDP|Ports DB';
|
|
4792
5398
|
}
|
|
5399
|
+
//#endregion
|
|
5400
|
+
//#region methods / header text style
|
|
4793
5401
|
textHeaderStyle() {
|
|
4794
5402
|
return 'block';
|
|
4795
5403
|
}
|
|
5404
|
+
//#endregion
|
|
5405
|
+
//#region methods / crud menu for take by os ports
|
|
4796
5406
|
async crudMenuForTakeByOsPorts() {
|
|
4797
5407
|
const { selected: actionChoice } = await UtilsTerminal.selectActionAndExecute({
|
|
4798
5408
|
back: {
|
|
@@ -4820,6 +5430,8 @@ class TcpUdpPortsTerminalUI extends BaseCliWorkerTerminalUI {
|
|
|
4820
5430
|
break;
|
|
4821
5431
|
}
|
|
4822
5432
|
}
|
|
5433
|
+
//#endregion
|
|
5434
|
+
//#region methods / add port process
|
|
4823
5435
|
async addPortTerminalUiProcess() {
|
|
4824
5436
|
/* */
|
|
4825
5437
|
/* */
|
|
@@ -4849,6 +5461,8 @@ class TcpUdpPortsTerminalUI extends BaseCliWorkerTerminalUI {
|
|
|
4849
5461
|
/* */
|
|
4850
5462
|
return (void 0);
|
|
4851
5463
|
}
|
|
5464
|
+
//#endregion
|
|
5465
|
+
//#region methods / select port process
|
|
4852
5466
|
async selectPortProcess(ports, title) {
|
|
4853
5467
|
/* */
|
|
4854
5468
|
/* */
|
|
@@ -4868,6 +5482,8 @@ class TcpUdpPortsTerminalUI extends BaseCliWorkerTerminalUI {
|
|
|
4868
5482
|
/* */
|
|
4869
5483
|
return (void 0);
|
|
4870
5484
|
}
|
|
5485
|
+
//#endregion
|
|
5486
|
+
//#region methods / delete port process
|
|
4871
5487
|
async deletePortTerminalUiProcess() {
|
|
4872
5488
|
/* */
|
|
4873
5489
|
/* */
|
|
@@ -4896,6 +5512,8 @@ class TcpUdpPortsTerminalUI extends BaseCliWorkerTerminalUI {
|
|
|
4896
5512
|
/* */
|
|
4897
5513
|
return (void 0);
|
|
4898
5514
|
}
|
|
5515
|
+
//#endregion
|
|
5516
|
+
//#region methods / edit port process
|
|
4899
5517
|
async editPortTerminalUiProcess() {
|
|
4900
5518
|
/* */
|
|
4901
5519
|
/* */
|
|
@@ -4937,6 +5555,8 @@ class TcpUdpPortsTerminalUI extends BaseCliWorkerTerminalUI {
|
|
|
4937
5555
|
/* */
|
|
4938
5556
|
return (void 0);
|
|
4939
5557
|
}
|
|
5558
|
+
//#endregion
|
|
5559
|
+
//#region methods / get worker terminal actions
|
|
4940
5560
|
getWorkerTerminalActions(options) {
|
|
4941
5561
|
/* */
|
|
4942
5562
|
/* */
|
|
@@ -4983,6 +5603,8 @@ class TcpUdpPortsTerminalUI extends BaseCliWorkerTerminalUI {
|
|
|
4983
5603
|
/* */
|
|
4984
5604
|
return (void 0);
|
|
4985
5605
|
}
|
|
5606
|
+
//#endregion
|
|
5607
|
+
//#region methods / display menu with items
|
|
4986
5608
|
async displayItemsForPortsStatus(status) {
|
|
4987
5609
|
/* */
|
|
4988
5610
|
/* */
|
|
@@ -5003,6 +5625,8 @@ class TcpUdpPortsTerminalUI extends BaseCliWorkerTerminalUI {
|
|
|
5003
5625
|
/* */
|
|
5004
5626
|
return (void 0);
|
|
5005
5627
|
}
|
|
5628
|
+
//#endregion
|
|
5629
|
+
//#region methods / get new port to add
|
|
5006
5630
|
async getNewPortToAdd() {
|
|
5007
5631
|
/* */
|
|
5008
5632
|
/* */
|
|
@@ -5042,9 +5666,8 @@ class TcpUdpPortsTerminalUI extends BaseCliWorkerTerminalUI {
|
|
|
5042
5666
|
return (void 0);
|
|
5043
5667
|
}
|
|
5044
5668
|
}
|
|
5045
|
-
;
|
|
5046
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/tcp-udp-ports/tcp-upd-ports-terminal-ui.ts
|
|
5047
5669
|
|
|
5670
|
+
//#endregion
|
|
5048
5671
|
class PortsWorker extends BaseCliWorker {
|
|
5049
5672
|
constructor() {
|
|
5050
5673
|
super(...arguments);
|
|
@@ -5053,23 +5676,23 @@ class PortsWorker extends BaseCliWorker {
|
|
|
5053
5676
|
this.controllerClass = PortsController;
|
|
5054
5677
|
}
|
|
5055
5678
|
}
|
|
5056
|
-
;
|
|
5057
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/tcp-udp-ports/tcp-upd-ports.worker.ts
|
|
5058
|
-
|
|
5059
|
-
;
|
|
5060
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/tcp-udp-ports/index.ts
|
|
5061
5679
|
|
|
5680
|
+
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
5062
5681
|
const BUILD_FRAMEWORK_CLI_NAME = 'tnp';
|
|
5063
|
-
const
|
|
5064
|
-
;
|
|
5065
|
-
|
|
5682
|
+
const PROJECT_NPM_NAME = 'tnp-helpers';
|
|
5683
|
+
const CURRENT_PACKAGE_VERSION = '19.0.6';
|
|
5684
|
+
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
5066
5685
|
|
|
5686
|
+
//#endregion
|
|
5067
5687
|
class BaseProjectResolver {
|
|
5688
|
+
//#endregion
|
|
5689
|
+
//#region constructor
|
|
5068
5690
|
constructor(classFn, cliToolName) {
|
|
5069
5691
|
this.classFn = classFn;
|
|
5070
5692
|
this.cliToolName = cliToolName;
|
|
5071
5693
|
this.configDb = new ConfigDatabase(this);
|
|
5072
5694
|
this.projectsDb = new ProjectDatabase(this);
|
|
5695
|
+
//#region fields
|
|
5073
5696
|
this.NPM_PROJECT_KEY = 'npm';
|
|
5074
5697
|
this.projects = [];
|
|
5075
5698
|
/**
|
|
@@ -5078,17 +5701,22 @@ class BaseProjectResolver {
|
|
|
5078
5701
|
*/
|
|
5079
5702
|
this.emptyLocations = [];
|
|
5080
5703
|
this.cliToolName = cliToolName;
|
|
5704
|
+
// console.log("global.frameworkName",global.frameworkName)
|
|
5081
5705
|
if (!this.cliToolName) {
|
|
5082
5706
|
Helpers.throw(`cliToolName is not provided`);
|
|
5083
5707
|
}
|
|
5084
5708
|
this.portsWorker = new PortsWorker('ports-worker', `${this.cliToolName} startCliServicePortsWorker --skipCoreCheck`, CURRENT_PACKAGE_VERSION);
|
|
5085
5709
|
}
|
|
5710
|
+
//#endregion
|
|
5711
|
+
//#region fields & getters / allowed types
|
|
5086
5712
|
get allowedTypes() {
|
|
5087
5713
|
/* */
|
|
5088
5714
|
/* */
|
|
5089
5715
|
/* */
|
|
5090
5716
|
return (void 0);
|
|
5091
5717
|
}
|
|
5718
|
+
//#endregion
|
|
5719
|
+
//#region fields & getters / current project
|
|
5092
5720
|
/**
|
|
5093
5721
|
* project from process.cwd()
|
|
5094
5722
|
*/
|
|
@@ -5108,6 +5736,8 @@ class BaseProjectResolver {
|
|
|
5108
5736
|
/* */
|
|
5109
5737
|
return (void 0);
|
|
5110
5738
|
}
|
|
5739
|
+
//#endregion
|
|
5740
|
+
//#region fields & getters / resolve type from
|
|
5111
5741
|
/**
|
|
5112
5742
|
* override this
|
|
5113
5743
|
*/
|
|
@@ -5125,7 +5755,12 @@ class BaseProjectResolver {
|
|
|
5125
5755
|
/* */
|
|
5126
5756
|
return (void 0);
|
|
5127
5757
|
}
|
|
5758
|
+
//#endregion
|
|
5759
|
+
//#region fields & getters / from
|
|
5128
5760
|
From(locationOfProject, options) {
|
|
5761
|
+
// console.log({
|
|
5762
|
+
// locationOfProj
|
|
5763
|
+
// })
|
|
5129
5764
|
/* */
|
|
5130
5765
|
/* */
|
|
5131
5766
|
/* */
|
|
@@ -5181,6 +5816,8 @@ class BaseProjectResolver {
|
|
|
5181
5816
|
/* */
|
|
5182
5817
|
return (void 0);
|
|
5183
5818
|
}
|
|
5819
|
+
//#endregion
|
|
5820
|
+
//#region fields & getters / get project nearest to path
|
|
5184
5821
|
nearestTo(absoluteLocation, options) {
|
|
5185
5822
|
/* */
|
|
5186
5823
|
/* */
|
|
@@ -5261,6 +5898,8 @@ class BaseProjectResolver {
|
|
|
5261
5898
|
/* */
|
|
5262
5899
|
return (void 0);
|
|
5263
5900
|
}
|
|
5901
|
+
//#endregion
|
|
5902
|
+
//#region fields & getters / unload project
|
|
5264
5903
|
unload(projectOrLocationOfProject) {
|
|
5265
5904
|
const location = _.isString(projectOrLocationOfProject)
|
|
5266
5905
|
? projectOrLocationOfProject
|
|
@@ -5268,16 +5907,22 @@ class BaseProjectResolver {
|
|
|
5268
5907
|
this.projects = this.projects.filter(f => f.location !== location);
|
|
5269
5908
|
this.emptyLocations = this.emptyLocations.filter(f => f !== location);
|
|
5270
5909
|
}
|
|
5910
|
+
//#endregion
|
|
5911
|
+
//#region fields & getters / remove project
|
|
5271
5912
|
remove(project) {
|
|
5272
5913
|
/* */
|
|
5273
5914
|
/* */
|
|
5274
5915
|
/* */
|
|
5275
5916
|
/* */
|
|
5276
5917
|
}
|
|
5918
|
+
//#endregion
|
|
5919
|
+
//#region fields & getters / manually add project
|
|
5277
5920
|
add(project) {
|
|
5278
5921
|
/* */
|
|
5279
5922
|
/* */
|
|
5280
5923
|
}
|
|
5924
|
+
//#endregion
|
|
5925
|
+
//#region fields & getters / all projects from location
|
|
5281
5926
|
allProjectFrom(absoluteLocation, stopOnCwd = '/') {
|
|
5282
5927
|
/* */
|
|
5283
5928
|
/* */
|
|
@@ -5313,12 +5958,15 @@ class BaseProjectResolver {
|
|
|
5313
5958
|
/* */
|
|
5314
5959
|
return (void 0);
|
|
5315
5960
|
}
|
|
5961
|
+
//#endregion
|
|
5962
|
+
//#region fields & getters / sort group of projects
|
|
5316
5963
|
sortGroupOfProject(projects, resoveDepsArray, projNameToCompare) {
|
|
5317
5964
|
const visited = {};
|
|
5318
5965
|
const stack = {};
|
|
5319
5966
|
const result = [];
|
|
5320
5967
|
const visit = (project) => {
|
|
5321
5968
|
if (stack[projNameToCompare(project)]) {
|
|
5969
|
+
// Circular dependency detected
|
|
5322
5970
|
Helpers.error(`Circular dependency detected involving project: ${projNameToCompare(project)}`);
|
|
5323
5971
|
}
|
|
5324
5972
|
if (!visited[projNameToCompare(project)]) {
|
|
@@ -5327,6 +5975,7 @@ class BaseProjectResolver {
|
|
|
5327
5975
|
const depsResolved = resoveDepsArray(project);
|
|
5328
5976
|
depsResolved.forEach(dependency => {
|
|
5329
5977
|
const dependentProject = projects.find(p => {
|
|
5978
|
+
// console.log(`comparing :"${projNameToCompare(p)}" and "${dependency}"`)
|
|
5330
5979
|
return projNameToCompare(p) === dependency;
|
|
5331
5980
|
});
|
|
5332
5981
|
if (dependentProject) {
|
|
@@ -5339,20 +5988,28 @@ class BaseProjectResolver {
|
|
|
5339
5988
|
};
|
|
5340
5989
|
projects.forEach(project => visit(project));
|
|
5341
5990
|
return result;
|
|
5991
|
+
// return result.reverse(); // Reverse the result to get the correct order
|
|
5342
5992
|
}
|
|
5343
5993
|
}
|
|
5344
|
-
;
|
|
5345
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-project-resolver.ts
|
|
5346
5994
|
|
|
5995
|
+
//#endregion
|
|
5347
5996
|
const takenPorts = [];
|
|
5348
5997
|
class BaseProject {
|
|
5349
5998
|
constructor() {
|
|
5999
|
+
//#region static
|
|
6000
|
+
//#endregion
|
|
6001
|
+
//#endregion
|
|
6002
|
+
//#region fields
|
|
5350
6003
|
this.cache = {};
|
|
5351
6004
|
this.type = 'unknow';
|
|
6005
|
+
//#endregion
|
|
6006
|
+
//#region getters & methods / to string
|
|
5352
6007
|
this.toString = () => {
|
|
5353
6008
|
return `${this.name}=>${this.location}`;
|
|
5354
6009
|
};
|
|
6010
|
+
//#endregion
|
|
5355
6011
|
}
|
|
6012
|
+
//#region static / instance of resovle
|
|
5356
6013
|
static { this.ins = new BaseProjectResolver(BaseProject, 'taon'); }
|
|
5357
6014
|
static { this.cache = {}; }
|
|
5358
6015
|
get globalCache() {
|
|
@@ -5370,6 +6027,7 @@ class BaseProject {
|
|
|
5370
6027
|
set location(v) {
|
|
5371
6028
|
this.__location = crossPlatformPath(v);
|
|
5372
6029
|
}
|
|
6030
|
+
//#region constructor
|
|
5373
6031
|
/* */
|
|
5374
6032
|
/* */
|
|
5375
6033
|
/* */
|
|
@@ -5403,6 +6061,8 @@ class BaseProject {
|
|
|
5403
6061
|
/* */
|
|
5404
6062
|
/* */
|
|
5405
6063
|
/* */
|
|
6064
|
+
//#endregion
|
|
6065
|
+
//#region methods & getters / is monorepo
|
|
5406
6066
|
/**
|
|
5407
6067
|
* TODO move this to framework
|
|
5408
6068
|
* Linked projects are actual inside repo
|
|
@@ -5411,11 +6071,15 @@ class BaseProject {
|
|
|
5411
6071
|
get isMonorepo() {
|
|
5412
6072
|
return false;
|
|
5413
6073
|
}
|
|
6074
|
+
//#endregion
|
|
6075
|
+
//#region getters & methods / order core projects
|
|
5414
6076
|
orderCoreProjects(coreProjects) {
|
|
5415
6077
|
const projectMap = new Map();
|
|
6078
|
+
// Initialize the project map
|
|
5416
6079
|
for (const project of coreProjects) {
|
|
5417
6080
|
projectMap.set(project, []);
|
|
5418
6081
|
}
|
|
6082
|
+
// Populate the project map with dependencies
|
|
5419
6083
|
for (const project of coreProjects) {
|
|
5420
6084
|
if (!projectMap.has(project.extends)) {
|
|
5421
6085
|
projectMap.set(project.extends, []);
|
|
@@ -5436,20 +6100,28 @@ class BaseProject {
|
|
|
5436
6100
|
orderedProjects.push(project);
|
|
5437
6101
|
}
|
|
5438
6102
|
};
|
|
6103
|
+
// Visit each project
|
|
5439
6104
|
for (const project of coreProjects) {
|
|
5440
6105
|
visit(project);
|
|
5441
6106
|
}
|
|
5442
6107
|
return orderedProjects.reverse();
|
|
5443
6108
|
}
|
|
6109
|
+
//#endregion
|
|
6110
|
+
//#region methods & getters / core
|
|
5444
6111
|
get core() {
|
|
5445
6112
|
if (!_.isUndefined(this.cache['core'])) {
|
|
5446
6113
|
return this.cache['core'];
|
|
5447
6114
|
}
|
|
6115
|
+
// Helpers.taskStarted(`Detecting core project for ${this.genericName}`);
|
|
5448
6116
|
let coreProjects = CoreProject.coreProjects.filter(p => p.recognizedFn(this));
|
|
5449
6117
|
coreProjects = this.orderCoreProjects(coreProjects);
|
|
6118
|
+
// Helpers.taskDone(`Core project detected for ${this.genericName}`);
|
|
6119
|
+
// console.log('CoreProject.coreProjects', CoreProject.coreProjects.map(c => c.name));
|
|
5450
6120
|
this.cache['core'] = _.first(coreProjects);
|
|
5451
6121
|
return this.cache['core'];
|
|
5452
6122
|
}
|
|
6123
|
+
//#endregion
|
|
6124
|
+
//#region getters & methods / link project exited
|
|
5453
6125
|
get linkedProjectsExisted() {
|
|
5454
6126
|
/* */
|
|
5455
6127
|
/* */
|
|
@@ -5460,16 +6132,24 @@ class BaseProject {
|
|
|
5460
6132
|
/* */
|
|
5461
6133
|
return (void 0);
|
|
5462
6134
|
}
|
|
6135
|
+
//#endregion
|
|
6136
|
+
//#region methods & getters / set type
|
|
5463
6137
|
setType(type) {
|
|
5464
6138
|
// @ts-ignore
|
|
5465
6139
|
this.type = type;
|
|
5466
6140
|
}
|
|
6141
|
+
//#endregion
|
|
6142
|
+
//#region methods & getters / type is
|
|
5467
6143
|
typeIs(...types) {
|
|
5468
6144
|
return this.type && types.includes(this.type);
|
|
5469
6145
|
}
|
|
6146
|
+
//#endregion
|
|
6147
|
+
//#region methods & getters / type is not
|
|
5470
6148
|
typeIsNot(...types) {
|
|
5471
6149
|
return !this.typeIs(...types);
|
|
5472
6150
|
}
|
|
6151
|
+
//#endregion
|
|
6152
|
+
//#region methods & getters / basename
|
|
5473
6153
|
/**
|
|
5474
6154
|
* project folder basename
|
|
5475
6155
|
*/
|
|
@@ -5478,6 +6158,8 @@ class BaseProject {
|
|
|
5478
6158
|
/* */
|
|
5479
6159
|
return (void 0);
|
|
5480
6160
|
}
|
|
6161
|
+
//#endregion
|
|
6162
|
+
//#region methods & getters / parent basename
|
|
5481
6163
|
/**
|
|
5482
6164
|
* project folder parent basename
|
|
5483
6165
|
*/
|
|
@@ -5486,6 +6168,8 @@ class BaseProject {
|
|
|
5486
6168
|
/* */
|
|
5487
6169
|
return (void 0);
|
|
5488
6170
|
}
|
|
6171
|
+
//#endregion
|
|
6172
|
+
//#region methods & getters / name
|
|
5489
6173
|
/**
|
|
5490
6174
|
* name from package.json
|
|
5491
6175
|
*/
|
|
@@ -5506,6 +6190,8 @@ class BaseProject {
|
|
|
5506
6190
|
}
|
|
5507
6191
|
return '';
|
|
5508
6192
|
}
|
|
6193
|
+
//#endregion
|
|
6194
|
+
//#region methods & getters / get folder for possible project chhildrens
|
|
5509
6195
|
getFoldersForPossibleProjectChildren() {
|
|
5510
6196
|
/* */
|
|
5511
6197
|
/* */
|
|
@@ -5530,6 +6216,8 @@ class BaseProject {
|
|
|
5530
6216
|
/* */
|
|
5531
6217
|
return (void 0);
|
|
5532
6218
|
}
|
|
6219
|
+
//#endregion
|
|
6220
|
+
//#region methods & getters / get all childrens
|
|
5533
6221
|
getAllChildren() {
|
|
5534
6222
|
/* */
|
|
5535
6223
|
/* */
|
|
@@ -5542,6 +6230,8 @@ class BaseProject {
|
|
|
5542
6230
|
/* */
|
|
5543
6231
|
return (void 0);
|
|
5544
6232
|
}
|
|
6233
|
+
//#endregion
|
|
6234
|
+
//#region methods & getters / children
|
|
5545
6235
|
/**
|
|
5546
6236
|
* alias to getAllChildren
|
|
5547
6237
|
*/
|
|
@@ -5550,6 +6240,8 @@ class BaseProject {
|
|
|
5550
6240
|
/* */
|
|
5551
6241
|
return (void 0);
|
|
5552
6242
|
}
|
|
6243
|
+
//#endregion
|
|
6244
|
+
//#region methods & getters / get child
|
|
5553
6245
|
getChildBy(nameOrBasename, errors = true) {
|
|
5554
6246
|
/* */
|
|
5555
6247
|
/* */
|
|
@@ -5564,6 +6256,8 @@ class BaseProject {
|
|
|
5564
6256
|
/* */
|
|
5565
6257
|
return (void 0);
|
|
5566
6258
|
}
|
|
6259
|
+
//#endregion
|
|
6260
|
+
//#region methods & getters / parent
|
|
5567
6261
|
get parent() {
|
|
5568
6262
|
/* */
|
|
5569
6263
|
/* */
|
|
@@ -5572,6 +6266,8 @@ class BaseProject {
|
|
|
5572
6266
|
/* */
|
|
5573
6267
|
return (void 0);
|
|
5574
6268
|
}
|
|
6269
|
+
//#endregion
|
|
6270
|
+
//#region methods & getters / parent
|
|
5575
6271
|
get nearestParent() {
|
|
5576
6272
|
/* */
|
|
5577
6273
|
/* */
|
|
@@ -5588,6 +6284,8 @@ class BaseProject {
|
|
|
5588
6284
|
/* */
|
|
5589
6285
|
return (void 0);
|
|
5590
6286
|
}
|
|
6287
|
+
//#endregion
|
|
6288
|
+
//#region methods & getters / grandpa
|
|
5591
6289
|
get grandpa() {
|
|
5592
6290
|
/* */
|
|
5593
6291
|
/* */
|
|
@@ -5597,6 +6295,8 @@ class BaseProject {
|
|
|
5597
6295
|
/* */
|
|
5598
6296
|
return (void 0);
|
|
5599
6297
|
}
|
|
6298
|
+
//#endregion
|
|
6299
|
+
//#region methods & getters / generic name
|
|
5600
6300
|
get allNpmPackagesNames() {
|
|
5601
6301
|
return [this.name];
|
|
5602
6302
|
}
|
|
@@ -5641,10 +6341,13 @@ class BaseProject {
|
|
|
5641
6341
|
/* */
|
|
5642
6342
|
return (void 0);
|
|
5643
6343
|
}
|
|
6344
|
+
//#endregion
|
|
6345
|
+
//#region methods & getters / check and bolden path
|
|
5644
6346
|
checkAndBoldenPath(fullPath) {
|
|
5645
6347
|
const parts = fullPath.split('/');
|
|
5646
6348
|
const result = parts.map((part, index) => {
|
|
5647
6349
|
const pathTocheck = parts.slice(0, index + 1).join('/');
|
|
6350
|
+
// console.log('pathTocheck', pathTocheck);
|
|
5648
6351
|
/* */
|
|
5649
6352
|
/* */
|
|
5650
6353
|
/* */
|
|
@@ -5653,12 +6356,16 @@ class BaseProject {
|
|
|
5653
6356
|
});
|
|
5654
6357
|
return result.join('/');
|
|
5655
6358
|
}
|
|
6359
|
+
//#endregion
|
|
6360
|
+
//#region methods & getters / path exits
|
|
5656
6361
|
/**
|
|
5657
6362
|
* same has project.hasFile();
|
|
5658
6363
|
*/
|
|
5659
6364
|
pathExists(relativePath) {
|
|
5660
6365
|
return this.hasFile(relativePath);
|
|
5661
6366
|
}
|
|
6367
|
+
//#endregion
|
|
6368
|
+
//#region methods & getters / has file
|
|
5662
6369
|
/**
|
|
5663
6370
|
* same as project.pathExists();
|
|
5664
6371
|
*/
|
|
@@ -5676,12 +6383,16 @@ class BaseProject {
|
|
|
5676
6383
|
/* */
|
|
5677
6384
|
return (void 0);
|
|
5678
6385
|
}
|
|
6386
|
+
//#endregion
|
|
6387
|
+
//#region methods & getters / relative
|
|
5679
6388
|
/**
|
|
5680
6389
|
* Function will return relative path from project location
|
|
5681
6390
|
*/
|
|
5682
6391
|
relative(absoultePath) {
|
|
5683
6392
|
return crossPlatformPath(path.relative(crossPlatformPath(this.location), crossPlatformPath(absoultePath)));
|
|
5684
6393
|
}
|
|
6394
|
+
//#endregion
|
|
6395
|
+
//#region methods & getters / create folder
|
|
5685
6396
|
/**
|
|
5686
6397
|
*
|
|
5687
6398
|
* @param relativePath
|
|
@@ -5702,6 +6413,8 @@ class BaseProject {
|
|
|
5702
6413
|
/* */
|
|
5703
6414
|
return (void 0);
|
|
5704
6415
|
}
|
|
6416
|
+
//#endregion
|
|
6417
|
+
//#region methods & getters / format file(s) with prettier
|
|
5705
6418
|
formatFile(specificRelativePath) {
|
|
5706
6419
|
/* */
|
|
5707
6420
|
/* */
|
|
@@ -5715,6 +6428,8 @@ class BaseProject {
|
|
|
5715
6428
|
/* */
|
|
5716
6429
|
return (void 0);
|
|
5717
6430
|
}
|
|
6431
|
+
//#endregion
|
|
6432
|
+
//#region methods & getters / contains file
|
|
5718
6433
|
/**
|
|
5719
6434
|
* same as project.pathhasFileExists();
|
|
5720
6435
|
* but with path.resolve
|
|
@@ -5723,6 +6438,8 @@ class BaseProject {
|
|
|
5723
6438
|
const fullPath = path.resolve(path.join(this.location, fileRelativeToProjectPath));
|
|
5724
6439
|
return Helpers.exists(fullPath);
|
|
5725
6440
|
}
|
|
6441
|
+
//#endregion
|
|
6442
|
+
//#region methods & getters / path for
|
|
5726
6443
|
/**
|
|
5727
6444
|
* absolute path:
|
|
5728
6445
|
* concated project location with relative path
|
|
@@ -5738,6 +6455,8 @@ class BaseProject {
|
|
|
5738
6455
|
/* */
|
|
5739
6456
|
return (void 0);
|
|
5740
6457
|
}
|
|
6458
|
+
//#endregion
|
|
6459
|
+
//#region methods & getters / write json
|
|
5741
6460
|
writeJson(relativePath, json) {
|
|
5742
6461
|
/* */
|
|
5743
6462
|
/* */
|
|
@@ -5746,6 +6465,8 @@ class BaseProject {
|
|
|
5746
6465
|
/* */
|
|
5747
6466
|
return (void 0);
|
|
5748
6467
|
}
|
|
6468
|
+
//#endregion
|
|
6469
|
+
//#region methods & getters / write json
|
|
5749
6470
|
writeJsonC(relativePath, json) {
|
|
5750
6471
|
/* */
|
|
5751
6472
|
/* */
|
|
@@ -5754,6 +6475,8 @@ class BaseProject {
|
|
|
5754
6475
|
/* */
|
|
5755
6476
|
return (void 0);
|
|
5756
6477
|
}
|
|
6478
|
+
//#endregion
|
|
6479
|
+
//#region methods & getters / run
|
|
5757
6480
|
/**
|
|
5758
6481
|
* @deprecated us execute instead
|
|
5759
6482
|
* use output from or more preciese crafted api
|
|
@@ -5782,6 +6505,8 @@ class BaseProject {
|
|
|
5782
6505
|
/* */
|
|
5783
6506
|
return Helpers.run(command, opt);
|
|
5784
6507
|
}
|
|
6508
|
+
//#endregion
|
|
6509
|
+
//#region methods & getters / execute
|
|
5785
6510
|
/**
|
|
5786
6511
|
* same as run but async
|
|
5787
6512
|
*/
|
|
@@ -5807,6 +6532,8 @@ class BaseProject {
|
|
|
5807
6532
|
/* */
|
|
5808
6533
|
return (void 0);
|
|
5809
6534
|
}
|
|
6535
|
+
//#endregion
|
|
6536
|
+
//#region methods & getters / try run sync command
|
|
5810
6537
|
/**
|
|
5811
6538
|
* try run but continue when it fails
|
|
5812
6539
|
* @param command
|
|
@@ -5822,11 +6549,15 @@ class BaseProject {
|
|
|
5822
6549
|
/* */
|
|
5823
6550
|
return (void 0);
|
|
5824
6551
|
}
|
|
6552
|
+
//#endregion
|
|
6553
|
+
//#region methods & getters / output from command
|
|
5825
6554
|
outputFrom(command) {
|
|
5826
6555
|
/* */
|
|
5827
6556
|
/* */
|
|
5828
6557
|
return (void 0);
|
|
5829
6558
|
}
|
|
6559
|
+
//#endregion
|
|
6560
|
+
//#region methods & getters / remove file
|
|
5830
6561
|
removeFile(fileRelativeToProjectPath) {
|
|
5831
6562
|
/* */
|
|
5832
6563
|
/* */
|
|
@@ -5835,6 +6566,8 @@ class BaseProject {
|
|
|
5835
6566
|
/* */
|
|
5836
6567
|
return (void 0);
|
|
5837
6568
|
}
|
|
6569
|
+
//#endregion
|
|
6570
|
+
//#region methods & getters / read file
|
|
5838
6571
|
readFile(fileRelativeToProjectPath) {
|
|
5839
6572
|
/* */
|
|
5840
6573
|
/* */
|
|
@@ -5844,6 +6577,8 @@ class BaseProject {
|
|
|
5844
6577
|
/* */
|
|
5845
6578
|
return (void 0);
|
|
5846
6579
|
}
|
|
6580
|
+
//#endregion
|
|
6581
|
+
//#region methods & getters / read file
|
|
5847
6582
|
/**
|
|
5848
6583
|
* read json file
|
|
5849
6584
|
* handle all json files
|
|
@@ -5859,6 +6594,8 @@ class BaseProject {
|
|
|
5859
6594
|
/* */
|
|
5860
6595
|
return (void 0);
|
|
5861
6596
|
}
|
|
6597
|
+
//#endregion
|
|
6598
|
+
//#region methods & getters / copy files or folders
|
|
5862
6599
|
/**
|
|
5863
6600
|
* copy files or folders from
|
|
5864
6601
|
* project to destination
|
|
@@ -5887,6 +6624,8 @@ class BaseProject {
|
|
|
5887
6624
|
},
|
|
5888
6625
|
};
|
|
5889
6626
|
}
|
|
6627
|
+
//#endregion
|
|
6628
|
+
//#region methods & getters / remove (fiel or folder)
|
|
5890
6629
|
remove(relativePath, exactPath = true) {
|
|
5891
6630
|
/* */
|
|
5892
6631
|
/* */
|
|
@@ -5899,6 +6638,8 @@ class BaseProject {
|
|
|
5899
6638
|
/* */
|
|
5900
6639
|
return (void 0);
|
|
5901
6640
|
}
|
|
6641
|
+
//#endregion
|
|
6642
|
+
//#region methods & getters / remove folder by relative path
|
|
5902
6643
|
removeFolderByRelativePath(relativePathToFolder) {
|
|
5903
6644
|
/* */
|
|
5904
6645
|
/* */
|
|
@@ -5906,6 +6647,7 @@ class BaseProject {
|
|
|
5906
6647
|
/* */
|
|
5907
6648
|
/* */
|
|
5908
6649
|
}
|
|
6650
|
+
//#endregion
|
|
5909
6651
|
get isAngularLib() {
|
|
5910
6652
|
/* */
|
|
5911
6653
|
/* */
|
|
@@ -5937,6 +6679,7 @@ class BaseProject {
|
|
|
5937
6679
|
/* */
|
|
5938
6680
|
return (void 0);
|
|
5939
6681
|
}
|
|
6682
|
+
//#region methods & getters / assign free port to project instance
|
|
5940
6683
|
/**
|
|
5941
6684
|
* @deprecated use this.registerAndAssignPort() or Utils.getFreePort() instead
|
|
5942
6685
|
*/
|
|
@@ -5945,10 +6688,14 @@ class BaseProject {
|
|
|
5945
6688
|
/* */
|
|
5946
6689
|
return (void 0);
|
|
5947
6690
|
}
|
|
6691
|
+
//#endregion
|
|
6692
|
+
//#region methods & getters / remove project from disk/memory
|
|
5948
6693
|
removeItself() {
|
|
5949
6694
|
/* */
|
|
5950
6695
|
/* */
|
|
5951
6696
|
}
|
|
6697
|
+
//#endregion
|
|
6698
|
+
//#region methods & getters / define property
|
|
5952
6699
|
/**
|
|
5953
6700
|
* Purpose: not initializing all classes at the beginning
|
|
5954
6701
|
* Only for BaseFeatureForProject class
|
|
@@ -5984,6 +6731,8 @@ class BaseProject {
|
|
|
5984
6731
|
/* */
|
|
5985
6732
|
return (void 0);
|
|
5986
6733
|
}
|
|
6734
|
+
//#endregion
|
|
6735
|
+
//#region methods & getters / filter only copy
|
|
5987
6736
|
/**
|
|
5988
6737
|
* fs.copy option filter function for copying only selected folders from project
|
|
5989
6738
|
*/
|
|
@@ -5992,6 +6741,8 @@ class BaseProject {
|
|
|
5992
6741
|
/* */
|
|
5993
6742
|
return (void 0);
|
|
5994
6743
|
}
|
|
6744
|
+
//#endregion
|
|
6745
|
+
//#region methods & getters / filter don't copy
|
|
5995
6746
|
/**
|
|
5996
6747
|
* fs.copy option filter function for copying only not selected folders from project
|
|
5997
6748
|
*/
|
|
@@ -6000,15 +6751,21 @@ class BaseProject {
|
|
|
6000
6751
|
/* */
|
|
6001
6752
|
return (void 0);
|
|
6002
6753
|
}
|
|
6754
|
+
//#endregion
|
|
6755
|
+
//#region methods & getters / get main branches
|
|
6003
6756
|
/**
|
|
6004
6757
|
* main/default hardcoded branches
|
|
6005
6758
|
*/
|
|
6006
6759
|
getMainBranches() {
|
|
6007
6760
|
return ['master', 'develop', 'stage', 'prod', 'test'];
|
|
6008
6761
|
}
|
|
6762
|
+
//#endregion
|
|
6763
|
+
//#region methods & getters / use feature in branch name for tests
|
|
6009
6764
|
useFeatureInBranchNameForTests() {
|
|
6010
6765
|
return false;
|
|
6011
6766
|
}
|
|
6767
|
+
//#endregion
|
|
6768
|
+
//#region methods & getters / reset process
|
|
6012
6769
|
async resetProcess(overrideBranch, recrusive = false) {
|
|
6013
6770
|
/* */
|
|
6014
6771
|
/* */
|
|
@@ -6064,10 +6821,14 @@ class BaseProject {
|
|
|
6064
6821
|
/* */
|
|
6065
6822
|
/* */
|
|
6066
6823
|
}
|
|
6824
|
+
//#endregion
|
|
6825
|
+
//#region methods & getters / link project to
|
|
6067
6826
|
linkTo(destPackageLocation) {
|
|
6068
6827
|
/* */
|
|
6069
6828
|
/* */
|
|
6070
6829
|
}
|
|
6830
|
+
//#endregion
|
|
6831
|
+
//#region methods & getters / set value to json
|
|
6071
6832
|
setValueToJSON(relativePath, lodashGetPath, value) {
|
|
6072
6833
|
/* */
|
|
6073
6834
|
/* */
|
|
@@ -6076,6 +6837,8 @@ class BaseProject {
|
|
|
6076
6837
|
/* */
|
|
6077
6838
|
return (void 0);
|
|
6078
6839
|
}
|
|
6840
|
+
//#endregion
|
|
6841
|
+
//#region methods & getters / set value to json
|
|
6079
6842
|
setValueToJSONC(relativePath, lodashGetPath, value) {
|
|
6080
6843
|
/* */
|
|
6081
6844
|
/* */
|
|
@@ -6084,6 +6847,8 @@ class BaseProject {
|
|
|
6084
6847
|
/* */
|
|
6085
6848
|
return (void 0);
|
|
6086
6849
|
}
|
|
6850
|
+
//#endregion
|
|
6851
|
+
//#region methods & getters / set value to json
|
|
6087
6852
|
setValueToJSON5(relativePath, lodashGetPath, value) {
|
|
6088
6853
|
/* */
|
|
6089
6854
|
/* */
|
|
@@ -6092,6 +6857,8 @@ class BaseProject {
|
|
|
6092
6857
|
/* */
|
|
6093
6858
|
return (void 0);
|
|
6094
6859
|
}
|
|
6860
|
+
//#endregion
|
|
6861
|
+
//#region methods & getters / get value from json
|
|
6095
6862
|
getValueFromJSON(relativePath, lodashGetPath, defaultValue = void 0) {
|
|
6096
6863
|
/* */
|
|
6097
6864
|
/* */
|
|
@@ -6104,6 +6871,8 @@ class BaseProject {
|
|
|
6104
6871
|
/* */
|
|
6105
6872
|
return (void 0);
|
|
6106
6873
|
}
|
|
6874
|
+
//#endregion
|
|
6875
|
+
//#region methods & getters / get value from jsonc
|
|
6107
6876
|
getValueFromJSONC(relativePath, lodashGetPath, defaultValue = void 0) {
|
|
6108
6877
|
/* */
|
|
6109
6878
|
/* */
|
|
@@ -6116,6 +6885,8 @@ class BaseProject {
|
|
|
6116
6885
|
/* */
|
|
6117
6886
|
return (void 0);
|
|
6118
6887
|
}
|
|
6888
|
+
//#endregion
|
|
6889
|
+
//#region methods & getters / write file
|
|
6119
6890
|
writeFile(relativePath, content) {
|
|
6120
6891
|
/* */
|
|
6121
6892
|
/* */
|
|
@@ -6123,6 +6894,8 @@ class BaseProject {
|
|
|
6123
6894
|
/* */
|
|
6124
6895
|
/* */
|
|
6125
6896
|
}
|
|
6897
|
+
//#endregion
|
|
6898
|
+
//#region getters & methods / run command and get string
|
|
6126
6899
|
runCommandGetString(command) {
|
|
6127
6900
|
/* */
|
|
6128
6901
|
/* */
|
|
@@ -6130,16 +6903,20 @@ class BaseProject {
|
|
|
6130
6903
|
/* */
|
|
6131
6904
|
return (void 0);
|
|
6132
6905
|
}
|
|
6906
|
+
//#endregion
|
|
6907
|
+
//#region getters & methods / find partners names
|
|
6133
6908
|
get parentsNames() {
|
|
6134
6909
|
/* */
|
|
6135
6910
|
/* */
|
|
6136
6911
|
return (void 0);
|
|
6137
6912
|
}
|
|
6913
|
+
//#region getters & methods / open location
|
|
6138
6914
|
openLocation(relativeFolderPath) {
|
|
6139
6915
|
/* */
|
|
6140
6916
|
/* */
|
|
6141
6917
|
return (void 0);
|
|
6142
6918
|
}
|
|
6919
|
+
//#endregion
|
|
6143
6920
|
findParentsNames(project, parent, result = []) {
|
|
6144
6921
|
/* */
|
|
6145
6922
|
/* */
|
|
@@ -6154,6 +6931,8 @@ class BaseProject {
|
|
|
6154
6931
|
/* */
|
|
6155
6932
|
return (void 0);
|
|
6156
6933
|
}
|
|
6934
|
+
//#endregion
|
|
6935
|
+
//#region getters & methods / kill all instance
|
|
6157
6936
|
tryKillAllElectronInstances() {
|
|
6158
6937
|
/* */
|
|
6159
6938
|
/* */
|
|
@@ -6167,45 +6946,61 @@ class BaseProject {
|
|
|
6167
6946
|
/* */
|
|
6168
6947
|
return (void 0);
|
|
6169
6948
|
}
|
|
6949
|
+
//#endregion
|
|
6950
|
+
//#region getters & methods / init
|
|
6170
6951
|
/**
|
|
6171
6952
|
* init project files structure and depedencies
|
|
6172
6953
|
*/
|
|
6173
6954
|
async init(initOptions) {
|
|
6174
6955
|
throw new Error('TODO IMPLEMENT');
|
|
6175
6956
|
}
|
|
6957
|
+
//#endregion
|
|
6958
|
+
//#region getters & methods / link
|
|
6176
6959
|
/**
|
|
6177
6960
|
* globally link npm as package
|
|
6178
6961
|
*/
|
|
6179
6962
|
async link() {
|
|
6180
6963
|
throw new Error('TODO IMPLEMENT');
|
|
6181
6964
|
}
|
|
6965
|
+
//#endregion
|
|
6966
|
+
//#region getters & methods / struct
|
|
6182
6967
|
/**
|
|
6183
6968
|
* init project files structure without depedencies
|
|
6184
6969
|
*/
|
|
6185
6970
|
async struct(initOptions) {
|
|
6186
6971
|
throw new Error('TODO IMPLEMENT');
|
|
6187
6972
|
}
|
|
6973
|
+
//#endregion
|
|
6974
|
+
//#region getters & methods / build
|
|
6188
6975
|
/**
|
|
6189
6976
|
* init and build() project
|
|
6190
6977
|
*/
|
|
6191
6978
|
async test(testOptions) {
|
|
6192
6979
|
throw new Error('TODO IMPLEMENT');
|
|
6193
6980
|
}
|
|
6981
|
+
//#endregion
|
|
6982
|
+
//#region getters & methods / build
|
|
6194
6983
|
/**
|
|
6195
6984
|
* init and build() project
|
|
6196
6985
|
*/
|
|
6197
6986
|
async build(buildOptions) {
|
|
6198
6987
|
throw new Error('TODO IMPLEMENT');
|
|
6199
6988
|
}
|
|
6989
|
+
//#endregion
|
|
6990
|
+
//#region getters & methods / publish
|
|
6200
6991
|
/**
|
|
6201
6992
|
* publish project to npm
|
|
6202
6993
|
*/
|
|
6203
6994
|
async publish(publishOptions) {
|
|
6204
6995
|
this.npmHelpers.publishToNpmRegistry();
|
|
6205
6996
|
}
|
|
6997
|
+
//#endregion
|
|
6998
|
+
//#region getters & methods / build
|
|
6206
6999
|
async release(releaseOptions) {
|
|
6207
7000
|
throw new Error('TODO IMPLEMENT');
|
|
6208
7001
|
}
|
|
7002
|
+
//#endregion
|
|
7003
|
+
//#region getters & methods / lint
|
|
6209
7004
|
/**
|
|
6210
7005
|
* lint porject
|
|
6211
7006
|
*/
|
|
@@ -6218,6 +7013,8 @@ class BaseProject {
|
|
|
6218
7013
|
|
|
6219
7014
|
`);
|
|
6220
7015
|
}
|
|
7016
|
+
//#endregion
|
|
7017
|
+
//#region getters & methods / info
|
|
6221
7018
|
/**
|
|
6222
7019
|
* get info about porject
|
|
6223
7020
|
*/
|
|
@@ -6259,8 +7056,6 @@ class BaseProject {
|
|
|
6259
7056
|
return (void 0);
|
|
6260
7057
|
}
|
|
6261
7058
|
}
|
|
6262
|
-
;
|
|
6263
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-project.ts
|
|
6264
7059
|
|
|
6265
7060
|
class BaseFeatureForProject {
|
|
6266
7061
|
get ins() {
|
|
@@ -6270,9 +7065,9 @@ class BaseFeatureForProject {
|
|
|
6270
7065
|
this.project = project;
|
|
6271
7066
|
}
|
|
6272
7067
|
}
|
|
6273
|
-
;
|
|
6274
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-feature-for-project.ts
|
|
6275
7068
|
|
|
7069
|
+
//#region import
|
|
7070
|
+
//#endregion
|
|
6276
7071
|
/**
|
|
6277
7072
|
* Base library build for standard angular/typescript projects
|
|
6278
7073
|
*/
|
|
@@ -6281,7 +7076,9 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
6281
7076
|
super(...arguments);
|
|
6282
7077
|
this.cache = {};
|
|
6283
7078
|
this.tempOrgTsConfigFile = `tmp-original-${config.file.tsconfig_json}`;
|
|
7079
|
+
//#endregion
|
|
6284
7080
|
}
|
|
7081
|
+
//#region getters & methods / sort by deps
|
|
6285
7082
|
sortByDeps(libraries) {
|
|
6286
7083
|
/* */
|
|
6287
7084
|
/* */
|
|
@@ -6311,6 +7108,8 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
6311
7108
|
/* */
|
|
6312
7109
|
return (void 0);
|
|
6313
7110
|
}
|
|
7111
|
+
//#endregion
|
|
7112
|
+
//#region getters & methods / get sorted libraries by deps for build\
|
|
6314
7113
|
/**
|
|
6315
7114
|
* Use cases:
|
|
6316
7115
|
* 1. build all libraries in normal mode
|
|
@@ -6322,7 +7121,9 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
6322
7121
|
* 5. build selected libraries in watch mode
|
|
6323
7122
|
* (skip normal build for not selected libraries)
|
|
6324
7123
|
*/
|
|
6325
|
-
async selectAndSaveLibraries(
|
|
7124
|
+
async selectAndSaveLibraries(
|
|
7125
|
+
// this: {},
|
|
7126
|
+
{ selectedLibs, watch, watchBuildSupported, skipAllLibsQuestion, useLastUserConfiguration, }) {
|
|
6326
7127
|
/* */
|
|
6327
7128
|
/* */
|
|
6328
7129
|
/* */
|
|
@@ -6438,6 +7239,8 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
6438
7239
|
/* */
|
|
6439
7240
|
return (void 0);
|
|
6440
7241
|
}
|
|
7242
|
+
//#endregion
|
|
7243
|
+
//#region getters & methods / angular libraries
|
|
6441
7244
|
/**
|
|
6442
7245
|
* angular libraries from angular.json
|
|
6443
7246
|
*/
|
|
@@ -6468,10 +7271,14 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
6468
7271
|
/* */
|
|
6469
7272
|
return (void 0);
|
|
6470
7273
|
}
|
|
7274
|
+
//#endregion
|
|
7275
|
+
//#region getters & methods / build libraries
|
|
6471
7276
|
/**
|
|
6472
7277
|
* Angular library build
|
|
6473
7278
|
*/
|
|
6474
|
-
async buildLibraries(
|
|
7279
|
+
async buildLibraries(
|
|
7280
|
+
// this:{},
|
|
7281
|
+
{ watch = false, strategy, releaseBuild = false, copylink_to_node_modules, outputLineReplace, libraries, useLastUserConfiguration, } = {}) {
|
|
6475
7282
|
/* */
|
|
6476
7283
|
/* */
|
|
6477
7284
|
/* */
|
|
@@ -6597,6 +7404,8 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
6597
7404
|
/* */
|
|
6598
7405
|
/* */
|
|
6599
7406
|
}
|
|
7407
|
+
//#endregion
|
|
7408
|
+
//#region getters & methods / lib watch build process
|
|
6600
7409
|
async libWatchBuildProcess({ lib, locationsForNodeModules, strategy, outputLineReplace, }) {
|
|
6601
7410
|
/* */
|
|
6602
7411
|
/* */
|
|
@@ -6652,6 +7461,8 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
6652
7461
|
/* */
|
|
6653
7462
|
return (void 0);
|
|
6654
7463
|
}
|
|
7464
|
+
//#endregion
|
|
7465
|
+
//#region getters & methods / lib normal build process
|
|
6655
7466
|
async libNormalBuildProcess({ lib, locationsForNodeModules, strategy, outputLineReplace, }) {
|
|
6656
7467
|
/* */
|
|
6657
7468
|
/* */
|
|
@@ -6755,6 +7566,8 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
6755
7566
|
/* */
|
|
6756
7567
|
return (void 0);
|
|
6757
7568
|
}
|
|
7569
|
+
//#endregion
|
|
7570
|
+
//#region getters & methods / get library build success command
|
|
6758
7571
|
getLibraryBuildCommand(options) {
|
|
6759
7572
|
/* */
|
|
6760
7573
|
/* */
|
|
@@ -6769,6 +7582,8 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
6769
7582
|
/* */
|
|
6770
7583
|
return (void 0);
|
|
6771
7584
|
}
|
|
7585
|
+
//#endregion
|
|
7586
|
+
//#region getters & methods / get library build success command
|
|
6772
7587
|
get getLibraryBuildSuccessComamnds() {
|
|
6773
7588
|
/* */
|
|
6774
7589
|
/* */
|
|
@@ -6782,6 +7597,8 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
6782
7597
|
/* */
|
|
6783
7598
|
return (void 0);
|
|
6784
7599
|
}
|
|
7600
|
+
//#endregion
|
|
7601
|
+
//#region getters & methods / select copy to projects
|
|
6785
7602
|
async selectCopytoProjects() {
|
|
6786
7603
|
/* */
|
|
6787
7604
|
/* */
|
|
@@ -6809,6 +7626,8 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
6809
7626
|
/* */
|
|
6810
7627
|
return (void 0);
|
|
6811
7628
|
}
|
|
7629
|
+
//#endregion
|
|
7630
|
+
//#region private methods / change tsconfig for libraries typescript proper local types
|
|
6812
7631
|
async changeTsConfigForLibrariesTypes() {
|
|
6813
7632
|
/* */
|
|
6814
7633
|
/* */
|
|
@@ -6827,6 +7646,8 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
6827
7646
|
/* */
|
|
6828
7647
|
return (void 0);
|
|
6829
7648
|
}
|
|
7649
|
+
//#endregion
|
|
7650
|
+
//#region private methods / replace tsconfig pathes
|
|
6830
7651
|
async replaceTsConfigsPathes() {
|
|
6831
7652
|
/* */
|
|
6832
7653
|
/* */
|
|
@@ -6857,6 +7678,8 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
6857
7678
|
/* */
|
|
6858
7679
|
return (void 0);
|
|
6859
7680
|
}
|
|
7681
|
+
//#endregion
|
|
7682
|
+
//#region private methods / restore original tsconfig
|
|
6860
7683
|
async restoreOriginalTsConfig() {
|
|
6861
7684
|
/* */
|
|
6862
7685
|
/* */
|
|
@@ -6878,8 +7701,6 @@ class BaseLibraryBuild extends BaseFeatureForProject {
|
|
|
6878
7701
|
return (void 0);
|
|
6879
7702
|
}
|
|
6880
7703
|
}
|
|
6881
|
-
;
|
|
6882
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-library-build.ts
|
|
6883
7704
|
|
|
6884
7705
|
/**
|
|
6885
7706
|
* Base class for reading json files
|
|
@@ -6915,12 +7736,16 @@ class BaseJsonFileReader {
|
|
|
6915
7736
|
this.jsonContent = _.cloneDeep(jsonContent);
|
|
6916
7737
|
this.reloadPackageJsonInMemory();
|
|
6917
7738
|
}
|
|
7739
|
+
//#endregion
|
|
7740
|
+
//#region path
|
|
6918
7741
|
/**
|
|
6919
7742
|
* cwd + fileName
|
|
6920
7743
|
*/
|
|
6921
7744
|
get path() {
|
|
6922
7745
|
return crossPlatformPath([this.cwd, this.fileName]);
|
|
6923
7746
|
}
|
|
7747
|
+
//#endregion
|
|
7748
|
+
//#region reload package json in memory
|
|
6924
7749
|
/**
|
|
6925
7750
|
* if something else change package.json in this project
|
|
6926
7751
|
* and you know that you need to reload it..
|
|
@@ -6953,6 +7778,8 @@ class BaseJsonFileReader {
|
|
|
6953
7778
|
this.reloadInMemoryCallback &&
|
|
6954
7779
|
this.reloadInMemoryCallback(_.cloneDeep(this.data));
|
|
6955
7780
|
}
|
|
7781
|
+
//#endregion
|
|
7782
|
+
//#region write package json to disk
|
|
6956
7783
|
saveToDisk(purpose) {
|
|
6957
7784
|
/* */
|
|
6958
7785
|
/* */
|
|
@@ -6973,6 +7800,8 @@ class BaseJsonFileReader {
|
|
|
6973
7800
|
/* */
|
|
6974
7801
|
return (void 0);
|
|
6975
7802
|
}
|
|
7803
|
+
//#endregion
|
|
7804
|
+
//#region link to
|
|
6976
7805
|
linkTo(destination) {
|
|
6977
7806
|
/* */
|
|
6978
7807
|
/* */
|
|
@@ -6981,16 +7810,18 @@ class BaseJsonFileReader {
|
|
|
6981
7810
|
/* */
|
|
6982
7811
|
return (void 0);
|
|
6983
7812
|
}
|
|
7813
|
+
//#endregion
|
|
7814
|
+
//#region get all data
|
|
6984
7815
|
getAllData() {
|
|
6985
7816
|
return _.cloneDeep(this.data);
|
|
6986
7817
|
}
|
|
7818
|
+
//#endregion
|
|
7819
|
+
//#region set all data
|
|
6987
7820
|
setAllData(data) {
|
|
6988
7821
|
this.data = _.cloneDeep(data);
|
|
6989
7822
|
this.saveToDisk();
|
|
6990
7823
|
}
|
|
6991
7824
|
}
|
|
6992
|
-
;
|
|
6993
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-json-file-reader.ts
|
|
6994
7825
|
|
|
6995
7826
|
const PackageJsonDependencyObjArr = [
|
|
6996
7827
|
'dependencies',
|
|
@@ -6998,10 +7829,12 @@ const PackageJsonDependencyObjArr = [
|
|
|
6998
7829
|
'peerDependencies',
|
|
6999
7830
|
'resolutions',
|
|
7000
7831
|
];
|
|
7832
|
+
//#endregion
|
|
7001
7833
|
class BasePackageJson extends BaseJsonFileReader {
|
|
7002
7834
|
constructor(options) {
|
|
7003
7835
|
super({ ...options, fileName: config.file.package_json });
|
|
7004
7836
|
}
|
|
7837
|
+
//#region name
|
|
7005
7838
|
/**
|
|
7006
7839
|
* 'dependencies'
|
|
7007
7840
|
* 'devDependencies'
|
|
@@ -7025,18 +7858,24 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7025
7858
|
/* */
|
|
7026
7859
|
return (void 0);
|
|
7027
7860
|
}
|
|
7861
|
+
//#endregion
|
|
7862
|
+
//#region dev dependencies
|
|
7028
7863
|
/**
|
|
7029
7864
|
* devDependencies dependencies
|
|
7030
7865
|
*/
|
|
7031
7866
|
get devDependencies() {
|
|
7032
7867
|
return _.cloneDeep(this.data ? this.data.devDependencies : {}) || {};
|
|
7033
7868
|
}
|
|
7869
|
+
//#endregion
|
|
7870
|
+
//#region resolutions dependencies
|
|
7034
7871
|
/**
|
|
7035
7872
|
* resolutions dependencies
|
|
7036
7873
|
*/
|
|
7037
7874
|
get resolutions() {
|
|
7038
7875
|
return _.cloneDeep(this.data ? this.data['resolutions'] : {}) || {};
|
|
7039
7876
|
}
|
|
7877
|
+
//#endregion
|
|
7878
|
+
//#region dependencies
|
|
7040
7879
|
/**
|
|
7041
7880
|
* npm dependencies from package.json
|
|
7042
7881
|
*/
|
|
@@ -7055,6 +7894,7 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7055
7894
|
this.data.dependencies = dependencies;
|
|
7056
7895
|
this.saveToDisk();
|
|
7057
7896
|
}
|
|
7897
|
+
//#endregion
|
|
7058
7898
|
/**
|
|
7059
7899
|
* set the WHOLE dependencies object
|
|
7060
7900
|
* THIS WILL NOT MERGE -> IT WILL REPLACE WHOLE DEPENDENCIES OBJECT
|
|
@@ -7067,6 +7907,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7067
7907
|
this.data.devDependencies = devDependencies;
|
|
7068
7908
|
this.saveToDisk();
|
|
7069
7909
|
}
|
|
7910
|
+
//#endregion
|
|
7911
|
+
//#region peer dependencies
|
|
7070
7912
|
/**
|
|
7071
7913
|
* peerDependencies dependencies
|
|
7072
7914
|
*/
|
|
@@ -7085,6 +7927,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7085
7927
|
this.data.peerDependencies = peerDependencies;
|
|
7086
7928
|
this.saveToDisk();
|
|
7087
7929
|
}
|
|
7930
|
+
//#endregion
|
|
7931
|
+
//#region remove dev dependencies
|
|
7088
7932
|
removeDevDependencies() {
|
|
7089
7933
|
if (!this.data) {
|
|
7090
7934
|
Helpers$1.warn(`[taon][removeDevDependencies] Package.json not exist in ${this.cwd}`);
|
|
@@ -7096,6 +7940,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7096
7940
|
catch (error) { }
|
|
7097
7941
|
this.saveToDisk();
|
|
7098
7942
|
}
|
|
7943
|
+
//#endregion
|
|
7944
|
+
//#region all dependencies
|
|
7099
7945
|
/**
|
|
7100
7946
|
* @returns object witl all deps from current project package json
|
|
7101
7947
|
*/
|
|
@@ -7115,6 +7961,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7115
7961
|
}, {}),
|
|
7116
7962
|
}));
|
|
7117
7963
|
}
|
|
7964
|
+
//#endregion
|
|
7965
|
+
//#region version
|
|
7118
7966
|
/**
|
|
7119
7967
|
* version from package.json -> property version
|
|
7120
7968
|
*/
|
|
@@ -7127,6 +7975,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7127
7975
|
/* */
|
|
7128
7976
|
return (void 0);
|
|
7129
7977
|
}
|
|
7978
|
+
//#endregion
|
|
7979
|
+
//#region bin
|
|
7130
7980
|
/**
|
|
7131
7981
|
* bin with cli config from package.json
|
|
7132
7982
|
*/
|
|
@@ -7137,6 +7987,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7137
7987
|
this.data.bin = value;
|
|
7138
7988
|
this.saveToDisk('setting bin');
|
|
7139
7989
|
}
|
|
7990
|
+
//#endregion
|
|
7991
|
+
//#region engines
|
|
7140
7992
|
get engines() {
|
|
7141
7993
|
return _.cloneDeep(this.data.engines);
|
|
7142
7994
|
}
|
|
@@ -7156,6 +8008,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7156
8008
|
/* */
|
|
7157
8009
|
return (void 0);
|
|
7158
8010
|
}
|
|
8011
|
+
//#endregion
|
|
8012
|
+
//#region homepage
|
|
7159
8013
|
get homepage() {
|
|
7160
8014
|
return _.cloneDeep(this.data.homepage);
|
|
7161
8015
|
}
|
|
@@ -7168,6 +8022,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7168
8022
|
/* */
|
|
7169
8023
|
return (void 0);
|
|
7170
8024
|
}
|
|
8025
|
+
//#endregion
|
|
8026
|
+
//#region version with patch plus one
|
|
7171
8027
|
get versionWithPatchPlusOne() {
|
|
7172
8028
|
const ver = this.version.split('.');
|
|
7173
8029
|
if (ver.length > 0) {
|
|
@@ -7175,6 +8031,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7175
8031
|
}
|
|
7176
8032
|
return ver.join('.');
|
|
7177
8033
|
}
|
|
8034
|
+
//#endregion
|
|
8035
|
+
//#region version with minor plus one and path zero
|
|
7178
8036
|
get versionWithMinorPlusOneAndPatchZero() {
|
|
7179
8037
|
const ver = this.version.split('.');
|
|
7180
8038
|
if (ver.length > 1) {
|
|
@@ -7188,6 +8046,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7188
8046
|
}
|
|
7189
8047
|
return ver.join('.');
|
|
7190
8048
|
}
|
|
8049
|
+
//#endregion
|
|
8050
|
+
//#region version with major plus one and minor zero and patch zero
|
|
7191
8051
|
get versionWithMajorPlusOneAndMinorZeroAndPatchZero() {
|
|
7192
8052
|
const ver = this.version.split('.');
|
|
7193
8053
|
if (ver.length > 0) {
|
|
@@ -7201,6 +8061,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7201
8061
|
}
|
|
7202
8062
|
return ver.join('.');
|
|
7203
8063
|
}
|
|
8064
|
+
//#endregion
|
|
8065
|
+
//#region get version path as number
|
|
7204
8066
|
get versionPathAsNumber() {
|
|
7205
8067
|
/* */
|
|
7206
8068
|
/* */
|
|
@@ -7208,6 +8070,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7208
8070
|
/* */
|
|
7209
8071
|
return (void 0);
|
|
7210
8072
|
}
|
|
8073
|
+
//#endregion
|
|
8074
|
+
//#region major version
|
|
7211
8075
|
/**
|
|
7212
8076
|
* Major Version from package.json
|
|
7213
8077
|
*/
|
|
@@ -7217,6 +8081,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7217
8081
|
/* */
|
|
7218
8082
|
return (void 0);
|
|
7219
8083
|
}
|
|
8084
|
+
//#endregion
|
|
8085
|
+
//#region minor version
|
|
7220
8086
|
/**
|
|
7221
8087
|
* Minor Version from package.json
|
|
7222
8088
|
*/
|
|
@@ -7227,6 +8093,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7227
8093
|
/* */
|
|
7228
8094
|
return (void 0);
|
|
7229
8095
|
}
|
|
8096
|
+
//#endregion
|
|
8097
|
+
//#region bump path version
|
|
7230
8098
|
async bumpPatchVersion() {
|
|
7231
8099
|
/* */
|
|
7232
8100
|
/* */
|
|
@@ -7252,6 +8120,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7252
8120
|
/* */
|
|
7253
8121
|
return (void 0);
|
|
7254
8122
|
}
|
|
8123
|
+
//#endregion
|
|
8124
|
+
//#region getters & methods / get version for
|
|
7255
8125
|
getVersionFor(releaseType) {
|
|
7256
8126
|
/* */
|
|
7257
8127
|
/* */
|
|
@@ -7265,6 +8135,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7265
8135
|
/* */
|
|
7266
8136
|
return (void 0);
|
|
7267
8137
|
}
|
|
8138
|
+
//#endregion
|
|
8139
|
+
//#region update deps from locations
|
|
7268
8140
|
updateDepsFrom(locations) {
|
|
7269
8141
|
/* */
|
|
7270
8142
|
/* */
|
|
@@ -7279,6 +8151,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7279
8151
|
/* */
|
|
7280
8152
|
return (void 0);
|
|
7281
8153
|
}
|
|
8154
|
+
//#endregion
|
|
8155
|
+
//#region update dependency
|
|
7282
8156
|
/**
|
|
7283
8157
|
* this will NOT SET dependency if
|
|
7284
8158
|
* dependency name is not in package.json
|
|
@@ -7297,6 +8171,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7297
8171
|
/* */
|
|
7298
8172
|
return (void 0);
|
|
7299
8173
|
}
|
|
8174
|
+
//#endregion
|
|
8175
|
+
//#region is private
|
|
7300
8176
|
get isPrivate() {
|
|
7301
8177
|
/* */
|
|
7302
8178
|
/* */
|
|
@@ -7308,11 +8184,13 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7308
8184
|
/* */
|
|
7309
8185
|
return (void 0);
|
|
7310
8186
|
}
|
|
8187
|
+
//#endregion
|
|
7311
8188
|
get sideEffects() {
|
|
7312
8189
|
/* */
|
|
7313
8190
|
/* */
|
|
7314
8191
|
return (void 0);
|
|
7315
8192
|
}
|
|
8193
|
+
//#region set new version
|
|
7316
8194
|
async setMainProperty(main, purpose = '') {
|
|
7317
8195
|
/* */
|
|
7318
8196
|
/* */
|
|
@@ -7322,6 +8200,8 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7322
8200
|
/* */
|
|
7323
8201
|
return (void 0);
|
|
7324
8202
|
}
|
|
8203
|
+
//#endregion
|
|
8204
|
+
//#region build hash
|
|
7325
8205
|
setBuildHash(hash) {
|
|
7326
8206
|
this.data.lastBuildTagHash = hash;
|
|
7327
8207
|
this.saveToDisk('setting build hash');
|
|
@@ -7330,10 +8210,10 @@ class BasePackageJson extends BaseJsonFileReader {
|
|
|
7330
8210
|
return this.data.lastBuildTagHash;
|
|
7331
8211
|
}
|
|
7332
8212
|
}
|
|
7333
|
-
;
|
|
7334
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-package-json.ts
|
|
7335
8213
|
|
|
8214
|
+
//#region imports
|
|
7336
8215
|
class BaseNodeModules {
|
|
8216
|
+
//#region constructor
|
|
7337
8217
|
constructor(
|
|
7338
8218
|
/**
|
|
7339
8219
|
* my-path/node_modules
|
|
@@ -7343,12 +8223,16 @@ class BaseNodeModules {
|
|
|
7343
8223
|
this.npmHelpers = npmHelpers;
|
|
7344
8224
|
this.npmHelpers = npmHelpers;
|
|
7345
8225
|
}
|
|
8226
|
+
//#endregion
|
|
8227
|
+
//#region path
|
|
7346
8228
|
/**
|
|
7347
8229
|
* cwd + node_modules
|
|
7348
8230
|
*/
|
|
7349
8231
|
get path() {
|
|
7350
8232
|
return crossPlatformPath([this.cwd, config.folder.node_modules]);
|
|
7351
8233
|
}
|
|
8234
|
+
//#endregion
|
|
8235
|
+
//#region path for package
|
|
7352
8236
|
/**
|
|
7353
8237
|
* Path to package inside node_modules folder
|
|
7354
8238
|
* @example <project-path>/node_modules/<package-name>
|
|
@@ -7358,6 +8242,8 @@ class BaseNodeModules {
|
|
|
7358
8242
|
/* */
|
|
7359
8243
|
return (void 0);
|
|
7360
8244
|
}
|
|
8245
|
+
//#endregion
|
|
8246
|
+
//#region real path of node_modules - if node_modules is a link
|
|
7361
8247
|
/**
|
|
7362
8248
|
* real path of node_modules
|
|
7363
8249
|
* if node_modules is a link
|
|
@@ -7373,6 +8259,8 @@ class BaseNodeModules {
|
|
|
7373
8259
|
return this.path;
|
|
7374
8260
|
}
|
|
7375
8261
|
}
|
|
8262
|
+
//#endregion
|
|
8263
|
+
//#region prevent wrong link destination
|
|
7376
8264
|
preventWrongLinkDestination(dest) {
|
|
7377
8265
|
if (!path.isAbsolute(dest)) {
|
|
7378
8266
|
Helpers.error(`[linkTo..] target destination path is not absolute "${dest}"`);
|
|
@@ -7382,6 +8270,8 @@ class BaseNodeModules {
|
|
|
7382
8270
|
}
|
|
7383
8271
|
return crossPlatformPath([dest, config.folder.node_modules]);
|
|
7384
8272
|
}
|
|
8273
|
+
//#endregion
|
|
8274
|
+
//#region link node_modules to other project
|
|
7385
8275
|
linkToProject(project) {
|
|
7386
8276
|
/* */
|
|
7387
8277
|
/* */
|
|
@@ -7393,6 +8283,8 @@ class BaseNodeModules {
|
|
|
7393
8283
|
/* */
|
|
7394
8284
|
return (void 0);
|
|
7395
8285
|
}
|
|
8286
|
+
//#endregion
|
|
8287
|
+
//#region link to project or location
|
|
7396
8288
|
linkToLocation(location) {
|
|
7397
8289
|
/* */
|
|
7398
8290
|
/* */
|
|
@@ -7403,11 +8295,15 @@ class BaseNodeModules {
|
|
|
7403
8295
|
/* */
|
|
7404
8296
|
return (void 0);
|
|
7405
8297
|
}
|
|
8298
|
+
//#endregion
|
|
8299
|
+
//#region make sure node modules installed
|
|
7406
8300
|
async makeSureInstalled(options) {
|
|
7407
8301
|
if (this.isEmpty()) {
|
|
7408
8302
|
await this.reinstall(options);
|
|
7409
8303
|
}
|
|
7410
8304
|
}
|
|
8305
|
+
//#endregion
|
|
8306
|
+
//#region delete node_modules
|
|
7411
8307
|
async remove(options) {
|
|
7412
8308
|
/* */
|
|
7413
8309
|
/* */
|
|
@@ -7421,12 +8317,16 @@ class BaseNodeModules {
|
|
|
7421
8317
|
/* */
|
|
7422
8318
|
return (void 0);
|
|
7423
8319
|
}
|
|
8320
|
+
//#endregion
|
|
8321
|
+
//#region remove package inside
|
|
7424
8322
|
removePackage(packageInside) {
|
|
7425
8323
|
/* */
|
|
7426
8324
|
/* */
|
|
7427
8325
|
/* */
|
|
7428
8326
|
return (void 0);
|
|
7429
8327
|
}
|
|
8328
|
+
//#endregion
|
|
8329
|
+
//#region reinstall node modules
|
|
7430
8330
|
async reinstall(options) {
|
|
7431
8331
|
/* */
|
|
7432
8332
|
/* */
|
|
@@ -7498,12 +8398,18 @@ class BaseNodeModules {
|
|
|
7498
8398
|
/* */
|
|
7499
8399
|
return (void 0);
|
|
7500
8400
|
}
|
|
8401
|
+
//#endregion
|
|
8402
|
+
//#region is link
|
|
7501
8403
|
get isLink() {
|
|
7502
8404
|
return Helpers.isSymlinkFileExitedOrUnexisted(this.path);
|
|
7503
8405
|
}
|
|
8406
|
+
//#endregion
|
|
8407
|
+
//#region empty
|
|
7504
8408
|
get empty() {
|
|
7505
8409
|
return this.isEmpty();
|
|
7506
8410
|
}
|
|
8411
|
+
//#endregion
|
|
8412
|
+
//#region fields & getters / empty node_modules
|
|
7507
8413
|
/**
|
|
7508
8414
|
* @returns true if node_modules folder is empty
|
|
7509
8415
|
* DEEP CHECK - also if node_modules is a link
|
|
@@ -7564,6 +8470,8 @@ class BaseNodeModules {
|
|
|
7564
8470
|
/* */
|
|
7565
8471
|
return (void 0);
|
|
7566
8472
|
}
|
|
8473
|
+
//#endregion
|
|
8474
|
+
//#region prepare command
|
|
7567
8475
|
/**
|
|
7568
8476
|
* Prepare command for npm install
|
|
7569
8477
|
* (or yarn install)
|
|
@@ -7634,6 +8542,8 @@ class BaseNodeModules {
|
|
|
7634
8542
|
/* */
|
|
7635
8543
|
return (void 0);
|
|
7636
8544
|
}
|
|
8545
|
+
//#endregion
|
|
8546
|
+
//#region dedupe packages action
|
|
7637
8547
|
dedupePackages(packagesConfig, countOnly = false) {
|
|
7638
8548
|
/* */
|
|
7639
8549
|
/* */
|
|
@@ -7747,22 +8657,23 @@ class BaseNodeModules {
|
|
|
7747
8657
|
return (void 0);
|
|
7748
8658
|
}
|
|
7749
8659
|
}
|
|
7750
|
-
;
|
|
7751
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-node-modules.ts
|
|
7752
8660
|
|
|
8661
|
+
//#endregion
|
|
7753
8662
|
class BaseBowerJson extends BaseJsonFileReader {
|
|
7754
8663
|
constructor(cwd) {
|
|
7755
8664
|
super({ cwd, fileName: config.file.bower_json });
|
|
7756
8665
|
this.cwd = cwd;
|
|
7757
8666
|
}
|
|
8667
|
+
//#region bower dependencies
|
|
7758
8668
|
get dependencies() {
|
|
7759
8669
|
return (this.data ? this.data.dependencies : {}) || {};
|
|
7760
8670
|
}
|
|
7761
8671
|
}
|
|
7762
|
-
;
|
|
7763
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-bower-json.ts
|
|
7764
8672
|
|
|
8673
|
+
//#endregion
|
|
7765
8674
|
class BaseNpmHelpers extends BaseFeatureForProject {
|
|
8675
|
+
//#endregion
|
|
8676
|
+
//#region constructor
|
|
7766
8677
|
constructor(project) {
|
|
7767
8678
|
super(project);
|
|
7768
8679
|
this._packageJsonType = BasePackageJson;
|
|
@@ -7778,9 +8689,13 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
7778
8689
|
}
|
|
7779
8690
|
this.bowerJson = new BaseBowerJson(project.location);
|
|
7780
8691
|
}
|
|
8692
|
+
//#endregion
|
|
8693
|
+
//#region prefer yarn over npm
|
|
7781
8694
|
preferYarnOverNpm() {
|
|
7782
8695
|
return false;
|
|
7783
8696
|
}
|
|
8697
|
+
//#endregion
|
|
8698
|
+
//#region reset package-lock.json
|
|
7784
8699
|
async resetPackageLockJson() {
|
|
7785
8700
|
/* */
|
|
7786
8701
|
/* */
|
|
@@ -7804,6 +8719,8 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
7804
8719
|
/* */
|
|
7805
8720
|
return (void 0);
|
|
7806
8721
|
}
|
|
8722
|
+
//#endregion
|
|
8723
|
+
//#region start npm task
|
|
7807
8724
|
startNpmTask(taskName, additionalArguments) {
|
|
7808
8725
|
/* */
|
|
7809
8726
|
/* */
|
|
@@ -7822,6 +8739,8 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
7822
8739
|
/* */
|
|
7823
8740
|
return (void 0);
|
|
7824
8741
|
}
|
|
8742
|
+
//#endregion
|
|
8743
|
+
//#region check if logged in to registry
|
|
7825
8744
|
/**
|
|
7826
8745
|
*
|
|
7827
8746
|
* @param registry without specified registr is checking npm registry
|
|
@@ -7858,6 +8777,8 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
7858
8777
|
/* */
|
|
7859
8778
|
return (void 0);
|
|
7860
8779
|
}
|
|
8780
|
+
//#endregion
|
|
8781
|
+
//#region login to registry
|
|
7861
8782
|
/**
|
|
7862
8783
|
* Prompt the user to log in to a specific npm registry.
|
|
7863
8784
|
* @param {string} [registry] - Optional npm registry URL.
|
|
@@ -7894,6 +8815,8 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
7894
8815
|
/* */
|
|
7895
8816
|
return (void 0);
|
|
7896
8817
|
}
|
|
8818
|
+
//#endregion
|
|
8819
|
+
//#region check if logged in to npm
|
|
7897
8820
|
async makeSureLoggedInToNpmRegistry(registry) {
|
|
7898
8821
|
/* */
|
|
7899
8822
|
/* */
|
|
@@ -7920,6 +8843,8 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
7920
8843
|
/* */
|
|
7921
8844
|
return (void 0);
|
|
7922
8845
|
}
|
|
8846
|
+
//#endregion
|
|
8847
|
+
//#region should release lib
|
|
7923
8848
|
async shouldReleaseMessage(options) {
|
|
7924
8849
|
/* */
|
|
7925
8850
|
/* */
|
|
@@ -7966,6 +8891,8 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
7966
8891
|
/* */
|
|
7967
8892
|
return (void 0);
|
|
7968
8893
|
}
|
|
8894
|
+
//#endregion
|
|
8895
|
+
//#region publish to npm registry
|
|
7969
8896
|
/**
|
|
7970
8897
|
* @param registry when not specified, it will use the default npm registry
|
|
7971
8898
|
*/
|
|
@@ -8000,6 +8927,8 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
8000
8927
|
/* */
|
|
8001
8928
|
return (void 0);
|
|
8002
8929
|
}
|
|
8930
|
+
//#endregion
|
|
8931
|
+
//#region get package version from npm registry
|
|
8003
8932
|
getPackageVersionFromNpmRegistry(packageName, options) {
|
|
8004
8933
|
/* */
|
|
8005
8934
|
/* */
|
|
@@ -8021,19 +8950,21 @@ class BaseNpmHelpers extends BaseFeatureForProject {
|
|
|
8021
8950
|
return (void 0);
|
|
8022
8951
|
}
|
|
8023
8952
|
}
|
|
8024
|
-
;
|
|
8025
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-npm-helpers.ts
|
|
8026
8953
|
|
|
8954
|
+
//#endregion
|
|
8027
8955
|
class BaseLinkedProjects extends BaseFeatureForProject {
|
|
8028
8956
|
constructor() {
|
|
8029
8957
|
super(...arguments);
|
|
8030
8958
|
this.cache = {};
|
|
8959
|
+
//#endregion
|
|
8031
8960
|
}
|
|
8961
|
+
//#region methods & getters / embedded project
|
|
8032
8962
|
get embeddedProject() {
|
|
8033
8963
|
const cacheKey = 'embeddedProject' + _.kebabCase(this.project.location);
|
|
8034
8964
|
if (!_.isUndefined(this.cache[cacheKey])) {
|
|
8035
8965
|
return this.cache[cacheKey];
|
|
8036
8966
|
}
|
|
8967
|
+
// Helpers.taskStarted(`Detecting embedded project for ${this.location}`); // TODO it is slow
|
|
8037
8968
|
const nearsetProj = this.project.ins.nearestTo(crossPlatformPath([this.project.location, '..']));
|
|
8038
8969
|
const linkedPorj = nearsetProj?.linkedProjects?.linkedProjects.find(l => {
|
|
8039
8970
|
const copareTo = crossPlatformPath([
|
|
@@ -8057,14 +8988,19 @@ class BaseLinkedProjects extends BaseFeatureForProject {
|
|
|
8057
8988
|
linkedPorj.internalRealtiveProjectPath || '',
|
|
8058
8989
|
]);
|
|
8059
8990
|
const embdedresult = this.project.ins.From(pathToEmbededProj);
|
|
8991
|
+
// Helpers.taskDone(`Embedded project detected for ${this.location}`);
|
|
8060
8992
|
this.cache[cacheKey] = embdedresult;
|
|
8061
8993
|
return this.cache[cacheKey];
|
|
8062
8994
|
}
|
|
8995
|
+
//#endregion
|
|
8996
|
+
//#region methods & getters / projects db location
|
|
8063
8997
|
get projectsDbLocation() {
|
|
8064
8998
|
/* */
|
|
8065
8999
|
/* */
|
|
8066
9000
|
return (void 0);
|
|
8067
9001
|
}
|
|
9002
|
+
//#endregion
|
|
9003
|
+
//#region methods & getters / save location to db
|
|
8068
9004
|
async saveLocationToDB() {
|
|
8069
9005
|
/* */
|
|
8070
9006
|
/* */
|
|
@@ -8090,6 +9026,8 @@ class BaseLinkedProjects extends BaseFeatureForProject {
|
|
|
8090
9026
|
/* */
|
|
8091
9027
|
return (void 0);
|
|
8092
9028
|
}
|
|
9029
|
+
//#endregion
|
|
9030
|
+
//#region methods & getters / save all linked projects to db
|
|
8093
9031
|
async saveAllLinkedProjectsToDB() {
|
|
8094
9032
|
const proj = this.project;
|
|
8095
9033
|
await proj.linkedProjects.saveLocationToDB();
|
|
@@ -8099,6 +9037,7 @@ class BaseLinkedProjects extends BaseFeatureForProject {
|
|
|
8099
9037
|
link.relativeClonePath,
|
|
8100
9038
|
link.internalRealtiveProjectPath || '',
|
|
8101
9039
|
]);
|
|
9040
|
+
// console.log({ linkedPorj })
|
|
8102
9041
|
if (linkedPorj) {
|
|
8103
9042
|
await linkedPorj.linkedProjects.saveLocationToDB();
|
|
8104
9043
|
}
|
|
@@ -8112,6 +9051,8 @@ class BaseLinkedProjects extends BaseFeatureForProject {
|
|
|
8112
9051
|
}
|
|
8113
9052
|
}
|
|
8114
9053
|
}
|
|
9054
|
+
//#endregion
|
|
9055
|
+
//#region methods & getters / add linked project
|
|
8115
9056
|
addLinkedProject(linkedProj) {
|
|
8116
9057
|
const linkedProject = _.isString(linkedProj)
|
|
8117
9058
|
? LinkedProject.fromName(linkedProj)
|
|
@@ -8122,6 +9063,8 @@ class BaseLinkedProjects extends BaseFeatureForProject {
|
|
|
8122
9063
|
/* */
|
|
8123
9064
|
return (void 0);
|
|
8124
9065
|
}
|
|
9066
|
+
//#endregion
|
|
9067
|
+
//#region methods & getters / add linked projects
|
|
8125
9068
|
addLinkedProjects(linkedProjs) {
|
|
8126
9069
|
/* */
|
|
8127
9070
|
/* */
|
|
@@ -8129,6 +9072,8 @@ class BaseLinkedProjects extends BaseFeatureForProject {
|
|
|
8129
9072
|
/* */
|
|
8130
9073
|
return (void 0);
|
|
8131
9074
|
}
|
|
9075
|
+
//#endregion
|
|
9076
|
+
//#region methods & getters / set linked projects config
|
|
8132
9077
|
setLinkedProjectsConfig(linkedPorjectsConfig) {
|
|
8133
9078
|
/* */
|
|
8134
9079
|
/* */
|
|
@@ -8169,12 +9114,16 @@ class BaseLinkedProjects extends BaseFeatureForProject {
|
|
|
8169
9114
|
/* */
|
|
8170
9115
|
return (void 0);
|
|
8171
9116
|
}
|
|
9117
|
+
//#endregion
|
|
9118
|
+
//#region methods & getters / get linked projects config path
|
|
8172
9119
|
get linkedProjectsConfigPath() {
|
|
8173
9120
|
return this.project.pathFor(config.file.linked_projects_json);
|
|
8174
9121
|
}
|
|
8175
9122
|
get linkedProjectsConfigTempPath() {
|
|
8176
9123
|
return this.project.pathFor([`tmp-${config.file.linked_projects_json}`]);
|
|
8177
9124
|
}
|
|
9125
|
+
//#endregion
|
|
9126
|
+
//#region methods & getters / recreate linked projects config
|
|
8178
9127
|
recreateLinkedProjectsConfig() {
|
|
8179
9128
|
/* */
|
|
8180
9129
|
/* */
|
|
@@ -8188,6 +9137,8 @@ class BaseLinkedProjects extends BaseFeatureForProject {
|
|
|
8188
9137
|
/* */
|
|
8189
9138
|
return (void 0);
|
|
8190
9139
|
}
|
|
9140
|
+
//#endregion
|
|
9141
|
+
//#region methods & getters / get linked projects config
|
|
8191
9142
|
getLinkedProjectsConfig() {
|
|
8192
9143
|
/* */
|
|
8193
9144
|
/* */
|
|
@@ -8238,19 +9189,29 @@ class BaseLinkedProjects extends BaseFeatureForProject {
|
|
|
8238
9189
|
/* */
|
|
8239
9190
|
return (void 0);
|
|
8240
9191
|
}
|
|
9192
|
+
//#endregion
|
|
9193
|
+
//#region methods & getters / linked projects
|
|
8241
9194
|
get linkedProjects() {
|
|
8242
9195
|
return this.getLinkedProjectsConfig().projects || [];
|
|
8243
9196
|
}
|
|
9197
|
+
//#endregion
|
|
9198
|
+
//#region methods & getters / detected linked projects
|
|
8244
9199
|
get detectedLinkedProjects() {
|
|
8245
|
-
const detectedLinkedProjects = LinkedProject.detect(this.project.location, true);
|
|
9200
|
+
const detectedLinkedProjects = LinkedProject.detect(this.project.location, { recursive: true });
|
|
8246
9201
|
return detectedLinkedProjects;
|
|
8247
9202
|
}
|
|
9203
|
+
//#endregion
|
|
9204
|
+
//#region methods & getters / linked projects prefix
|
|
8248
9205
|
get linkedProjectsPrefix() {
|
|
8249
9206
|
return this.getLinkedProjectsConfig().prefix;
|
|
8250
9207
|
}
|
|
9208
|
+
//#endregion
|
|
9209
|
+
//#region getters & methods / reset linked projects only to core branches
|
|
8251
9210
|
resetLinkedProjectsOnlyToCoreBranches() {
|
|
8252
9211
|
return false;
|
|
8253
9212
|
}
|
|
9213
|
+
//#endregion
|
|
9214
|
+
//#region getters & methods / get unexisted projects
|
|
8254
9215
|
async cloneUnexistedLinkedProjects(actionType, setOrigin, cloneChildren = false) {
|
|
8255
9216
|
/* */
|
|
8256
9217
|
/* */
|
|
@@ -8336,20 +9297,24 @@ class BaseLinkedProjects extends BaseFeatureForProject {
|
|
|
8336
9297
|
return (void 0);
|
|
8337
9298
|
}
|
|
8338
9299
|
}
|
|
8339
|
-
;
|
|
8340
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-linked-projects.ts
|
|
8341
9300
|
|
|
9301
|
+
//#endregion
|
|
8342
9302
|
class BaseGit extends BaseFeatureForProject {
|
|
9303
|
+
//#region methods & getters / unstage all files
|
|
8343
9304
|
unstageAllFiles() {
|
|
8344
9305
|
/* */
|
|
8345
9306
|
/* */
|
|
8346
9307
|
return (void 0);
|
|
8347
9308
|
}
|
|
9309
|
+
//#endregion
|
|
9310
|
+
//#region methods & getters / revert file changes
|
|
8348
9311
|
revertFileChanges(fileReletivePath) {
|
|
8349
9312
|
/* */
|
|
8350
9313
|
/* */
|
|
8351
9314
|
return (void 0);
|
|
8352
9315
|
}
|
|
9316
|
+
//#endregion
|
|
9317
|
+
//#region methods & getters / clone
|
|
8353
9318
|
async clone(url, destinationFolderName = '', branchName) {
|
|
8354
9319
|
/* */
|
|
8355
9320
|
/* */
|
|
@@ -8371,71 +9336,99 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8371
9336
|
/* */
|
|
8372
9337
|
return (void 0);
|
|
8373
9338
|
}
|
|
9339
|
+
//#endregion
|
|
9340
|
+
//#region methods & getters / restore last version
|
|
8374
9341
|
restoreLastVersion(relativeFilePath) {
|
|
8375
9342
|
/* */
|
|
8376
9343
|
/* */
|
|
8377
9344
|
return (void 0);
|
|
8378
9345
|
}
|
|
9346
|
+
//#endregion
|
|
9347
|
+
//#region methods & getters / stage all files
|
|
8379
9348
|
stageAllFiles() {
|
|
8380
9349
|
/* */
|
|
8381
9350
|
/* */
|
|
8382
9351
|
return (void 0);
|
|
8383
9352
|
}
|
|
9353
|
+
//#endregion
|
|
9354
|
+
//#region methods & getters / stage all files
|
|
8384
9355
|
stageFile(relativeFilePath) {
|
|
8385
9356
|
/* */
|
|
8386
9357
|
/* */
|
|
8387
9358
|
return (void 0);
|
|
8388
9359
|
}
|
|
9360
|
+
//#endregion
|
|
9361
|
+
//#region methods & getters / stash
|
|
8389
9362
|
stash(options) {
|
|
8390
9363
|
/* */
|
|
8391
9364
|
/* */
|
|
8392
9365
|
return (void 0);
|
|
8393
9366
|
}
|
|
9367
|
+
//#endregion
|
|
9368
|
+
//#region methods & getters / stash
|
|
8394
9369
|
rebase(toBranch) {
|
|
8395
9370
|
/* */
|
|
8396
9371
|
/* */
|
|
8397
9372
|
return (void 0);
|
|
8398
9373
|
}
|
|
9374
|
+
//#endregion
|
|
9375
|
+
//#region methods & getters / stash apply
|
|
8399
9376
|
stashApply() {
|
|
8400
9377
|
/* */
|
|
8401
9378
|
/* */
|
|
8402
9379
|
return (void 0);
|
|
8403
9380
|
}
|
|
9381
|
+
//#endregion
|
|
9382
|
+
//#region methods & getters / fetch
|
|
8404
9383
|
fetch(all = false) {
|
|
8405
9384
|
/* */
|
|
8406
9385
|
/* */
|
|
8407
9386
|
return (void 0);
|
|
8408
9387
|
}
|
|
9388
|
+
//#endregion
|
|
9389
|
+
//#region methods & getters / reset files
|
|
8409
9390
|
resetFiles(...relativePathes) {
|
|
8410
9391
|
/* */
|
|
8411
9392
|
/* */
|
|
8412
9393
|
return (void 0);
|
|
8413
9394
|
}
|
|
9395
|
+
//#endregion
|
|
9396
|
+
//#region methods & getters / is inside git repo
|
|
8414
9397
|
get isInsideGitRepo() {
|
|
8415
9398
|
/* */
|
|
8416
9399
|
/* */
|
|
8417
9400
|
return (void 0);
|
|
8418
9401
|
}
|
|
9402
|
+
//#endregion
|
|
9403
|
+
//#region methods & getters / is without git repository
|
|
8419
9404
|
get isWithoutGitRepository() {
|
|
8420
9405
|
/* */
|
|
8421
9406
|
/* */
|
|
8422
9407
|
return (void 0);
|
|
8423
9408
|
}
|
|
9409
|
+
//#endregion
|
|
9410
|
+
//#region methods & getters / is git root
|
|
8424
9411
|
get isGitRoot() {
|
|
8425
9412
|
/* */
|
|
8426
9413
|
/* */
|
|
8427
9414
|
return (void 0);
|
|
8428
9415
|
}
|
|
9416
|
+
//#endregion
|
|
9417
|
+
//#region methods & getters / origin url
|
|
8429
9418
|
get originURL() {
|
|
8430
9419
|
/* */
|
|
8431
9420
|
/* */
|
|
8432
9421
|
return (void 0);
|
|
8433
9422
|
}
|
|
9423
|
+
//#endregion
|
|
9424
|
+
//#region methods & getters / commit
|
|
8434
9425
|
commit(commitMessage) {
|
|
8435
9426
|
/* */
|
|
8436
9427
|
/* */
|
|
8437
9428
|
return (void 0);
|
|
8438
9429
|
}
|
|
9430
|
+
//#endregion
|
|
9431
|
+
//#region methods & getters / add and commit
|
|
8439
9432
|
/**
|
|
8440
9433
|
* alias to stage all and commit
|
|
8441
9434
|
*/
|
|
@@ -8444,15 +9437,20 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8444
9437
|
/* */
|
|
8445
9438
|
return (void 0);
|
|
8446
9439
|
}
|
|
9440
|
+
//#endregion
|
|
9441
|
+
//#region methods & getters / get default develop Branch
|
|
8447
9442
|
/**
|
|
8448
9443
|
* general default development branch for all kinds of projects
|
|
8449
9444
|
*/
|
|
8450
9445
|
getDefaultDevelopmentBranch() {
|
|
8451
9446
|
return 'develop';
|
|
8452
9447
|
}
|
|
9448
|
+
//#endregion
|
|
9449
|
+
//#region methods & getters / is using action commit
|
|
8453
9450
|
isUsingActionCommit() {
|
|
8454
9451
|
return false;
|
|
8455
9452
|
}
|
|
9453
|
+
//#endregion
|
|
8456
9454
|
jiraIssuesAreOutsideBrackets() {
|
|
8457
9455
|
return false;
|
|
8458
9456
|
}
|
|
@@ -8471,26 +9469,35 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8471
9469
|
/* */
|
|
8472
9470
|
return (void 0);
|
|
8473
9471
|
}
|
|
9472
|
+
//#region methods & getters / stage all and commit
|
|
8474
9473
|
stageAllAndCommit(commitMessage) {
|
|
8475
9474
|
/* */
|
|
8476
9475
|
/* */
|
|
8477
9476
|
return (void 0);
|
|
8478
9477
|
}
|
|
9478
|
+
//#endregion
|
|
9479
|
+
//#region methods & getters / push current branch
|
|
8479
9480
|
async pushCurrentBranch(options) {
|
|
8480
9481
|
/* */
|
|
8481
9482
|
/* */
|
|
8482
9483
|
return (void 0);
|
|
8483
9484
|
}
|
|
9485
|
+
//#endregion
|
|
9486
|
+
//#region methods & getters / all origins
|
|
8484
9487
|
get allOrigins() {
|
|
8485
9488
|
/* */
|
|
8486
9489
|
/* */
|
|
8487
9490
|
return (void 0);
|
|
8488
9491
|
}
|
|
9492
|
+
//#endregion
|
|
9493
|
+
//#region methods & getters / uncommited files
|
|
8489
9494
|
get uncommitedFiles() {
|
|
8490
9495
|
/* */
|
|
8491
9496
|
/* */
|
|
8492
9497
|
return (void 0);
|
|
8493
9498
|
}
|
|
9499
|
+
//#endregion
|
|
9500
|
+
//#region methods & getters / there are some uncommited change
|
|
8494
9501
|
get thereAreSomeUncommitedChange() {
|
|
8495
9502
|
/* */
|
|
8496
9503
|
/* */
|
|
@@ -8498,6 +9505,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8498
9505
|
/* */
|
|
8499
9506
|
return (void 0);
|
|
8500
9507
|
}
|
|
9508
|
+
//#endregion
|
|
9509
|
+
//#region methods & getters / there are some uncommited change except
|
|
8501
9510
|
thereAreSomeUncommitedChangeExcept(filesList = []) {
|
|
8502
9511
|
/* */
|
|
8503
9512
|
/* */
|
|
@@ -8506,6 +9515,7 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8506
9515
|
/* */
|
|
8507
9516
|
return (void 0);
|
|
8508
9517
|
}
|
|
9518
|
+
//#endregion
|
|
8509
9519
|
/**
|
|
8510
9520
|
* Resolve last changes
|
|
8511
9521
|
* - uncommited changes
|
|
@@ -8686,6 +9696,7 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8686
9696
|
/* */
|
|
8687
9697
|
return (void 0);
|
|
8688
9698
|
}
|
|
9699
|
+
//#region methods & getters / has action commits to melt
|
|
8689
9700
|
get hasActionCommitsToMelt() {
|
|
8690
9701
|
/* */
|
|
8691
9702
|
/* */
|
|
@@ -8694,10 +9705,14 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8694
9705
|
/* */
|
|
8695
9706
|
return (void 0);
|
|
8696
9707
|
}
|
|
9708
|
+
//#endregion
|
|
9709
|
+
//#region methods & getters / melt action commits
|
|
8697
9710
|
meltActionCommits() {
|
|
8698
9711
|
/* */
|
|
8699
9712
|
/* */
|
|
8700
9713
|
}
|
|
9714
|
+
//#endregion
|
|
9715
|
+
//#region push to git repo
|
|
8701
9716
|
/**
|
|
8702
9717
|
*
|
|
8703
9718
|
* @param newVersion
|
|
@@ -8712,71 +9727,99 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8712
9727
|
/* */
|
|
8713
9728
|
return (void 0);
|
|
8714
9729
|
}
|
|
9730
|
+
//#endregion
|
|
9731
|
+
//#region methods & getters / pull current branch
|
|
8715
9732
|
async pullCurrentBranch(options) {
|
|
8716
9733
|
/* */
|
|
8717
9734
|
/* */
|
|
8718
9735
|
return (void 0);
|
|
8719
9736
|
}
|
|
9737
|
+
//#endregion
|
|
9738
|
+
//#region methods & getters / current branch name
|
|
8720
9739
|
get currentBranchName() {
|
|
8721
9740
|
/* */
|
|
8722
9741
|
/* */
|
|
8723
9742
|
return (void 0);
|
|
8724
9743
|
}
|
|
9744
|
+
//#endregion
|
|
9745
|
+
//#region methods & getters / list of current git changes
|
|
8725
9746
|
get listOfCurrentGitChanges() {
|
|
8726
9747
|
/* */
|
|
8727
9748
|
/* */
|
|
8728
9749
|
return (void 0);
|
|
8729
9750
|
}
|
|
9751
|
+
//#endregion
|
|
9752
|
+
//#region methods & getters / get branches names by
|
|
8730
9753
|
getBranchesNamesBy(pattern) {
|
|
8731
9754
|
/* */
|
|
8732
9755
|
/* */
|
|
8733
9756
|
return (void 0);
|
|
8734
9757
|
}
|
|
9758
|
+
//#endregion
|
|
9759
|
+
//#region methods & getters / reset soft HEAD
|
|
8735
9760
|
resetSoftHEAD(HEAD = 1) {
|
|
8736
9761
|
/* */
|
|
8737
9762
|
/* */
|
|
8738
9763
|
return (void 0);
|
|
8739
9764
|
}
|
|
9765
|
+
//#endregion
|
|
9766
|
+
//#region methods & getters / reset hard
|
|
8740
9767
|
resetHard(options) {
|
|
8741
9768
|
/* */
|
|
8742
9769
|
/* */
|
|
8743
9770
|
return (void 0);
|
|
8744
9771
|
}
|
|
9772
|
+
//#endregion
|
|
9773
|
+
//#region methods & getters / count commits
|
|
8745
9774
|
countComits() {
|
|
8746
9775
|
/* */
|
|
8747
9776
|
/* */
|
|
8748
9777
|
return (void 0);
|
|
8749
9778
|
}
|
|
9779
|
+
//#endregion
|
|
9780
|
+
//#region methods & getters / has any commits
|
|
8750
9781
|
hasAnyCommits() {
|
|
8751
9782
|
/* */
|
|
8752
9783
|
/* */
|
|
8753
9784
|
return (void 0);
|
|
8754
9785
|
}
|
|
9786
|
+
//#endregion
|
|
9787
|
+
//#region methods & getters / is in merge process
|
|
8755
9788
|
get isInMergeProcess() {
|
|
8756
9789
|
/* */
|
|
8757
9790
|
/* */
|
|
8758
9791
|
return (void 0);
|
|
8759
9792
|
}
|
|
9793
|
+
//#endregion
|
|
9794
|
+
//#region methods & getters / last commit date
|
|
8760
9795
|
lastCommitDate() {
|
|
8761
9796
|
/* */
|
|
8762
9797
|
/* */
|
|
8763
9798
|
return (void 0);
|
|
8764
9799
|
}
|
|
9800
|
+
//#endregion
|
|
9801
|
+
//#region methods & getters / last commit hash
|
|
8765
9802
|
lastCommitHash() {
|
|
8766
9803
|
/* */
|
|
8767
9804
|
/* */
|
|
8768
9805
|
return (void 0);
|
|
8769
9806
|
}
|
|
9807
|
+
//#endregion
|
|
9808
|
+
//#region methods & getters / last commit message
|
|
8770
9809
|
lastCommitMessage() {
|
|
8771
9810
|
/* */
|
|
8772
9811
|
/* */
|
|
8773
9812
|
return (void 0);
|
|
8774
9813
|
}
|
|
9814
|
+
//#endregion
|
|
9815
|
+
//#region methods & getters / last commit message
|
|
8775
9816
|
async penultimateCommitMessage() {
|
|
8776
9817
|
/* */
|
|
8777
9818
|
/* */
|
|
8778
9819
|
return (void 0);
|
|
8779
9820
|
}
|
|
9821
|
+
//#endregion
|
|
9822
|
+
//#region methods & getters / get commit message by index
|
|
8780
9823
|
async getCommitMessageByIndex(index) {
|
|
8781
9824
|
/* */
|
|
8782
9825
|
/* */
|
|
@@ -8785,6 +9828,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8785
9828
|
/* */
|
|
8786
9829
|
return (void 0);
|
|
8787
9830
|
}
|
|
9831
|
+
//#endregion
|
|
9832
|
+
//#region methods & getters / get commit message by hash
|
|
8788
9833
|
async getCommitMessageByHash(hash) {
|
|
8789
9834
|
/* */
|
|
8790
9835
|
/* */
|
|
@@ -8793,26 +9838,35 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8793
9838
|
/* */
|
|
8794
9839
|
return (void 0);
|
|
8795
9840
|
}
|
|
9841
|
+
//#endregion
|
|
9842
|
+
//#region methods & getters / get commit hash by index
|
|
8796
9843
|
async getCommitHashByIndex(index) {
|
|
8797
9844
|
/* */
|
|
8798
9845
|
/* */
|
|
8799
9846
|
return (void 0);
|
|
8800
9847
|
}
|
|
9848
|
+
//#endregion
|
|
9849
|
+
//#region methods & getters / penultimate commit hash
|
|
8801
9850
|
penultimateCommitHash() {
|
|
8802
9851
|
/* */
|
|
8803
9852
|
/* */
|
|
8804
9853
|
return (void 0);
|
|
8805
9854
|
}
|
|
9855
|
+
//#endregion
|
|
9856
|
+
//#region methods & getters / check tag exists
|
|
8806
9857
|
checkTagExists(tag) {
|
|
8807
9858
|
/* */
|
|
8808
9859
|
/* */
|
|
8809
9860
|
return (void 0);
|
|
8810
9861
|
}
|
|
9862
|
+
//#endregion
|
|
9863
|
+
//#region methods & getters / checkout
|
|
8811
9864
|
checkout(branchName, options) {
|
|
8812
9865
|
/* */
|
|
8813
9866
|
/* */
|
|
8814
9867
|
return (void 0);
|
|
8815
9868
|
}
|
|
9869
|
+
//#endregion
|
|
8816
9870
|
cleanRepoFromAnyFilesExceptDotGitFolder() {
|
|
8817
9871
|
/* */
|
|
8818
9872
|
/* */
|
|
@@ -8820,6 +9874,7 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8820
9874
|
/* */
|
|
8821
9875
|
return (void 0);
|
|
8822
9876
|
}
|
|
9877
|
+
//#region methods & getters / checkout from to
|
|
8823
9878
|
checkoutFromTo(checkoutFromBranch, branch, origin = 'origin') {
|
|
8824
9879
|
/* */
|
|
8825
9880
|
/* */
|
|
@@ -8830,6 +9885,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8830
9885
|
/* */
|
|
8831
9886
|
return (void 0);
|
|
8832
9887
|
}
|
|
9888
|
+
//#endregion
|
|
9889
|
+
//#region methods & getters / last tag name for major version
|
|
8833
9890
|
/**
|
|
8834
9891
|
*
|
|
8835
9892
|
* @param majorVersion example: v1, v2 etc.
|
|
@@ -8843,16 +9900,22 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8843
9900
|
/* */
|
|
8844
9901
|
return (void 0);
|
|
8845
9902
|
}
|
|
9903
|
+
//#endregion
|
|
9904
|
+
//#region methods & getters / last tag hash
|
|
8846
9905
|
lastTagHash() {
|
|
8847
9906
|
/* */
|
|
8848
9907
|
/* */
|
|
8849
9908
|
return (void 0);
|
|
8850
9909
|
}
|
|
9910
|
+
//#endregion
|
|
9911
|
+
//#region methods & getters / remote origin url
|
|
8851
9912
|
get remoteOriginUrl() {
|
|
8852
9913
|
/* */
|
|
8853
9914
|
/* */
|
|
8854
9915
|
return (void 0);
|
|
8855
9916
|
}
|
|
9917
|
+
//#endregion
|
|
9918
|
+
//#region methods & getters / remote origin url
|
|
8856
9919
|
/**
|
|
8857
9920
|
* get provider of remote origin
|
|
8858
9921
|
*/
|
|
@@ -8861,11 +9924,15 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8861
9924
|
/* */
|
|
8862
9925
|
return (void 0);
|
|
8863
9926
|
}
|
|
9927
|
+
//#endregion
|
|
9928
|
+
//#region methods & getters / last tag version name
|
|
8864
9929
|
get lastTagVersionName() {
|
|
8865
9930
|
/* */
|
|
8866
9931
|
/* */
|
|
8867
9932
|
return (void 0);
|
|
8868
9933
|
}
|
|
9934
|
+
//#endregion
|
|
9935
|
+
//#region methods & getters / staged files
|
|
8869
9936
|
get stagedFiles() {
|
|
8870
9937
|
/* */
|
|
8871
9938
|
/* */
|
|
@@ -8876,6 +9943,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8876
9943
|
/* */
|
|
8877
9944
|
return (void 0);
|
|
8878
9945
|
}
|
|
9946
|
+
//#endregion
|
|
9947
|
+
//#region methods & getters / rename origin
|
|
8879
9948
|
/**
|
|
8880
9949
|
* TODO does this make any sense
|
|
8881
9950
|
*/
|
|
@@ -8907,12 +9976,16 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8907
9976
|
/* */
|
|
8908
9977
|
return (void 0);
|
|
8909
9978
|
}
|
|
9979
|
+
//#endregion
|
|
9980
|
+
//#region getters & methods / translate git commit from args
|
|
8910
9981
|
/**
|
|
8911
9982
|
* By default no translation of commit
|
|
8912
9983
|
*/
|
|
8913
9984
|
transalteGitCommitFromArgs() {
|
|
8914
9985
|
return { from: void 0, to: void 0 };
|
|
8915
9986
|
}
|
|
9987
|
+
//#endregion
|
|
9988
|
+
//#region getters & methods / us git branches when commiting and pushing
|
|
8916
9989
|
/**
|
|
8917
9990
|
* By defult true.. when commit branches will not function.
|
|
8918
9991
|
* (false is better for simple projects)
|
|
@@ -8920,18 +9993,24 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8920
9993
|
useGitBranchesWhenCommitingAndPushing() {
|
|
8921
9994
|
return true;
|
|
8922
9995
|
}
|
|
9996
|
+
//#endregion
|
|
9997
|
+
//#region getters & methods / automatically add all changes when pushing to git
|
|
8923
9998
|
/**
|
|
8924
9999
|
* usefull when pushing in project with childrens as git repos
|
|
8925
10000
|
*/
|
|
8926
10001
|
automaticallyAddAllChangesWhenPushingToGit() {
|
|
8927
10002
|
return false;
|
|
8928
10003
|
}
|
|
10004
|
+
//#endregion
|
|
10005
|
+
//#region getters & methods / use git branches as metadata for commits
|
|
8929
10006
|
/**
|
|
8930
10007
|
* usefull when pushing in project with childrens as git repos
|
|
8931
10008
|
*/
|
|
8932
10009
|
useGitBranchesAsMetadataForCommits() {
|
|
8933
10010
|
return true;
|
|
8934
10011
|
}
|
|
10012
|
+
//#endregion
|
|
10013
|
+
//#region getters & methods / clone to
|
|
8935
10014
|
async cloneTo(cwd, newProjectName) {
|
|
8936
10015
|
/* */
|
|
8937
10016
|
/* */
|
|
@@ -8964,6 +10043,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8964
10043
|
/* */
|
|
8965
10044
|
return (void 0);
|
|
8966
10045
|
}
|
|
10046
|
+
//#endregion
|
|
10047
|
+
//#region getters & methods / get children
|
|
8967
10048
|
/**
|
|
8968
10049
|
* This is only for push/pull process
|
|
8969
10050
|
*
|
|
@@ -8991,6 +10072,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
8991
10072
|
childrenRepos = childrenRepos.filter(f => f.git.isInsideGitRepo && f.git.isGitRoot);
|
|
8992
10073
|
return childrenRepos;
|
|
8993
10074
|
}
|
|
10075
|
+
//#endregion
|
|
10076
|
+
//#region getters & methods / set remote origin type
|
|
8994
10077
|
async setRemoteOriginType(setOrigin) {
|
|
8995
10078
|
/* */
|
|
8996
10079
|
/* */
|
|
@@ -9003,6 +10086,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
9003
10086
|
/* */
|
|
9004
10087
|
return (void 0);
|
|
9005
10088
|
}
|
|
10089
|
+
//#endregion
|
|
10090
|
+
//#region methods & getters / push process
|
|
9006
10091
|
async pullProcess(options = {}) {
|
|
9007
10092
|
/* */
|
|
9008
10093
|
/* */
|
|
@@ -9040,6 +10125,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
9040
10125
|
/* */
|
|
9041
10126
|
return (void 0);
|
|
9042
10127
|
}
|
|
10128
|
+
//#endregion
|
|
10129
|
+
//#region methods & getters / push process
|
|
9043
10130
|
async pushProcess(options = {}) {
|
|
9044
10131
|
/* */
|
|
9045
10132
|
/* */
|
|
@@ -9368,6 +10455,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
9368
10455
|
/* */
|
|
9369
10456
|
return (void 0);
|
|
9370
10457
|
}
|
|
10458
|
+
//#endregion
|
|
10459
|
+
//#region methods & getters / before any action on git root
|
|
9371
10460
|
_beforeAnyActionOnGitRoot() {
|
|
9372
10461
|
/* */
|
|
9373
10462
|
/* */
|
|
@@ -9388,6 +10477,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
9388
10477
|
/* */
|
|
9389
10478
|
return (void 0);
|
|
9390
10479
|
}
|
|
10480
|
+
//#endregion
|
|
10481
|
+
//#region methods & getters / before push action
|
|
9391
10482
|
async _beforePushProcessAction(setOrigin) {
|
|
9392
10483
|
/* */
|
|
9393
10484
|
/* */
|
|
@@ -9414,6 +10505,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
9414
10505
|
/* */
|
|
9415
10506
|
return (void 0);
|
|
9416
10507
|
}
|
|
10508
|
+
//#endregion
|
|
10509
|
+
//#region methods & getters / before push action
|
|
9417
10510
|
async _beforePullProcessAction(setOrigin, cloneChildren = false) {
|
|
9418
10511
|
/* */
|
|
9419
10512
|
/* */
|
|
@@ -9424,6 +10517,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
9424
10517
|
/* */
|
|
9425
10518
|
return (void 0);
|
|
9426
10519
|
}
|
|
10520
|
+
//#endregion
|
|
10521
|
+
//#region methods & getters / resovle commit message
|
|
9427
10522
|
async _getCommitMessage(typeOfCommit, args, commitMessageRequired,
|
|
9428
10523
|
/**
|
|
9429
10524
|
* only needed when push github
|
|
@@ -9489,6 +10584,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
9489
10584
|
/* */
|
|
9490
10585
|
return (void 0);
|
|
9491
10586
|
}
|
|
10587
|
+
//#endregion
|
|
10588
|
+
//#region methods & getters / prevent accidental branch change for taon projects
|
|
9492
10589
|
/**
|
|
9493
10590
|
* This will prevent accidental branch change for taon projects
|
|
9494
10591
|
* @returns branch name
|
|
@@ -9496,6 +10593,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
9496
10593
|
duringPushWarnIfProjectNotOnSpecyficDevBranch() {
|
|
9497
10594
|
return void 0;
|
|
9498
10595
|
}
|
|
10596
|
+
//#endregion
|
|
10597
|
+
//#region methods & getters / get changed files in commit by hash
|
|
9499
10598
|
async getChangedFilesInCommitByHash(hash) {
|
|
9500
10599
|
/* */
|
|
9501
10600
|
/* */
|
|
@@ -9504,6 +10603,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
9504
10603
|
/* */
|
|
9505
10604
|
return (void 0);
|
|
9506
10605
|
}
|
|
10606
|
+
//#endregion
|
|
10607
|
+
//#region methods & getters / get changed files in commit
|
|
9507
10608
|
/**
|
|
9508
10609
|
* @param index 0 - means last commit
|
|
9509
10610
|
*/
|
|
@@ -9515,6 +10616,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
9515
10616
|
/* */
|
|
9516
10617
|
return (void 0);
|
|
9517
10618
|
}
|
|
10619
|
+
//#endregion
|
|
10620
|
+
//#region methods & getters / get changes summary
|
|
9518
10621
|
async changesSummary() {
|
|
9519
10622
|
/* */
|
|
9520
10623
|
/* */
|
|
@@ -9530,6 +10633,8 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
9530
10633
|
/* */
|
|
9531
10634
|
return (void 0);
|
|
9532
10635
|
}
|
|
10636
|
+
//#endregion
|
|
10637
|
+
//#region methods & getters / reset is resting also children
|
|
9533
10638
|
/**
|
|
9534
10639
|
* If true command navi reset will reset project
|
|
9535
10640
|
* and its children.
|
|
@@ -9540,8 +10645,6 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
9540
10645
|
return true;
|
|
9541
10646
|
}
|
|
9542
10647
|
}
|
|
9543
|
-
;
|
|
9544
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-git.ts
|
|
9545
10648
|
|
|
9546
10649
|
class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
9547
10650
|
constructor() {
|
|
@@ -9551,7 +10654,9 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
9551
10654
|
*/
|
|
9552
10655
|
this.settingsJson = '.vscode/settings.json';
|
|
9553
10656
|
this.extensionsJson = '.vscode/extensions.json';
|
|
10657
|
+
//#endregion
|
|
9554
10658
|
}
|
|
10659
|
+
//#region extensions
|
|
9555
10660
|
get extensions() {
|
|
9556
10661
|
return Helpers.uniqArray([
|
|
9557
10662
|
/* */
|
|
@@ -9661,6 +10766,8 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
9661
10766
|
/* */
|
|
9662
10767
|
]).map(c => c.toLowerCase());
|
|
9663
10768
|
}
|
|
10769
|
+
//#endregion
|
|
10770
|
+
//#region recreate extensions
|
|
9664
10771
|
recreateExtensions() {
|
|
9665
10772
|
/* */
|
|
9666
10773
|
/* */
|
|
@@ -9675,6 +10782,8 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
9675
10782
|
/* */
|
|
9676
10783
|
return (void 0);
|
|
9677
10784
|
}
|
|
10785
|
+
//#endregion
|
|
10786
|
+
//#region recraete window title
|
|
9678
10787
|
recreateWindowTitle() {
|
|
9679
10788
|
/* */
|
|
9680
10789
|
/* */
|
|
@@ -9684,6 +10793,8 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
9684
10793
|
/* */
|
|
9685
10794
|
return (void 0);
|
|
9686
10795
|
}
|
|
10796
|
+
//#endregion
|
|
10797
|
+
//#region install extensions
|
|
9687
10798
|
async installExtensions(extensions = this.extensions, defaultSelectedAll = false) {
|
|
9688
10799
|
/* */
|
|
9689
10800
|
/* */
|
|
@@ -9742,6 +10853,8 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
9742
10853
|
/* */
|
|
9743
10854
|
return (void 0);
|
|
9744
10855
|
}
|
|
10856
|
+
//#endregion
|
|
10857
|
+
//#region strip version
|
|
9745
10858
|
/**
|
|
9746
10859
|
* This pattern finds a dash followed by at least one digit.
|
|
9747
10860
|
* It removes everything from that dash to the end of the string.
|
|
@@ -9752,6 +10865,8 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
9752
10865
|
stripVersion(folderName) {
|
|
9753
10866
|
return folderName.replace(/(-\d+.*)$/, '');
|
|
9754
10867
|
}
|
|
10868
|
+
//#endregion
|
|
10869
|
+
//#region installed extensions
|
|
9755
10870
|
get installedExtensions() {
|
|
9756
10871
|
/* */
|
|
9757
10872
|
/* */
|
|
@@ -9779,6 +10894,8 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
9779
10894
|
/* */
|
|
9780
10895
|
return (void 0);
|
|
9781
10896
|
}
|
|
10897
|
+
//#endregion
|
|
10898
|
+
//#region apply proper global settings
|
|
9782
10899
|
async applyProperGlobalSettings() {
|
|
9783
10900
|
/* */
|
|
9784
10901
|
/* */
|
|
@@ -10064,6 +11181,8 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
10064
11181
|
/* */
|
|
10065
11182
|
return (void 0);
|
|
10066
11183
|
}
|
|
11184
|
+
//#endregion
|
|
11185
|
+
//#region fields & getters / vscode settings
|
|
10067
11186
|
get vscodeSettingsJson() {
|
|
10068
11187
|
/* */
|
|
10069
11188
|
/* */
|
|
@@ -10072,24 +11191,31 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
10072
11191
|
return (void 0);
|
|
10073
11192
|
}
|
|
10074
11193
|
}
|
|
10075
|
-
;
|
|
10076
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-vscode.ts
|
|
10077
11194
|
|
|
11195
|
+
//#endregion
|
|
10078
11196
|
class BaseReleaseProcess extends BaseFeatureForProject {
|
|
10079
11197
|
constructor() {
|
|
11198
|
+
//#region fields
|
|
10080
11199
|
super(...arguments);
|
|
10081
11200
|
/**
|
|
10082
11201
|
* Automatic release process of patch plus one version
|
|
10083
11202
|
*/
|
|
10084
11203
|
this.automaticRelease = false;
|
|
10085
11204
|
this.commitsForChangelog = [];
|
|
11205
|
+
//#endregion
|
|
10086
11206
|
}
|
|
11207
|
+
//#endregion
|
|
11208
|
+
//#region methods & getters / start release
|
|
10087
11209
|
startRelease(options) {
|
|
10088
11210
|
throw new Error('Method not implemented.');
|
|
10089
11211
|
}
|
|
11212
|
+
//#endregion
|
|
11213
|
+
//#region methods & getters / get release words
|
|
10090
11214
|
getReleaseWords() {
|
|
10091
11215
|
return ['release'];
|
|
10092
11216
|
}
|
|
11217
|
+
//#endregion
|
|
11218
|
+
//#region methods & getters / select changelog commits
|
|
10093
11219
|
async selectChangelogCommits() {
|
|
10094
11220
|
/* */
|
|
10095
11221
|
/* */
|
|
@@ -10118,6 +11244,8 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10118
11244
|
/* */
|
|
10119
11245
|
return (void 0);
|
|
10120
11246
|
}
|
|
11247
|
+
//#endregion
|
|
11248
|
+
//#region methods & getters / get commits up to release commit
|
|
10121
11249
|
async getCommitsUpToReleaseCommit() {
|
|
10122
11250
|
/* */
|
|
10123
11251
|
/* */
|
|
@@ -10134,6 +11262,7 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10134
11262
|
/* */
|
|
10135
11263
|
return (void 0);
|
|
10136
11264
|
}
|
|
11265
|
+
//#endregion
|
|
10137
11266
|
async checkBundleQuestion(cwdForCode, checkMessage = `Select action before publishing ?`) {
|
|
10138
11267
|
/* */
|
|
10139
11268
|
/* */
|
|
@@ -10175,6 +11304,7 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10175
11304
|
/* */
|
|
10176
11305
|
return (void 0);
|
|
10177
11306
|
}
|
|
11307
|
+
//#region methods & getters / publish to npm
|
|
10178
11308
|
/**
|
|
10179
11309
|
* @returns true if publish , faslse if just version bump
|
|
10180
11310
|
*/
|
|
@@ -10215,6 +11345,8 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10215
11345
|
/* */
|
|
10216
11346
|
return (void 0);
|
|
10217
11347
|
}
|
|
11348
|
+
//#endregion
|
|
11349
|
+
//#region methods & getters / test after publish
|
|
10218
11350
|
async testAfterPublish() {
|
|
10219
11351
|
/* */
|
|
10220
11352
|
/* */
|
|
@@ -10234,6 +11366,8 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10234
11366
|
/* */
|
|
10235
11367
|
return (void 0);
|
|
10236
11368
|
}
|
|
11369
|
+
//#endregion
|
|
11370
|
+
//#region methods & getters / test before publish
|
|
10237
11371
|
async testBeforePublish() {
|
|
10238
11372
|
/* */
|
|
10239
11373
|
/* */
|
|
@@ -10253,6 +11387,8 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10253
11387
|
/* */
|
|
10254
11388
|
return (void 0);
|
|
10255
11389
|
}
|
|
11390
|
+
//#endregion
|
|
11391
|
+
//#region methods & getters / commit and push
|
|
10256
11392
|
async commitAndPush() {
|
|
10257
11393
|
/* */
|
|
10258
11394
|
/* */
|
|
@@ -10274,9 +11410,13 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10274
11410
|
/* */
|
|
10275
11411
|
return (void 0);
|
|
10276
11412
|
}
|
|
11413
|
+
//#endregion
|
|
11414
|
+
//#region methods & getters / release commit template
|
|
10277
11415
|
releaseCommitTemplate() {
|
|
10278
11416
|
return `Release v${this.newVersion} + changelog.md update`;
|
|
10279
11417
|
}
|
|
11418
|
+
//#endregion
|
|
11419
|
+
//#region methods & getters / test libraries
|
|
10280
11420
|
async testLibraries() {
|
|
10281
11421
|
try {
|
|
10282
11422
|
this.project.run('npm run test', { output: true }).sync();
|
|
@@ -10287,12 +11427,16 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10287
11427
|
return false;
|
|
10288
11428
|
}
|
|
10289
11429
|
}
|
|
11430
|
+
//#endregion
|
|
11431
|
+
//#region methods & getters / build all libraries
|
|
10290
11432
|
async buildAllLibraries() {
|
|
10291
11433
|
await this.project.libraryBuild.buildLibraries({
|
|
10292
11434
|
watch: false,
|
|
10293
11435
|
releaseBuild: true,
|
|
10294
11436
|
});
|
|
10295
11437
|
}
|
|
11438
|
+
//#endregion
|
|
11439
|
+
//#region methods & getters / reset release files
|
|
10296
11440
|
async resetReleaseFiles() {
|
|
10297
11441
|
/* */
|
|
10298
11442
|
/* */
|
|
@@ -10302,6 +11446,8 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10302
11446
|
/* */
|
|
10303
11447
|
return (void 0);
|
|
10304
11448
|
}
|
|
11449
|
+
//#endregion
|
|
11450
|
+
//#region methods & getters / to bump projects
|
|
10305
11451
|
get toBumpProjects() {
|
|
10306
11452
|
const toBumpProjects = [
|
|
10307
11453
|
this.project,
|
|
@@ -10309,6 +11455,8 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10309
11455
|
];
|
|
10310
11456
|
return toBumpProjects;
|
|
10311
11457
|
}
|
|
11458
|
+
//#endregion
|
|
11459
|
+
//#region methods & getters / bump new version everywhere
|
|
10312
11460
|
async bumpNewVersionEverywhere() {
|
|
10313
11461
|
/* */
|
|
10314
11462
|
/* */
|
|
@@ -10328,6 +11476,8 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10328
11476
|
/* */
|
|
10329
11477
|
return (void 0);
|
|
10330
11478
|
}
|
|
11479
|
+
//#endregion
|
|
11480
|
+
//#region methods & getters / confirm release type
|
|
10331
11481
|
async confirmNewVersion() {
|
|
10332
11482
|
/* */
|
|
10333
11483
|
/* */
|
|
@@ -10373,6 +11523,8 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10373
11523
|
/* */
|
|
10374
11524
|
return (void 0);
|
|
10375
11525
|
}
|
|
11526
|
+
//#endregion
|
|
11527
|
+
//#region methods & getters / select release type
|
|
10376
11528
|
async selectReleaseType(versionToUseResolveFn) {
|
|
10377
11529
|
/* */
|
|
10378
11530
|
/* */
|
|
@@ -10413,9 +11565,13 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10413
11565
|
/* */
|
|
10414
11566
|
return (void 0);
|
|
10415
11567
|
}
|
|
11568
|
+
//#endregion
|
|
11569
|
+
//#region methods & getters / commit message in changelog transform fn
|
|
10416
11570
|
async commitMessageInChangelogTransformFn(message) {
|
|
10417
11571
|
return message;
|
|
10418
11572
|
}
|
|
11573
|
+
//#endregion
|
|
11574
|
+
//#region methods & getters / calculate item
|
|
10419
11575
|
async getChangelogContentToAppend(askForEveryItem) {
|
|
10420
11576
|
/* */
|
|
10421
11577
|
/* */
|
|
@@ -10437,6 +11593,8 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10437
11593
|
/* */
|
|
10438
11594
|
return (void 0);
|
|
10439
11595
|
}
|
|
11596
|
+
//#endregion
|
|
11597
|
+
//#region methods & getters / update changelog.md from commits
|
|
10440
11598
|
/**
|
|
10441
11599
|
* TODO extend this to all commits from last release
|
|
10442
11600
|
*/
|
|
@@ -10470,6 +11628,8 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10470
11628
|
/* */
|
|
10471
11629
|
return (void 0);
|
|
10472
11630
|
}
|
|
11631
|
+
//#endregion
|
|
11632
|
+
//#region methods & getters / extract changed libraries in last commit
|
|
10473
11633
|
async extractChangedLibrariesInCommit(hashOrIndex) {
|
|
10474
11634
|
/* */
|
|
10475
11635
|
/* */
|
|
@@ -10489,6 +11649,8 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10489
11649
|
/* */
|
|
10490
11650
|
return (void 0);
|
|
10491
11651
|
}
|
|
11652
|
+
//#endregion
|
|
11653
|
+
//#region methods & getters / change log item template
|
|
10492
11654
|
async changelogItemTemplate(hashOrIndex, confirmEveryItem = false) {
|
|
10493
11655
|
/* */
|
|
10494
11656
|
/* */
|
|
@@ -10540,6 +11702,8 @@ class BaseReleaseProcess extends BaseFeatureForProject {
|
|
|
10540
11702
|
/* */
|
|
10541
11703
|
return (void 0);
|
|
10542
11704
|
}
|
|
11705
|
+
//#endregion
|
|
11706
|
+
//#region methods & getters / generate last changes summary
|
|
10543
11707
|
async generateLastChangesSummary() {
|
|
10544
11708
|
const lastReleaseCommitData = await this.getLastReleaseCommitData();
|
|
10545
11709
|
const hasLastReleaseCommit = lastReleaseCommitData.index !== -1;
|
|
@@ -10558,6 +11722,8 @@ ${await this.getLastChangesFromCommits({
|
|
|
10558
11722
|
})}
|
|
10559
11723
|
`;
|
|
10560
11724
|
}
|
|
11725
|
+
//#endregion
|
|
11726
|
+
//#region methods & getters / get last changes from commits
|
|
10561
11727
|
async getLastChangesFromCommits({ maxMessagesToCheck = 3, stopOnCommitMessage = '', } = {}) {
|
|
10562
11728
|
/* */
|
|
10563
11729
|
/* */
|
|
@@ -10583,6 +11749,8 @@ ${await this.getLastChangesFromCommits({
|
|
|
10583
11749
|
/* */
|
|
10584
11750
|
return (void 0);
|
|
10585
11751
|
}
|
|
11752
|
+
//#endregion
|
|
11753
|
+
//#region methods & getters / get last release commit data
|
|
10586
11754
|
async getLastReleaseCommitData() {
|
|
10587
11755
|
/* */
|
|
10588
11756
|
/* */
|
|
@@ -10613,6 +11781,8 @@ ${await this.getLastChangesFromCommits({
|
|
|
10613
11781
|
/* */
|
|
10614
11782
|
return (void 0);
|
|
10615
11783
|
}
|
|
11784
|
+
//#endregion
|
|
11785
|
+
//#region methods & getters / get last changes from changelog
|
|
10616
11786
|
async getLastPackageVersionChangesFromChnagelog() {
|
|
10617
11787
|
/* */
|
|
10618
11788
|
/* */
|
|
@@ -10653,6 +11823,8 @@ ${await this.getLastChangesFromCommits({
|
|
|
10653
11823
|
/* */
|
|
10654
11824
|
return (void 0);
|
|
10655
11825
|
}
|
|
11826
|
+
//#endregion
|
|
11827
|
+
//#region methods & getters / get changelog path
|
|
10656
11828
|
get changeLogPath() {
|
|
10657
11829
|
/* */
|
|
10658
11830
|
/* */
|
|
@@ -10660,12 +11832,18 @@ ${await this.getLastChangesFromCommits({
|
|
|
10660
11832
|
/* */
|
|
10661
11833
|
return (void 0);
|
|
10662
11834
|
}
|
|
11835
|
+
//#endregion
|
|
11836
|
+
//#region methods & getters / get changelog content
|
|
10663
11837
|
get changelogContent() {
|
|
10664
11838
|
return this.project.readFile(this.changeLogPath) || '';
|
|
10665
11839
|
}
|
|
11840
|
+
//#endregion
|
|
11841
|
+
//#region methods & getters / change log key word
|
|
10666
11842
|
changeLogKeyWord() {
|
|
10667
11843
|
return 'Changes in version';
|
|
10668
11844
|
}
|
|
11845
|
+
//#endregion
|
|
11846
|
+
//#region methods & getters / get changelog data
|
|
10669
11847
|
getChnagelogData() {
|
|
10670
11848
|
/* */
|
|
10671
11849
|
/* */
|
|
@@ -10696,12 +11874,13 @@ ${await this.getLastChangesFromCommits({
|
|
|
10696
11874
|
return (void 0);
|
|
10697
11875
|
}
|
|
10698
11876
|
}
|
|
10699
|
-
;
|
|
10700
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-release-process.ts
|
|
10701
11877
|
|
|
11878
|
+
//#region imports
|
|
10702
11879
|
/* */
|
|
10703
11880
|
/* */
|
|
11881
|
+
//#endregion
|
|
10704
11882
|
class BaseCompilerForProject extends IncCompiler.Base {
|
|
11883
|
+
//#region check folder compiler
|
|
10705
11884
|
checkFolderCompiler(project, options, dontCheck = false) {
|
|
10706
11885
|
/* */
|
|
10707
11886
|
/* */
|
|
@@ -10742,6 +11921,8 @@ class BaseCompilerForProject extends IncCompiler.Base {
|
|
|
10742
11921
|
/* */
|
|
10743
11922
|
return (void 0);
|
|
10744
11923
|
}
|
|
11924
|
+
//#endregion
|
|
11925
|
+
//#region constructor
|
|
10745
11926
|
constructor(project, options, allowFolderOutSideProject = false) {
|
|
10746
11927
|
super();
|
|
10747
11928
|
this.project = project;
|
|
@@ -10756,8 +11937,6 @@ class BaseCompilerForProject extends IncCompiler.Base {
|
|
|
10756
11937
|
/* */
|
|
10757
11938
|
}
|
|
10758
11939
|
}
|
|
10759
|
-
;
|
|
10760
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-compiler-for-project.ts
|
|
10761
11940
|
|
|
10762
11941
|
class BaseDebounceCompilerForProject extends BaseCompilerForProject {
|
|
10763
11942
|
constructor() {
|
|
@@ -10809,9 +11988,8 @@ class BaseDebounceCompilerForProject extends BaseCompilerForProject {
|
|
|
10809
11988
|
await this.debounceAction();
|
|
10810
11989
|
}
|
|
10811
11990
|
}
|
|
10812
|
-
;
|
|
10813
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-debounce-compiler-for-project.ts
|
|
10814
11991
|
|
|
11992
|
+
//#endregion
|
|
10815
11993
|
class BaseQuickFixes extends BaseFeatureForProject {
|
|
10816
11994
|
constructor(project) {
|
|
10817
11995
|
super(project);
|
|
@@ -10839,6 +12017,7 @@ class BaseQuickFixes extends BaseFeatureForProject {
|
|
|
10839
12017
|
/* */
|
|
10840
12018
|
return (void 0);
|
|
10841
12019
|
}
|
|
12020
|
+
//#region fix sqlite pacakge in node_modules
|
|
10842
12021
|
fixSQLLiteModuleInNodeModules() {
|
|
10843
12022
|
/* */
|
|
10844
12023
|
/* */
|
|
@@ -10853,6 +12032,8 @@ class BaseQuickFixes extends BaseFeatureForProject {
|
|
|
10853
12032
|
/* */
|
|
10854
12033
|
return (void 0);
|
|
10855
12034
|
}
|
|
12035
|
+
//#endregion
|
|
12036
|
+
//#region add missing empty libs
|
|
10856
12037
|
createDummyEmptyLibsReplacements(missingLibsNames = []) {
|
|
10857
12038
|
/* */
|
|
10858
12039
|
/* */
|
|
@@ -10896,10 +12077,10 @@ class BaseQuickFixes extends BaseFeatureForProject {
|
|
|
10896
12077
|
return (void 0);
|
|
10897
12078
|
}
|
|
10898
12079
|
}
|
|
10899
|
-
;
|
|
10900
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-quick-fixes.ts
|
|
10901
12080
|
|
|
10902
12081
|
const BaseProjectTypeArr = CoreModels.BaseProjectTypeArr;
|
|
12082
|
+
//#endregion
|
|
12083
|
+
//#region command config
|
|
10903
12084
|
class CommandConfig {
|
|
10904
12085
|
static from(config) {
|
|
10905
12086
|
return new CommandConfig(config);
|
|
@@ -10915,6 +12096,8 @@ class CommandConfig {
|
|
|
10915
12096
|
});
|
|
10916
12097
|
}
|
|
10917
12098
|
}
|
|
12099
|
+
//#endregion
|
|
12100
|
+
//#region command process state
|
|
10918
12101
|
var CommandProcessState;
|
|
10919
12102
|
(function (CommandProcessState) {
|
|
10920
12103
|
CommandProcessState["NOT_STARTED"] = "not-started";
|
|
@@ -10923,6 +12106,8 @@ var CommandProcessState;
|
|
|
10923
12106
|
CommandProcessState["FINISHED_AND_RUNNING"] = "finished-and-running";
|
|
10924
12107
|
CommandProcessState["FINISHED"] = "finished";
|
|
10925
12108
|
})(CommandProcessState || (CommandProcessState = {}));
|
|
12109
|
+
//#endregion
|
|
12110
|
+
//#region command process
|
|
10926
12111
|
class CommandProcess {
|
|
10927
12112
|
get cmd() {
|
|
10928
12113
|
return this.config.cmd;
|
|
@@ -10958,13 +12143,18 @@ class CommandProcess {
|
|
|
10958
12143
|
}
|
|
10959
12144
|
this.state = CommandProcessState.WAITING_TO_START;
|
|
10960
12145
|
}
|
|
12146
|
+
//#region constructor
|
|
10961
12147
|
constructor(project, config, manager) {
|
|
10962
12148
|
this.project = project;
|
|
10963
12149
|
this.config = config;
|
|
10964
12150
|
this.manager = manager;
|
|
12151
|
+
//#region fields and getters
|
|
10965
12152
|
this.state = CommandProcessState.NOT_STARTED;
|
|
12153
|
+
//#endregion
|
|
10966
12154
|
this.dependenciesProcesses = [];
|
|
10967
12155
|
}
|
|
12156
|
+
//#endregion
|
|
12157
|
+
//#region run
|
|
10968
12158
|
async start(options) {
|
|
10969
12159
|
/* */
|
|
10970
12160
|
/* */
|
|
@@ -11028,6 +12218,8 @@ class CommandProcess {
|
|
|
11028
12218
|
/* */
|
|
11029
12219
|
return (void 0);
|
|
11030
12220
|
}
|
|
12221
|
+
//#endregion
|
|
12222
|
+
//#region stop
|
|
11031
12223
|
async stop() {
|
|
11032
12224
|
/* */
|
|
11033
12225
|
/* */
|
|
@@ -11070,9 +12262,10 @@ class CommandProcess {
|
|
|
11070
12262
|
return (void 0);
|
|
11071
12263
|
}
|
|
11072
12264
|
}
|
|
11073
|
-
|
|
11074
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/models.ts
|
|
12265
|
+
//#endregion
|
|
11075
12266
|
|
|
12267
|
+
//#endregion
|
|
12268
|
+
//#region custom console select/multiselect
|
|
11076
12269
|
/* */
|
|
11077
12270
|
/* */
|
|
11078
12271
|
/* */
|
|
@@ -11106,6 +12299,7 @@ class CommandProcess {
|
|
|
11106
12299
|
/* */
|
|
11107
12300
|
/* */
|
|
11108
12301
|
/* */
|
|
12302
|
+
//#endregion
|
|
11109
12303
|
class BaseProcessManger extends BaseFeatureForProject {
|
|
11110
12304
|
set showLogs(value) {
|
|
11111
12305
|
this._showLogs = value;
|
|
@@ -11115,6 +12309,9 @@ class BaseProcessManger extends BaseFeatureForProject {
|
|
|
11115
12309
|
get showLogs() {
|
|
11116
12310
|
return this._showLogs;
|
|
11117
12311
|
}
|
|
12312
|
+
//#endregion
|
|
12313
|
+
//#endregion
|
|
12314
|
+
//#region constructor
|
|
11118
12315
|
constructor(project) {
|
|
11119
12316
|
super(project);
|
|
11120
12317
|
this.allProcesses = [];
|
|
@@ -11122,6 +12319,7 @@ class BaseProcessManger extends BaseFeatureForProject {
|
|
|
11122
12319
|
this.outputBuffer = [];
|
|
11123
12320
|
this.startedProcesses = new Set();
|
|
11124
12321
|
this.watch = false;
|
|
12322
|
+
//#region fields and getters / show logs
|
|
11125
12323
|
this._showLogs = false;
|
|
11126
12324
|
/**
|
|
11127
12325
|
* special config for Helpers.executer
|
|
@@ -11132,6 +12330,8 @@ class BaseProcessManger extends BaseFeatureForProject {
|
|
|
11132
12330
|
acceptAllExitCodeAsSuccess: true,
|
|
11133
12331
|
};
|
|
11134
12332
|
}
|
|
12333
|
+
//#endregion
|
|
12334
|
+
//#region init
|
|
11135
12335
|
async init(initialOptions) {
|
|
11136
12336
|
/* */
|
|
11137
12337
|
/* */
|
|
@@ -11167,6 +12367,8 @@ class BaseProcessManger extends BaseFeatureForProject {
|
|
|
11167
12367
|
/* */
|
|
11168
12368
|
return (void 0);
|
|
11169
12369
|
}
|
|
12370
|
+
//#endregion
|
|
12371
|
+
//#region show output
|
|
11170
12372
|
showOutput() {
|
|
11171
12373
|
/* */
|
|
11172
12374
|
/* */
|
|
@@ -11186,6 +12388,8 @@ class BaseProcessManger extends BaseFeatureForProject {
|
|
|
11186
12388
|
/* */
|
|
11187
12389
|
return (void 0);
|
|
11188
12390
|
}
|
|
12391
|
+
//#endregion
|
|
12392
|
+
//#region kill or build menu
|
|
11189
12393
|
async killOrBuildMenu() {
|
|
11190
12394
|
/* */
|
|
11191
12395
|
/* */
|
|
@@ -11262,6 +12466,8 @@ class BaseProcessManger extends BaseFeatureForProject {
|
|
|
11262
12466
|
/* */
|
|
11263
12467
|
return (void 0);
|
|
11264
12468
|
}
|
|
12469
|
+
//#endregion
|
|
12470
|
+
//#region make sure selected processes are running
|
|
11265
12471
|
async makeSureSelectedProcessesAreRunning() {
|
|
11266
12472
|
/* */
|
|
11267
12473
|
/* */
|
|
@@ -11293,6 +12499,8 @@ class BaseProcessManger extends BaseFeatureForProject {
|
|
|
11293
12499
|
/* */
|
|
11294
12500
|
return (void 0);
|
|
11295
12501
|
}
|
|
12502
|
+
//#endregion
|
|
12503
|
+
//#region start process with dependencies
|
|
11296
12504
|
async startProcessWithDependencies(process, startedProcesses = new Set(), parent = undefined) {
|
|
11297
12505
|
/* */
|
|
11298
12506
|
/* */
|
|
@@ -11315,6 +12523,8 @@ class BaseProcessManger extends BaseFeatureForProject {
|
|
|
11315
12523
|
/* */
|
|
11316
12524
|
return (void 0);
|
|
11317
12525
|
}
|
|
12526
|
+
//#endregion
|
|
12527
|
+
//#region build menu
|
|
11318
12528
|
async buildMenu(allowedToShowOutput = true) {
|
|
11319
12529
|
/* */
|
|
11320
12530
|
/* */
|
|
@@ -11353,26 +12563,34 @@ class BaseProcessManger extends BaseFeatureForProject {
|
|
|
11353
12563
|
return (void 0);
|
|
11354
12564
|
}
|
|
11355
12565
|
}
|
|
11356
|
-
;
|
|
11357
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/base-process-manager.ts
|
|
11358
12566
|
|
|
11359
12567
|
/* */
|
|
11360
12568
|
/* */
|
|
11361
12569
|
/* */
|
|
11362
12570
|
/* */
|
|
11363
|
-
;
|
|
11364
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/classes/index.ts
|
|
11365
12571
|
|
|
12572
|
+
//#region imports
|
|
12573
|
+
//#endregion
|
|
12574
|
+
//#region open source proviers
|
|
11366
12575
|
const openSourceProvidersIssuePrefix = [
|
|
11367
12576
|
'GH',
|
|
12577
|
+
// 'GITHUB',
|
|
12578
|
+
// 'BB',
|
|
12579
|
+
// 'BITBUCKET',
|
|
12580
|
+
// 'GL',
|
|
12581
|
+
// 'GITLAB',
|
|
11368
12582
|
];
|
|
11369
12583
|
const regexTeamsID = /[A-Z0-9]+\#/;
|
|
11370
12584
|
const regexCommitModuleInArgs = /\[[a-z|\-|\,]+\]/;
|
|
11371
12585
|
const regexCommitModuleInBranch = /\-\-[a-z|\-|\_]+\-\-/;
|
|
11372
12586
|
class CommitData {
|
|
11373
12587
|
constructor() {
|
|
12588
|
+
//#region static
|
|
12589
|
+
//#endregion
|
|
11374
12590
|
this.useFeatureBranchForTestBranch = false;
|
|
12591
|
+
//#endregion
|
|
11375
12592
|
}
|
|
12593
|
+
//#region static / methods & getters / clean http(s) from commit message
|
|
11376
12594
|
static cleanHttpFromCommitMessage(commitMsg) {
|
|
11377
12595
|
if (!commitMsg) {
|
|
11378
12596
|
return commitMsg;
|
|
@@ -11381,6 +12599,8 @@ class CommitData {
|
|
|
11381
12599
|
commitMsg = commitMsg.replace('http://', '');
|
|
11382
12600
|
return commitMsg;
|
|
11383
12601
|
}
|
|
12602
|
+
//#endregion
|
|
12603
|
+
//#region static / methods & getters / get temas id from
|
|
11384
12604
|
static getTeamsIdFrom(commitMsg) {
|
|
11385
12605
|
let teamID = _.first(commitMsg.match(regexTeamsID));
|
|
11386
12606
|
if (teamID) {
|
|
@@ -11391,6 +12611,8 @@ class CommitData {
|
|
|
11391
12611
|
teamID,
|
|
11392
12612
|
};
|
|
11393
12613
|
}
|
|
12614
|
+
//#endregion
|
|
12615
|
+
//#region static / methods & getters / get module name from
|
|
11394
12616
|
static getModuleNameFrom(commitMsg) {
|
|
11395
12617
|
let commitModuleName = _.first(commitMsg.match(regexCommitModuleInArgs));
|
|
11396
12618
|
if (commitModuleName) {
|
|
@@ -11402,6 +12624,8 @@ class CommitData {
|
|
|
11402
12624
|
commitModuleName,
|
|
11403
12625
|
};
|
|
11404
12626
|
}
|
|
12627
|
+
//#endregion
|
|
12628
|
+
//#region static / methods & getters / extract jira numbers
|
|
11405
12629
|
/**
|
|
11406
12630
|
*
|
|
11407
12631
|
* @returns jiras (from oldest to newset)
|
|
@@ -11435,6 +12659,8 @@ class CommitData {
|
|
|
11435
12659
|
/* */
|
|
11436
12660
|
return (void 0);
|
|
11437
12661
|
}
|
|
12662
|
+
//#endregion
|
|
12663
|
+
//#region static / methods & getters / extract jira numbers
|
|
11438
12664
|
/**
|
|
11439
12665
|
*
|
|
11440
12666
|
* @returns jiras (from oldest to newset)
|
|
@@ -11526,6 +12752,8 @@ class CommitData {
|
|
|
11526
12752
|
/* */
|
|
11527
12753
|
return (void 0);
|
|
11528
12754
|
}
|
|
12755
|
+
//#endregion
|
|
12756
|
+
//#region static / methods & getters / clean message from jira numbers, team id and stuff
|
|
11529
12757
|
static cleanMessageFromJiraNumTeamIdEtc(message, optinos) {
|
|
11530
12758
|
message = message || '';
|
|
11531
12759
|
let { teamID, commitModuleName, jiraNumbers, issuesFromOtherProjects } = optinos || {};
|
|
@@ -11543,7 +12771,10 @@ class CommitData {
|
|
|
11543
12771
|
message = message.replace(teamID.toLowerCase().replace('-', ' '), ' ');
|
|
11544
12772
|
message = message.replace(teamID.toUpperCase().replace('-', ' '), ' ');
|
|
11545
12773
|
}
|
|
12774
|
+
// console.log({ clere: 'CLEAR', issuesFromOtherProjects, message });
|
|
11546
12775
|
for (const issueFromOtherProj of issuesFromOtherProjects || []) {
|
|
12776
|
+
// console.log('issueFromOtherProj', issueFromOtherProj);
|
|
12777
|
+
// console.log('message', message);
|
|
11547
12778
|
message = message.replace(`__${issueFromOtherProj.replace(/\//g, '_').replace(/\-/g, ' ')}__`, ' ');
|
|
11548
12779
|
message = message.replace(issueFromOtherProj, ' ');
|
|
11549
12780
|
message = message.replace(issueFromOtherProj.toLowerCase().replace('-', ' '), ' ');
|
|
@@ -11576,6 +12807,8 @@ class CommitData {
|
|
|
11576
12807
|
.replace(/\ \ /g, ' ')
|
|
11577
12808
|
.replace(/\ \ /g, ' ');
|
|
11578
12809
|
}
|
|
12810
|
+
//#endregion
|
|
12811
|
+
//#region static / methods & getters / get module name from branch
|
|
11579
12812
|
static getModuleNameFromBranch(branchName) {
|
|
11580
12813
|
let commitModuleName = _.first(branchName.match(regexCommitModuleInBranch));
|
|
11581
12814
|
if (commitModuleName) {
|
|
@@ -11593,6 +12826,8 @@ class CommitData {
|
|
|
11593
12826
|
.replace(/\_/, ',');
|
|
11594
12827
|
return { commitModuleName };
|
|
11595
12828
|
}
|
|
12829
|
+
//#endregion
|
|
12830
|
+
//#region static / methods & getters / get from args
|
|
11596
12831
|
static async getFromArgs(args, options) {
|
|
11597
12832
|
/* */
|
|
11598
12833
|
/* */
|
|
@@ -11662,6 +12897,8 @@ class CommitData {
|
|
|
11662
12897
|
/* */
|
|
11663
12898
|
return (void 0);
|
|
11664
12899
|
}
|
|
12900
|
+
//#endregion
|
|
12901
|
+
//#region static / methods & getters / get from bramch
|
|
11665
12902
|
static async getFromBranch(currentBranchName, options) {
|
|
11666
12903
|
/* */
|
|
11667
12904
|
/* */
|
|
@@ -11776,11 +13013,16 @@ class CommitData {
|
|
|
11776
13013
|
/* */
|
|
11777
13014
|
return (void 0);
|
|
11778
13015
|
}
|
|
13016
|
+
//#endregion
|
|
13017
|
+
//#region static / methods & getters / from
|
|
11779
13018
|
static from(options) {
|
|
11780
13019
|
options = (options ? options : {});
|
|
13020
|
+
// console.log(options)
|
|
11781
13021
|
const opt = _.merge(new CommitData(), _.cloneDeep(options));
|
|
11782
13022
|
return opt;
|
|
11783
13023
|
}
|
|
13024
|
+
//#endregion
|
|
13025
|
+
//#region methods & getters / clear message
|
|
11784
13026
|
clearMessage(message) {
|
|
11785
13027
|
return CommitData.cleanMessageFromJiraNumTeamIdEtc(message, {
|
|
11786
13028
|
teamID: this.teamID,
|
|
@@ -11789,6 +13031,8 @@ class CommitData {
|
|
|
11789
13031
|
issuesFromOtherProjects: this.issuesFromOtherProjects,
|
|
11790
13032
|
});
|
|
11791
13033
|
}
|
|
13034
|
+
//#endregion
|
|
13035
|
+
//#region methods & getters / message
|
|
11792
13036
|
/**
|
|
11793
13037
|
* pure message what was done (without jira or prefixes)
|
|
11794
13038
|
* => is included in this.commitMessage
|
|
@@ -11799,6 +13043,7 @@ class CommitData {
|
|
|
11799
13043
|
set message(message) {
|
|
11800
13044
|
this._message = this.clearMessage(message);
|
|
11801
13045
|
}
|
|
13046
|
+
//#region methods & getters / branch prefix
|
|
11802
13047
|
get branchPrefix() {
|
|
11803
13048
|
/* */
|
|
11804
13049
|
/* */
|
|
@@ -11812,6 +13057,8 @@ class CommitData {
|
|
|
11812
13057
|
/* */
|
|
11813
13058
|
return (void 0);
|
|
11814
13059
|
}
|
|
13060
|
+
//#endregion
|
|
13061
|
+
//#region methods & getters / issues from other projects
|
|
11815
13062
|
/**
|
|
11816
13063
|
* ex. taon/GH-12 darekf77/tnp-helpers/GH-4
|
|
11817
13064
|
*/
|
|
@@ -11820,7 +13067,25 @@ class CommitData {
|
|
|
11820
13067
|
}
|
|
11821
13068
|
set issuesFromOtherProjects(value) {
|
|
11822
13069
|
this.__issuesFromOtherProjects = value;
|
|
11823
|
-
|
|
13070
|
+
// this.__issuesFromOtherProjects = value.map(issue => {
|
|
13071
|
+
// console.log('MAPPING', issue);
|
|
13072
|
+
// console.log('project', this.project?.name);
|
|
13073
|
+
// if (issue.split('/').length === 1 && !!this.project) {
|
|
13074
|
+
// console.log('issue', issue);
|
|
13075
|
+
// const origin = Helpers.git.originSshToHttp(this.project.git.originURL);
|
|
13076
|
+
// const provider = _.first(origin.replace('https://', '').split('/'));
|
|
13077
|
+
// const cleanUserWithPath = origin
|
|
13078
|
+
// .replace('https://', '')
|
|
13079
|
+
// .replace(provider + '/', '')
|
|
13080
|
+
// .replace(path.basename(origin).replace('.git', ''), '');
|
|
13081
|
+
// const issueLastPart = _.last(issue.split('/'));
|
|
13082
|
+
// return `tnp/${cleanUserWithPath}/${issueLastPart}`;
|
|
13083
|
+
// }
|
|
13084
|
+
// return issue;
|
|
13085
|
+
// });
|
|
13086
|
+
}
|
|
13087
|
+
//#endregion
|
|
13088
|
+
//#region methods & getters / commit message git commit -m
|
|
11824
13089
|
get commitMessage() {
|
|
11825
13090
|
/* */
|
|
11826
13091
|
/* */
|
|
@@ -11938,6 +13203,8 @@ class CommitData {
|
|
|
11938
13203
|
/* */
|
|
11939
13204
|
return (void 0);
|
|
11940
13205
|
}
|
|
13206
|
+
//#endregion
|
|
13207
|
+
//#region methods & getters / branch name
|
|
11941
13208
|
get branchName() {
|
|
11942
13209
|
/* */
|
|
11943
13210
|
/* */
|
|
@@ -11986,20 +13253,29 @@ class CommitData {
|
|
|
11986
13253
|
/* */
|
|
11987
13254
|
return (void 0);
|
|
11988
13255
|
}
|
|
13256
|
+
//#endregion
|
|
13257
|
+
//#region methods & getters / is action commit
|
|
11989
13258
|
get isActionCommit() {
|
|
11990
13259
|
/* */
|
|
11991
13260
|
/* */
|
|
11992
13261
|
return (void 0);
|
|
11993
13262
|
}
|
|
11994
13263
|
}
|
|
11995
|
-
;
|
|
11996
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/commit-data.ts
|
|
11997
13264
|
|
|
13265
|
+
//#region imports
|
|
13266
|
+
//#endregion
|
|
13267
|
+
//#region constants
|
|
13268
|
+
//#region constants / defult db
|
|
11998
13269
|
const defaultDb = {
|
|
11999
13270
|
projects: [],
|
|
12000
13271
|
};
|
|
13272
|
+
//#endregion
|
|
12001
13273
|
class CoreProject {
|
|
13274
|
+
//#region static
|
|
13275
|
+
//#region static / core projects
|
|
12002
13276
|
static { this.coreProjects = []; }
|
|
13277
|
+
//#endregion
|
|
13278
|
+
//#region static / from
|
|
12003
13279
|
static from(options) {
|
|
12004
13280
|
/* */
|
|
12005
13281
|
/* */
|
|
@@ -12028,6 +13304,9 @@ class CoreProject {
|
|
|
12028
13304
|
/* */
|
|
12029
13305
|
return (void 0);
|
|
12030
13306
|
}
|
|
13307
|
+
//#endregion
|
|
13308
|
+
//#endregion
|
|
13309
|
+
//#region constructor
|
|
12031
13310
|
constructor() {
|
|
12032
13311
|
/**
|
|
12033
13312
|
* project environments
|
|
@@ -12054,6 +13333,7 @@ class CoreProject {
|
|
|
12054
13333
|
}
|
|
12055
13334
|
}
|
|
12056
13335
|
const CoreTypescriptProject = CoreProject.from({
|
|
13336
|
+
//#region configuration
|
|
12057
13337
|
branches: ['master', 'develop'],
|
|
12058
13338
|
urlHttp: 'https://github.com/microsoft/TypeScript',
|
|
12059
13339
|
environments: [],
|
|
@@ -12087,8 +13367,10 @@ const CoreTypescriptProject = CoreProject.from({
|
|
|
12087
13367
|
/* */
|
|
12088
13368
|
return (void 0);
|
|
12089
13369
|
},
|
|
13370
|
+
//#endregion
|
|
12090
13371
|
});
|
|
12091
13372
|
const CoreAngularProject = CoreProject.from({
|
|
13373
|
+
//#region configuration
|
|
12092
13374
|
extends: CoreTypescriptProject,
|
|
12093
13375
|
branches: ['master', 'develop'],
|
|
12094
13376
|
urlHttp: 'https://github.com/angular/angular-cli',
|
|
@@ -12105,11 +13387,12 @@ const CoreAngularProject = CoreProject.from({
|
|
|
12105
13387
|
await project.npmHelpers.nodeModules.makeSureInstalled();
|
|
12106
13388
|
project.run(`npm-run ng build`).sync();
|
|
12107
13389
|
},
|
|
13390
|
+
//#endregion
|
|
12108
13391
|
});
|
|
12109
|
-
;
|
|
12110
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/core-project.ts
|
|
12111
13392
|
|
|
12112
13393
|
class LinkedProject {
|
|
13394
|
+
//#region static
|
|
13395
|
+
//#region static / from
|
|
12113
13396
|
static from(options) {
|
|
12114
13397
|
const linkedProj = _.merge(new LinkedProject(), _.cloneDeep(options));
|
|
12115
13398
|
if (!linkedProj.relativeClonePath) {
|
|
@@ -12120,6 +13403,8 @@ class LinkedProject {
|
|
|
12120
13403
|
}
|
|
12121
13404
|
return linkedProj;
|
|
12122
13405
|
}
|
|
13406
|
+
//#endregion
|
|
13407
|
+
//#region static / from name
|
|
12123
13408
|
static fromName(projectName, currentRemoteUrl, currentBranch) {
|
|
12124
13409
|
return LinkedProject.from({
|
|
12125
13410
|
repoUrl: currentRemoteUrl?.replace(path.basename(currentRemoteUrl), `${projectName}.git`),
|
|
@@ -12127,7 +13412,19 @@ class LinkedProject {
|
|
|
12127
13412
|
relativeClonePath: projectName,
|
|
12128
13413
|
});
|
|
12129
13414
|
}
|
|
12130
|
-
|
|
13415
|
+
//#endregion
|
|
13416
|
+
//#region static / detect
|
|
13417
|
+
static detect(insideLocation, options) {
|
|
13418
|
+
/* */
|
|
13419
|
+
/* */
|
|
13420
|
+
/* */
|
|
13421
|
+
/* */
|
|
13422
|
+
/* */
|
|
13423
|
+
/* */
|
|
13424
|
+
/* */
|
|
13425
|
+
/* */
|
|
13426
|
+
/* */
|
|
13427
|
+
/* */
|
|
12131
13428
|
/* */
|
|
12132
13429
|
/* */
|
|
12133
13430
|
/* */
|
|
@@ -12184,6 +13481,8 @@ class LinkedProject {
|
|
|
12184
13481
|
}
|
|
12185
13482
|
}
|
|
12186
13483
|
class LinkedPorjectsConfig {
|
|
13484
|
+
//#region static
|
|
13485
|
+
//#region static / from
|
|
12187
13486
|
static from(options) {
|
|
12188
13487
|
options = options || {};
|
|
12189
13488
|
options.projects = (options.projects || []).map(linkedProjOrname => {
|
|
@@ -12192,24 +13491,21 @@ class LinkedPorjectsConfig {
|
|
|
12192
13491
|
}
|
|
12193
13492
|
return LinkedProject.from(linkedProjOrname);
|
|
12194
13493
|
});
|
|
13494
|
+
// .sort((a, b) => {
|
|
13495
|
+
// return (a.relativeClonePath || '').localeCompare((b.relativeClonePath || ''));
|
|
13496
|
+
// });
|
|
12195
13497
|
return _.merge(new LinkedPorjectsConfig(), _.cloneDeep(options));
|
|
12196
13498
|
}
|
|
12197
13499
|
}
|
|
12198
|
-
;
|
|
12199
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/linked-project.ts
|
|
12200
13500
|
|
|
12201
13501
|
/* */
|
|
12202
13502
|
/* */
|
|
12203
|
-
;
|
|
12204
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/base/index.ts
|
|
12205
13503
|
|
|
12206
13504
|
const Helpers = HelpersTaon.Instance;
|
|
12207
13505
|
/* */
|
|
12208
13506
|
/* */
|
|
12209
13507
|
/* */
|
|
12210
13508
|
/* */
|
|
12211
|
-
;
|
|
12212
|
-
({}); // @--end-of-file-for-module=tnp-helpers lib/index.ts
|
|
12213
13509
|
|
|
12214
13510
|
/**
|
|
12215
13511
|
* Generated bundle index. Do not edit.
|