tnp-helpers 16.100.11 → 16.100.13
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/esm2022/lib/base/base-project.mjs +92 -13
- package/browser/esm2022/lib/base/core-project.mjs +61 -2
- package/browser/esm2022/lib/models.mjs +3 -2
- package/browser/fesm2022/tnp-helpers.mjs +152 -14
- package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
- package/browser/lib/base/base-project.d.ts +31 -5
- package/browser/lib/base/core-project.d.ts +38 -13
- package/browser/lib/models.d.ts +3 -1
- package/client/esm2022/lib/base/base-project.mjs +92 -13
- package/client/esm2022/lib/base/core-project.mjs +61 -2
- package/client/esm2022/lib/models.mjs +3 -2
- package/client/fesm2022/tnp-helpers.mjs +152 -14
- package/client/fesm2022/tnp-helpers.mjs.map +1 -1
- package/client/lib/base/base-project.d.ts +31 -5
- package/client/lib/base/core-project.d.ts +38 -13
- package/client/lib/models.d.ts +3 -1
- package/client/package.json +13 -13
- package/lib/base/base-command-line.backend.d.ts +11 -0
- package/lib/base/base-command-line.backend.js +80 -11
- package/lib/base/base-command-line.backend.js.map +1 -1
- package/lib/base/base-project.d.ts +31 -9
- package/lib/base/base-project.js +248 -115
- package/lib/base/base-project.js.map +1 -1
- package/lib/base/base-start-config.backend.d.ts +4 -1
- package/lib/base/base-start-config.backend.js +26 -13
- package/lib/base/base-start-config.backend.js.map +1 -1
- package/lib/base/commit-data.js +1 -1
- package/lib/base/commit-data.js.map +1 -1
- package/lib/base/core-project.d.ts +37 -12
- package/lib/base/core-project.js +102 -2
- package/lib/base/core-project.js.map +1 -1
- package/lib/helpers/for-backend/helpers-console-gui.d.ts +1 -1
- package/lib/helpers/for-backend/helpers-console-gui.js +6 -2
- package/lib/helpers/for-backend/helpers-console-gui.js.map +1 -1
- package/lib/helpers/for-backend/helpers-file-folders.backend.js +1 -1
- package/lib/helpers/for-backend/helpers-file-folders.backend.js.map +1 -1
- package/lib/helpers/for-backend/helpers-process.backend.d.ts +1 -1
- package/lib/helpers/for-browser/angular.helper.js +3 -3
- package/lib/models.d.ts +4 -2
- package/lib/models.js +3 -0
- package/lib/models.js.map +1 -1
- package/lib/old/base-component.js +3 -3
- package/lib/old/base-formly-component.js +3 -3
- package/lib/old/dual-component-ctrl.js +3 -3
- package/package.json +4 -4
- package/tmp-environment.json +16 -16
- package/websql/esm2022/lib/base/base-project.mjs +87 -13
- package/websql/esm2022/lib/base/core-project.mjs +61 -2
- package/websql/esm2022/lib/models.mjs +3 -2
- package/websql/fesm2022/tnp-helpers.mjs +147 -14
- package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
- package/websql/lib/base/base-project.d.ts +31 -5
- package/websql/lib/base/core-project.d.ts +38 -13
- package/websql/lib/models.d.ts +3 -1
package/lib/base/base-project.js
CHANGED
|
@@ -75,16 +75,23 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
75
75
|
//#endregion
|
|
76
76
|
get: function () {
|
|
77
77
|
var _this = this;
|
|
78
|
+
var cacheKey = 'embeddedProject' + tnp_core_2._.kebabCase(this.location);
|
|
79
|
+
if (!tnp_core_2._.isUndefined(this.globalCache[cacheKey])) {
|
|
80
|
+
return this.globalCache[cacheKey];
|
|
81
|
+
}
|
|
82
|
+
// Helpers.taskStarted(`Detecting embedded project for ${this.location}`); // TODO it is slow
|
|
78
83
|
var nearsetProj = this.ins.nearestTo((0, tnp_core_1.crossPlatformPath)([this.location, '..']));
|
|
79
84
|
var linkedPorj = nearsetProj.linkedProjects.find(function (l) {
|
|
80
85
|
return _this.location === (0, tnp_core_1.crossPlatformPath)([nearsetProj.location, l.relativeClonePath]);
|
|
81
86
|
});
|
|
82
|
-
if (!linkedPorj) {
|
|
87
|
+
if (!linkedPorj || !linkedPorj.internalRealtiveProjectPath) {
|
|
83
88
|
return;
|
|
84
89
|
}
|
|
85
90
|
var pathToEmbededProj = (0, tnp_core_1.crossPlatformPath)([nearsetProj.location, linkedPorj.relativeClonePath, linkedPorj.internalRealtiveProjectPath || '']);
|
|
86
91
|
var embdedresult = this.ins.From(pathToEmbededProj);
|
|
87
|
-
|
|
92
|
+
// Helpers.taskDone(`Embedded project detected for ${this.location}`);
|
|
93
|
+
this.globalCache[cacheKey] = embdedresult;
|
|
94
|
+
return this.globalCache[cacheKey];
|
|
88
95
|
},
|
|
89
96
|
enumerable: false,
|
|
90
97
|
configurable: true
|
|
@@ -133,8 +140,15 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
133
140
|
});
|
|
134
141
|
});
|
|
135
142
|
};
|
|
143
|
+
Object.defineProperty(BaseProject.prototype, "globalCache", {
|
|
144
|
+
get: function () {
|
|
145
|
+
return BaseProject.cache;
|
|
146
|
+
},
|
|
147
|
+
enumerable: false,
|
|
148
|
+
configurable: true
|
|
149
|
+
});
|
|
136
150
|
//#endregion
|
|
137
|
-
//#region
|
|
151
|
+
//#region methods & getters / save all linked projects to db
|
|
138
152
|
BaseProject.prototype.saveAllLinkedProjectsToDB = function () {
|
|
139
153
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
140
154
|
var proj, _a, _b, link, linkedPorj, e_1_1;
|
|
@@ -183,30 +197,112 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
183
197
|
});
|
|
184
198
|
};
|
|
185
199
|
Object.defineProperty(BaseProject.prototype, "isMonorepo", {
|
|
186
|
-
//#
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region methods & getters / is monorepo
|
|
187
202
|
get: function () {
|
|
188
203
|
return false;
|
|
189
204
|
},
|
|
190
205
|
enumerable: false,
|
|
191
206
|
configurable: true
|
|
192
207
|
});
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region getters & methods / order core projects
|
|
210
|
+
BaseProject.prototype.orderCoreProjects = function (coreProjects) {
|
|
211
|
+
var e_2, _a, e_3, _b, e_4, _c;
|
|
212
|
+
var projectMap = new Map();
|
|
213
|
+
try {
|
|
214
|
+
// Initialize the project map
|
|
215
|
+
for (var coreProjects_1 = tslib_1.__values(coreProjects), coreProjects_1_1 = coreProjects_1.next(); !coreProjects_1_1.done; coreProjects_1_1 = coreProjects_1.next()) {
|
|
216
|
+
var project = coreProjects_1_1.value;
|
|
217
|
+
projectMap.set(project, []);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
221
|
+
finally {
|
|
222
|
+
try {
|
|
223
|
+
if (coreProjects_1_1 && !coreProjects_1_1.done && (_a = coreProjects_1.return)) _a.call(coreProjects_1);
|
|
224
|
+
}
|
|
225
|
+
finally { if (e_2) throw e_2.error; }
|
|
226
|
+
}
|
|
227
|
+
try {
|
|
228
|
+
// Populate the project map with dependencies
|
|
229
|
+
for (var coreProjects_2 = tslib_1.__values(coreProjects), coreProjects_2_1 = coreProjects_2.next(); !coreProjects_2_1.done; coreProjects_2_1 = coreProjects_2.next()) {
|
|
230
|
+
var project = coreProjects_2_1.value;
|
|
231
|
+
if (!projectMap.has(project.extends)) {
|
|
232
|
+
projectMap.set(project.extends, []);
|
|
233
|
+
}
|
|
234
|
+
projectMap.get(project.extends).push(project);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
238
|
+
finally {
|
|
239
|
+
try {
|
|
240
|
+
if (coreProjects_2_1 && !coreProjects_2_1.done && (_b = coreProjects_2.return)) _b.call(coreProjects_2);
|
|
241
|
+
}
|
|
242
|
+
finally { if (e_3) throw e_3.error; }
|
|
243
|
+
}
|
|
244
|
+
var orderedProjects = [];
|
|
245
|
+
var visited = new Set();
|
|
246
|
+
var visit = function (project) {
|
|
247
|
+
var e_5, _a;
|
|
248
|
+
if (!visited.has(project)) {
|
|
249
|
+
visited.add(project);
|
|
250
|
+
var dependencies = projectMap.get(project);
|
|
251
|
+
if (dependencies) {
|
|
252
|
+
try {
|
|
253
|
+
for (var dependencies_1 = tslib_1.__values(dependencies), dependencies_1_1 = dependencies_1.next(); !dependencies_1_1.done; dependencies_1_1 = dependencies_1.next()) {
|
|
254
|
+
var dep = dependencies_1_1.value;
|
|
255
|
+
visit(dep);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
259
|
+
finally {
|
|
260
|
+
try {
|
|
261
|
+
if (dependencies_1_1 && !dependencies_1_1.done && (_a = dependencies_1.return)) _a.call(dependencies_1);
|
|
262
|
+
}
|
|
263
|
+
finally { if (e_5) throw e_5.error; }
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
orderedProjects.push(project);
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
try {
|
|
270
|
+
// Visit each project
|
|
271
|
+
for (var coreProjects_3 = tslib_1.__values(coreProjects), coreProjects_3_1 = coreProjects_3.next(); !coreProjects_3_1.done; coreProjects_3_1 = coreProjects_3.next()) {
|
|
272
|
+
var project = coreProjects_3_1.value;
|
|
273
|
+
visit(project);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
277
|
+
finally {
|
|
278
|
+
try {
|
|
279
|
+
if (coreProjects_3_1 && !coreProjects_3_1.done && (_c = coreProjects_3.return)) _c.call(coreProjects_3);
|
|
280
|
+
}
|
|
281
|
+
finally { if (e_4) throw e_4.error; }
|
|
282
|
+
}
|
|
283
|
+
return orderedProjects.reverse();
|
|
284
|
+
};
|
|
193
285
|
Object.defineProperty(BaseProject.prototype, "core", {
|
|
194
286
|
//#endregion
|
|
195
|
-
//#region
|
|
287
|
+
//#region methods & getters / core
|
|
196
288
|
get: function () {
|
|
197
289
|
var _this = this;
|
|
198
|
-
if (this.cache['core']) {
|
|
290
|
+
if (!tnp_core_2._.isUndefined(this.cache['core'])) {
|
|
199
291
|
return this.cache['core'];
|
|
200
292
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
293
|
+
// Helpers.taskStarted(`Detecting core project for ${this.genericName}`);
|
|
294
|
+
var coreProjects = index_1.CoreProject.coreProjects.filter(function (p) { return p.recognizedFn(_this); });
|
|
295
|
+
coreProjects = this.orderCoreProjects(coreProjects);
|
|
296
|
+
// Helpers.taskDone(`Core project detected for ${this.genericName}`);
|
|
297
|
+
// console.log('CoreProject.coreProjects', CoreProject.coreProjects.map(c => c.name));
|
|
298
|
+
this.cache['core'] = tnp_core_2._.first(coreProjects);
|
|
299
|
+
return this.cache['core'];
|
|
204
300
|
},
|
|
205
301
|
enumerable: false,
|
|
206
302
|
configurable: true
|
|
207
303
|
});
|
|
208
304
|
//#endregion
|
|
209
|
-
//#region
|
|
305
|
+
//#region methods & getters / add linked project
|
|
210
306
|
BaseProject.prototype.addLinkedProject = function (linkedProj) {
|
|
211
307
|
var linkedProject = tnp_core_2._.isString(linkedProj) ? index_1.LinkedProject.fromName(linkedProj) : linkedProj;
|
|
212
308
|
//#region @backendFunc
|
|
@@ -216,9 +312,9 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
216
312
|
//#endregion
|
|
217
313
|
};
|
|
218
314
|
//#endregion
|
|
219
|
-
//#region
|
|
315
|
+
//#region methods & getters / add linked projects
|
|
220
316
|
BaseProject.prototype.addLinkedProjects = function (linkedProjs) {
|
|
221
|
-
var
|
|
317
|
+
var e_6, _a;
|
|
222
318
|
try {
|
|
223
319
|
//#region @backendFunc
|
|
224
320
|
for (var linkedProjs_1 = tslib_1.__values(linkedProjs), linkedProjs_1_1 = linkedProjs_1.next(); !linkedProjs_1_1.done; linkedProjs_1_1 = linkedProjs_1.next()) {
|
|
@@ -226,19 +322,22 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
226
322
|
this.addLinkedProject(linkedProj);
|
|
227
323
|
}
|
|
228
324
|
}
|
|
229
|
-
catch (
|
|
325
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
230
326
|
finally {
|
|
231
327
|
try {
|
|
232
328
|
if (linkedProjs_1_1 && !linkedProjs_1_1.done && (_a = linkedProjs_1.return)) _a.call(linkedProjs_1);
|
|
233
329
|
}
|
|
234
|
-
finally { if (
|
|
330
|
+
finally { if (e_6) throw e_6.error; }
|
|
235
331
|
}
|
|
236
332
|
//#endregion
|
|
237
333
|
};
|
|
238
334
|
//#endregion
|
|
239
|
-
//#region
|
|
335
|
+
//#region methods & getters / set linked projects config
|
|
240
336
|
BaseProject.prototype.setLinkedProjectsConfig = function (linkedPorjectsConfig) {
|
|
241
337
|
//#region @backendFunc
|
|
338
|
+
if (!index_1.Helpers.exists(this.linkedProjectsConfigPath)) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
242
341
|
linkedPorjectsConfig = index_1.LinkedPorjectsConfig.from(linkedPorjectsConfig);
|
|
243
342
|
var writer = json5Write.load(index_1.Helpers.readFile(this.linkedProjectsConfigPath));
|
|
244
343
|
writer.write(linkedPorjectsConfig);
|
|
@@ -251,7 +350,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
251
350
|
};
|
|
252
351
|
Object.defineProperty(BaseProject.prototype, "linkedProjectsConfigPath", {
|
|
253
352
|
//#endregion
|
|
254
|
-
//#region
|
|
353
|
+
//#region methods & getters / get linked projects config path
|
|
255
354
|
get: function () {
|
|
256
355
|
return this.pathFor(tnp_config_1.config.file.linked_projects_json);
|
|
257
356
|
},
|
|
@@ -259,7 +358,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
259
358
|
configurable: true
|
|
260
359
|
});
|
|
261
360
|
//#endregion
|
|
262
|
-
//#region
|
|
361
|
+
//#region methods & getters / recreate linked projects config
|
|
263
362
|
BaseProject.prototype.recreateLinkedProjectsConfig = function () {
|
|
264
363
|
//#region @backendFunc
|
|
265
364
|
if (!index_1.Helpers.exists(this.linkedProjectsConfigPath)) {
|
|
@@ -268,7 +367,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
268
367
|
//#endregion
|
|
269
368
|
};
|
|
270
369
|
//#endregion
|
|
271
|
-
//#region
|
|
370
|
+
//#region methods & getters / get linked projects config
|
|
272
371
|
BaseProject.prototype.getLinkedProjectsConfig = function () {
|
|
273
372
|
//#region @backendFunc
|
|
274
373
|
this.recreateLinkedProjectsConfig();
|
|
@@ -301,7 +400,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
301
400
|
};
|
|
302
401
|
Object.defineProperty(BaseProject.prototype, "linkedProjects", {
|
|
303
402
|
//#endregion
|
|
304
|
-
//#region
|
|
403
|
+
//#region methods & getters / linked projects
|
|
305
404
|
get: function () {
|
|
306
405
|
return this.getLinkedProjectsConfig().projects || [];
|
|
307
406
|
},
|
|
@@ -310,7 +409,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
310
409
|
});
|
|
311
410
|
Object.defineProperty(BaseProject.prototype, "detectedLinkedProjects", {
|
|
312
411
|
//#endregion
|
|
313
|
-
//#region
|
|
412
|
+
//#region methods & getters / detected linked projects
|
|
314
413
|
get: function () {
|
|
315
414
|
var detectedLinkedProjects = index_1.LinkedProject.detect(this.location, true // TOOD fix recrusive
|
|
316
415
|
);
|
|
@@ -321,7 +420,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
321
420
|
});
|
|
322
421
|
Object.defineProperty(BaseProject.prototype, "linkedProjectsPrefix", {
|
|
323
422
|
//#endregion
|
|
324
|
-
//#region
|
|
423
|
+
//#region methods & getters / linked projects prefix
|
|
325
424
|
get: function () {
|
|
326
425
|
return this.getLinkedProjectsConfig().prefix;
|
|
327
426
|
},
|
|
@@ -355,8 +454,8 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
355
454
|
BaseProject.prototype.cloneUnexistedLinkedProjects = function (actionType, cloneChildren) {
|
|
356
455
|
if (cloneChildren === void 0) { cloneChildren = false; }
|
|
357
456
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
358
|
-
var detectedLinkedProjects, projectsThatShouldBeLinked, _a, projectsThatShouldBeLinked_1, projectsThatShouldBeLinked_1_1, linkedProj, childProjLocaiton, childProj,
|
|
359
|
-
var
|
|
457
|
+
var detectedLinkedProjects, projectsThatShouldBeLinked, _a, projectsThatShouldBeLinked_1, projectsThatShouldBeLinked_1_1, linkedProj, childProjLocaiton, childProj, e_7_1;
|
|
458
|
+
var e_7, _b;
|
|
360
459
|
return tslib_1.__generator(this, function (_c) {
|
|
361
460
|
switch (_c.label) {
|
|
362
461
|
case 0:
|
|
@@ -408,14 +507,14 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
408
507
|
return [3 /*break*/, 4];
|
|
409
508
|
case 8: return [3 /*break*/, 11];
|
|
410
509
|
case 9:
|
|
411
|
-
|
|
412
|
-
|
|
510
|
+
e_7_1 = _c.sent();
|
|
511
|
+
e_7 = { error: e_7_1 };
|
|
413
512
|
return [3 /*break*/, 11];
|
|
414
513
|
case 10:
|
|
415
514
|
try {
|
|
416
515
|
if (projectsThatShouldBeLinked_1_1 && !projectsThatShouldBeLinked_1_1.done && (_b = projectsThatShouldBeLinked_1.return)) _b.call(projectsThatShouldBeLinked_1);
|
|
417
516
|
}
|
|
418
|
-
finally { if (
|
|
517
|
+
finally { if (e_7) throw e_7.error; }
|
|
419
518
|
return [7 /*endfinally*/];
|
|
420
519
|
case 11: return [2 /*return*/];
|
|
421
520
|
}
|
|
@@ -423,13 +522,13 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
423
522
|
});
|
|
424
523
|
};
|
|
425
524
|
//#endregion
|
|
426
|
-
//#region
|
|
525
|
+
//#region methods & getters / set type
|
|
427
526
|
BaseProject.prototype.setType = function (type) {
|
|
428
527
|
// @ts-ignore
|
|
429
528
|
this.type = type;
|
|
430
529
|
};
|
|
431
530
|
//#endregion
|
|
432
|
-
//#region
|
|
531
|
+
//#region methods & getters / type is
|
|
433
532
|
BaseProject.prototype.typeIs = function () {
|
|
434
533
|
var types = [];
|
|
435
534
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -438,7 +537,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
438
537
|
return this.type && types.includes(this.type);
|
|
439
538
|
};
|
|
440
539
|
//#endregion
|
|
441
|
-
//#region
|
|
540
|
+
//#region methods & getters / type is not
|
|
442
541
|
BaseProject.prototype.typeIsNot = function () {
|
|
443
542
|
var types = [];
|
|
444
543
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -448,7 +547,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
448
547
|
};
|
|
449
548
|
Object.defineProperty(BaseProject.prototype, "basename", {
|
|
450
549
|
//#endregion
|
|
451
|
-
//#region
|
|
550
|
+
//#region methods & getters / basename
|
|
452
551
|
/**
|
|
453
552
|
* project folder basename
|
|
454
553
|
*/
|
|
@@ -462,7 +561,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
462
561
|
});
|
|
463
562
|
Object.defineProperty(BaseProject.prototype, "name", {
|
|
464
563
|
//#endregion
|
|
465
|
-
//#region
|
|
564
|
+
//#region methods & getters / name
|
|
466
565
|
/**
|
|
467
566
|
* name from package.json
|
|
468
567
|
*/
|
|
@@ -475,7 +574,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
475
574
|
});
|
|
476
575
|
Object.defineProperty(BaseProject.prototype, "version", {
|
|
477
576
|
//#endregion
|
|
478
|
-
//#region
|
|
577
|
+
//#region methods & getters / version
|
|
479
578
|
/**
|
|
480
579
|
* version from package.json -> property version
|
|
481
580
|
*/
|
|
@@ -488,7 +587,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
488
587
|
});
|
|
489
588
|
Object.defineProperty(BaseProject.prototype, "majorVersion", {
|
|
490
589
|
//#endregion
|
|
491
|
-
//#region
|
|
590
|
+
//#region methods & getters / major version
|
|
492
591
|
/**
|
|
493
592
|
* Major Version from package.json
|
|
494
593
|
*/
|
|
@@ -503,7 +602,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
503
602
|
});
|
|
504
603
|
Object.defineProperty(BaseProject.prototype, "minorVersion", {
|
|
505
604
|
//#endregion
|
|
506
|
-
//#region
|
|
605
|
+
//#region methods & getters / minor version
|
|
507
606
|
/**
|
|
508
607
|
* Minor Version from package.json
|
|
509
608
|
*/
|
|
@@ -520,7 +619,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
520
619
|
});
|
|
521
620
|
Object.defineProperty(BaseProject.prototype, "versionPathAsNumber", {
|
|
522
621
|
//#endregion
|
|
523
|
-
//#region
|
|
622
|
+
//#region methods & getters / get version path as number
|
|
524
623
|
get: function () {
|
|
525
624
|
//#region @backendFunc
|
|
526
625
|
var ver = this.version.split('.');
|
|
@@ -533,7 +632,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
533
632
|
});
|
|
534
633
|
Object.defineProperty(BaseProject.prototype, "dependencies", {
|
|
535
634
|
//#endregion
|
|
536
|
-
//#region
|
|
635
|
+
//#region methods & getters / dependencies
|
|
537
636
|
/**
|
|
538
637
|
* npm dependencies from package.json
|
|
539
638
|
*/
|
|
@@ -545,7 +644,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
545
644
|
});
|
|
546
645
|
Object.defineProperty(BaseProject.prototype, "peerDependencies", {
|
|
547
646
|
//#endregion
|
|
548
|
-
//#region
|
|
647
|
+
//#region methods & getters / peer dependencies
|
|
549
648
|
/**
|
|
550
649
|
* peerDependencies dependencies
|
|
551
650
|
*/
|
|
@@ -557,7 +656,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
557
656
|
});
|
|
558
657
|
Object.defineProperty(BaseProject.prototype, "devDependencies", {
|
|
559
658
|
//#endregion
|
|
560
|
-
//#region
|
|
659
|
+
//#region methods & getters / dev dependencies
|
|
561
660
|
/**
|
|
562
661
|
* devDependencies dependencies
|
|
563
662
|
*/
|
|
@@ -569,7 +668,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
569
668
|
});
|
|
570
669
|
Object.defineProperty(BaseProject.prototype, "resolutions", {
|
|
571
670
|
//#endregion
|
|
572
|
-
//#region
|
|
671
|
+
//#region methods & getters / resolutions dependencies
|
|
573
672
|
/**
|
|
574
673
|
* resolutions dependencies
|
|
575
674
|
*/
|
|
@@ -581,7 +680,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
581
680
|
});
|
|
582
681
|
Object.defineProperty(BaseProject.prototype, "allDependencies", {
|
|
583
682
|
//#endregion
|
|
584
|
-
//#region
|
|
683
|
+
//#region methods & getters / all dependencies
|
|
585
684
|
/**
|
|
586
685
|
* object with all deps from package json
|
|
587
686
|
*/
|
|
@@ -592,7 +691,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
592
691
|
configurable: true
|
|
593
692
|
});
|
|
594
693
|
//#endregion
|
|
595
|
-
//#region
|
|
694
|
+
//#region methods & getters / get folder for possible project chhildrens
|
|
596
695
|
BaseProject.prototype.getFoldersForPossibleProjectChildren = function () {
|
|
597
696
|
//#region @backendFunc
|
|
598
697
|
var isDirectory = function (source) { return tnp_core_3.fse.lstatSync(source).isDirectory(); };
|
|
@@ -615,7 +714,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
615
714
|
//#endregion
|
|
616
715
|
};
|
|
617
716
|
//#endregion
|
|
618
|
-
//#region
|
|
717
|
+
//#region methods & getters / get all childrens
|
|
619
718
|
BaseProject.prototype.getAllChildren = function () {
|
|
620
719
|
var _this = this;
|
|
621
720
|
//#region @backendFunc
|
|
@@ -631,7 +730,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
631
730
|
};
|
|
632
731
|
Object.defineProperty(BaseProject.prototype, "children", {
|
|
633
732
|
//#endregion
|
|
634
|
-
//#region
|
|
733
|
+
//#region methods & getters / children
|
|
635
734
|
/**
|
|
636
735
|
* alias to getAllChildren
|
|
637
736
|
*/
|
|
@@ -644,7 +743,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
644
743
|
configurable: true
|
|
645
744
|
});
|
|
646
745
|
//#endregion
|
|
647
|
-
//#region
|
|
746
|
+
//#region methods & getters / get child
|
|
648
747
|
BaseProject.prototype.getChildBy = function (nameOrBasename, errors) {
|
|
649
748
|
if (errors === void 0) { errors = true; }
|
|
650
749
|
//#region @websqlFunc
|
|
@@ -657,7 +756,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
657
756
|
};
|
|
658
757
|
Object.defineProperty(BaseProject.prototype, "parent", {
|
|
659
758
|
//#endregion
|
|
660
|
-
//#region
|
|
759
|
+
//#region methods & getters / parent
|
|
661
760
|
get: function () {
|
|
662
761
|
//#region @websqlFunc
|
|
663
762
|
if (!tnp_core_2._.isString(this.location) || this.location.trim() === '') {
|
|
@@ -671,7 +770,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
671
770
|
});
|
|
672
771
|
Object.defineProperty(BaseProject.prototype, "grandpa", {
|
|
673
772
|
//#endregion
|
|
674
|
-
//#region
|
|
773
|
+
//#region methods & getters / grandpa
|
|
675
774
|
get: function () {
|
|
676
775
|
//#region @websqlFunc
|
|
677
776
|
if (!tnp_core_2._.isString(this.location) || this.location.trim() === '') {
|
|
@@ -686,11 +785,16 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
686
785
|
});
|
|
687
786
|
Object.defineProperty(BaseProject.prototype, "genericName", {
|
|
688
787
|
//#endregion
|
|
689
|
-
//#region
|
|
788
|
+
//#region methods & getters / generic name
|
|
690
789
|
get: function () {
|
|
691
790
|
//#region @websqlFunc
|
|
692
791
|
var parent = this.parent;
|
|
792
|
+
// const nearest = this.ins.nearestTo(crossPlatformPath([this.location, '..']));
|
|
793
|
+
// const nerestProj = (nearest && nearest !== parent) ? (nearest.name || nearest.basename) : void 0;
|
|
794
|
+
// let secondNearest = nearest && this.ins.nearestTo(crossPlatformPath([nearest.location, '..']));
|
|
693
795
|
return [
|
|
796
|
+
// (secondNearest && secondNearest !== nearest) ? (secondNearest.name || secondNearest.basename) : void 0,
|
|
797
|
+
// nerestProj,
|
|
694
798
|
parent ? tnp_core_1.path.basename(tnp_core_1.path.dirname(parent.location)) : void 0,
|
|
695
799
|
parent ? parent.basename : tnp_core_1.path.basename(this.location),
|
|
696
800
|
this.basename,
|
|
@@ -707,7 +811,26 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
707
811
|
configurable: true
|
|
708
812
|
});
|
|
709
813
|
//#endregion
|
|
710
|
-
|
|
814
|
+
BaseProject.prototype.deleteNodeModules = function () {
|
|
815
|
+
this.remove(tnp_config_1.config.folder.node_modules);
|
|
816
|
+
};
|
|
817
|
+
BaseProject.prototype.reinstalNodeModules = function (options) {
|
|
818
|
+
//#region @backendFunc
|
|
819
|
+
this.deleteNodeModules();
|
|
820
|
+
index_1.Helpers.run("".concat((options === null || options === void 0 ? void 0 : options.useYarn) ? 'yarn' : 'npm', " install ").concat((options === null || options === void 0 ? void 0 : options.force) ? '--force' : ''), { cwd: this.location }).sync();
|
|
821
|
+
//#endregion
|
|
822
|
+
};
|
|
823
|
+
BaseProject.prototype.makeSureNodeModulesInstalled = function (options) {
|
|
824
|
+
if (this.nodeModulesEmpty()) {
|
|
825
|
+
this.reinstalNodeModules(options);
|
|
826
|
+
}
|
|
827
|
+
};
|
|
828
|
+
BaseProject.prototype.nodeModulesEmpty = function () {
|
|
829
|
+
//#region @backendFunc
|
|
830
|
+
return !this.hasFolder(tnp_config_1.config.folder.node_modules) || tnp_core_3.fse.readdirSync(this.pathFor(tnp_config_1.config.folder.node_modules)).length === 0;
|
|
831
|
+
//#endregion
|
|
832
|
+
};
|
|
833
|
+
//#region methods & getters / path exits
|
|
711
834
|
/**
|
|
712
835
|
* same has project.hasFile();
|
|
713
836
|
*/
|
|
@@ -715,15 +838,22 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
715
838
|
return this.hasFile(relativePath);
|
|
716
839
|
};
|
|
717
840
|
//#endregion
|
|
718
|
-
//#region
|
|
841
|
+
//#region methods & getters / has file
|
|
719
842
|
/**
|
|
720
843
|
* same as project.pathExists();
|
|
721
844
|
*/
|
|
722
845
|
BaseProject.prototype.hasFile = function (relativePath) {
|
|
846
|
+
//#region @backendFunc
|
|
723
847
|
return index_1.Helpers.exists(this.pathFor(relativePath));
|
|
848
|
+
//#endregion
|
|
849
|
+
};
|
|
850
|
+
BaseProject.prototype.hasFolder = function (relativePath) {
|
|
851
|
+
//#region @backendFunc
|
|
852
|
+
return index_1.Helpers.exists(this.pathFor(relativePath)) && tnp_core_3.fse.lstatSync(this.pathFor(relativePath)).isDirectory();
|
|
853
|
+
//#endregion
|
|
724
854
|
};
|
|
725
855
|
//#endregion
|
|
726
|
-
//#region
|
|
856
|
+
//#region methods & getters / contains file
|
|
727
857
|
/**
|
|
728
858
|
* same as project.pathhasFileExists();
|
|
729
859
|
* but with path.resolve
|
|
@@ -733,7 +863,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
733
863
|
return index_1.Helpers.exists(fullPath);
|
|
734
864
|
};
|
|
735
865
|
//#endregion
|
|
736
|
-
//#region
|
|
866
|
+
//#region methods & getters / path for
|
|
737
867
|
/**
|
|
738
868
|
* absolute path:
|
|
739
869
|
* concated project location with relative path
|
|
@@ -750,7 +880,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
750
880
|
//#endregion
|
|
751
881
|
};
|
|
752
882
|
//#endregion
|
|
753
|
-
//#region
|
|
883
|
+
//#region methods & getters / write json
|
|
754
884
|
BaseProject.prototype.writeJson = function (relativePath, json) {
|
|
755
885
|
//#region @backendFunc
|
|
756
886
|
if (tnp_core_1.path.isAbsolute(relativePath)) {
|
|
@@ -760,19 +890,20 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
760
890
|
//#endregion
|
|
761
891
|
};
|
|
762
892
|
//#endregion
|
|
763
|
-
//#region
|
|
893
|
+
//#region methods & getters / run
|
|
764
894
|
/**
|
|
765
895
|
* @deprecated us execute instead
|
|
766
896
|
* use output from or more preciese crafted api
|
|
767
897
|
*/
|
|
768
898
|
BaseProject.prototype.run = function (command, options) {
|
|
769
|
-
|
|
899
|
+
var opt;
|
|
900
|
+
//#region @backend
|
|
770
901
|
options = tnp_core_2._.cloneDeep(options) || {};
|
|
771
902
|
index_1.Helpers.log("command: ".concat(command));
|
|
772
903
|
if (tnp_core_2._.isUndefined(options.showCommand)) {
|
|
773
904
|
options.showCommand = false;
|
|
774
905
|
}
|
|
775
|
-
|
|
906
|
+
opt = options;
|
|
776
907
|
if (!opt.cwd) {
|
|
777
908
|
opt.cwd = this.location;
|
|
778
909
|
}
|
|
@@ -782,11 +913,11 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
782
913
|
else {
|
|
783
914
|
index_1.Helpers.log("[".concat(tnp_cli_1.CLI.chalk.underline('Executing shell command'), "] \"").concat(command, "\" in [").concat(opt.cwd, "]"));
|
|
784
915
|
}
|
|
785
|
-
return index_1.Helpers.run(command, opt);
|
|
786
916
|
//#endregion
|
|
917
|
+
return index_1.Helpers.run(command, opt);
|
|
787
918
|
};
|
|
788
919
|
//#endregion
|
|
789
|
-
//#region
|
|
920
|
+
//#region methods & getters / execute
|
|
790
921
|
/**
|
|
791
922
|
* same as run but async
|
|
792
923
|
*/
|
|
@@ -817,7 +948,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
817
948
|
});
|
|
818
949
|
};
|
|
819
950
|
//#endregion
|
|
820
|
-
//#region
|
|
951
|
+
//#region methods & getters / try run sync command
|
|
821
952
|
/**
|
|
822
953
|
* try run but continue when it fails
|
|
823
954
|
* @param command
|
|
@@ -839,7 +970,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
839
970
|
//#endregion
|
|
840
971
|
};
|
|
841
972
|
//#endregion
|
|
842
|
-
//#region
|
|
973
|
+
//#region methods & getters / output from command
|
|
843
974
|
BaseProject.prototype.outputFrom = function (command
|
|
844
975
|
//#region @backend
|
|
845
976
|
, options
|
|
@@ -850,7 +981,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
850
981
|
//#endregion
|
|
851
982
|
};
|
|
852
983
|
//#endregion
|
|
853
|
-
//#region
|
|
984
|
+
//#region methods & getters / remove file
|
|
854
985
|
BaseProject.prototype.removeFile = function (fileRelativeToProjectPath) {
|
|
855
986
|
//#region @backendFunc
|
|
856
987
|
var fullPath = tnp_core_1.path.resolve(tnp_core_1.path.join(this.location, fileRelativeToProjectPath));
|
|
@@ -858,7 +989,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
858
989
|
//#endregion
|
|
859
990
|
};
|
|
860
991
|
//#endregion
|
|
861
|
-
//#region
|
|
992
|
+
//#region methods & getters / read file
|
|
862
993
|
BaseProject.prototype.readFile = function (fileRelativeToProjectPath) {
|
|
863
994
|
//#region @backendFunc
|
|
864
995
|
var fullPath = tnp_core_1.path.resolve(tnp_core_1.path.join(this.location, fileRelativeToProjectPath));
|
|
@@ -866,7 +997,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
866
997
|
//#endregion
|
|
867
998
|
};
|
|
868
999
|
//#endregion
|
|
869
|
-
//#region
|
|
1000
|
+
//#region methods & getters / remove (fiel or folder)
|
|
870
1001
|
BaseProject.prototype.remove = function (relativePath, exactPath) {
|
|
871
1002
|
if (exactPath === void 0) { exactPath = true; }
|
|
872
1003
|
//#region @backend
|
|
@@ -875,7 +1006,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
875
1006
|
//#endregion
|
|
876
1007
|
};
|
|
877
1008
|
//#endregion
|
|
878
|
-
//#region
|
|
1009
|
+
//#region methods & getters / remove folder by relative path
|
|
879
1010
|
BaseProject.prototype.removeFolderByRelativePath = function (relativePathToFolder) {
|
|
880
1011
|
//#region @backend
|
|
881
1012
|
relativePathToFolder = relativePathToFolder.replace(/^\//, '');
|
|
@@ -885,7 +1016,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
885
1016
|
//#endregion
|
|
886
1017
|
};
|
|
887
1018
|
//#endregion
|
|
888
|
-
//#region
|
|
1019
|
+
//#region methods & getters / link node_modules to other project
|
|
889
1020
|
BaseProject.prototype.linkNodeModulesTo = function (proj) {
|
|
890
1021
|
//#region @backendFunc
|
|
891
1022
|
var source = this.pathFor(tnp_config_1.config.folder.node_modules);
|
|
@@ -895,7 +1026,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
895
1026
|
//#endregion
|
|
896
1027
|
};
|
|
897
1028
|
//#endregion
|
|
898
|
-
//#region
|
|
1029
|
+
//#region methods & getters / reinstall node_modules
|
|
899
1030
|
BaseProject.prototype.reinstallNodeModules = function (forcerRemoveNodeModules) {
|
|
900
1031
|
if (forcerRemoveNodeModules === void 0) { forcerRemoveNodeModules = false; }
|
|
901
1032
|
//#region @backendFunc
|
|
@@ -909,7 +1040,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
909
1040
|
//#endregion
|
|
910
1041
|
};
|
|
911
1042
|
//#endregion
|
|
912
|
-
//#region
|
|
1043
|
+
//#region methods & getters / assign free port to project instance
|
|
913
1044
|
BaseProject.prototype.assignFreePort = function (startFrom, howManyFreePortsAfterThatPort) {
|
|
914
1045
|
if (startFrom === void 0) { startFrom = 4200; }
|
|
915
1046
|
if (howManyFreePortsAfterThatPort === void 0) { howManyFreePortsAfterThatPort = 0; }
|
|
@@ -957,14 +1088,14 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
957
1088
|
});
|
|
958
1089
|
};
|
|
959
1090
|
//#endregion
|
|
960
|
-
//#region
|
|
1091
|
+
//#region methods & getters / remove project from disk/memory
|
|
961
1092
|
BaseProject.prototype.removeItself = function () {
|
|
962
1093
|
//#region @backend
|
|
963
1094
|
this.ins.remove(this);
|
|
964
1095
|
//#endregion
|
|
965
1096
|
};
|
|
966
1097
|
//#endregion
|
|
967
|
-
//#region
|
|
1098
|
+
//#region methods & getters / define property
|
|
968
1099
|
/**
|
|
969
1100
|
* Purpose: not initializing all classes at the beginning
|
|
970
1101
|
* Only for BaseFeatureForProject class
|
|
@@ -1000,7 +1131,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1000
1131
|
//#endregion
|
|
1001
1132
|
};
|
|
1002
1133
|
//#endregion
|
|
1003
|
-
//#region
|
|
1134
|
+
//#region methods & getters / filter only copy
|
|
1004
1135
|
/**
|
|
1005
1136
|
* fs.copy option filter function for copying only selected folders from project
|
|
1006
1137
|
*/
|
|
@@ -1010,7 +1141,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1010
1141
|
//#endregion
|
|
1011
1142
|
};
|
|
1012
1143
|
//#endregion
|
|
1013
|
-
//#region
|
|
1144
|
+
//#region methods & getters / filter don't copy
|
|
1014
1145
|
/**
|
|
1015
1146
|
* fs.copy option filter function for copying only not selected folders from project
|
|
1016
1147
|
*/
|
|
@@ -1020,12 +1151,12 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1020
1151
|
//#endregion
|
|
1021
1152
|
};
|
|
1022
1153
|
//#endregion
|
|
1023
|
-
//#region
|
|
1154
|
+
//#region methods & getters / get default develop Branch
|
|
1024
1155
|
BaseProject.prototype.getDefaultDevelopmentBranch = function () {
|
|
1025
1156
|
return 'develop';
|
|
1026
1157
|
};
|
|
1027
1158
|
//#endregion
|
|
1028
|
-
//#region
|
|
1159
|
+
//#region methods & getters / get main branches
|
|
1029
1160
|
/**
|
|
1030
1161
|
* main/default hardcoded branches
|
|
1031
1162
|
*/
|
|
@@ -1033,18 +1164,18 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1033
1164
|
return ['master', 'develop', 'stage', 'prod', 'test'];
|
|
1034
1165
|
};
|
|
1035
1166
|
//#endregion
|
|
1036
|
-
//#region
|
|
1167
|
+
//#region methods & getters / is using aciton commit
|
|
1037
1168
|
BaseProject.prototype.isUnsingActionCommit = function () {
|
|
1038
1169
|
return false;
|
|
1039
1170
|
};
|
|
1040
1171
|
//#endregion
|
|
1041
|
-
//#region
|
|
1172
|
+
//#region methods & getters / reset process
|
|
1042
1173
|
BaseProject.prototype.resetProcess = function (overrideBranch, recrusive) {
|
|
1043
1174
|
var _a;
|
|
1044
1175
|
if (recrusive === void 0) { recrusive = false; }
|
|
1045
1176
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1046
|
-
var branchToReset, _b, _c, linked, child,
|
|
1047
|
-
var
|
|
1177
|
+
var branchToReset, _b, _c, linked, child, e_8_1;
|
|
1178
|
+
var e_8, _d;
|
|
1048
1179
|
return tslib_1.__generator(this, function (_e) {
|
|
1049
1180
|
switch (_e.label) {
|
|
1050
1181
|
case 0:
|
|
@@ -1091,14 +1222,14 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1091
1222
|
return [3 /*break*/, 4];
|
|
1092
1223
|
case 7: return [3 /*break*/, 10];
|
|
1093
1224
|
case 8:
|
|
1094
|
-
|
|
1095
|
-
|
|
1225
|
+
e_8_1 = _e.sent();
|
|
1226
|
+
e_8 = { error: e_8_1 };
|
|
1096
1227
|
return [3 /*break*/, 10];
|
|
1097
1228
|
case 9:
|
|
1098
1229
|
try {
|
|
1099
1230
|
if (_c && !_c.done && (_d = _b.return)) _d.call(_b);
|
|
1100
1231
|
}
|
|
1101
|
-
finally { if (
|
|
1232
|
+
finally { if (e_8) throw e_8.error; }
|
|
1102
1233
|
return [7 /*endfinally*/];
|
|
1103
1234
|
case 10: return [2 /*return*/];
|
|
1104
1235
|
}
|
|
@@ -1106,12 +1237,12 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1106
1237
|
});
|
|
1107
1238
|
};
|
|
1108
1239
|
//#endregion
|
|
1109
|
-
//#region
|
|
1240
|
+
//#region methods & getters / push process
|
|
1110
1241
|
BaseProject.prototype.pullProcess = function (cloneChildren) {
|
|
1111
1242
|
if (cloneChildren === void 0) { cloneChildren = false; }
|
|
1112
1243
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1113
|
-
var uncommitedChanges, location, childrenRepos, childrenRepos_1, childrenRepos_1_1, child,
|
|
1114
|
-
var
|
|
1244
|
+
var uncommitedChanges, location, childrenRepos, childrenRepos_1, childrenRepos_1_1, child, e_9_1;
|
|
1245
|
+
var e_9, _a;
|
|
1115
1246
|
return tslib_1.__generator(this, function (_b) {
|
|
1116
1247
|
switch (_b.label) {
|
|
1117
1248
|
case 0:
|
|
@@ -1161,14 +1292,14 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1161
1292
|
return [3 /*break*/, 5];
|
|
1162
1293
|
case 8: return [3 /*break*/, 11];
|
|
1163
1294
|
case 9:
|
|
1164
|
-
|
|
1165
|
-
|
|
1295
|
+
e_9_1 = _b.sent();
|
|
1296
|
+
e_9 = { error: e_9_1 };
|
|
1166
1297
|
return [3 /*break*/, 11];
|
|
1167
1298
|
case 10:
|
|
1168
1299
|
try {
|
|
1169
1300
|
if (childrenRepos_1_1 && !childrenRepos_1_1.done && (_a = childrenRepos_1.return)) _a.call(childrenRepos_1);
|
|
1170
1301
|
}
|
|
1171
|
-
finally { if (
|
|
1302
|
+
finally { if (e_9) throw e_9.error; }
|
|
1172
1303
|
return [7 /*endfinally*/];
|
|
1173
1304
|
case 11: return [4 /*yield*/, this.saveAllLinkedProjectsToDB()];
|
|
1174
1305
|
case 12:
|
|
@@ -1179,17 +1310,17 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1179
1310
|
});
|
|
1180
1311
|
};
|
|
1181
1312
|
//#endregion
|
|
1182
|
-
//#region
|
|
1313
|
+
//#region methods & getters / push process
|
|
1183
1314
|
BaseProject.prototype.pushProcess = function (options) {
|
|
1184
1315
|
var _a;
|
|
1185
1316
|
if (options === void 0) { options = {}; }
|
|
1186
1317
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1187
|
-
var force, typeofCommit, forcePushNoQuestion, origin, exitCallBack, args, commitMessageRequired, commitData, error_2, childrenRepos, childrenRepos_2, childrenRepos_2_1, child,
|
|
1188
|
-
var _b, _c, _d,
|
|
1318
|
+
var force, typeofCommit, forcePushNoQuestion, origin, exitCallBack, args, commitMessageRequired, skipChildren, commitData, error_2, childrenRepos, childrenRepos_2, childrenRepos_2_1, child, e_10_1;
|
|
1319
|
+
var _b, _c, _d, e_10, _e;
|
|
1189
1320
|
return tslib_1.__generator(this, function (_f) {
|
|
1190
1321
|
switch (_f.label) {
|
|
1191
1322
|
case 0:
|
|
1192
|
-
force = (_b = options.force, _b === void 0 ? false : _b), typeofCommit = options.typeofCommit, forcePushNoQuestion = options.forcePushNoQuestion, origin = (_c = options.origin, _c === void 0 ? 'origin' : _c), exitCallBack = options.exitCallBack, args = (_d = options.args, _d === void 0 ? [] : _d), commitMessageRequired = options.commitMessageRequired;
|
|
1323
|
+
force = (_b = options.force, _b === void 0 ? false : _b), typeofCommit = options.typeofCommit, forcePushNoQuestion = options.forcePushNoQuestion, origin = (_c = options.origin, _c === void 0 ? 'origin' : _c), exitCallBack = options.exitCallBack, args = (_d = options.args, _d === void 0 ? [] : _d), commitMessageRequired = options.commitMessageRequired, skipChildren = options.skipChildren;
|
|
1193
1324
|
return [4 /*yield*/, this._beforePushProcessAction()];
|
|
1194
1325
|
case 1:
|
|
1195
1326
|
_f.sent();
|
|
@@ -1259,7 +1390,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1259
1390
|
return [4 /*yield*/, this.git.pushCurrentBranch({ force: force, origin: origin, forcePushNoQuestion: forcePushNoQuestion, askToRetry: true })];
|
|
1260
1391
|
case 15:
|
|
1261
1392
|
_f.sent();
|
|
1262
|
-
if (!this.automaticallyAddAllChnagesWhenPushingToGit()) return [3 /*break*/, 23];
|
|
1393
|
+
if (!(this.automaticallyAddAllChnagesWhenPushingToGit() && !skipChildren)) return [3 /*break*/, 23];
|
|
1263
1394
|
if (this.getLinkedProjectsConfig().skipRecrusivePush) {
|
|
1264
1395
|
index_1.Helpers.warn("Skipping recrusive (children) push for ".concat(this.genericName));
|
|
1265
1396
|
return [2 /*return*/];
|
|
@@ -1282,14 +1413,14 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1282
1413
|
return [3 /*break*/, 17];
|
|
1283
1414
|
case 20: return [3 /*break*/, 23];
|
|
1284
1415
|
case 21:
|
|
1285
|
-
|
|
1286
|
-
|
|
1416
|
+
e_10_1 = _f.sent();
|
|
1417
|
+
e_10 = { error: e_10_1 };
|
|
1287
1418
|
return [3 /*break*/, 23];
|
|
1288
1419
|
case 22:
|
|
1289
1420
|
try {
|
|
1290
1421
|
if (childrenRepos_2_1 && !childrenRepos_2_1.done && (_e = childrenRepos_2.return)) _e.call(childrenRepos_2);
|
|
1291
1422
|
}
|
|
1292
|
-
finally { if (
|
|
1423
|
+
finally { if (e_10) throw e_10.error; }
|
|
1293
1424
|
return [7 /*endfinally*/];
|
|
1294
1425
|
case 23: return [4 /*yield*/, this.saveAllLinkedProjectsToDB()];
|
|
1295
1426
|
case 24:
|
|
@@ -1300,7 +1431,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1300
1431
|
});
|
|
1301
1432
|
};
|
|
1302
1433
|
//#endregion
|
|
1303
|
-
//#region
|
|
1434
|
+
//#region methods & getters / before any action on git root
|
|
1304
1435
|
BaseProject.prototype._beforeAnyActionOnGitRoot = function () {
|
|
1305
1436
|
//#region @backendFunc
|
|
1306
1437
|
if (!this.git.isInsideGitRepo) {
|
|
@@ -1407,14 +1538,14 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1407
1538
|
});
|
|
1408
1539
|
};
|
|
1409
1540
|
//#endregion
|
|
1410
|
-
//#region
|
|
1541
|
+
//#region methods & getters / link project to
|
|
1411
1542
|
BaseProject.prototype.linkTo = function (destPackageLocation) {
|
|
1412
1543
|
//#region @backend
|
|
1413
1544
|
index_1.Helpers.createSymLink(this.location, destPackageLocation);
|
|
1414
1545
|
//#endregion
|
|
1415
1546
|
};
|
|
1416
1547
|
//#endregion
|
|
1417
|
-
//#region
|
|
1548
|
+
//#region methods & getters / write file
|
|
1418
1549
|
BaseProject.prototype.writeFile = function (relativePath, content) {
|
|
1419
1550
|
//#region @backend
|
|
1420
1551
|
index_1.Helpers.writeFile([this.location, relativePath], content);
|
|
@@ -1861,13 +1992,13 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1861
1992
|
* get info about porject
|
|
1862
1993
|
*/
|
|
1863
1994
|
BaseProject.prototype.info = function () {
|
|
1864
|
-
var _a;
|
|
1995
|
+
var _a, _b, _c;
|
|
1865
1996
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1866
1997
|
var proj;
|
|
1867
|
-
return tslib_1.__generator(this, function (
|
|
1998
|
+
return tslib_1.__generator(this, function (_d) {
|
|
1868
1999
|
proj = this;
|
|
1869
|
-
index_1.Helpers.info("\n\n name: ".concat(proj === null || proj === void 0 ? void 0 : proj.name, "\n type: ").concat(proj === null || proj === void 0 ? void 0 : proj.type, "\n children (").concat(proj === null || proj === void 0 ? void 0 : proj.children.length, "): ").concat((!proj || !proj.children.length) ? '< none >' : '', "\n").concat(proj === null || proj === void 0 ? void 0 : proj.children.map(function (c) { return '+' + c.genericName; }).join('\n'), "\n") +
|
|
1870
|
-
"\nlinked porject prefix: \"".concat(this.linkedProjectsPrefix, "\"\n\nlinked projects from json (").concat(((
|
|
2000
|
+
index_1.Helpers.info("\n\n name: ".concat(proj === null || proj === void 0 ? void 0 : proj.name, "\n type: ").concat(proj === null || proj === void 0 ? void 0 : proj.type, "\n core project name: '").concat((_a = proj === null || proj === void 0 ? void 0 : proj.core) === null || _a === void 0 ? void 0 : _a.name, "'\n embedded project: ").concat(((_b = proj === null || proj === void 0 ? void 0 : proj.embeddedProject) === null || _b === void 0 ? void 0 : _b.genericName) || '< none >', "\n children (").concat(proj === null || proj === void 0 ? void 0 : proj.children.length, "): ").concat((!proj || !proj.children.length) ? '< none >' : '', "\n").concat(proj === null || proj === void 0 ? void 0 : proj.children.map(function (c) { return '+' + c.genericName; }).join('\n'), "\n") +
|
|
2001
|
+
"\nlinked porject prefix: \"".concat(this.linkedProjectsPrefix, "\"\n\nlinked projects from json (").concat(((_c = this.linkedProjects) === null || _c === void 0 ? void 0 : _c.length) || 0, "):\n").concat((this.linkedProjects || []).map(function (c) { return '- ' + c.relativeClonePath; }).join('\n'), "\n\n "));
|
|
1871
2002
|
return [2 /*return*/];
|
|
1872
2003
|
});
|
|
1873
2004
|
});
|
|
@@ -2042,8 +2173,8 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
2042
2173
|
BaseProject.prototype.buildLibraries = function (_a) {
|
|
2043
2174
|
var _b = _a === void 0 ? {} : _a, _c = _b.rebuild, rebuild = _c === void 0 ? false : _c, _d = _b.watch, watch = _d === void 0 ? false : _d, strategy = _b.strategy;
|
|
2044
2175
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2045
|
-
var libsToWatch, locationsForNodeModules, libs, _loop_1, this_1, _e, _f, _g, index, lib, _loop_2, _h, _j, _k, index, lib,
|
|
2046
|
-
var
|
|
2176
|
+
var libsToWatch, locationsForNodeModules, libs, _loop_1, this_1, _e, _f, _g, index, lib, _loop_2, _h, _j, _k, index, lib, e_11_1;
|
|
2177
|
+
var e_12, _l, e_11, _m;
|
|
2047
2178
|
var _this = this;
|
|
2048
2179
|
return tslib_1.__generator(this, function (_o) {
|
|
2049
2180
|
switch (_o.label) {
|
|
@@ -2076,10 +2207,10 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
2076
2207
|
index_1.Helpers.info("Building (".concat(index + 1, "/").concat(libs.length, ") ").concat(lib.basename, " (").concat(tnp_core_3.chalk.bold(lib.name), ")"));
|
|
2077
2208
|
if (strategy === 'link') {
|
|
2078
2209
|
(function () {
|
|
2079
|
-
var
|
|
2210
|
+
var e_13, _a;
|
|
2080
2211
|
var sourceDist = _this.pathFor([tnp_config_1.config.folder.dist, lib.basename]);
|
|
2081
2212
|
try {
|
|
2082
|
-
for (var locationsForNodeModules_1 = (
|
|
2213
|
+
for (var locationsForNodeModules_1 = (e_13 = void 0, tslib_1.__values(locationsForNodeModules)), locationsForNodeModules_1_1 = locationsForNodeModules_1.next(); !locationsForNodeModules_1_1.done; locationsForNodeModules_1_1 = locationsForNodeModules_1.next()) {
|
|
2083
2214
|
var node_modules = locationsForNodeModules_1_1.value;
|
|
2084
2215
|
var dest = (0, tnp_core_1.crossPlatformPath)([node_modules, lib.name]);
|
|
2085
2216
|
if (!index_1.Helpers.isSymlinkFileExitedOrUnexisted(dest)) {
|
|
@@ -2091,12 +2222,12 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
2091
2222
|
index_1.Helpers.createSymLink(sourceDist, dest, { continueWhenExistedFolderDoesntExists: true });
|
|
2092
2223
|
}
|
|
2093
2224
|
}
|
|
2094
|
-
catch (
|
|
2225
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
2095
2226
|
finally {
|
|
2096
2227
|
try {
|
|
2097
2228
|
if (locationsForNodeModules_1_1 && !locationsForNodeModules_1_1.done && (_a = locationsForNodeModules_1.return)) _a.call(locationsForNodeModules_1);
|
|
2098
2229
|
}
|
|
2099
|
-
finally { if (
|
|
2230
|
+
finally { if (e_13) throw e_13.error; }
|
|
2100
2231
|
}
|
|
2101
2232
|
if (rebuild || !index_1.Helpers.exists(sourceDist)) {
|
|
2102
2233
|
index_1.Helpers.info("Compiling ".concat(lib.name, " ..."));
|
|
@@ -2132,12 +2263,12 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
2132
2263
|
_loop_1(index, lib);
|
|
2133
2264
|
}
|
|
2134
2265
|
}
|
|
2135
|
-
catch (
|
|
2266
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
2136
2267
|
finally {
|
|
2137
2268
|
try {
|
|
2138
2269
|
if (_f && !_f.done && (_l = _e.return)) _l.call(_e);
|
|
2139
2270
|
}
|
|
2140
|
-
finally { if (
|
|
2271
|
+
finally { if (e_12) throw e_12.error; }
|
|
2141
2272
|
}
|
|
2142
2273
|
if (!watch) return [3 /*break*/, 12];
|
|
2143
2274
|
_loop_2 = function (index, lib) {
|
|
@@ -2185,14 +2316,14 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
2185
2316
|
return [3 /*break*/, 5];
|
|
2186
2317
|
case 8: return [3 /*break*/, 11];
|
|
2187
2318
|
case 9:
|
|
2188
|
-
|
|
2189
|
-
|
|
2319
|
+
e_11_1 = _o.sent();
|
|
2320
|
+
e_11 = { error: e_11_1 };
|
|
2190
2321
|
return [3 /*break*/, 11];
|
|
2191
2322
|
case 10:
|
|
2192
2323
|
try {
|
|
2193
2324
|
if (_j && !_j.done && (_m = _h.return)) _m.call(_h);
|
|
2194
2325
|
}
|
|
2195
|
-
finally { if (
|
|
2326
|
+
finally { if (e_11) throw e_11.error; }
|
|
2196
2327
|
return [7 /*endfinally*/];
|
|
2197
2328
|
case 11:
|
|
2198
2329
|
// await this.__indexRebuilder.startAndWatch({ taskName: 'index rebuild watch' });
|
|
@@ -2223,14 +2354,16 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
2223
2354
|
};
|
|
2224
2355
|
//#endregion
|
|
2225
2356
|
//#region getters & methods / start npm task
|
|
2226
|
-
BaseProject.prototype.startNpmTask = function (taskName) {
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2357
|
+
BaseProject.prototype.startNpmTask = function (taskName, additionalArguments) {
|
|
2358
|
+
if (tnp_core_2._.isObject(additionalArguments)) {
|
|
2359
|
+
additionalArguments = Object.keys(additionalArguments).map(function (k) { return "--".concat(k, " ").concat(additionalArguments[k]); }).join(' ');
|
|
2360
|
+
}
|
|
2361
|
+
return this.run("npm run ".concat(taskName, " ").concat(additionalArguments ? (' -- ' + additionalArguments) : ''), { output: true });
|
|
2230
2362
|
};
|
|
2231
2363
|
//#region static
|
|
2232
2364
|
//#region static / instance of resovle
|
|
2233
2365
|
BaseProject.ins = new base_project_resolver_1.BaseProjectResolver(BaseProject);
|
|
2366
|
+
BaseProject.cache = {};
|
|
2234
2367
|
return BaseProject;
|
|
2235
2368
|
}());
|
|
2236
2369
|
//# sourceMappingURL=base-project.js.map
|