tnp-helpers 16.100.10 → 16.100.12
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 +94 -14
- package/browser/esm2022/lib/base/core-project.mjs +61 -2
- package/browser/esm2022/lib/models.mjs +3 -2
- package/browser/fesm2022/tnp-helpers.mjs +154 -15
- package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
- package/browser/lib/base/base-project.d.ts +34 -8
- 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 +94 -14
- package/client/esm2022/lib/base/core-project.mjs +61 -2
- package/client/esm2022/lib/models.mjs +3 -2
- package/client/fesm2022/tnp-helpers.mjs +154 -15
- package/client/fesm2022/tnp-helpers.mjs.map +1 -1
- package/client/lib/base/base-project.d.ts +34 -8
- package/client/lib/base/core-project.d.ts +38 -13
- package/client/lib/models.d.ts +3 -1
- package/client/package.json +9 -9
- 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 +33 -11
- package/lib/base/base-project.js +250 -116
- 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/config-database.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-process.backend.d.ts +7 -0
- package/lib/helpers/for-backend/helpers-process.backend.js +30 -1
- package/lib/helpers/for-backend/helpers-process.backend.js.map +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 +12 -12
- package/websql/esm2022/lib/base/base-project.mjs +89 -14
- package/websql/esm2022/lib/base/core-project.mjs +61 -2
- package/websql/esm2022/lib/models.mjs +3 -2
- package/websql/fesm2022/tnp-helpers.mjs +149 -15
- package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
- package/websql/lib/base/base-project.d.ts +34 -8
- 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,9 +409,10 @@ 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
|
-
var detectedLinkedProjects = index_1.LinkedProject.detect(this.location, true
|
|
414
|
+
var detectedLinkedProjects = index_1.LinkedProject.detect(this.location, true // TOOD fix recrusive
|
|
415
|
+
);
|
|
316
416
|
return detectedLinkedProjects;
|
|
317
417
|
},
|
|
318
418
|
enumerable: false,
|
|
@@ -320,7 +420,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
320
420
|
});
|
|
321
421
|
Object.defineProperty(BaseProject.prototype, "linkedProjectsPrefix", {
|
|
322
422
|
//#endregion
|
|
323
|
-
//#region
|
|
423
|
+
//#region methods & getters / linked projects prefix
|
|
324
424
|
get: function () {
|
|
325
425
|
return this.getLinkedProjectsConfig().prefix;
|
|
326
426
|
},
|
|
@@ -354,8 +454,8 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
354
454
|
BaseProject.prototype.cloneUnexistedLinkedProjects = function (actionType, cloneChildren) {
|
|
355
455
|
if (cloneChildren === void 0) { cloneChildren = false; }
|
|
356
456
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
357
|
-
var detectedLinkedProjects, projectsThatShouldBeLinked, _a, projectsThatShouldBeLinked_1, projectsThatShouldBeLinked_1_1, linkedProj, childProjLocaiton, childProj,
|
|
358
|
-
var
|
|
457
|
+
var detectedLinkedProjects, projectsThatShouldBeLinked, _a, projectsThatShouldBeLinked_1, projectsThatShouldBeLinked_1_1, linkedProj, childProjLocaiton, childProj, e_7_1;
|
|
458
|
+
var e_7, _b;
|
|
359
459
|
return tslib_1.__generator(this, function (_c) {
|
|
360
460
|
switch (_c.label) {
|
|
361
461
|
case 0:
|
|
@@ -407,14 +507,14 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
407
507
|
return [3 /*break*/, 4];
|
|
408
508
|
case 8: return [3 /*break*/, 11];
|
|
409
509
|
case 9:
|
|
410
|
-
|
|
411
|
-
|
|
510
|
+
e_7_1 = _c.sent();
|
|
511
|
+
e_7 = { error: e_7_1 };
|
|
412
512
|
return [3 /*break*/, 11];
|
|
413
513
|
case 10:
|
|
414
514
|
try {
|
|
415
515
|
if (projectsThatShouldBeLinked_1_1 && !projectsThatShouldBeLinked_1_1.done && (_b = projectsThatShouldBeLinked_1.return)) _b.call(projectsThatShouldBeLinked_1);
|
|
416
516
|
}
|
|
417
|
-
finally { if (
|
|
517
|
+
finally { if (e_7) throw e_7.error; }
|
|
418
518
|
return [7 /*endfinally*/];
|
|
419
519
|
case 11: return [2 /*return*/];
|
|
420
520
|
}
|
|
@@ -422,13 +522,13 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
422
522
|
});
|
|
423
523
|
};
|
|
424
524
|
//#endregion
|
|
425
|
-
//#region
|
|
525
|
+
//#region methods & getters / set type
|
|
426
526
|
BaseProject.prototype.setType = function (type) {
|
|
427
527
|
// @ts-ignore
|
|
428
528
|
this.type = type;
|
|
429
529
|
};
|
|
430
530
|
//#endregion
|
|
431
|
-
//#region
|
|
531
|
+
//#region methods & getters / type is
|
|
432
532
|
BaseProject.prototype.typeIs = function () {
|
|
433
533
|
var types = [];
|
|
434
534
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -437,7 +537,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
437
537
|
return this.type && types.includes(this.type);
|
|
438
538
|
};
|
|
439
539
|
//#endregion
|
|
440
|
-
//#region
|
|
540
|
+
//#region methods & getters / type is not
|
|
441
541
|
BaseProject.prototype.typeIsNot = function () {
|
|
442
542
|
var types = [];
|
|
443
543
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -447,7 +547,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
447
547
|
};
|
|
448
548
|
Object.defineProperty(BaseProject.prototype, "basename", {
|
|
449
549
|
//#endregion
|
|
450
|
-
//#region
|
|
550
|
+
//#region methods & getters / basename
|
|
451
551
|
/**
|
|
452
552
|
* project folder basename
|
|
453
553
|
*/
|
|
@@ -461,7 +561,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
461
561
|
});
|
|
462
562
|
Object.defineProperty(BaseProject.prototype, "name", {
|
|
463
563
|
//#endregion
|
|
464
|
-
//#region
|
|
564
|
+
//#region methods & getters / name
|
|
465
565
|
/**
|
|
466
566
|
* name from package.json
|
|
467
567
|
*/
|
|
@@ -474,7 +574,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
474
574
|
});
|
|
475
575
|
Object.defineProperty(BaseProject.prototype, "version", {
|
|
476
576
|
//#endregion
|
|
477
|
-
//#region
|
|
577
|
+
//#region methods & getters / version
|
|
478
578
|
/**
|
|
479
579
|
* version from package.json -> property version
|
|
480
580
|
*/
|
|
@@ -487,7 +587,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
487
587
|
});
|
|
488
588
|
Object.defineProperty(BaseProject.prototype, "majorVersion", {
|
|
489
589
|
//#endregion
|
|
490
|
-
//#region
|
|
590
|
+
//#region methods & getters / major version
|
|
491
591
|
/**
|
|
492
592
|
* Major Version from package.json
|
|
493
593
|
*/
|
|
@@ -502,7 +602,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
502
602
|
});
|
|
503
603
|
Object.defineProperty(BaseProject.prototype, "minorVersion", {
|
|
504
604
|
//#endregion
|
|
505
|
-
//#region
|
|
605
|
+
//#region methods & getters / minor version
|
|
506
606
|
/**
|
|
507
607
|
* Minor Version from package.json
|
|
508
608
|
*/
|
|
@@ -519,7 +619,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
519
619
|
});
|
|
520
620
|
Object.defineProperty(BaseProject.prototype, "versionPathAsNumber", {
|
|
521
621
|
//#endregion
|
|
522
|
-
//#region
|
|
622
|
+
//#region methods & getters / get version path as number
|
|
523
623
|
get: function () {
|
|
524
624
|
//#region @backendFunc
|
|
525
625
|
var ver = this.version.split('.');
|
|
@@ -532,7 +632,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
532
632
|
});
|
|
533
633
|
Object.defineProperty(BaseProject.prototype, "dependencies", {
|
|
534
634
|
//#endregion
|
|
535
|
-
//#region
|
|
635
|
+
//#region methods & getters / dependencies
|
|
536
636
|
/**
|
|
537
637
|
* npm dependencies from package.json
|
|
538
638
|
*/
|
|
@@ -544,7 +644,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
544
644
|
});
|
|
545
645
|
Object.defineProperty(BaseProject.prototype, "peerDependencies", {
|
|
546
646
|
//#endregion
|
|
547
|
-
//#region
|
|
647
|
+
//#region methods & getters / peer dependencies
|
|
548
648
|
/**
|
|
549
649
|
* peerDependencies dependencies
|
|
550
650
|
*/
|
|
@@ -556,7 +656,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
556
656
|
});
|
|
557
657
|
Object.defineProperty(BaseProject.prototype, "devDependencies", {
|
|
558
658
|
//#endregion
|
|
559
|
-
//#region
|
|
659
|
+
//#region methods & getters / dev dependencies
|
|
560
660
|
/**
|
|
561
661
|
* devDependencies dependencies
|
|
562
662
|
*/
|
|
@@ -568,7 +668,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
568
668
|
});
|
|
569
669
|
Object.defineProperty(BaseProject.prototype, "resolutions", {
|
|
570
670
|
//#endregion
|
|
571
|
-
//#region
|
|
671
|
+
//#region methods & getters / resolutions dependencies
|
|
572
672
|
/**
|
|
573
673
|
* resolutions dependencies
|
|
574
674
|
*/
|
|
@@ -580,7 +680,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
580
680
|
});
|
|
581
681
|
Object.defineProperty(BaseProject.prototype, "allDependencies", {
|
|
582
682
|
//#endregion
|
|
583
|
-
//#region
|
|
683
|
+
//#region methods & getters / all dependencies
|
|
584
684
|
/**
|
|
585
685
|
* object with all deps from package json
|
|
586
686
|
*/
|
|
@@ -591,7 +691,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
591
691
|
configurable: true
|
|
592
692
|
});
|
|
593
693
|
//#endregion
|
|
594
|
-
//#region
|
|
694
|
+
//#region methods & getters / get folder for possible project chhildrens
|
|
595
695
|
BaseProject.prototype.getFoldersForPossibleProjectChildren = function () {
|
|
596
696
|
//#region @backendFunc
|
|
597
697
|
var isDirectory = function (source) { return tnp_core_3.fse.lstatSync(source).isDirectory(); };
|
|
@@ -614,7 +714,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
614
714
|
//#endregion
|
|
615
715
|
};
|
|
616
716
|
//#endregion
|
|
617
|
-
//#region
|
|
717
|
+
//#region methods & getters / get all childrens
|
|
618
718
|
BaseProject.prototype.getAllChildren = function () {
|
|
619
719
|
var _this = this;
|
|
620
720
|
//#region @backendFunc
|
|
@@ -630,7 +730,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
630
730
|
};
|
|
631
731
|
Object.defineProperty(BaseProject.prototype, "children", {
|
|
632
732
|
//#endregion
|
|
633
|
-
//#region
|
|
733
|
+
//#region methods & getters / children
|
|
634
734
|
/**
|
|
635
735
|
* alias to getAllChildren
|
|
636
736
|
*/
|
|
@@ -643,7 +743,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
643
743
|
configurable: true
|
|
644
744
|
});
|
|
645
745
|
//#endregion
|
|
646
|
-
//#region
|
|
746
|
+
//#region methods & getters / get child
|
|
647
747
|
BaseProject.prototype.getChildBy = function (nameOrBasename, errors) {
|
|
648
748
|
if (errors === void 0) { errors = true; }
|
|
649
749
|
//#region @websqlFunc
|
|
@@ -656,7 +756,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
656
756
|
};
|
|
657
757
|
Object.defineProperty(BaseProject.prototype, "parent", {
|
|
658
758
|
//#endregion
|
|
659
|
-
//#region
|
|
759
|
+
//#region methods & getters / parent
|
|
660
760
|
get: function () {
|
|
661
761
|
//#region @websqlFunc
|
|
662
762
|
if (!tnp_core_2._.isString(this.location) || this.location.trim() === '') {
|
|
@@ -670,7 +770,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
670
770
|
});
|
|
671
771
|
Object.defineProperty(BaseProject.prototype, "grandpa", {
|
|
672
772
|
//#endregion
|
|
673
|
-
//#region
|
|
773
|
+
//#region methods & getters / grandpa
|
|
674
774
|
get: function () {
|
|
675
775
|
//#region @websqlFunc
|
|
676
776
|
if (!tnp_core_2._.isString(this.location) || this.location.trim() === '') {
|
|
@@ -685,11 +785,16 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
685
785
|
});
|
|
686
786
|
Object.defineProperty(BaseProject.prototype, "genericName", {
|
|
687
787
|
//#endregion
|
|
688
|
-
//#region
|
|
788
|
+
//#region methods & getters / generic name
|
|
689
789
|
get: function () {
|
|
690
790
|
//#region @websqlFunc
|
|
691
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, '..']));
|
|
692
795
|
return [
|
|
796
|
+
// (secondNearest && secondNearest !== nearest) ? (secondNearest.name || secondNearest.basename) : void 0,
|
|
797
|
+
// nerestProj,
|
|
693
798
|
parent ? tnp_core_1.path.basename(tnp_core_1.path.dirname(parent.location)) : void 0,
|
|
694
799
|
parent ? parent.basename : tnp_core_1.path.basename(this.location),
|
|
695
800
|
this.basename,
|
|
@@ -706,7 +811,26 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
706
811
|
configurable: true
|
|
707
812
|
});
|
|
708
813
|
//#endregion
|
|
709
|
-
|
|
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
|
|
710
834
|
/**
|
|
711
835
|
* same has project.hasFile();
|
|
712
836
|
*/
|
|
@@ -714,15 +838,22 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
714
838
|
return this.hasFile(relativePath);
|
|
715
839
|
};
|
|
716
840
|
//#endregion
|
|
717
|
-
//#region
|
|
841
|
+
//#region methods & getters / has file
|
|
718
842
|
/**
|
|
719
843
|
* same as project.pathExists();
|
|
720
844
|
*/
|
|
721
845
|
BaseProject.prototype.hasFile = function (relativePath) {
|
|
846
|
+
//#region @backendFunc
|
|
722
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
|
|
723
854
|
};
|
|
724
855
|
//#endregion
|
|
725
|
-
//#region
|
|
856
|
+
//#region methods & getters / contains file
|
|
726
857
|
/**
|
|
727
858
|
* same as project.pathhasFileExists();
|
|
728
859
|
* but with path.resolve
|
|
@@ -732,7 +863,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
732
863
|
return index_1.Helpers.exists(fullPath);
|
|
733
864
|
};
|
|
734
865
|
//#endregion
|
|
735
|
-
//#region
|
|
866
|
+
//#region methods & getters / path for
|
|
736
867
|
/**
|
|
737
868
|
* absolute path:
|
|
738
869
|
* concated project location with relative path
|
|
@@ -749,7 +880,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
749
880
|
//#endregion
|
|
750
881
|
};
|
|
751
882
|
//#endregion
|
|
752
|
-
//#region
|
|
883
|
+
//#region methods & getters / write json
|
|
753
884
|
BaseProject.prototype.writeJson = function (relativePath, json) {
|
|
754
885
|
//#region @backendFunc
|
|
755
886
|
if (tnp_core_1.path.isAbsolute(relativePath)) {
|
|
@@ -759,19 +890,20 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
759
890
|
//#endregion
|
|
760
891
|
};
|
|
761
892
|
//#endregion
|
|
762
|
-
//#region
|
|
893
|
+
//#region methods & getters / run
|
|
763
894
|
/**
|
|
764
895
|
* @deprecated us execute instead
|
|
765
896
|
* use output from or more preciese crafted api
|
|
766
897
|
*/
|
|
767
898
|
BaseProject.prototype.run = function (command, options) {
|
|
768
|
-
|
|
899
|
+
var opt;
|
|
900
|
+
//#region @backend
|
|
769
901
|
options = tnp_core_2._.cloneDeep(options) || {};
|
|
770
902
|
index_1.Helpers.log("command: ".concat(command));
|
|
771
903
|
if (tnp_core_2._.isUndefined(options.showCommand)) {
|
|
772
904
|
options.showCommand = false;
|
|
773
905
|
}
|
|
774
|
-
|
|
906
|
+
opt = options;
|
|
775
907
|
if (!opt.cwd) {
|
|
776
908
|
opt.cwd = this.location;
|
|
777
909
|
}
|
|
@@ -781,11 +913,11 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
781
913
|
else {
|
|
782
914
|
index_1.Helpers.log("[".concat(tnp_cli_1.CLI.chalk.underline('Executing shell command'), "] \"").concat(command, "\" in [").concat(opt.cwd, "]"));
|
|
783
915
|
}
|
|
784
|
-
return index_1.Helpers.run(command, opt);
|
|
785
916
|
//#endregion
|
|
917
|
+
return index_1.Helpers.run(command, opt);
|
|
786
918
|
};
|
|
787
919
|
//#endregion
|
|
788
|
-
//#region
|
|
920
|
+
//#region methods & getters / execute
|
|
789
921
|
/**
|
|
790
922
|
* same as run but async
|
|
791
923
|
*/
|
|
@@ -816,7 +948,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
816
948
|
});
|
|
817
949
|
};
|
|
818
950
|
//#endregion
|
|
819
|
-
//#region
|
|
951
|
+
//#region methods & getters / try run sync command
|
|
820
952
|
/**
|
|
821
953
|
* try run but continue when it fails
|
|
822
954
|
* @param command
|
|
@@ -838,7 +970,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
838
970
|
//#endregion
|
|
839
971
|
};
|
|
840
972
|
//#endregion
|
|
841
|
-
//#region
|
|
973
|
+
//#region methods & getters / output from command
|
|
842
974
|
BaseProject.prototype.outputFrom = function (command
|
|
843
975
|
//#region @backend
|
|
844
976
|
, options
|
|
@@ -849,7 +981,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
849
981
|
//#endregion
|
|
850
982
|
};
|
|
851
983
|
//#endregion
|
|
852
|
-
//#region
|
|
984
|
+
//#region methods & getters / remove file
|
|
853
985
|
BaseProject.prototype.removeFile = function (fileRelativeToProjectPath) {
|
|
854
986
|
//#region @backendFunc
|
|
855
987
|
var fullPath = tnp_core_1.path.resolve(tnp_core_1.path.join(this.location, fileRelativeToProjectPath));
|
|
@@ -857,7 +989,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
857
989
|
//#endregion
|
|
858
990
|
};
|
|
859
991
|
//#endregion
|
|
860
|
-
//#region
|
|
992
|
+
//#region methods & getters / read file
|
|
861
993
|
BaseProject.prototype.readFile = function (fileRelativeToProjectPath) {
|
|
862
994
|
//#region @backendFunc
|
|
863
995
|
var fullPath = tnp_core_1.path.resolve(tnp_core_1.path.join(this.location, fileRelativeToProjectPath));
|
|
@@ -865,7 +997,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
865
997
|
//#endregion
|
|
866
998
|
};
|
|
867
999
|
//#endregion
|
|
868
|
-
//#region
|
|
1000
|
+
//#region methods & getters / remove (fiel or folder)
|
|
869
1001
|
BaseProject.prototype.remove = function (relativePath, exactPath) {
|
|
870
1002
|
if (exactPath === void 0) { exactPath = true; }
|
|
871
1003
|
//#region @backend
|
|
@@ -874,7 +1006,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
874
1006
|
//#endregion
|
|
875
1007
|
};
|
|
876
1008
|
//#endregion
|
|
877
|
-
//#region
|
|
1009
|
+
//#region methods & getters / remove folder by relative path
|
|
878
1010
|
BaseProject.prototype.removeFolderByRelativePath = function (relativePathToFolder) {
|
|
879
1011
|
//#region @backend
|
|
880
1012
|
relativePathToFolder = relativePathToFolder.replace(/^\//, '');
|
|
@@ -884,7 +1016,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
884
1016
|
//#endregion
|
|
885
1017
|
};
|
|
886
1018
|
//#endregion
|
|
887
|
-
//#region
|
|
1019
|
+
//#region methods & getters / link node_modules to other project
|
|
888
1020
|
BaseProject.prototype.linkNodeModulesTo = function (proj) {
|
|
889
1021
|
//#region @backendFunc
|
|
890
1022
|
var source = this.pathFor(tnp_config_1.config.folder.node_modules);
|
|
@@ -894,7 +1026,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
894
1026
|
//#endregion
|
|
895
1027
|
};
|
|
896
1028
|
//#endregion
|
|
897
|
-
//#region
|
|
1029
|
+
//#region methods & getters / reinstall node_modules
|
|
898
1030
|
BaseProject.prototype.reinstallNodeModules = function (forcerRemoveNodeModules) {
|
|
899
1031
|
if (forcerRemoveNodeModules === void 0) { forcerRemoveNodeModules = false; }
|
|
900
1032
|
//#region @backendFunc
|
|
@@ -908,7 +1040,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
908
1040
|
//#endregion
|
|
909
1041
|
};
|
|
910
1042
|
//#endregion
|
|
911
|
-
//#region
|
|
1043
|
+
//#region methods & getters / assign free port to project instance
|
|
912
1044
|
BaseProject.prototype.assignFreePort = function (startFrom, howManyFreePortsAfterThatPort) {
|
|
913
1045
|
if (startFrom === void 0) { startFrom = 4200; }
|
|
914
1046
|
if (howManyFreePortsAfterThatPort === void 0) { howManyFreePortsAfterThatPort = 0; }
|
|
@@ -956,14 +1088,14 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
956
1088
|
});
|
|
957
1089
|
};
|
|
958
1090
|
//#endregion
|
|
959
|
-
//#region
|
|
1091
|
+
//#region methods & getters / remove project from disk/memory
|
|
960
1092
|
BaseProject.prototype.removeItself = function () {
|
|
961
1093
|
//#region @backend
|
|
962
1094
|
this.ins.remove(this);
|
|
963
1095
|
//#endregion
|
|
964
1096
|
};
|
|
965
1097
|
//#endregion
|
|
966
|
-
//#region
|
|
1098
|
+
//#region methods & getters / define property
|
|
967
1099
|
/**
|
|
968
1100
|
* Purpose: not initializing all classes at the beginning
|
|
969
1101
|
* Only for BaseFeatureForProject class
|
|
@@ -999,7 +1131,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
999
1131
|
//#endregion
|
|
1000
1132
|
};
|
|
1001
1133
|
//#endregion
|
|
1002
|
-
//#region
|
|
1134
|
+
//#region methods & getters / filter only copy
|
|
1003
1135
|
/**
|
|
1004
1136
|
* fs.copy option filter function for copying only selected folders from project
|
|
1005
1137
|
*/
|
|
@@ -1009,7 +1141,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1009
1141
|
//#endregion
|
|
1010
1142
|
};
|
|
1011
1143
|
//#endregion
|
|
1012
|
-
//#region
|
|
1144
|
+
//#region methods & getters / filter don't copy
|
|
1013
1145
|
/**
|
|
1014
1146
|
* fs.copy option filter function for copying only not selected folders from project
|
|
1015
1147
|
*/
|
|
@@ -1019,12 +1151,12 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1019
1151
|
//#endregion
|
|
1020
1152
|
};
|
|
1021
1153
|
//#endregion
|
|
1022
|
-
//#region
|
|
1154
|
+
//#region methods & getters / get default develop Branch
|
|
1023
1155
|
BaseProject.prototype.getDefaultDevelopmentBranch = function () {
|
|
1024
1156
|
return 'develop';
|
|
1025
1157
|
};
|
|
1026
1158
|
//#endregion
|
|
1027
|
-
//#region
|
|
1159
|
+
//#region methods & getters / get main branches
|
|
1028
1160
|
/**
|
|
1029
1161
|
* main/default hardcoded branches
|
|
1030
1162
|
*/
|
|
@@ -1032,18 +1164,18 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1032
1164
|
return ['master', 'develop', 'stage', 'prod', 'test'];
|
|
1033
1165
|
};
|
|
1034
1166
|
//#endregion
|
|
1035
|
-
//#region
|
|
1167
|
+
//#region methods & getters / is using aciton commit
|
|
1036
1168
|
BaseProject.prototype.isUnsingActionCommit = function () {
|
|
1037
1169
|
return false;
|
|
1038
1170
|
};
|
|
1039
1171
|
//#endregion
|
|
1040
|
-
//#region
|
|
1172
|
+
//#region methods & getters / reset process
|
|
1041
1173
|
BaseProject.prototype.resetProcess = function (overrideBranch, recrusive) {
|
|
1042
1174
|
var _a;
|
|
1043
1175
|
if (recrusive === void 0) { recrusive = false; }
|
|
1044
1176
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1045
|
-
var branchToReset, _b, _c, linked, child,
|
|
1046
|
-
var
|
|
1177
|
+
var branchToReset, _b, _c, linked, child, e_8_1;
|
|
1178
|
+
var e_8, _d;
|
|
1047
1179
|
return tslib_1.__generator(this, function (_e) {
|
|
1048
1180
|
switch (_e.label) {
|
|
1049
1181
|
case 0:
|
|
@@ -1090,14 +1222,14 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1090
1222
|
return [3 /*break*/, 4];
|
|
1091
1223
|
case 7: return [3 /*break*/, 10];
|
|
1092
1224
|
case 8:
|
|
1093
|
-
|
|
1094
|
-
|
|
1225
|
+
e_8_1 = _e.sent();
|
|
1226
|
+
e_8 = { error: e_8_1 };
|
|
1095
1227
|
return [3 /*break*/, 10];
|
|
1096
1228
|
case 9:
|
|
1097
1229
|
try {
|
|
1098
1230
|
if (_c && !_c.done && (_d = _b.return)) _d.call(_b);
|
|
1099
1231
|
}
|
|
1100
|
-
finally { if (
|
|
1232
|
+
finally { if (e_8) throw e_8.error; }
|
|
1101
1233
|
return [7 /*endfinally*/];
|
|
1102
1234
|
case 10: return [2 /*return*/];
|
|
1103
1235
|
}
|
|
@@ -1105,12 +1237,12 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1105
1237
|
});
|
|
1106
1238
|
};
|
|
1107
1239
|
//#endregion
|
|
1108
|
-
//#region
|
|
1240
|
+
//#region methods & getters / push process
|
|
1109
1241
|
BaseProject.prototype.pullProcess = function (cloneChildren) {
|
|
1110
1242
|
if (cloneChildren === void 0) { cloneChildren = false; }
|
|
1111
1243
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1112
|
-
var uncommitedChanges, location, childrenRepos, childrenRepos_1, childrenRepos_1_1, child,
|
|
1113
|
-
var
|
|
1244
|
+
var uncommitedChanges, location, childrenRepos, childrenRepos_1, childrenRepos_1_1, child, e_9_1;
|
|
1245
|
+
var e_9, _a;
|
|
1114
1246
|
return tslib_1.__generator(this, function (_b) {
|
|
1115
1247
|
switch (_b.label) {
|
|
1116
1248
|
case 0:
|
|
@@ -1160,14 +1292,14 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1160
1292
|
return [3 /*break*/, 5];
|
|
1161
1293
|
case 8: return [3 /*break*/, 11];
|
|
1162
1294
|
case 9:
|
|
1163
|
-
|
|
1164
|
-
|
|
1295
|
+
e_9_1 = _b.sent();
|
|
1296
|
+
e_9 = { error: e_9_1 };
|
|
1165
1297
|
return [3 /*break*/, 11];
|
|
1166
1298
|
case 10:
|
|
1167
1299
|
try {
|
|
1168
1300
|
if (childrenRepos_1_1 && !childrenRepos_1_1.done && (_a = childrenRepos_1.return)) _a.call(childrenRepos_1);
|
|
1169
1301
|
}
|
|
1170
|
-
finally { if (
|
|
1302
|
+
finally { if (e_9) throw e_9.error; }
|
|
1171
1303
|
return [7 /*endfinally*/];
|
|
1172
1304
|
case 11: return [4 /*yield*/, this.saveAllLinkedProjectsToDB()];
|
|
1173
1305
|
case 12:
|
|
@@ -1178,17 +1310,17 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1178
1310
|
});
|
|
1179
1311
|
};
|
|
1180
1312
|
//#endregion
|
|
1181
|
-
//#region
|
|
1313
|
+
//#region methods & getters / push process
|
|
1182
1314
|
BaseProject.prototype.pushProcess = function (options) {
|
|
1183
1315
|
var _a;
|
|
1184
1316
|
if (options === void 0) { options = {}; }
|
|
1185
1317
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1186
|
-
var force, typeofCommit, forcePushNoQuestion, origin, exitCallBack, args, commitMessageRequired, commitData, error_2, childrenRepos, childrenRepos_2, childrenRepos_2_1, child,
|
|
1187
|
-
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;
|
|
1188
1320
|
return tslib_1.__generator(this, function (_f) {
|
|
1189
1321
|
switch (_f.label) {
|
|
1190
1322
|
case 0:
|
|
1191
|
-
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;
|
|
1192
1324
|
return [4 /*yield*/, this._beforePushProcessAction()];
|
|
1193
1325
|
case 1:
|
|
1194
1326
|
_f.sent();
|
|
@@ -1258,7 +1390,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1258
1390
|
return [4 /*yield*/, this.git.pushCurrentBranch({ force: force, origin: origin, forcePushNoQuestion: forcePushNoQuestion, askToRetry: true })];
|
|
1259
1391
|
case 15:
|
|
1260
1392
|
_f.sent();
|
|
1261
|
-
if (!this.automaticallyAddAllChnagesWhenPushingToGit()) return [3 /*break*/, 23];
|
|
1393
|
+
if (!(this.automaticallyAddAllChnagesWhenPushingToGit() && !skipChildren)) return [3 /*break*/, 23];
|
|
1262
1394
|
if (this.getLinkedProjectsConfig().skipRecrusivePush) {
|
|
1263
1395
|
index_1.Helpers.warn("Skipping recrusive (children) push for ".concat(this.genericName));
|
|
1264
1396
|
return [2 /*return*/];
|
|
@@ -1281,14 +1413,14 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1281
1413
|
return [3 /*break*/, 17];
|
|
1282
1414
|
case 20: return [3 /*break*/, 23];
|
|
1283
1415
|
case 21:
|
|
1284
|
-
|
|
1285
|
-
|
|
1416
|
+
e_10_1 = _f.sent();
|
|
1417
|
+
e_10 = { error: e_10_1 };
|
|
1286
1418
|
return [3 /*break*/, 23];
|
|
1287
1419
|
case 22:
|
|
1288
1420
|
try {
|
|
1289
1421
|
if (childrenRepos_2_1 && !childrenRepos_2_1.done && (_e = childrenRepos_2.return)) _e.call(childrenRepos_2);
|
|
1290
1422
|
}
|
|
1291
|
-
finally { if (
|
|
1423
|
+
finally { if (e_10) throw e_10.error; }
|
|
1292
1424
|
return [7 /*endfinally*/];
|
|
1293
1425
|
case 23: return [4 /*yield*/, this.saveAllLinkedProjectsToDB()];
|
|
1294
1426
|
case 24:
|
|
@@ -1299,7 +1431,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1299
1431
|
});
|
|
1300
1432
|
};
|
|
1301
1433
|
//#endregion
|
|
1302
|
-
//#region
|
|
1434
|
+
//#region methods & getters / before any action on git root
|
|
1303
1435
|
BaseProject.prototype._beforeAnyActionOnGitRoot = function () {
|
|
1304
1436
|
//#region @backendFunc
|
|
1305
1437
|
if (!this.git.isInsideGitRepo) {
|
|
@@ -1406,14 +1538,14 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1406
1538
|
});
|
|
1407
1539
|
};
|
|
1408
1540
|
//#endregion
|
|
1409
|
-
//#region
|
|
1541
|
+
//#region methods & getters / link project to
|
|
1410
1542
|
BaseProject.prototype.linkTo = function (destPackageLocation) {
|
|
1411
1543
|
//#region @backend
|
|
1412
1544
|
index_1.Helpers.createSymLink(this.location, destPackageLocation);
|
|
1413
1545
|
//#endregion
|
|
1414
1546
|
};
|
|
1415
1547
|
//#endregion
|
|
1416
|
-
//#region
|
|
1548
|
+
//#region methods & getters / write file
|
|
1417
1549
|
BaseProject.prototype.writeFile = function (relativePath, content) {
|
|
1418
1550
|
//#region @backend
|
|
1419
1551
|
index_1.Helpers.writeFile([this.location, relativePath], content);
|
|
@@ -1860,13 +1992,13 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
1860
1992
|
* get info about porject
|
|
1861
1993
|
*/
|
|
1862
1994
|
BaseProject.prototype.info = function () {
|
|
1863
|
-
var _a;
|
|
1995
|
+
var _a, _b, _c;
|
|
1864
1996
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1865
1997
|
var proj;
|
|
1866
|
-
return tslib_1.__generator(this, function (
|
|
1998
|
+
return tslib_1.__generator(this, function (_d) {
|
|
1867
1999
|
proj = this;
|
|
1868
|
-
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") +
|
|
1869
|
-
"\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 "));
|
|
1870
2002
|
return [2 /*return*/];
|
|
1871
2003
|
});
|
|
1872
2004
|
});
|
|
@@ -2041,8 +2173,8 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
2041
2173
|
BaseProject.prototype.buildLibraries = function (_a) {
|
|
2042
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;
|
|
2043
2175
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2044
|
-
var libsToWatch, locationsForNodeModules, libs, _loop_1, this_1, _e, _f, _g, index, lib, _loop_2, _h, _j, _k, index, lib,
|
|
2045
|
-
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;
|
|
2046
2178
|
var _this = this;
|
|
2047
2179
|
return tslib_1.__generator(this, function (_o) {
|
|
2048
2180
|
switch (_o.label) {
|
|
@@ -2075,10 +2207,10 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
2075
2207
|
index_1.Helpers.info("Building (".concat(index + 1, "/").concat(libs.length, ") ").concat(lib.basename, " (").concat(tnp_core_3.chalk.bold(lib.name), ")"));
|
|
2076
2208
|
if (strategy === 'link') {
|
|
2077
2209
|
(function () {
|
|
2078
|
-
var
|
|
2210
|
+
var e_13, _a;
|
|
2079
2211
|
var sourceDist = _this.pathFor([tnp_config_1.config.folder.dist, lib.basename]);
|
|
2080
2212
|
try {
|
|
2081
|
-
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()) {
|
|
2082
2214
|
var node_modules = locationsForNodeModules_1_1.value;
|
|
2083
2215
|
var dest = (0, tnp_core_1.crossPlatformPath)([node_modules, lib.name]);
|
|
2084
2216
|
if (!index_1.Helpers.isSymlinkFileExitedOrUnexisted(dest)) {
|
|
@@ -2090,12 +2222,12 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
2090
2222
|
index_1.Helpers.createSymLink(sourceDist, dest, { continueWhenExistedFolderDoesntExists: true });
|
|
2091
2223
|
}
|
|
2092
2224
|
}
|
|
2093
|
-
catch (
|
|
2225
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
2094
2226
|
finally {
|
|
2095
2227
|
try {
|
|
2096
2228
|
if (locationsForNodeModules_1_1 && !locationsForNodeModules_1_1.done && (_a = locationsForNodeModules_1.return)) _a.call(locationsForNodeModules_1);
|
|
2097
2229
|
}
|
|
2098
|
-
finally { if (
|
|
2230
|
+
finally { if (e_13) throw e_13.error; }
|
|
2099
2231
|
}
|
|
2100
2232
|
if (rebuild || !index_1.Helpers.exists(sourceDist)) {
|
|
2101
2233
|
index_1.Helpers.info("Compiling ".concat(lib.name, " ..."));
|
|
@@ -2131,12 +2263,12 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
2131
2263
|
_loop_1(index, lib);
|
|
2132
2264
|
}
|
|
2133
2265
|
}
|
|
2134
|
-
catch (
|
|
2266
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
2135
2267
|
finally {
|
|
2136
2268
|
try {
|
|
2137
2269
|
if (_f && !_f.done && (_l = _e.return)) _l.call(_e);
|
|
2138
2270
|
}
|
|
2139
|
-
finally { if (
|
|
2271
|
+
finally { if (e_12) throw e_12.error; }
|
|
2140
2272
|
}
|
|
2141
2273
|
if (!watch) return [3 /*break*/, 12];
|
|
2142
2274
|
_loop_2 = function (index, lib) {
|
|
@@ -2184,14 +2316,14 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
2184
2316
|
return [3 /*break*/, 5];
|
|
2185
2317
|
case 8: return [3 /*break*/, 11];
|
|
2186
2318
|
case 9:
|
|
2187
|
-
|
|
2188
|
-
|
|
2319
|
+
e_11_1 = _o.sent();
|
|
2320
|
+
e_11 = { error: e_11_1 };
|
|
2189
2321
|
return [3 /*break*/, 11];
|
|
2190
2322
|
case 10:
|
|
2191
2323
|
try {
|
|
2192
2324
|
if (_j && !_j.done && (_m = _h.return)) _m.call(_h);
|
|
2193
2325
|
}
|
|
2194
|
-
finally { if (
|
|
2326
|
+
finally { if (e_11) throw e_11.error; }
|
|
2195
2327
|
return [7 /*endfinally*/];
|
|
2196
2328
|
case 11:
|
|
2197
2329
|
// await this.__indexRebuilder.startAndWatch({ taskName: 'index rebuild watch' });
|
|
@@ -2222,14 +2354,16 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
|
|
|
2222
2354
|
};
|
|
2223
2355
|
//#endregion
|
|
2224
2356
|
//#region getters & methods / start npm task
|
|
2225
|
-
BaseProject.prototype.startNpmTask = function (taskName) {
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
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 });
|
|
2229
2362
|
};
|
|
2230
2363
|
//#region static
|
|
2231
2364
|
//#region static / instance of resovle
|
|
2232
2365
|
BaseProject.ins = new base_project_resolver_1.BaseProjectResolver(BaseProject);
|
|
2366
|
+
BaseProject.cache = {};
|
|
2233
2367
|
return BaseProject;
|
|
2234
2368
|
}());
|
|
2235
2369
|
//# sourceMappingURL=base-project.js.map
|