tnp-helpers 18.0.4 → 18.0.9
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/assets/shared/shared_folder_info.txt +1 -1
- package/browser/README.md +24 -24
- package/browser/esm2022/lib/base/base-git.mjs +5 -5
- package/browser/esm2022/lib/base/base-library-build.mjs +114 -10
- package/browser/esm2022/lib/base/base-linked-projects.mjs +1 -1
- package/browser/esm2022/lib/base/base-npm-helpers.mjs +48 -15
- package/browser/esm2022/lib/base/base-project-resolver.mjs +4 -3
- package/browser/esm2022/lib/base/base-project.mjs +10 -1
- package/browser/esm2022/lib/base/base-release-process.mjs +2 -2
- package/browser/esm2022/lib/base/commit-data.mjs +2 -2
- package/browser/esm2022/lib/base/core-project.mjs +1 -1
- package/browser/esm2022/lib/helpers/for-browser/helpers-browser.mjs +2 -2
- package/browser/esm2022/lib/helpers/helpers-strings.mjs +3 -3
- package/browser/esm2022/lib/helpers/helpers.mjs +6 -6
- package/browser/esm2022/lib/index.mjs +3 -3
- package/browser/esm2022/lib/models.mjs +1 -1
- package/browser/esm2022/lib/utils.mjs +141 -1
- package/browser/fesm2022/tnp-helpers.mjs +330 -43
- package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
- package/browser/lib/base/base-git.d.ts +6 -6
- package/browser/lib/base/base-library-build.d.ts +22 -8
- package/browser/lib/base/base-npm-helpers.d.ts +9 -19
- package/browser/lib/base/base-project.d.ts +8 -3
- package/browser/lib/base/commit-data.d.ts +5 -5
- package/browser/lib/base/core-project.d.ts +4 -3
- package/browser/lib/helpers/helpers.d.ts +3 -3
- package/browser/lib/index.d.ts +2 -2
- package/browser/lib/models.d.ts +16 -1
- package/browser/lib/utils.d.ts +32 -0
- package/client/README.md +24 -24
- package/client/esm2022/lib/base/base-git.mjs +5 -5
- package/client/esm2022/lib/base/base-library-build.mjs +114 -10
- package/client/esm2022/lib/base/base-linked-projects.mjs +1 -1
- package/client/esm2022/lib/base/base-npm-helpers.mjs +48 -15
- package/client/esm2022/lib/base/base-project-resolver.mjs +4 -3
- package/client/esm2022/lib/base/base-project.mjs +10 -1
- package/client/esm2022/lib/base/base-release-process.mjs +2 -2
- package/client/esm2022/lib/base/commit-data.mjs +2 -2
- package/client/esm2022/lib/base/core-project.mjs +1 -1
- package/client/esm2022/lib/helpers/for-browser/helpers-browser.mjs +2 -2
- package/client/esm2022/lib/helpers/helpers-strings.mjs +3 -3
- package/client/esm2022/lib/helpers/helpers.mjs +6 -6
- package/client/esm2022/lib/index.mjs +3 -3
- package/client/esm2022/lib/models.mjs +1 -1
- package/client/esm2022/lib/utils.mjs +141 -1
- package/client/fesm2022/tnp-helpers.mjs +330 -43
- package/client/fesm2022/tnp-helpers.mjs.map +1 -1
- package/client/lib/base/base-git.d.ts +6 -6
- package/client/lib/base/base-library-build.d.ts +22 -8
- package/client/lib/base/base-npm-helpers.d.ts +9 -19
- package/client/lib/base/base-project.d.ts +8 -3
- package/client/lib/base/commit-data.d.ts +5 -5
- package/client/lib/base/core-project.d.ts +4 -3
- package/client/lib/helpers/helpers.d.ts +3 -3
- package/client/lib/index.d.ts +2 -2
- package/client/lib/models.d.ts +16 -1
- package/client/lib/utils.d.ts +32 -0
- package/lib/base/base-command-line.backend.d.ts +16 -10
- package/lib/base/base-command-line.backend.js +382 -165
- package/lib/base/base-command-line.backend.js.map +1 -1
- package/lib/base/base-db.js +2 -2
- package/lib/base/base-db.js.map +1 -1
- package/lib/base/base-git.d.ts +6 -6
- package/lib/base/base-git.js +26 -21
- package/lib/base/base-git.js.map +1 -1
- package/lib/base/base-library-build.d.ts +23 -19
- package/lib/base/base-library-build.js +403 -285
- package/lib/base/base-library-build.js.map +1 -1
- package/lib/base/base-linked-projects.js +1 -2
- package/lib/base/base-linked-projects.js.map +1 -1
- package/lib/base/base-npm-helpers.d.ts +8 -14
- package/lib/base/base-npm-helpers.js +103 -62
- package/lib/base/base-npm-helpers.js.map +1 -1
- package/lib/base/base-project-resolver.js +7 -5
- package/lib/base/base-project-resolver.js.map +1 -1
- package/lib/base/base-project.d.ts +8 -3
- package/lib/base/base-project.js +22 -6
- package/lib/base/base-project.js.map +1 -1
- package/lib/base/base-release-process.js +9 -4
- package/lib/base/base-release-process.js.map +1 -1
- package/lib/base/base-start-config.backend.js +1 -1
- package/lib/base/base-start-config.backend.js.map +1 -1
- package/lib/base/command-line-feature.backend.js +1 -1
- package/lib/base/command-line-feature.backend.js.map +1 -1
- package/lib/base/commit-data.d.ts +5 -5
- package/lib/base/commit-data.js +1 -1
- package/lib/base/core-project.d.ts +4 -3
- package/lib/base/core-project.js.map +1 -1
- package/lib/base/linked-project.js +1 -1
- package/lib/base/linked-project.js.map +1 -1
- package/lib/helpers/for-backend/helpers-cli-tool.backend.js +0 -1
- package/lib/helpers/for-backend/helpers-cli-tool.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-console-gui.d.ts +6 -0
- package/lib/helpers/for-backend/helpers-console-gui.js +12 -4
- package/lib/helpers/for-backend/helpers-console-gui.js.map +1 -1
- package/lib/helpers/for-backend/helpers-file-folders.backend.d.ts +1 -1
- package/lib/helpers/for-backend/helpers-file-folders.backend.js +18 -18
- package/lib/helpers/for-backend/helpers-file-folders.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-git.backend.d.ts +2 -2
- package/lib/helpers/for-backend/helpers-git.backend.js +206 -158
- package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-process.backend.d.ts +7 -0
- package/lib/helpers/for-backend/helpers-process.backend.js +13 -37
- package/lib/helpers/for-backend/helpers-process.backend.js.map +1 -1
- package/lib/helpers/for-browser/angular.helper.js +2 -2
- package/lib/helpers/for-browser/helpers-browser.js +1 -1
- package/lib/helpers/for-browser/helpers-browser.js.map +1 -1
- package/lib/helpers/helpers-strings.js +2 -2
- package/lib/helpers/helpers-strings.js.map +1 -1
- package/lib/helpers/helpers.d.ts +3 -3
- package/lib/helpers/helpers.js +28 -28
- package/lib/helpers/helpers.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/models.d.ts +16 -1
- package/lib/models.js.map +1 -1
- package/lib/old/base-component.js +2 -2
- package/lib/old/base-formly-component.js +2 -2
- package/lib/old/dual-component-ctrl.js +2 -2
- package/lib/utils.d.ts +32 -0
- package/lib/utils.js +113 -1
- package/lib/utils.js.map +1 -1
- package/lib/validators/validators-firedev.d.ts +1 -1
- package/lib/validators/validators-firedev.js +5 -5
- package/lib/validators/validators-firedev.js.map +1 -1
- package/package.json +5 -5
- package/src.d.ts +1 -1
- package/{firedev.jsonc → taon.jsonc} +48 -42
- package/tmp-environment.json +37 -40
- package/websql/README.md +24 -24
- package/websql/esm2022/lib/base/base-git.mjs +5 -5
- package/websql/esm2022/lib/base/base-library-build.mjs +114 -10
- package/websql/esm2022/lib/base/base-linked-projects.mjs +1 -1
- package/websql/esm2022/lib/base/base-npm-helpers.mjs +48 -15
- package/websql/esm2022/lib/base/base-project-resolver.mjs +4 -3
- package/websql/esm2022/lib/base/base-project.mjs +10 -1
- package/websql/esm2022/lib/base/base-release-process.mjs +2 -2
- package/websql/esm2022/lib/base/commit-data.mjs +2 -2
- package/websql/esm2022/lib/base/core-project.mjs +1 -1
- package/websql/esm2022/lib/helpers/for-browser/helpers-browser.mjs +2 -2
- package/websql/esm2022/lib/helpers/helpers-strings.mjs +3 -3
- package/websql/esm2022/lib/helpers/helpers.mjs +6 -6
- package/websql/esm2022/lib/index.mjs +3 -3
- package/websql/esm2022/lib/models.mjs +1 -1
- package/websql/esm2022/lib/utils.mjs +141 -1
- package/websql/fesm2022/tnp-helpers.mjs +330 -43
- package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
- package/websql/lib/base/base-git.d.ts +6 -6
- package/websql/lib/base/base-library-build.d.ts +22 -8
- package/websql/lib/base/base-npm-helpers.d.ts +9 -17
- package/websql/lib/base/base-project.d.ts +9 -8
- package/websql/lib/base/commit-data.d.ts +5 -5
- package/websql/lib/base/core-project.d.ts +4 -3
- package/websql/lib/helpers/helpers.d.ts +3 -3
- package/websql/lib/index.d.ts +2 -2
- package/websql/lib/models.d.ts +16 -1
- package/websql/lib/utils.d.ts +32 -0
|
@@ -7,7 +7,6 @@ var tslib_1 = require("tslib");
|
|
|
7
7
|
var tnp_core_1 = require("tnp-core");
|
|
8
8
|
var child_process_1 = require("child_process");
|
|
9
9
|
Object.defineProperty(exports, "ChildProcess", { enumerable: true, get: function () { return child_process_1.ChildProcess; } });
|
|
10
|
-
//#endregion
|
|
11
10
|
var tnp_core_2 = require("tnp-core");
|
|
12
11
|
var tnp_config_1 = require("tnp-config");
|
|
13
12
|
var tnp_core_3 = require("tnp-core");
|
|
@@ -27,8 +26,28 @@ var BaseLibraryBuild = /** @class */ (function (_super) {
|
|
|
27
26
|
}
|
|
28
27
|
//#region getters & methods / sort by deps
|
|
29
28
|
BaseLibraryBuild.prototype.sortByDeps = function (libraries) {
|
|
30
|
-
|
|
29
|
+
//#region @backendFunc
|
|
30
|
+
var libs = libraries;
|
|
31
|
+
var sorted = this.project.ins.sortGroupOfProject(libs, function (proj) {
|
|
32
|
+
// resolve dependencies names
|
|
33
|
+
if (!tnp_core_3._.isUndefined(proj.cache['deps'])) {
|
|
34
|
+
return proj.cache['deps'];
|
|
35
|
+
}
|
|
36
|
+
var allLibs = Object.keys(proj.npmHelpers.allDependencies);
|
|
37
|
+
proj.cache['deps'] = allLibs.filter(function (f) { return !tnp_core_3._.isUndefined(libs.find(function (c) { return c.name === f; })); });
|
|
38
|
+
return proj.cache['deps'];
|
|
39
|
+
}, function (proj) {
|
|
40
|
+
// resolve name to compare
|
|
41
|
+
if (!tnp_core_3._.isUndefined(proj.cache['nameToCompare'])) {
|
|
42
|
+
return proj.cache['nameToCompare'];
|
|
43
|
+
}
|
|
44
|
+
proj.cache['nameToCompare'] = proj.name;
|
|
45
|
+
return proj.cache['nameToCompare'];
|
|
46
|
+
});
|
|
47
|
+
return sorted;
|
|
48
|
+
//#endregion
|
|
31
49
|
};
|
|
50
|
+
//#endregion
|
|
32
51
|
//#region getters & methods / get sorted libraries by deps for build\
|
|
33
52
|
/**
|
|
34
53
|
* Use cases:
|
|
@@ -42,12 +61,14 @@ var BaseLibraryBuild = /** @class */ (function (_super) {
|
|
|
42
61
|
* (skip normal build for not selected libraries)
|
|
43
62
|
*/
|
|
44
63
|
BaseLibraryBuild.prototype.selectAndSaveLibraries = function (_a) {
|
|
45
|
-
return tslib_1.__awaiter(this, arguments, void 0, function (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
|
|
64
|
+
return tslib_1.__awaiter(this, arguments, void 0, function (
|
|
65
|
+
// this: {},
|
|
66
|
+
_b) {
|
|
67
|
+
var buildAll, skipRebuildingAllForWatch, lastSelected, selected, _c, _d, defaultSelected, pickedLibs, selected;
|
|
68
|
+
var _e;
|
|
69
|
+
var selectedLibs = _b.selectedLibs, watch = _b.watch, watchBuildSupported = _b.watchBuildSupported, skipAllLibsQuestion = _b.skipAllLibsQuestion, useLastUserConfiguration = _b.useLastUserConfiguration;
|
|
70
|
+
return tslib_1.__generator(this, function (_f) {
|
|
71
|
+
switch (_f.label) {
|
|
51
72
|
case 0:
|
|
52
73
|
buildAll = false;
|
|
53
74
|
skipRebuildingAllForWatch = false;
|
|
@@ -57,53 +78,79 @@ var BaseLibraryBuild = /** @class */ (function (_super) {
|
|
|
57
78
|
if (tnp_core_3._.isUndefined(watchBuildSupported)) {
|
|
58
79
|
watchBuildSupported = true;
|
|
59
80
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
});
|
|
81
|
+
lastSelected = ((_e = index_1.Helpers.readJson(this.project.pathFor(tnp_config_1.FilesNames.tmpLastSelectedJsonFile))) === null || _e === void 0 ? void 0 : _e.lastSelected) || [];
|
|
82
|
+
if (!(tnp_core_3._.isArray(lastSelected) && lastSelected.length > 0)) return [3 /*break*/, 7];
|
|
83
|
+
selected = lastSelected
|
|
84
|
+
.map(function (c) { return selectedLibs.find(function (l) { return l.name == c; }); })
|
|
85
|
+
.filter(function (c) { return !!c; });
|
|
66
86
|
index_1.Helpers.info("\nLast selected libs\n\n".concat(selected.map(function (c, i) { return "".concat(i + 1, ". ").concat(c.basename, " ").concat(tnp_core_1.chalk.bold(c.name)); }).join('\n'), "\n\n "));
|
|
67
|
-
return [
|
|
68
|
-
|
|
69
|
-
|
|
87
|
+
if (!useLastUserConfiguration) return [3 /*break*/, 1];
|
|
88
|
+
_c = true;
|
|
89
|
+
return [3 /*break*/, 3];
|
|
90
|
+
case 1: return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo("Continue ".concat(watch ? 'watch' : '', " build with last selected ?"))];
|
|
91
|
+
case 2:
|
|
92
|
+
_c = _f.sent();
|
|
93
|
+
_f.label = 3;
|
|
94
|
+
case 3:
|
|
95
|
+
if (!_c) return [3 /*break*/, 7];
|
|
70
96
|
selectedLibs = selected;
|
|
71
|
-
if (!(watchBuildSupported && watch)) return [3 /*break*/,
|
|
97
|
+
if (!((watchBuildSupported && watch) || useLastUserConfiguration)) return [3 /*break*/, 6];
|
|
98
|
+
_d = useLastUserConfiguration;
|
|
99
|
+
if (_d) return [3 /*break*/, 5];
|
|
72
100
|
return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo("Skip rebuilding all libraries for watch mode ?")];
|
|
73
|
-
case 2:
|
|
74
|
-
skipRebuildingAllForWatch = _d.sent();
|
|
75
|
-
_d.label = 3;
|
|
76
|
-
case 3: return [2 /*return*/, { selectedLibs: selectedLibs, skipRebuildingAllForWatch: skipRebuildingAllForWatch }];
|
|
77
101
|
case 4:
|
|
78
|
-
|
|
79
|
-
|
|
102
|
+
_d = (_f.sent());
|
|
103
|
+
_f.label = 5;
|
|
80
104
|
case 5:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
case 6:
|
|
105
|
+
skipRebuildingAllForWatch = _d;
|
|
106
|
+
_f.label = 6;
|
|
107
|
+
case 6: return [2 /*return*/, { selectedLibs: selectedLibs, skipRebuildingAllForWatch: skipRebuildingAllForWatch }];
|
|
108
|
+
case 7:
|
|
109
|
+
if (!(!watch || (watch && selectedLibs.length < 6))) return [3 /*break*/, 9];
|
|
110
|
+
if (!!skipAllLibsQuestion) return [3 /*break*/, 9];
|
|
111
|
+
return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo("Should all libraries be included in".concat(watch ? ' watch' : ' ', "build ?"))];
|
|
112
|
+
case 8:
|
|
113
|
+
buildAll = _f.sent();
|
|
114
|
+
_f.label = 9;
|
|
115
|
+
case 9:
|
|
84
116
|
if (buildAll) {
|
|
85
117
|
return [2 /*return*/, { selectedLibs: selectedLibs, skipRebuildingAllForWatch: skipRebuildingAllForWatch }];
|
|
86
118
|
}
|
|
87
|
-
|
|
88
|
-
case
|
|
89
|
-
if (!true) return [3 /*break*/,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
119
|
+
_f.label = 10;
|
|
120
|
+
case 10:
|
|
121
|
+
if (!true) return [3 /*break*/, 13];
|
|
122
|
+
defaultSelected = lastSelected
|
|
123
|
+
.map(function (c) { return selectedLibs.find(function (l) { return l.name == c; }); })
|
|
124
|
+
.filter(function (c) { return !!c; })
|
|
125
|
+
.map(function (c) { return c.name; });
|
|
126
|
+
return [4 /*yield*/, index_1.UtilsTerminal.multiselect({
|
|
127
|
+
question: "Select libraries to ".concat(watch ? 'watch' : '', " build "),
|
|
128
|
+
choices: selectedLibs.map(function (c) {
|
|
129
|
+
return { name: c.name, value: c.name, selected: true };
|
|
130
|
+
}),
|
|
131
|
+
defaultSelected: defaultSelected,
|
|
132
|
+
})];
|
|
133
|
+
case 11:
|
|
134
|
+
pickedLibs = (_f.sent()).map(function (c) { return selectedLibs.find(function (l) { return l.name == c; }); });
|
|
135
|
+
selected = pickedLibs.filter(function (c) {
|
|
136
|
+
// if (!!c) { // TODO QUICK_FIX
|
|
137
|
+
// this.project.removeFile(lastSelectedJsonFile);
|
|
138
|
+
// Helpers.warn(`Please restart this command`);
|
|
139
|
+
// process.exit(0);
|
|
140
|
+
// }
|
|
141
|
+
return !!c;
|
|
142
|
+
});
|
|
96
143
|
index_1.Helpers.info("\n\n".concat(selected.map(function (c, i) { return "".concat(i + 1, ". ").concat(c.basename, " ").concat(tnp_core_1.chalk.bold(c.name)); }).join('\n'), "\n\n "));
|
|
97
144
|
return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo("Continue build with ".concat(selected.length, " selected ?"))];
|
|
98
|
-
case
|
|
99
|
-
if (
|
|
145
|
+
case 12:
|
|
146
|
+
if (_f.sent()) {
|
|
100
147
|
selectedLibs = selected;
|
|
101
|
-
return [3 /*break*/,
|
|
148
|
+
return [3 /*break*/, 13];
|
|
102
149
|
}
|
|
103
|
-
return [3 /*break*/,
|
|
104
|
-
case
|
|
105
|
-
index_1.Helpers.writeJson(this.project.pathFor(
|
|
106
|
-
lastSelected: selectedLibs.map(function (c) { return c.
|
|
150
|
+
return [3 /*break*/, 10];
|
|
151
|
+
case 13:
|
|
152
|
+
index_1.Helpers.writeJson(this.project.pathFor(tnp_config_1.FilesNames.tmpLastSelectedJsonFile), {
|
|
153
|
+
lastSelected: selectedLibs.map(function (c) { return c.name; }),
|
|
107
154
|
});
|
|
108
155
|
return [2 /*return*/, { selectedLibs: selectedLibs, skipRebuildingAllForWatch: skipRebuildingAllForWatch }];
|
|
109
156
|
}
|
|
@@ -117,17 +164,11 @@ var BaseLibraryBuild = /** @class */ (function (_super) {
|
|
|
117
164
|
* angular libraries from angular.json
|
|
118
165
|
*/
|
|
119
166
|
get: function () {
|
|
120
|
-
var _this = this;
|
|
121
|
-
var _a;
|
|
122
167
|
//#region @backendFunc
|
|
123
168
|
if (!tnp_core_3._.isUndefined(this.cache['libraries'])) {
|
|
124
169
|
return this.cache['libraries'];
|
|
125
170
|
}
|
|
126
|
-
var
|
|
127
|
-
var libraries = projects.map(function (c) {
|
|
128
|
-
return _this.project.ins.From(tnp_core_2.path.join(_this.project.location, c.root));
|
|
129
|
-
});
|
|
130
|
-
libraries = this.sortByDeps(libraries);
|
|
171
|
+
var libraries = this.getLibraries();
|
|
131
172
|
this.cache['libraries'] = libraries;
|
|
132
173
|
return libraries;
|
|
133
174
|
//#endregion
|
|
@@ -135,37 +176,17 @@ var BaseLibraryBuild = /** @class */ (function (_super) {
|
|
|
135
176
|
enumerable: false,
|
|
136
177
|
configurable: true
|
|
137
178
|
});
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
return
|
|
145
|
-
switch (_d.label) {
|
|
146
|
-
case 0:
|
|
147
|
-
allLibs = this.libraries;
|
|
148
|
-
return [4 /*yield*/, this.selectAndSaveLibraries({
|
|
149
|
-
libs: allLibs,
|
|
150
|
-
watch: watch,
|
|
151
|
-
watchBuildSupported: watchBuildSupported,
|
|
152
|
-
})];
|
|
153
|
-
case 1:
|
|
154
|
-
_c = _d.sent(), selectedLibs = _c.selectedLibs, skipRebuildingAllForWatch = _c.skipRebuildingAllForWatch;
|
|
155
|
-
return [2 /*return*/, {
|
|
156
|
-
skipRebuildingAllForWatch: skipRebuildingAllForWatch,
|
|
157
|
-
/**
|
|
158
|
-
* libs selected for build
|
|
159
|
-
*/
|
|
160
|
-
selectedLibs: selectedLibs,
|
|
161
|
-
/**
|
|
162
|
-
* all libs that can be in build
|
|
163
|
-
*/
|
|
164
|
-
allLibs: allLibs,
|
|
165
|
-
}];
|
|
166
|
-
}
|
|
167
|
-
});
|
|
179
|
+
BaseLibraryBuild.prototype.getLibraries = function () {
|
|
180
|
+
var _this = this;
|
|
181
|
+
var _a;
|
|
182
|
+
//#region @backendFunc
|
|
183
|
+
var projects = Object.values(((_a = index_1.Helpers.readJson(this.project.pathFor(tnp_config_1.config.file.angular_json))) === null || _a === void 0 ? void 0 : _a.projects) || {}).filter(function (f) { return f.projectType === 'library'; });
|
|
184
|
+
var libraries = projects.map(function (c) {
|
|
185
|
+
return _this.project.ins.From(tnp_core_2.path.join(_this.project.location, c.root));
|
|
168
186
|
});
|
|
187
|
+
libraries = this.sortByDeps(libraries);
|
|
188
|
+
return libraries;
|
|
189
|
+
//#endregion
|
|
169
190
|
};
|
|
170
191
|
//#endregion
|
|
171
192
|
//#region getters & methods / build libraries
|
|
@@ -173,238 +194,335 @@ var BaseLibraryBuild = /** @class */ (function (_super) {
|
|
|
173
194
|
* Angular library build
|
|
174
195
|
*/
|
|
175
196
|
BaseLibraryBuild.prototype.buildLibraries = function () {
|
|
176
|
-
return tslib_1.__awaiter(this, arguments, void 0, function (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
var
|
|
180
|
-
var
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
197
|
+
return tslib_1.__awaiter(this, arguments, void 0, function (
|
|
198
|
+
// this:{},
|
|
199
|
+
_a) {
|
|
200
|
+
var useExternalProvidedLibs, allLibs, locationsForNodeModules, _b, selectedLibs, skipRebuildingAllForWatch, allParenProjsForExtenalLibsBuild, allParenProjsForExtenalLibsBuild_1, allParenProjsForExtenalLibsBuild_1_1, libProj, _c, _d, _e, index, lib, e_1_1, e_2_1, _f, _g, _h, index, lib, e_3_1;
|
|
201
|
+
var e_2, _j, e_1, _k, e_3, _l;
|
|
202
|
+
var
|
|
203
|
+
// this:{},
|
|
204
|
+
_m = _a === void 0 ? {} : _a, _o = _m.watch, watch = _o === void 0 ? false : _o, strategy = _m.strategy, _p = _m.releaseBuild, releaseBuild = _p === void 0 ? false : _p, buildType = _m.buildType, copylink_to_node_modules = _m.copylink_to_node_modules, outputLineReplace = _m.outputLineReplace, libraries = _m.libraries, useLastUserConfiguration = _m.useLastUserConfiguration;
|
|
205
|
+
return tslib_1.__generator(this, function (_q) {
|
|
206
|
+
switch (_q.label) {
|
|
207
|
+
case 0:
|
|
208
|
+
//#region @backend
|
|
209
|
+
return [4 /*yield*/, this.project.linkedProjects.saveAllLinkedProjectsToDB()];
|
|
210
|
+
case 1:
|
|
184
211
|
//#region @backend
|
|
212
|
+
_q.sent();
|
|
213
|
+
//#region prepare parameters
|
|
185
214
|
if (!Array.isArray(copylink_to_node_modules)) {
|
|
186
215
|
copylink_to_node_modules = [];
|
|
187
216
|
}
|
|
188
|
-
return [4 /*yield*/, this.project.linkedProjects.saveAllLinkedProjectsToDB()];
|
|
189
|
-
case 1:
|
|
190
|
-
_r.sent();
|
|
191
217
|
if (!strategy) {
|
|
192
218
|
strategy = 'link';
|
|
193
219
|
}
|
|
220
|
+
useExternalProvidedLibs = !tnp_core_3._.isNil(libraries);
|
|
221
|
+
allLibs = useExternalProvidedLibs ? libraries : this.libraries;
|
|
194
222
|
locationsForNodeModules = releaseBuild
|
|
195
223
|
? []
|
|
196
|
-
: tslib_1.__spreadArray([
|
|
224
|
+
: tslib_1.__spreadArray(tslib_1.__spreadArray([
|
|
197
225
|
this.project.pathFor(tnp_config_1.config.folder.node_modules)
|
|
198
|
-
], tslib_1.__read(copylink_to_node_modules), false)
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
226
|
+
], tslib_1.__read(copylink_to_node_modules), false), tslib_1.__read((!useExternalProvidedLibs
|
|
227
|
+
? []
|
|
228
|
+
: index_1.Helpers.uniqArray(libraries.map(function (c) {
|
|
229
|
+
return c.parent.pathFor(tnp_config_1.config.folder.node_modules);
|
|
230
|
+
})))), false);
|
|
231
|
+
return [4 /*yield*/, this.selectAndSaveLibraries({
|
|
232
|
+
selectedLibs: libraries ? libraries : allLibs,
|
|
203
233
|
watch: watch,
|
|
234
|
+
skipAllLibsQuestion: useExternalProvidedLibs,
|
|
235
|
+
useLastUserConfiguration: useLastUserConfiguration,
|
|
204
236
|
})];
|
|
237
|
+
case 2:
|
|
238
|
+
_b = _q.sent(), selectedLibs = _b.selectedLibs, skipRebuildingAllForWatch = _b.skipRebuildingAllForWatch;
|
|
239
|
+
allParenProjsForExtenalLibsBuild = useExternalProvidedLibs
|
|
240
|
+
? index_1.Helpers.uniqArray(libraries.map(function (c) { return c.parent; }), 'location')
|
|
241
|
+
: [this.project];
|
|
242
|
+
_q.label = 3;
|
|
205
243
|
case 3:
|
|
206
|
-
|
|
244
|
+
_q.trys.push([3, 15, 16, 17]);
|
|
245
|
+
allParenProjsForExtenalLibsBuild_1 = tslib_1.__values(allParenProjsForExtenalLibsBuild), allParenProjsForExtenalLibsBuild_1_1 = allParenProjsForExtenalLibsBuild_1.next();
|
|
246
|
+
_q.label = 4;
|
|
247
|
+
case 4:
|
|
248
|
+
if (!!allParenProjsForExtenalLibsBuild_1_1.done) return [3 /*break*/, 14];
|
|
249
|
+
libProj = allParenProjsForExtenalLibsBuild_1_1.value;
|
|
250
|
+
return [4 /*yield*/, libProj.init()];
|
|
251
|
+
case 5:
|
|
252
|
+
_q.sent();
|
|
253
|
+
_q.label = 6;
|
|
254
|
+
case 6:
|
|
255
|
+
_q.trys.push([6, 11, 12, 13]);
|
|
256
|
+
_c = (e_1 = void 0, tslib_1.__values(libProj.libraryBuild.libraries.entries())), _d = _c.next();
|
|
257
|
+
_q.label = 7;
|
|
258
|
+
case 7:
|
|
259
|
+
if (!!_d.done) return [3 /*break*/, 10];
|
|
260
|
+
_e = tslib_1.__read(_d.value, 2), index = _e[0], lib = _e[1];
|
|
261
|
+
if (watch && skipRebuildingAllForWatch) {
|
|
262
|
+
index_1.Helpers.info("Skipping build for watch mode (".concat(index + 1, "/").concat(allLibs.length, ")") +
|
|
263
|
+
" ".concat(lib.basename, " (").concat(tnp_core_1.chalk.bold(lib.name), ")"));
|
|
264
|
+
return [3 /*break*/, 9];
|
|
265
|
+
}
|
|
266
|
+
index_1.Helpers.info("Building (".concat(index + 1, "/").concat(allLibs.length, ") ").concat(lib.basename) +
|
|
267
|
+
" (".concat(tnp_core_1.chalk.bold(lib.name), ")"));
|
|
268
|
+
return [4 /*yield*/, libProj.libraryBuild.libNormalBuildProcess({
|
|
269
|
+
lib: lib,
|
|
270
|
+
locationsForNodeModules: useExternalProvidedLibs
|
|
271
|
+
? [
|
|
272
|
+
this.project.pathFor(tnp_config_1.config.folder.node_modules),
|
|
273
|
+
libProj.pathFor(tnp_config_1.config.folder.node_modules),
|
|
274
|
+
]
|
|
275
|
+
: locationsForNodeModules,
|
|
276
|
+
strategy: strategy,
|
|
277
|
+
buildType: buildType,
|
|
278
|
+
outputLineReplace: outputLineReplace(lib, useExternalProvidedLibs),
|
|
279
|
+
})];
|
|
280
|
+
case 8:
|
|
281
|
+
_q.sent();
|
|
282
|
+
_q.label = 9;
|
|
283
|
+
case 9:
|
|
284
|
+
_d = _c.next();
|
|
285
|
+
return [3 /*break*/, 7];
|
|
286
|
+
case 10: return [3 /*break*/, 13];
|
|
287
|
+
case 11:
|
|
288
|
+
e_1_1 = _q.sent();
|
|
289
|
+
e_1 = { error: e_1_1 };
|
|
290
|
+
return [3 /*break*/, 13];
|
|
291
|
+
case 12:
|
|
207
292
|
try {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
293
|
+
if (_d && !_d.done && (_k = _c.return)) _k.call(_c);
|
|
294
|
+
}
|
|
295
|
+
finally { if (e_1) throw e_1.error; }
|
|
296
|
+
return [7 /*endfinally*/];
|
|
297
|
+
case 13:
|
|
298
|
+
allParenProjsForExtenalLibsBuild_1_1 = allParenProjsForExtenalLibsBuild_1.next();
|
|
299
|
+
return [3 /*break*/, 4];
|
|
300
|
+
case 14: return [3 /*break*/, 17];
|
|
301
|
+
case 15:
|
|
302
|
+
e_2_1 = _q.sent();
|
|
303
|
+
e_2 = { error: e_2_1 };
|
|
304
|
+
return [3 /*break*/, 17];
|
|
305
|
+
case 16:
|
|
306
|
+
try {
|
|
307
|
+
if (allParenProjsForExtenalLibsBuild_1_1 && !allParenProjsForExtenalLibsBuild_1_1.done && (_j = allParenProjsForExtenalLibsBuild_1.return)) _j.call(allParenProjsForExtenalLibsBuild_1);
|
|
308
|
+
}
|
|
309
|
+
finally { if (e_2) throw e_2.error; }
|
|
310
|
+
return [7 /*endfinally*/];
|
|
311
|
+
case 17:
|
|
312
|
+
_q.trys.push([17, 22, 23, 24]);
|
|
313
|
+
_f = tslib_1.__values(selectedLibs.entries()), _g = _f.next();
|
|
314
|
+
_q.label = 18;
|
|
315
|
+
case 18:
|
|
316
|
+
if (!!_g.done) return [3 /*break*/, 21];
|
|
317
|
+
_h = tslib_1.__read(_g.value, 2), index = _h[0], lib = _h[1];
|
|
318
|
+
index_1.Helpers.info("Building for watch (".concat(index + 1, "/").concat(selectedLibs.length, ") ") +
|
|
319
|
+
"".concat(lib.basename, " (").concat(tnp_core_1.chalk.bold(lib.name), ")"));
|
|
320
|
+
return [4 /*yield*/, this.libWatchBuildProcess({
|
|
321
|
+
lib: lib,
|
|
322
|
+
locationsForNodeModules: locationsForNodeModules,
|
|
323
|
+
strategy: strategy,
|
|
324
|
+
buildType: buildType,
|
|
325
|
+
outputLineReplace: outputLineReplace(lib, useExternalProvidedLibs),
|
|
326
|
+
})];
|
|
327
|
+
case 19:
|
|
328
|
+
_q.sent();
|
|
329
|
+
_q.label = 20;
|
|
330
|
+
case 20:
|
|
331
|
+
_g = _f.next();
|
|
332
|
+
return [3 /*break*/, 18];
|
|
333
|
+
case 21: return [3 /*break*/, 24];
|
|
334
|
+
case 22:
|
|
335
|
+
e_3_1 = _q.sent();
|
|
336
|
+
e_3 = { error: e_3_1 };
|
|
337
|
+
return [3 /*break*/, 24];
|
|
338
|
+
case 23:
|
|
339
|
+
try {
|
|
340
|
+
if (_g && !_g.done && (_l = _f.return)) _l.call(_f);
|
|
341
|
+
}
|
|
342
|
+
finally { if (e_3) throw e_3.error; }
|
|
343
|
+
return [7 /*endfinally*/];
|
|
344
|
+
case 24:
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region success message
|
|
347
|
+
if (watch) {
|
|
348
|
+
index_1.Helpers.success('BUILD DONE.. watching..');
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
// await this.__indexRebuilder.start({ taskName: 'index rebuild watch' });
|
|
352
|
+
index_1.Helpers.success('BUILD DONE');
|
|
353
|
+
}
|
|
354
|
+
return [2 /*return*/];
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
//#endregion
|
|
360
|
+
//#region getters & methods / lib watch build process
|
|
361
|
+
BaseLibraryBuild.prototype.libWatchBuildProcess = function (_a) {
|
|
362
|
+
return tslib_1.__awaiter(this, arguments, void 0, function (_b) {
|
|
363
|
+
var debouncedBuild;
|
|
364
|
+
var lib = _b.lib, locationsForNodeModules = _b.locationsForNodeModules, strategy = _b.strategy, buildType = _b.buildType, outputLineReplace = _b.outputLineReplace;
|
|
365
|
+
return tslib_1.__generator(this, function (_c) {
|
|
366
|
+
switch (_c.label) {
|
|
367
|
+
case 0:
|
|
368
|
+
debouncedBuild = tnp_core_3._.debounce(function () {
|
|
369
|
+
var e_4, _a;
|
|
370
|
+
var sourceDist = lib.parent.pathFor([tnp_config_1.config.folder.dist, lib.basename]);
|
|
371
|
+
try {
|
|
372
|
+
for (var locationsForNodeModules_1 = tslib_1.__values(locationsForNodeModules), locationsForNodeModules_1_1 = locationsForNodeModules_1.next(); !locationsForNodeModules_1_1.done; locationsForNodeModules_1_1 = locationsForNodeModules_1.next()) {
|
|
373
|
+
var node_modules = locationsForNodeModules_1_1.value;
|
|
374
|
+
var dest = (0, tnp_core_2.crossPlatformPath)([node_modules, lib.name]);
|
|
375
|
+
if (index_1.Helpers.isSymlinkFileExitedOrUnexisted(dest)) {
|
|
376
|
+
index_1.Helpers.remove(dest);
|
|
241
377
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
378
|
+
index_1.Helpers.copy(sourceDist, dest);
|
|
379
|
+
// console.log({ sourceDist, dest });
|
|
380
|
+
console.log("Sync (watch) done for ".concat(lib.basename, " to ").concat(lib.name, " (").concat((0, tnp_core_2.crossPlatformPath)([
|
|
381
|
+
tnp_core_2.path.basename(tnp_core_2.path.dirname(node_modules)),
|
|
382
|
+
tnp_config_1.config.folder.node_modules,
|
|
383
|
+
]), ")"));
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
387
|
+
finally {
|
|
388
|
+
try {
|
|
389
|
+
if (locationsForNodeModules_1_1 && !locationsForNodeModules_1_1.done && (_a = locationsForNodeModules_1.return)) _a.call(locationsForNodeModules_1);
|
|
390
|
+
}
|
|
391
|
+
finally { if (e_4) throw e_4.error; }
|
|
392
|
+
}
|
|
393
|
+
}, 500);
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region watch build process
|
|
396
|
+
return [4 /*yield*/, lib.parent.execute(lib.libraryBuild.getLibraryBuildComamnd({
|
|
397
|
+
watch: true,
|
|
398
|
+
buildType: buildType,
|
|
399
|
+
}), {
|
|
400
|
+
outputLineReplace: outputLineReplace,
|
|
401
|
+
resolvePromiseMsg: {
|
|
402
|
+
stdout: lib.libraryBuild.getLibraryBuildSuccessComamnd,
|
|
403
|
+
},
|
|
404
|
+
resolvePromiseMsgCallback: {
|
|
405
|
+
stdout: function () {
|
|
406
|
+
if (strategy === 'copy') {
|
|
407
|
+
debouncedBuild();
|
|
246
408
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
})];
|
|
412
|
+
case 1:
|
|
413
|
+
//#endregion
|
|
414
|
+
//#region watch build process
|
|
415
|
+
_c.sent();
|
|
416
|
+
return [2 /*return*/];
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
};
|
|
421
|
+
//#endregion
|
|
422
|
+
//#region getters & methods / lib normal build process
|
|
423
|
+
BaseLibraryBuild.prototype.libNormalBuildProcess = function (_a) {
|
|
424
|
+
return tslib_1.__awaiter(this, arguments, void 0, function (_b) {
|
|
425
|
+
var libCompiledInDist, compileProcess, locationsForNodeModules_2, locationsForNodeModules_2_1, node_modules_abs_path, libInsideNodeModules, locationsForNodeModules_3, locationsForNodeModules_3_1, node_modules_abs_path, libInsideNodeModules;
|
|
426
|
+
var e_5, _c, e_6, _d;
|
|
427
|
+
var _this = this;
|
|
428
|
+
var lib = _b.lib, locationsForNodeModules = _b.locationsForNodeModules, strategy = _b.strategy, buildType = _b.buildType, outputLineReplace = _b.outputLineReplace;
|
|
429
|
+
return tslib_1.__generator(this, function (_e) {
|
|
430
|
+
switch (_e.label) {
|
|
431
|
+
case 0:
|
|
432
|
+
libCompiledInDist = lib.parent.pathFor([
|
|
433
|
+
tnp_config_1.config.folder.dist,
|
|
434
|
+
lib.basename,
|
|
435
|
+
]);
|
|
436
|
+
compileProcess = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
437
|
+
return tslib_1.__generator(this, function (_a) {
|
|
438
|
+
switch (_a.label) {
|
|
439
|
+
case 0:
|
|
440
|
+
if (!!index_1.Helpers.exists(libCompiledInDist)) return [3 /*break*/, 2];
|
|
250
441
|
index_1.Helpers.info("Compiling ".concat(lib.name, " ..."));
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
442
|
+
return [4 /*yield*/, lib.parent.execute(lib.libraryBuild.getLibraryBuildComamnd({
|
|
443
|
+
watch: false,
|
|
444
|
+
buildType: buildType,
|
|
445
|
+
}), {
|
|
446
|
+
resolvePromiseMsg: {
|
|
447
|
+
stdout: lib.libraryBuild.getLibraryBuildSuccessComamnd,
|
|
448
|
+
},
|
|
449
|
+
outputLineReplace: outputLineReplace,
|
|
450
|
+
})];
|
|
451
|
+
case 1:
|
|
452
|
+
_a.sent();
|
|
453
|
+
_a.label = 2;
|
|
454
|
+
case 2: return [2 /*return*/];
|
|
261
455
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
try {
|
|
276
|
-
for (locationsForNodeModules_2 = (e_4 = void 0, tslib_1.__values(locationsForNodeModules)), locationsForNodeModules_2_1 = locationsForNodeModules_2.next(); !locationsForNodeModules_2_1.done; locationsForNodeModules_2_1 = locationsForNodeModules_2.next()) {
|
|
277
|
-
node_modules = locationsForNodeModules_2_1.value;
|
|
278
|
-
dest = (0, tnp_core_2.crossPlatformPath)([node_modules, lib.name]);
|
|
279
|
-
if (index_1.Helpers.isSymlinkFileExitedOrUnexisted(dest)) {
|
|
280
|
-
index_1.Helpers.remove(dest);
|
|
281
|
-
}
|
|
282
|
-
index_1.Helpers.copy(sourceDist, dest);
|
|
283
|
-
console.log("Sync done for ".concat(lib.basename, " to ").concat(lib.name, " (").concat((0, tnp_core_2.crossPlatformPath)([
|
|
284
|
-
tnp_core_2.path.basename(tnp_core_2.path.dirname(node_modules)),
|
|
285
|
-
tnp_config_1.config.folder.node_modules,
|
|
286
|
-
]), ")"));
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
290
|
-
finally {
|
|
291
|
-
try {
|
|
292
|
-
if (locationsForNodeModules_2_1 && !locationsForNodeModules_2_1.done && (_l = locationsForNodeModules_2.return)) _l.call(locationsForNodeModules_2);
|
|
293
|
-
}
|
|
294
|
-
finally { if (e_4) throw e_4.error; }
|
|
295
|
-
}
|
|
296
|
-
//#endregion
|
|
456
|
+
});
|
|
457
|
+
}); };
|
|
458
|
+
if (!(strategy === 'link')) return [3 /*break*/, 2];
|
|
459
|
+
try {
|
|
460
|
+
//#region link dist to node_modules
|
|
461
|
+
for (locationsForNodeModules_2 = tslib_1.__values(locationsForNodeModules), locationsForNodeModules_2_1 = locationsForNodeModules_2.next(); !locationsForNodeModules_2_1.done; locationsForNodeModules_2_1 = locationsForNodeModules_2.next()) {
|
|
462
|
+
node_modules_abs_path = locationsForNodeModules_2_1.value;
|
|
463
|
+
libInsideNodeModules = (0, tnp_core_2.crossPlatformPath)([
|
|
464
|
+
node_modules_abs_path,
|
|
465
|
+
lib.name,
|
|
466
|
+
]);
|
|
467
|
+
if (!index_1.Helpers.isSymlinkFileExitedOrUnexisted(libInsideNodeModules)) {
|
|
468
|
+
index_1.Helpers.remove(libInsideNodeModules);
|
|
297
469
|
}
|
|
470
|
+
// console.log('linking from ', sourceDist);
|
|
471
|
+
// console.log('linking to ', dest);
|
|
472
|
+
// Helpers.remove(dest);
|
|
473
|
+
index_1.Helpers.createSymLink(libCompiledInDist, libInsideNodeModules, {
|
|
474
|
+
continueWhenExistedFolderDoesntExists: true,
|
|
475
|
+
});
|
|
476
|
+
console.log("Sync (link) done for ".concat(lib.basename, " to ").concat(lib.name, " (").concat((0, tnp_core_2.crossPlatformPath)([
|
|
477
|
+
tnp_core_2.path.basename(tnp_core_2.path.dirname(node_modules_abs_path)),
|
|
478
|
+
tnp_config_1.config.folder.node_modules,
|
|
479
|
+
]), ")"));
|
|
298
480
|
}
|
|
299
481
|
}
|
|
300
|
-
catch (
|
|
482
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
301
483
|
finally {
|
|
302
484
|
try {
|
|
303
|
-
if (
|
|
485
|
+
if (locationsForNodeModules_2_1 && !locationsForNodeModules_2_1.done && (_c = locationsForNodeModules_2.return)) _c.call(locationsForNodeModules_2);
|
|
304
486
|
}
|
|
305
|
-
finally { if (
|
|
487
|
+
finally { if (e_5) throw e_5.error; }
|
|
306
488
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
switch (_a.label) {
|
|
319
|
-
case 0:
|
|
320
|
-
debouncedBuild = tnp_core_3._.debounce(function () {
|
|
321
|
-
var e_5, _a;
|
|
322
|
-
var sourceDist = _this.project.pathFor([
|
|
323
|
-
tnp_config_1.config.folder.dist,
|
|
324
|
-
lib.basename,
|
|
325
|
-
]);
|
|
326
|
-
try {
|
|
327
|
-
for (var locationsForNodeModules_3 = tslib_1.__values(locationsForNodeModules), locationsForNodeModules_3_1 = locationsForNodeModules_3.next(); !locationsForNodeModules_3_1.done; locationsForNodeModules_3_1 = locationsForNodeModules_3.next()) {
|
|
328
|
-
var node_modules = locationsForNodeModules_3_1.value;
|
|
329
|
-
var dest = (0, tnp_core_2.crossPlatformPath)([node_modules, lib.name]);
|
|
330
|
-
if (index_1.Helpers.isSymlinkFileExitedOrUnexisted(dest)) {
|
|
331
|
-
index_1.Helpers.remove(dest);
|
|
332
|
-
}
|
|
333
|
-
index_1.Helpers.copy(sourceDist, dest);
|
|
334
|
-
// console.log({ sourceDist, dest });
|
|
335
|
-
console.log("Sync (watch) done for ".concat(lib.basename, " to ").concat(lib.name, " (").concat((0, tnp_core_2.crossPlatformPath)([
|
|
336
|
-
tnp_core_2.path.basename(tnp_core_2.path.dirname(node_modules)),
|
|
337
|
-
tnp_config_1.config.folder.node_modules,
|
|
338
|
-
]), ")"));
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
342
|
-
finally {
|
|
343
|
-
try {
|
|
344
|
-
if (locationsForNodeModules_3_1 && !locationsForNodeModules_3_1.done && (_a = locationsForNodeModules_3.return)) _a.call(locationsForNodeModules_3);
|
|
345
|
-
}
|
|
346
|
-
finally { if (e_5) throw e_5.error; }
|
|
347
|
-
}
|
|
348
|
-
}, 500);
|
|
349
|
-
return [4 /*yield*/, this.project
|
|
350
|
-
.run(lib.libraryBuild.getLibraryBuildComamnd({
|
|
351
|
-
watch: true,
|
|
352
|
-
buildType: buildType,
|
|
353
|
-
}), {
|
|
354
|
-
output: true,
|
|
355
|
-
})
|
|
356
|
-
.unitlOutputContains(lib.libraryBuild.getLibraryBuildSuccessComamnd, [], 0, function () {
|
|
357
|
-
if (strategy === 'copy') {
|
|
358
|
-
debouncedBuild();
|
|
359
|
-
}
|
|
360
|
-
})];
|
|
361
|
-
case 1:
|
|
362
|
-
_a.sent();
|
|
363
|
-
return [2 /*return*/];
|
|
364
|
-
}
|
|
365
|
-
});
|
|
366
|
-
}); })()];
|
|
367
|
-
case 1:
|
|
368
|
-
_s.sent();
|
|
369
|
-
return [2 /*return*/];
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
};
|
|
373
|
-
_r.label = 4;
|
|
374
|
-
case 4:
|
|
375
|
-
_r.trys.push([4, 9, 10, 11]);
|
|
376
|
-
_f = tslib_1.__values(selectedLibs.entries()), _g = _f.next();
|
|
377
|
-
_r.label = 5;
|
|
378
|
-
case 5:
|
|
379
|
-
if (!!_g.done) return [3 /*break*/, 8];
|
|
380
|
-
_h = tslib_1.__read(_g.value, 2), index = _h[0], lib = _h[1];
|
|
381
|
-
return [5 /*yield**/, _loop_1(index, lib)];
|
|
382
|
-
case 6:
|
|
383
|
-
_r.sent();
|
|
384
|
-
_r.label = 7;
|
|
385
|
-
case 7:
|
|
386
|
-
_g = _f.next();
|
|
387
|
-
return [3 /*break*/, 5];
|
|
388
|
-
case 8: return [3 /*break*/, 11];
|
|
389
|
-
case 9:
|
|
390
|
-
e_1_1 = _r.sent();
|
|
391
|
-
e_1 = { error: e_1_1 };
|
|
392
|
-
return [3 /*break*/, 11];
|
|
393
|
-
case 10:
|
|
489
|
+
return [4 /*yield*/, compileProcess()];
|
|
490
|
+
case 1:
|
|
491
|
+
_e.sent();
|
|
492
|
+
return [3 /*break*/, 4];
|
|
493
|
+
case 2:
|
|
494
|
+
if (!(strategy === 'copy')) return [3 /*break*/, 4];
|
|
495
|
+
//#region copy dist to node_modules
|
|
496
|
+
return [4 /*yield*/, compileProcess()];
|
|
497
|
+
case 3:
|
|
498
|
+
//#region copy dist to node_modules
|
|
499
|
+
_e.sent();
|
|
394
500
|
try {
|
|
395
|
-
|
|
501
|
+
for (locationsForNodeModules_3 = tslib_1.__values(locationsForNodeModules), locationsForNodeModules_3_1 = locationsForNodeModules_3.next(); !locationsForNodeModules_3_1.done; locationsForNodeModules_3_1 = locationsForNodeModules_3.next()) {
|
|
502
|
+
node_modules_abs_path = locationsForNodeModules_3_1.value;
|
|
503
|
+
libInsideNodeModules = (0, tnp_core_2.crossPlatformPath)([
|
|
504
|
+
node_modules_abs_path,
|
|
505
|
+
lib.name,
|
|
506
|
+
]);
|
|
507
|
+
if (index_1.Helpers.isSymlinkFileExitedOrUnexisted(libInsideNodeModules)) {
|
|
508
|
+
index_1.Helpers.remove(libInsideNodeModules);
|
|
509
|
+
}
|
|
510
|
+
index_1.Helpers.copy(libCompiledInDist, libInsideNodeModules);
|
|
511
|
+
console.log("Sync done for ".concat(lib.basename, " to ").concat(lib.name, " (").concat((0, tnp_core_2.crossPlatformPath)([
|
|
512
|
+
tnp_core_2.path.basename(tnp_core_2.path.dirname(node_modules_abs_path)),
|
|
513
|
+
tnp_config_1.config.folder.node_modules,
|
|
514
|
+
]), ")"));
|
|
515
|
+
}
|
|
396
516
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
_r.label = 13;
|
|
407
|
-
case 13: return [2 /*return*/];
|
|
517
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
518
|
+
finally {
|
|
519
|
+
try {
|
|
520
|
+
if (locationsForNodeModules_3_1 && !locationsForNodeModules_3_1.done && (_d = locationsForNodeModules_3.return)) _d.call(locationsForNodeModules_3);
|
|
521
|
+
}
|
|
522
|
+
finally { if (e_6) throw e_6.error; }
|
|
523
|
+
}
|
|
524
|
+
_e.label = 4;
|
|
525
|
+
case 4: return [2 /*return*/];
|
|
408
526
|
}
|
|
409
527
|
});
|
|
410
528
|
});
|