@git.zone/cli 2.19.4 → 2.19.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.smartconfig.json +4 -4
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.gitzoneconfig.js +1 -1
- package/dist_ts/gitzone.cli.js +2 -2
- package/dist_ts/helpers.changelog.js +14 -6
- package/dist_ts/mod_commit/mod.helpers.js +5 -3
- package/dist_ts/mod_format/classes.diffreporter.js +3 -2
- package/dist_ts/mod_format/formatters/copy.formatter.js +3 -2
- package/dist_ts/mod_format/formatters/packagejson.formatter.js +3 -2
- package/dist_ts/mod_format/formatters/templates.formatter.js +3 -2
- package/dist_ts/mod_format/formatters/tsconfig.formatter.js +3 -2
- package/dist_ts/mod_meta/meta.classes.meta.js +1 -1
- package/dist_ts/mod_open/index.d.ts +1 -1
- package/dist_ts/mod_open/index.js +3 -3
- package/dist_ts/mod_services/classes.dockercontainer.js +5 -3
- package/dist_ts/mod_services/classes.serviceconfiguration.js +1 -1
- package/dist_ts/mod_services/classes.servicemanager.js +10 -7
- package/dist_ts/mod_template/index.d.ts +1 -1
- package/dist_ts/mod_template/index.js +6 -2
- package/dist_ts/mod_tools/classes.packagemanager.d.ts +4 -0
- package/dist_ts/mod_tools/classes.packagemanager.js +183 -5
- package/dist_ts/mod_tools/index.js +23 -14
- package/package.json +11 -11
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.gitzoneconfig.ts +1 -1
- package/ts/gitzone.cli.ts +1 -1
- package/ts/helpers.changelog.ts +22 -8
- package/ts/mod_commit/mod.helpers.ts +4 -2
- package/ts/mod_format/classes.diffreporter.ts +2 -1
- package/ts/mod_format/formatters/copy.formatter.ts +2 -1
- package/ts/mod_format/formatters/packagejson.formatter.ts +2 -1
- package/ts/mod_format/formatters/templates.formatter.ts +2 -1
- package/ts/mod_format/formatters/tsconfig.formatter.ts +2 -1
- package/ts/mod_meta/meta.classes.meta.ts +1 -1
- package/ts/mod_open/index.ts +2 -2
- package/ts/mod_services/classes.dockercontainer.ts +5 -3
- package/ts/mod_services/classes.serviceconfiguration.ts +2 -2
- package/ts/mod_services/classes.servicemanager.ts +9 -6
- package/ts/mod_template/index.ts +5 -1
- package/ts/mod_tools/classes.packagemanager.ts +251 -4
- package/ts/mod_tools/index.ts +31 -13
package/ts/mod_tools/index.ts
CHANGED
|
@@ -88,7 +88,10 @@ async function runUpdate(argvArg: any, mode: ICliMode): Promise<void> {
|
|
|
88
88
|
const installedPackages = await pmUtil.getInstalledPackages();
|
|
89
89
|
const packageInfos = await getPackageUpdateInfos(pmUtil, installedPackages);
|
|
90
90
|
const legacyRoots = await pmUtil.getLegacyGlobalRoots();
|
|
91
|
-
const
|
|
91
|
+
const legacyCleanupRoots = legacyRoots.filter(
|
|
92
|
+
(legacyRoot) => legacyRoot.safeToDelete,
|
|
93
|
+
);
|
|
94
|
+
const legacyCleanupNeeded = legacyCleanupRoots.length > 0;
|
|
92
95
|
|
|
93
96
|
if (packageInfos.length === 0) {
|
|
94
97
|
console.log("No managed @git.zone packages found installed globally.");
|
|
@@ -131,10 +134,10 @@ async function runUpdate(argvArg: any, mode: ICliMode): Promise<void> {
|
|
|
131
134
|
console.log("");
|
|
132
135
|
} else if (legacyCleanupNeeded) {
|
|
133
136
|
console.log(
|
|
134
|
-
`Detected ${
|
|
137
|
+
`Detected ${legacyCleanupRoots.length} legacy pnpm global root(s) for cleanup.`,
|
|
135
138
|
);
|
|
136
139
|
if (verbose) {
|
|
137
|
-
for (const legacyRoot of
|
|
140
|
+
for (const legacyRoot of legacyCleanupRoots) {
|
|
138
141
|
console.log(` ${legacyRoot.globalDir}`);
|
|
139
142
|
}
|
|
140
143
|
}
|
|
@@ -180,11 +183,12 @@ async function runUpdate(argvArg: any, mode: ICliMode): Promise<void> {
|
|
|
180
183
|
return;
|
|
181
184
|
}
|
|
182
185
|
|
|
186
|
+
let pnpmUpdated = false;
|
|
183
187
|
if (pnpmNeedsUpdate && pnpmInfo.latestVersion) {
|
|
184
188
|
console.log(`Updating pnpm to ${pnpmInfo.latestVersion}...`);
|
|
185
|
-
|
|
189
|
+
pnpmUpdated = await pmUtil.updatePnpm(pnpmInfo.latestVersion);
|
|
186
190
|
console.log(
|
|
187
|
-
|
|
191
|
+
pnpmUpdated
|
|
188
192
|
? "pnpm updated successfully.\n"
|
|
189
193
|
: "pnpm update failed. Continuing with package updates.\n",
|
|
190
194
|
);
|
|
@@ -205,8 +209,11 @@ async function runUpdate(argvArg: any, mode: ICliMode): Promise<void> {
|
|
|
205
209
|
)
|
|
206
210
|
: { successCount: 0, failCount: 0 };
|
|
207
211
|
|
|
208
|
-
if (packagesToUpdate.length > 0 || legacyCleanupNeeded) {
|
|
212
|
+
if (packagesToUpdate.length > 0 || legacyCleanupNeeded || pnpmUpdated) {
|
|
209
213
|
await syncCurrentGlobalShims(pmUtil);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (packagesToUpdate.length > 0 || legacyCleanupNeeded) {
|
|
210
217
|
await cleanupLegacyInstalls(pmUtil);
|
|
211
218
|
}
|
|
212
219
|
}
|
|
@@ -256,7 +263,7 @@ async function runInstall(argvArg: any, mode: ICliMode): Promise<void> {
|
|
|
256
263
|
if (!mode.yes) {
|
|
257
264
|
const choicesWithVersions: Array<{ name: string; value: string }> = [];
|
|
258
265
|
for (const packageName of missingPackages) {
|
|
259
|
-
const latest = await pmUtil.
|
|
266
|
+
const latest = await pmUtil.getLatestMatureVersion(packageName);
|
|
260
267
|
choicesWithVersions.push({
|
|
261
268
|
name: `${packageName}${latest ? `@${latest}` : ""}`,
|
|
262
269
|
value: packageName,
|
|
@@ -288,7 +295,7 @@ async function handleSelfUpdate(
|
|
|
288
295
|
): Promise<boolean> {
|
|
289
296
|
console.log("Checking for gitzone self-update...\n");
|
|
290
297
|
const currentVersion = commitinfo.version;
|
|
291
|
-
const latestVersion = await pmUtil.
|
|
298
|
+
const latestVersion = await pmUtil.getLatestMatureVersion("@git.zone/cli");
|
|
292
299
|
|
|
293
300
|
if (!latestVersion || !pmUtil.isNewerVersion(currentVersion, latestVersion)) {
|
|
294
301
|
console.log(` @git.zone/cli ${currentVersion} Up to date\n`);
|
|
@@ -321,7 +328,7 @@ async function handleSelfUpdate(
|
|
|
321
328
|
return false;
|
|
322
329
|
}
|
|
323
330
|
|
|
324
|
-
const success = await pmUtil.installLatest("@git.zone/cli");
|
|
331
|
+
const success = await pmUtil.installLatest("@git.zone/cli", latestVersion);
|
|
325
332
|
if (!success) {
|
|
326
333
|
console.log(
|
|
327
334
|
"\ngitzone self-update failed. Continuing with the current version.\n",
|
|
@@ -329,8 +336,10 @@ async function handleSelfUpdate(
|
|
|
329
336
|
return false;
|
|
330
337
|
}
|
|
331
338
|
|
|
339
|
+
await syncCurrentGlobalShims(pmUtil);
|
|
340
|
+
await cleanupLegacyInstalls(pmUtil);
|
|
332
341
|
console.log(
|
|
333
|
-
"\ngitzone has been updated. Re-run gitzone tools update to check remaining packages.",
|
|
342
|
+
"\ngitzone has been updated and command shims have been refreshed. Re-run gitzone tools update to check remaining packages.",
|
|
334
343
|
);
|
|
335
344
|
return true;
|
|
336
345
|
}
|
|
@@ -344,7 +353,9 @@ async function getPackageUpdateInfos(
|
|
|
344
353
|
if (!GITZONE_PACKAGES.includes(installedPackage.name)) {
|
|
345
354
|
continue;
|
|
346
355
|
}
|
|
347
|
-
const latestVersion = await pmUtil.
|
|
356
|
+
const latestVersion = await pmUtil.getLatestMatureVersion(
|
|
357
|
+
installedPackage.name,
|
|
358
|
+
);
|
|
348
359
|
packageInfos.push({
|
|
349
360
|
name: installedPackage.name,
|
|
350
361
|
currentVersion: installedPackage.version,
|
|
@@ -401,7 +412,7 @@ async function printPackageListWithLatest(
|
|
|
401
412
|
console.log(" Package Latest");
|
|
402
413
|
console.log(" ----------------------------------------");
|
|
403
414
|
for (const packageName of packageNames) {
|
|
404
|
-
const latest = await pmUtil.
|
|
415
|
+
const latest = await pmUtil.getLatestMatureVersion(packageName);
|
|
405
416
|
console.log(` ${packageName.padEnd(28)} ${latest || "unknown"}`);
|
|
406
417
|
}
|
|
407
418
|
console.log("");
|
|
@@ -420,7 +431,14 @@ async function installPackages(
|
|
|
420
431
|
typeof packageSpec === "string" ? packageSpec : packageSpec.name;
|
|
421
432
|
const packageVersion =
|
|
422
433
|
typeof packageSpec === "string" ? undefined : packageSpec.version;
|
|
423
|
-
const
|
|
434
|
+
const effectivePackageVersion =
|
|
435
|
+
packageVersion ||
|
|
436
|
+
(await pmUtil.getLatestMatureVersion(packageName)) ||
|
|
437
|
+
undefined;
|
|
438
|
+
const success = await pmUtil.installLatest(
|
|
439
|
+
packageName,
|
|
440
|
+
effectivePackageVersion,
|
|
441
|
+
);
|
|
424
442
|
if (success) {
|
|
425
443
|
console.log(` ${packageName} ${action} successfully`);
|
|
426
444
|
successCount++;
|