mano-coding 0.1.34 → 0.1.35
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/dist/bin.js +42 -11
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -46435,6 +46435,7 @@ async function buildLock(_operation, templateResolution, addonResolutions, proje
|
|
|
46435
46435
|
}
|
|
46436
46436
|
const desiredPackages = [];
|
|
46437
46437
|
const resolvedPackages = [];
|
|
46438
|
+
const currentPackageIds = new Set(allResolutions.map((r) => r.packageId));
|
|
46438
46439
|
for (const res of allResolutions) {
|
|
46439
46440
|
const packageRoot = service?.getPackageRoot(res) ?? process.cwd();
|
|
46440
46441
|
const contentDigest = await computePackageDigest(packageRoot);
|
|
@@ -46457,6 +46458,20 @@ async function buildLock(_operation, templateResolution, addonResolutions, proje
|
|
|
46457
46458
|
...res.integrity ? { integrity: res.integrity } : {}
|
|
46458
46459
|
});
|
|
46459
46460
|
}
|
|
46461
|
+
if (existingLock) {
|
|
46462
|
+
const existingDesired = existingLock.desired?.packages ?? [];
|
|
46463
|
+
const existingResolved = existingLock.resolved?.packages ?? [];
|
|
46464
|
+
for (const ep of existingDesired) {
|
|
46465
|
+
if (!currentPackageIds.has(ep.id)) {
|
|
46466
|
+
desiredPackages.push(ep);
|
|
46467
|
+
}
|
|
46468
|
+
}
|
|
46469
|
+
for (const ep of existingResolved) {
|
|
46470
|
+
if (!currentPackageIds.has(ep.id)) {
|
|
46471
|
+
resolvedPackages.push(ep);
|
|
46472
|
+
}
|
|
46473
|
+
}
|
|
46474
|
+
}
|
|
46460
46475
|
const resources = /* @__PURE__ */ new Map();
|
|
46461
46476
|
if (existingLock?.resources) {
|
|
46462
46477
|
for (const res of existingLock.resources) {
|
|
@@ -46537,6 +46552,15 @@ async function buildLock(_operation, templateResolution, addonResolutions, proje
|
|
|
46537
46552
|
});
|
|
46538
46553
|
}
|
|
46539
46554
|
}
|
|
46555
|
+
const mergedTargets = [...targetStrings];
|
|
46556
|
+
if (existingLock?.desired?.targets) {
|
|
46557
|
+
for (const t2 of existingLock.desired.targets) {
|
|
46558
|
+
const tid = typeof t2 === "string" ? t2 : t2.id;
|
|
46559
|
+
if (!mergedTargets.includes(tid)) {
|
|
46560
|
+
mergedTargets.push(tid);
|
|
46561
|
+
}
|
|
46562
|
+
}
|
|
46563
|
+
}
|
|
46540
46564
|
return {
|
|
46541
46565
|
apiVersion: "mano-coding/v1",
|
|
46542
46566
|
kind: "ProjectLock",
|
|
@@ -46546,7 +46570,7 @@ async function buildLock(_operation, templateResolution, addonResolutions, proje
|
|
|
46546
46570
|
},
|
|
46547
46571
|
desired: {
|
|
46548
46572
|
packages: desiredPackages,
|
|
46549
|
-
targets:
|
|
46573
|
+
targets: mergedTargets
|
|
46550
46574
|
},
|
|
46551
46575
|
resolved: {
|
|
46552
46576
|
packages: resolvedPackages
|
|
@@ -46917,24 +46941,29 @@ async function confirmPlanInteractive(opts) {
|
|
|
46917
46941
|
`);
|
|
46918
46942
|
}
|
|
46919
46943
|
}
|
|
46920
|
-
process.stderr.write(
|
|
46921
|
-
|
|
46922
|
-
|
|
46923
|
-
|
|
46944
|
+
process.stderr.write(t("tty.confirmPrompt"));
|
|
46945
|
+
const confirmed = await readConfirm({
|
|
46946
|
+
input: opts.input,
|
|
46947
|
+
output: opts.interactiveOutput
|
|
46948
|
+
});
|
|
46924
46949
|
if (!confirmed) {
|
|
46925
46950
|
return { confirmed: false, granted: [], denied: toConfirm };
|
|
46926
46951
|
}
|
|
46927
46952
|
return { confirmed: true, granted: requested, denied: [] };
|
|
46928
46953
|
}
|
|
46929
|
-
async function readConfirm() {
|
|
46954
|
+
async function readConfirm(streams) {
|
|
46930
46955
|
try {
|
|
46931
46956
|
return await dist_default5(
|
|
46932
46957
|
{
|
|
46933
46958
|
message: t("tty.proceedPrompt"),
|
|
46934
|
-
default:
|
|
46959
|
+
default: true
|
|
46935
46960
|
},
|
|
46936
46961
|
// 1 分钟无响应超时视为拒绝
|
|
46937
|
-
{
|
|
46962
|
+
{
|
|
46963
|
+
signal: AbortSignal.timeout(6e4),
|
|
46964
|
+
...streams?.input ? { input: streams.input } : {},
|
|
46965
|
+
...streams?.output ? { output: streams.output } : {}
|
|
46966
|
+
}
|
|
46938
46967
|
);
|
|
46939
46968
|
} catch {
|
|
46940
46969
|
return false;
|
|
@@ -47186,7 +47215,9 @@ async function executeCreate(packageSpecs, directory, options, cliVersion, event
|
|
|
47186
47215
|
await recoverIncompleteJournals(service, output);
|
|
47187
47216
|
let cliTargets = options.target;
|
|
47188
47217
|
if (cliTargets.length === 0) {
|
|
47189
|
-
if (
|
|
47218
|
+
if (existingLock?.desired?.targets && existingLock.desired.targets.length > 0) {
|
|
47219
|
+
cliTargets = existingLock.desired.targets.map((t2) => typeof t2 === "string" ? t2 : t2.id);
|
|
47220
|
+
} else if (isInteractive) {
|
|
47190
47221
|
try {
|
|
47191
47222
|
const selected = await selectSearchableMulti({
|
|
47192
47223
|
message: t("create.chooseTargets"),
|
|
@@ -47441,7 +47472,7 @@ async function executeCreate(packageSpecs, directory, options, cliVersion, event
|
|
|
47441
47472
|
);
|
|
47442
47473
|
if (!output.json && userInstallationKeys.size > 0) writeHumanOutput(t("create.userToolsInstalled", formatElapsed(userInstallationStartedAt)));
|
|
47443
47474
|
addRollback(userLifecycle.rollback);
|
|
47444
|
-
const lock = await buildLock("create", templateResolution, addonResolutions, projectTargets, planResult.plan, service.cliVersion, inputValues, service, intents, userInstallationKeys);
|
|
47475
|
+
const lock = await buildLock("create", templateResolution, addonResolutions, projectTargets, planResult.plan, service.cliVersion, inputValues, service, intents, userInstallationKeys, void 0, existingLock);
|
|
47445
47476
|
await lockRepo.write(lock);
|
|
47446
47477
|
addRollback(async () => previousLock ? lockRepo.write(previousLock) : unlink9(lockRepo.path).catch(() => void 0));
|
|
47447
47478
|
await userLifecycle.addReferences(lock);
|
|
@@ -50913,7 +50944,7 @@ import { createRequire as createRequire2 } from "node:module";
|
|
|
50913
50944
|
import { readFileSync as readFileSync4 } from "node:fs";
|
|
50914
50945
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
50915
50946
|
function resolveVersion() {
|
|
50916
|
-
if (true) return "0.1.
|
|
50947
|
+
if (true) return "0.1.35";
|
|
50917
50948
|
const candidates = [
|
|
50918
50949
|
new URL("../package.json", import.meta.url),
|
|
50919
50950
|
new URL("../../package.json", import.meta.url),
|