tnp-helpers 18.0.6 → 18.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/assets/shared/shared_folder_info.txt +1 -1
  2. package/browser/esm2022/lib/base/base-git.mjs +4 -4
  3. package/browser/esm2022/lib/base/base-library-build.mjs +96 -10
  4. package/browser/esm2022/lib/base/base-npm-helpers.mjs +3 -3
  5. package/browser/esm2022/lib/base/base-project-resolver.mjs +2 -2
  6. package/browser/esm2022/lib/base/base-project.mjs +1 -1
  7. package/browser/esm2022/lib/base/commit-data.mjs +2 -2
  8. package/browser/esm2022/lib/helpers/for-browser/helpers-browser.mjs +2 -2
  9. package/browser/esm2022/lib/helpers/helpers-strings.mjs +3 -3
  10. package/browser/esm2022/lib/helpers/helpers.mjs +6 -6
  11. package/browser/esm2022/lib/index.mjs +3 -3
  12. package/browser/esm2022/lib/models.mjs +1 -1
  13. package/browser/esm2022/lib/utils.mjs +141 -1
  14. package/browser/fesm2022/tnp-helpers.mjs +254 -28
  15. package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
  16. package/browser/lib/base/base-git.d.ts +5 -5
  17. package/browser/lib/base/base-library-build.d.ts +21 -8
  18. package/browser/lib/base/base-npm-helpers.d.ts +9 -8
  19. package/browser/lib/base/base-project.d.ts +4 -3
  20. package/browser/lib/base/commit-data.d.ts +5 -5
  21. package/browser/lib/base/core-project.d.ts +2 -2
  22. package/browser/lib/helpers/helpers.d.ts +3 -3
  23. package/browser/lib/index.d.ts +2 -2
  24. package/browser/lib/models.d.ts +12 -1
  25. package/browser/lib/utils.d.ts +32 -0
  26. package/client/esm2022/lib/base/base-git.mjs +4 -4
  27. package/client/esm2022/lib/base/base-library-build.mjs +96 -10
  28. package/client/esm2022/lib/base/base-npm-helpers.mjs +3 -3
  29. package/client/esm2022/lib/base/base-project-resolver.mjs +2 -2
  30. package/client/esm2022/lib/base/base-project.mjs +1 -1
  31. package/client/esm2022/lib/base/commit-data.mjs +2 -2
  32. package/client/esm2022/lib/helpers/for-browser/helpers-browser.mjs +2 -2
  33. package/client/esm2022/lib/helpers/helpers-strings.mjs +3 -3
  34. package/client/esm2022/lib/helpers/helpers.mjs +6 -6
  35. package/client/esm2022/lib/index.mjs +3 -3
  36. package/client/esm2022/lib/models.mjs +1 -1
  37. package/client/esm2022/lib/utils.mjs +141 -1
  38. package/client/fesm2022/tnp-helpers.mjs +254 -28
  39. package/client/fesm2022/tnp-helpers.mjs.map +1 -1
  40. package/client/lib/base/base-git.d.ts +5 -5
  41. package/client/lib/base/base-library-build.d.ts +21 -8
  42. package/client/lib/base/base-npm-helpers.d.ts +9 -8
  43. package/client/lib/base/base-project.d.ts +4 -3
  44. package/client/lib/base/commit-data.d.ts +5 -5
  45. package/client/lib/base/core-project.d.ts +2 -2
  46. package/client/lib/helpers/helpers.d.ts +3 -3
  47. package/client/lib/index.d.ts +2 -2
  48. package/client/lib/models.d.ts +12 -1
  49. package/client/lib/utils.d.ts +32 -0
  50. package/lib/base/base-command-line.backend.js +1 -1
  51. package/lib/base/base-command-line.backend.js.map +1 -1
  52. package/lib/base/base-db.js +2 -2
  53. package/lib/base/base-db.js.map +1 -1
  54. package/lib/base/base-git.d.ts +5 -5
  55. package/lib/base/base-git.js +3 -3
  56. package/lib/base/base-git.js.map +1 -1
  57. package/lib/base/base-library-build.d.ts +23 -20
  58. package/lib/base/base-library-build.js +384 -281
  59. package/lib/base/base-library-build.js.map +1 -1
  60. package/lib/base/base-linked-projects.js +1 -1
  61. package/lib/base/base-linked-projects.js.map +1 -1
  62. package/lib/base/base-npm-helpers.d.ts +9 -8
  63. package/lib/base/base-npm-helpers.js +25 -25
  64. package/lib/base/base-npm-helpers.js.map +1 -1
  65. package/lib/base/base-project-resolver.js +5 -5
  66. package/lib/base/base-project-resolver.js.map +1 -1
  67. package/lib/base/base-project.d.ts +4 -3
  68. package/lib/base/base-project.js +42 -42
  69. package/lib/base/base-project.js.map +1 -1
  70. package/lib/base/base-start-config.backend.js +1 -1
  71. package/lib/base/base-start-config.backend.js.map +1 -1
  72. package/lib/base/command-line-feature.backend.js +1 -1
  73. package/lib/base/command-line-feature.backend.js.map +1 -1
  74. package/lib/base/commit-data.d.ts +5 -5
  75. package/lib/base/commit-data.js +1 -1
  76. package/lib/base/core-project.d.ts +2 -2
  77. package/lib/base/linked-project.js +1 -1
  78. package/lib/base/linked-project.js.map +1 -1
  79. package/lib/helpers/for-backend/helpers-cli-tool.backend.js +2 -2
  80. package/lib/helpers/for-backend/helpers-cli-tool.backend.js.map +1 -1
  81. package/lib/helpers/for-backend/helpers-console-gui.d.ts +6 -0
  82. package/lib/helpers/for-backend/helpers-console-gui.js +12 -4
  83. package/lib/helpers/for-backend/helpers-console-gui.js.map +1 -1
  84. package/lib/helpers/for-backend/helpers-file-folders.backend.d.ts +1 -1
  85. package/lib/helpers/for-backend/helpers-file-folders.backend.js +14 -14
  86. package/lib/helpers/for-backend/helpers-file-folders.backend.js.map +1 -1
  87. package/lib/helpers/for-backend/helpers-git.backend.js +92 -77
  88. package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
  89. package/lib/helpers/for-backend/helpers-process.backend.d.ts +7 -0
  90. package/lib/helpers/for-backend/helpers-process.backend.js +16 -40
  91. package/lib/helpers/for-backend/helpers-process.backend.js.map +1 -1
  92. package/lib/helpers/for-browser/angular.helper.js +2 -2
  93. package/lib/helpers/for-browser/helpers-browser.js +1 -1
  94. package/lib/helpers/for-browser/helpers-browser.js.map +1 -1
  95. package/lib/helpers/helpers-strings.js +2 -2
  96. package/lib/helpers/helpers-strings.js.map +1 -1
  97. package/lib/helpers/helpers.d.ts +3 -3
  98. package/lib/helpers/helpers.js +34 -34
  99. package/lib/helpers/helpers.js.map +1 -1
  100. package/lib/index.d.ts +2 -2
  101. package/lib/index.js +2 -2
  102. package/lib/index.js.map +1 -1
  103. package/lib/models.d.ts +12 -1
  104. package/lib/models.js.map +1 -1
  105. package/lib/old/base-component.js +2 -2
  106. package/lib/old/base-formly-component.js +2 -2
  107. package/lib/old/dual-component-ctrl.js +2 -2
  108. package/lib/utils.d.ts +32 -0
  109. package/lib/utils.js +113 -1
  110. package/lib/utils.js.map +1 -1
  111. package/lib/validators/validators-firedev.d.ts +1 -1
  112. package/lib/validators/validators-firedev.js +5 -5
  113. package/lib/validators/validators-firedev.js.map +1 -1
  114. package/package.json +5 -5
  115. package/src.d.ts +1 -1
  116. package/{firedev.jsonc → taon.jsonc} +12 -6
  117. package/tmp-environment.json +33 -39
  118. package/websql/esm2022/lib/base/base-git.mjs +4 -4
  119. package/websql/esm2022/lib/base/base-library-build.mjs +96 -10
  120. package/websql/esm2022/lib/base/base-npm-helpers.mjs +3 -3
  121. package/websql/esm2022/lib/base/base-project-resolver.mjs +2 -2
  122. package/websql/esm2022/lib/base/base-project.mjs +1 -1
  123. package/websql/esm2022/lib/base/commit-data.mjs +2 -2
  124. package/websql/esm2022/lib/helpers/for-browser/helpers-browser.mjs +2 -2
  125. package/websql/esm2022/lib/helpers/helpers-strings.mjs +3 -3
  126. package/websql/esm2022/lib/helpers/helpers.mjs +6 -6
  127. package/websql/esm2022/lib/index.mjs +3 -3
  128. package/websql/esm2022/lib/models.mjs +1 -1
  129. package/websql/esm2022/lib/utils.mjs +141 -1
  130. package/websql/fesm2022/tnp-helpers.mjs +254 -28
  131. package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
  132. package/websql/lib/base/base-git.d.ts +5 -5
  133. package/websql/lib/base/base-library-build.d.ts +21 -8
  134. package/websql/lib/base/base-npm-helpers.d.ts +9 -8
  135. package/websql/lib/base/base-project.d.ts +5 -8
  136. package/websql/lib/base/commit-data.d.ts +5 -5
  137. package/websql/lib/base/core-project.d.ts +2 -2
  138. package/websql/lib/helpers/helpers.d.ts +3 -3
  139. package/websql/lib/index.d.ts +2 -2
  140. package/websql/lib/models.d.ts +12 -1
  141. 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
- return libraries;
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 (_b) {
46
- var buildAll, skipRebuildingAllForWatch, lastSelectedJsonFile, lastSelected, selected, pickedLibs, selected;
47
- var _c;
48
- var selectedLibs = _b.libs, watch = _b.watch, watchBuildSupported = _b.watchBuildSupported;
49
- return tslib_1.__generator(this, function (_d) {
50
- switch (_d.label) {
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,44 +78,61 @@ var BaseLibraryBuild = /** @class */ (function (_super) {
57
78
  if (tnp_core_3._.isUndefined(watchBuildSupported)) {
58
79
  watchBuildSupported = true;
59
80
  }
60
- lastSelectedJsonFile = 'tmp-last-selected.json';
61
- lastSelected = ((_c = index_1.Helpers.readJson(this.project.pathFor(lastSelectedJsonFile))) === null || _c === void 0 ? void 0 : _c.lastSelected) || [];
62
- if (!(tnp_core_3._.isArray(lastSelected) && lastSelected.length > 0)) return [3 /*break*/, 4];
63
- selected = lastSelected.map(function (c) {
64
- return selectedLibs.find(function (l) { return l.basename == c; });
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 [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo("Continue ".concat(watch ? 'watch' : '', " build with last selected ?"))];
68
- case 1:
69
- if (!_d.sent()) return [3 /*break*/, 4];
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*/, 3];
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
- if (!(!watch || (watch && selectedLibs.length < 6))) return [3 /*break*/, 6];
79
- return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo("Should all libraries be included in".concat(watch ? ' watch' : ' ', "build ?"))];
102
+ _d = (_f.sent());
103
+ _f.label = 5;
80
104
  case 5:
81
- buildAll = _d.sent();
82
- _d.label = 6;
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
- _d.label = 7;
88
- case 7:
89
- if (!true) return [3 /*break*/, 10];
90
- return [4 /*yield*/, index_1.Helpers.consoleGui.multiselect("Select libraries to ".concat(watch ? 'watch' : '', " build "), selectedLibs.map(function (c) {
91
- return { name: c.name, value: c.name, selected: true };
92
- }), true)];
93
- case 8:
94
- pickedLibs = _d.sent();
95
- selected = pickedLibs
119
+ _f.label = 10;
120
+ case 10:
121
+ if (!true) return [3 /*break*/, 13];
122
+ defaultSelected = lastSelected
96
123
  .map(function (c) { return selectedLibs.find(function (l) { return l.name == c; }); })
97
- .filter(function (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) {
98
136
  // if (!!c) { // TODO QUICK_FIX
99
137
  // this.project.removeFile(lastSelectedJsonFile);
100
138
  // Helpers.warn(`Please restart this command`);
@@ -104,15 +142,15 @@ var BaseLibraryBuild = /** @class */ (function (_super) {
104
142
  });
105
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 "));
106
144
  return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo("Continue build with ".concat(selected.length, " selected ?"))];
107
- case 9:
108
- if (_d.sent()) {
145
+ case 12:
146
+ if (_f.sent()) {
109
147
  selectedLibs = selected;
110
- return [3 /*break*/, 10];
148
+ return [3 /*break*/, 13];
111
149
  }
112
- return [3 /*break*/, 7];
113
- case 10:
114
- index_1.Helpers.writeJson(this.project.pathFor(lastSelectedJsonFile), {
115
- lastSelected: selectedLibs.map(function (c) { return c.basename; }),
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; }),
116
154
  });
117
155
  return [2 /*return*/, { selectedLibs: selectedLibs, skipRebuildingAllForWatch: skipRebuildingAllForWatch }];
118
156
  }
@@ -138,7 +176,6 @@ var BaseLibraryBuild = /** @class */ (function (_super) {
138
176
  enumerable: false,
139
177
  configurable: true
140
178
  });
141
- //#endregion
142
179
  BaseLibraryBuild.prototype.getLibraries = function () {
143
180
  var _this = this;
144
181
  var _a;
@@ -151,275 +188,341 @@ var BaseLibraryBuild = /** @class */ (function (_super) {
151
188
  return libraries;
152
189
  //#endregion
153
190
  };
154
- //#region getters & methods / selected libraries
155
- BaseLibraryBuild.prototype.selectLibraries = function (_a) {
156
- return tslib_1.__awaiter(this, arguments, void 0, function (_b) {
157
- var allLibs, _c, selectedLibs, skipRebuildingAllForWatch;
158
- var watch = _b.watch, watchBuildSupported = _b.watchBuildSupported;
159
- return tslib_1.__generator(this, function (_d) {
160
- switch (_d.label) {
161
- case 0:
162
- allLibs = this.libraries;
163
- return [4 /*yield*/, this.selectAndSaveLibraries({
164
- libs: allLibs,
165
- watch: watch,
166
- watchBuildSupported: watchBuildSupported,
167
- })];
168
- case 1:
169
- _c = _d.sent(), selectedLibs = _c.selectedLibs, skipRebuildingAllForWatch = _c.skipRebuildingAllForWatch;
170
- return [2 /*return*/, {
171
- skipRebuildingAllForWatch: skipRebuildingAllForWatch,
172
- /**
173
- * libs selected for build
174
- */
175
- selectedLibs: selectedLibs,
176
- /**
177
- * all libs that can be in build
178
- */
179
- allLibs: allLibs,
180
- }];
181
- }
182
- });
183
- });
184
- };
185
191
  //#endregion
186
192
  //#region getters & methods / build libraries
187
193
  /**
188
194
  * Angular library build
189
195
  */
190
196
  BaseLibraryBuild.prototype.buildLibraries = function () {
191
- return tslib_1.__awaiter(this, arguments, void 0, function (_a) {
192
- var locationsForNodeModules, _b, selectedLibs, allLibs, skipRebuildingAllForWatch, _c, _d, _e, index, lib, sourceDist, locationsForNodeModules_1, locationsForNodeModules_1_1, node_modules, dest, locationsForNodeModules_2, locationsForNodeModules_2_1, node_modules, dest, _loop_1, _f, _g, _h, index, lib, e_1_1;
193
- var e_2, _j, e_3, _k, e_4, _l, e_1, _m;
194
- var _this = this;
195
- var _o = _a === void 0 ? {} : _a, _p = _o.watch, watch = _p === void 0 ? false : _p, strategy = _o.strategy, _q = _o.releaseBuild, releaseBuild = _q === void 0 ? false : _q, buildType = _o.buildType, copylink_to_node_modules = _o.copylink_to_node_modules;
196
- return tslib_1.__generator(this, function (_r) {
197
- switch (_r.label) {
198
- case 0:
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:
199
211
  //#region @backend
212
+ _q.sent();
213
+ //#region prepare parameters
200
214
  if (!Array.isArray(copylink_to_node_modules)) {
201
215
  copylink_to_node_modules = [];
202
216
  }
203
- return [4 /*yield*/, this.project.linkedProjects.saveAllLinkedProjectsToDB()];
204
- case 1:
205
- _r.sent();
206
217
  if (!strategy) {
207
218
  strategy = 'link';
208
219
  }
220
+ useExternalProvidedLibs = !tnp_core_3._.isNil(libraries);
221
+ allLibs = useExternalProvidedLibs ? libraries : this.libraries;
209
222
  locationsForNodeModules = releaseBuild
210
223
  ? []
211
- : tslib_1.__spreadArray([
224
+ : tslib_1.__spreadArray(tslib_1.__spreadArray([
212
225
  this.project.pathFor(tnp_config_1.config.folder.node_modules)
213
- ], tslib_1.__read(copylink_to_node_modules), false);
214
- return [4 /*yield*/, this.project.npmHelpers.makeSureNodeModulesInstalled()];
215
- case 2:
216
- _r.sent();
217
- return [4 /*yield*/, this.selectLibraries({
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,
218
233
  watch: watch,
234
+ skipAllLibsQuestion: useExternalProvidedLibs,
235
+ useLastUserConfiguration: useLastUserConfiguration,
219
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;
220
243
  case 3:
221
- _b = _r.sent(), selectedLibs = _b.selectedLibs, allLibs = _b.allLibs, skipRebuildingAllForWatch = _b.skipRebuildingAllForWatch;
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:
222
292
  try {
223
- //#endregion
224
- //#region normal build
225
- for (_c = tslib_1.__values(allLibs.entries()), _d = _c.next(); !_d.done; _d = _c.next()) {
226
- _e = tslib_1.__read(_d.value, 2), index = _e[0], lib = _e[1];
227
- if (watch && skipRebuildingAllForWatch) {
228
- index_1.Helpers.info("Skipping build for watch mode (".concat(index + 1, "/").concat(allLibs.length, ") ").concat(lib.basename, " (").concat(tnp_core_1.chalk.bold(lib.name), ")"));
229
- continue;
230
- }
231
- index_1.Helpers.info("Building (".concat(index + 1, "/").concat(allLibs.length, ") ").concat(lib.basename, " (").concat(tnp_core_1.chalk.bold(lib.name), ")"));
232
- sourceDist = this.project.pathFor([
233
- tnp_config_1.config.folder.dist,
234
- lib.basename,
235
- ]);
236
- if (strategy === 'link') {
237
- try {
238
- //#region link dist to node_modules
239
- for (locationsForNodeModules_1 = (e_3 = void 0, tslib_1.__values(locationsForNodeModules)), locationsForNodeModules_1_1 = locationsForNodeModules_1.next(); !locationsForNodeModules_1_1.done; locationsForNodeModules_1_1 = locationsForNodeModules_1.next()) {
240
- node_modules = locationsForNodeModules_1_1.value;
241
- dest = (0, tnp_core_2.crossPlatformPath)([node_modules, lib.name]);
242
- if (!index_1.Helpers.isSymlinkFileExitedOrUnexisted(dest)) {
243
- index_1.Helpers.remove(dest);
244
- }
245
- // console.log('linking from ', sourceDist);
246
- // console.log('linking to ', dest);
247
- // Helpers.remove(dest);
248
- index_1.Helpers.createSymLink(sourceDist, dest, {
249
- continueWhenExistedFolderDoesntExists: true,
250
- });
251
- console.log("Sync (link) done for ".concat(lib.basename, " to ").concat(lib.name, " (").concat((0, tnp_core_2.crossPlatformPath)([
252
- tnp_core_2.path.basename(tnp_core_2.path.dirname(node_modules)),
253
- tnp_config_1.config.folder.node_modules,
254
- ]), ")"));
255
- }
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);
256
377
  }
257
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
258
- finally {
259
- try {
260
- if (locationsForNodeModules_1_1 && !locationsForNodeModules_1_1.done && (_k = locationsForNodeModules_1.return)) _k.call(locationsForNodeModules_1);
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();
261
408
  }
262
- finally { if (e_3) throw e_3.error; }
263
- }
264
- if (!index_1.Helpers.exists(sourceDist)) {
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];
265
441
  index_1.Helpers.info("Compiling ".concat(lib.name, " ..."));
266
- this.project
267
- .run(lib.libraryBuild.getLibraryBuildComamnd({
268
- watch: false,
269
- buildType: buildType,
270
- }), {
271
- output: true,
272
- })
273
- .sync();
274
- }
275
- //#endregion
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*/];
276
455
  }
277
- else if (strategy === 'copy') {
278
- //#region copy dist to node_modules
279
- if (!index_1.Helpers.exists(sourceDist)) {
280
- index_1.Helpers.info("Compiling ".concat(lib.name, " ..."));
281
- this.project
282
- .run(lib.libraryBuild.getLibraryBuildComamnd({
283
- watch: false,
284
- buildType: buildType,
285
- }), {
286
- output: true,
287
- })
288
- .sync();
289
- }
290
- try {
291
- 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()) {
292
- node_modules = locationsForNodeModules_2_1.value;
293
- dest = (0, tnp_core_2.crossPlatformPath)([node_modules, lib.name]);
294
- if (index_1.Helpers.isSymlinkFileExitedOrUnexisted(dest)) {
295
- index_1.Helpers.remove(dest);
296
- }
297
- index_1.Helpers.copy(sourceDist, dest);
298
- console.log("Sync done for ".concat(lib.basename, " to ").concat(lib.name, " (").concat((0, tnp_core_2.crossPlatformPath)([
299
- tnp_core_2.path.basename(tnp_core_2.path.dirname(node_modules)),
300
- tnp_config_1.config.folder.node_modules,
301
- ]), ")"));
302
- }
303
- }
304
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
305
- finally {
306
- try {
307
- if (locationsForNodeModules_2_1 && !locationsForNodeModules_2_1.done && (_l = locationsForNodeModules_2.return)) _l.call(locationsForNodeModules_2);
308
- }
309
- finally { if (e_4) throw e_4.error; }
310
- }
311
- //#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);
312
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
+ ]), ")"));
313
480
  }
314
481
  }
315
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
482
+ catch (e_5_1) { e_5 = { error: e_5_1 }; }
316
483
  finally {
317
484
  try {
318
- if (_d && !_d.done && (_j = _c.return)) _j.call(_c);
485
+ if (locationsForNodeModules_2_1 && !locationsForNodeModules_2_1.done && (_c = locationsForNodeModules_2.return)) _c.call(locationsForNodeModules_2);
319
486
  }
320
- finally { if (e_2) throw e_2.error; }
487
+ finally { if (e_5) throw e_5.error; }
321
488
  }
322
- if (!watch) return [3 /*break*/, 12];
323
- _loop_1 = function (index, lib) {
324
- return tslib_1.__generator(this, function (_s) {
325
- switch (_s.label) {
326
- case 0:
327
- index_1.Helpers.info("Building for watch (".concat(index + 1, "/").concat(selectedLibs.length, ") ") +
328
- "".concat(lib.basename, " (").concat(tnp_core_1.chalk.bold(lib.name), ")"));
329
- return [4 /*yield*/, (function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
330
- var debouncedBuild;
331
- var _this = this;
332
- return tslib_1.__generator(this, function (_a) {
333
- switch (_a.label) {
334
- case 0:
335
- debouncedBuild = tnp_core_3._.debounce(function () {
336
- var e_5, _a;
337
- var sourceDist = _this.project.pathFor([
338
- tnp_config_1.config.folder.dist,
339
- lib.basename,
340
- ]);
341
- try {
342
- for (var locationsForNodeModules_3 = tslib_1.__values(locationsForNodeModules), locationsForNodeModules_3_1 = locationsForNodeModules_3.next(); !locationsForNodeModules_3_1.done; locationsForNodeModules_3_1 = locationsForNodeModules_3.next()) {
343
- var node_modules = locationsForNodeModules_3_1.value;
344
- var dest = (0, tnp_core_2.crossPlatformPath)([node_modules, lib.name]);
345
- if (index_1.Helpers.isSymlinkFileExitedOrUnexisted(dest)) {
346
- index_1.Helpers.remove(dest);
347
- }
348
- index_1.Helpers.copy(sourceDist, dest);
349
- // console.log({ sourceDist, dest });
350
- console.log("Sync (watch) done for ".concat(lib.basename, " to ").concat(lib.name, " (").concat((0, tnp_core_2.crossPlatformPath)([
351
- tnp_core_2.path.basename(tnp_core_2.path.dirname(node_modules)),
352
- tnp_config_1.config.folder.node_modules,
353
- ]), ")"));
354
- }
355
- }
356
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
357
- finally {
358
- try {
359
- if (locationsForNodeModules_3_1 && !locationsForNodeModules_3_1.done && (_a = locationsForNodeModules_3.return)) _a.call(locationsForNodeModules_3);
360
- }
361
- finally { if (e_5) throw e_5.error; }
362
- }
363
- }, 500);
364
- return [4 /*yield*/, this.project
365
- .run(lib.libraryBuild.getLibraryBuildComamnd({
366
- watch: true,
367
- buildType: buildType,
368
- }), {
369
- output: true,
370
- })
371
- .unitlOutputContains(lib.libraryBuild.getLibraryBuildSuccessComamnd, [], 0, function () {
372
- if (strategy === 'copy') {
373
- debouncedBuild();
374
- }
375
- })];
376
- case 1:
377
- _a.sent();
378
- return [2 /*return*/];
379
- }
380
- });
381
- }); })()];
382
- case 1:
383
- _s.sent();
384
- return [2 /*return*/];
385
- }
386
- });
387
- };
388
- _r.label = 4;
389
- case 4:
390
- _r.trys.push([4, 9, 10, 11]);
391
- _f = tslib_1.__values(selectedLibs.entries()), _g = _f.next();
392
- _r.label = 5;
393
- case 5:
394
- if (!!_g.done) return [3 /*break*/, 8];
395
- _h = tslib_1.__read(_g.value, 2), index = _h[0], lib = _h[1];
396
- return [5 /*yield**/, _loop_1(index, lib)];
397
- case 6:
398
- _r.sent();
399
- _r.label = 7;
400
- case 7:
401
- _g = _f.next();
402
- return [3 /*break*/, 5];
403
- case 8: return [3 /*break*/, 11];
404
- case 9:
405
- e_1_1 = _r.sent();
406
- e_1 = { error: e_1_1 };
407
- return [3 /*break*/, 11];
408
- 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();
409
500
  try {
410
- if (_g && !_g.done && (_m = _f.return)) _m.call(_f);
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
+ }
411
516
  }
412
- finally { if (e_1) throw e_1.error; }
413
- return [7 /*endfinally*/];
414
- case 11:
415
- // await this.__indexRebuilder.startAndWatch({ taskName: 'index rebuild watch' });
416
- index_1.Helpers.success('BUILD DONE.. watching..');
417
- return [3 /*break*/, 13];
418
- case 12:
419
- // await this.__indexRebuilder.start({ taskName: 'index rebuild watch' });
420
- index_1.Helpers.success('BUILD DONE');
421
- _r.label = 13;
422
- 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*/];
423
526
  }
424
527
  });
425
528
  });