@unbrained/pm-cli 2026.5.18 → 2026.5.24
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/CHANGELOG.md +60 -0
- package/README.md +2 -1
- package/dist/cli/commander-usage.js +16 -2
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/annotation-command.d.ts +49 -0
- package/dist/cli/commands/annotation-command.js +135 -0
- package/dist/cli/commands/annotation-command.js.map +1 -0
- package/dist/cli/commands/append.js +3 -7
- package/dist/cli/commands/append.js.map +1 -1
- package/dist/cli/commands/calendar.js +3 -6
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/claim.js +12 -22
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.js +61 -9
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments.d.ts +5 -0
- package/dist/cli/commands/comments.js +27 -117
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.js +102 -15
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/context.js +4 -10
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.js +168 -36
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +49 -44
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.js +7 -4
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/delete.d.ts +3 -0
- package/dist/cli/commands/delete.js +9 -8
- package/dist/cli/commands/delete.js.map +1 -1
- package/dist/cli/commands/docs.d.ts +1 -0
- package/dist/cli/commands/docs.js +4 -8
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/event-validation-messages.d.ts +3 -0
- package/dist/cli/commands/event-validation-messages.js +44 -0
- package/dist/cli/commands/event-validation-messages.js.map +1 -0
- package/dist/cli/commands/extension.d.ts +1 -0
- package/dist/cli/commands/extension.js +138 -21
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.js +6 -13
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/gc.js +17 -4
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +3 -2
- package/dist/cli/commands/get.js +50 -8
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.d.ts +10 -0
- package/dist/cli/commands/health.js +254 -75
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-redact.d.ts +8 -0
- package/dist/cli/commands/history-redact.js +14 -97
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.d.ts +33 -0
- package/dist/cli/commands/history-repair.js +166 -0
- package/dist/cli/commands/history-repair.js.map +1 -0
- package/dist/cli/commands/history.d.ts +4 -4
- package/dist/cli/commands/history.js +10 -88
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +3 -1
- package/dist/cli/commands/index.js +5 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +28 -0
- package/dist/cli/commands/init.js +23 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.js +20 -119
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/linked-test-entry.d.ts +3 -0
- package/dist/cli/commands/linked-test-entry.js +62 -0
- package/dist/cli/commands/linked-test-entry.js.map +1 -0
- package/dist/cli/commands/list.js +32 -22
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/notes.js +20 -119
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +3 -0
- package/dist/cli/commands/plan.js +184 -22
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/restore.js +7 -50
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +31 -0
- package/dist/cli/commands/schema.js +98 -0
- package/dist/cli/commands/schema.js.map +1 -0
- package/dist/cli/commands/search.js +151 -40
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/templates.d.ts +4 -0
- package/dist/cli/commands/templates.js +89 -17
- package/dist/cli/commands/templates.js.map +1 -1
- package/dist/cli/commands/test-all.js +4 -8
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test.d.ts +1 -0
- package/dist/cli/commands/test.js +7 -10
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +4 -8
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.js +109 -51
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +3 -1
- package/dist/cli/commands/validate.js +23 -71
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +96 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +0 -1
- package/dist/cli/extension-command-help.js +2 -13
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/extension-command-options.d.ts +1 -0
- package/dist/cli/extension-command-options.js +106 -7
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.d.ts +0 -1
- package/dist/cli/help-content.js +13 -9
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.d.ts +1 -0
- package/dist/cli/help-json-payload.js +33 -3
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.js +35 -29
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +1 -1
- package/dist/cli/register-list-query.js +40 -17
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.d.ts +1 -1
- package/dist/cli/register-mutation.js +232 -64
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +16 -11
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +26 -14
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +0 -2
- package/dist/cli/registration-helpers.js +13 -40
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli.js +23 -3
- package/dist/cli.js.map +1 -1
- package/dist/core/extensions/index.d.ts +0 -1
- package/dist/core/extensions/index.js +2 -14
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.js +3 -9
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/fs/path-utils.d.ts +1 -0
- package/dist/core/fs/path-utils.js +12 -0
- package/dist/core/fs/path-utils.js.map +1 -0
- package/dist/core/history/drift-scan.d.ts +11 -0
- package/dist/core/history/drift-scan.js +67 -0
- package/dist/core/history/drift-scan.js.map +1 -0
- package/dist/core/history/replay.d.ts +82 -0
- package/dist/core/history/replay.js +249 -0
- package/dist/core/history/replay.js.map +1 -0
- package/dist/core/item/item-format.js +11 -8
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/item-type-definition.d.ts +52 -0
- package/dist/core/item/item-type-definition.js +123 -0
- package/dist/core/item/item-type-definition.js.map +1 -0
- package/dist/core/item/parse.js +3 -2
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/item/priority.d.ts +23 -0
- package/dist/core/item/priority.js +55 -0
- package/dist/core/item/priority.js.map +1 -0
- package/dist/core/item/status.d.ts +14 -1
- package/dist/core/item/status.js +22 -2
- package/dist/core/item/status.js.map +1 -1
- package/dist/core/item/toon-decode.d.ts +19 -0
- package/dist/core/item/toon-decode.js +69 -0
- package/dist/core/item/toon-decode.js.map +1 -0
- package/dist/core/item/type-registry.js +13 -84
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/packages/manifest.js +3 -9
- package/dist/core/packages/manifest.js.map +1 -1
- package/dist/core/schema/item-types-file.d.ts +85 -0
- package/dist/core/schema/item-types-file.js +243 -0
- package/dist/core/schema/item-types-file.js.map +1 -0
- package/dist/core/schema/runtime-schema.d.ts +2 -1
- package/dist/core/schema/runtime-schema.js +11 -9
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/semantic-defaults.js +3 -3
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/shared/author.d.ts +1 -0
- package/dist/core/shared/author.js +9 -0
- package/dist/core/shared/author.js.map +1 -0
- package/dist/core/shared/lazy-module.d.ts +1 -0
- package/dist/core/shared/lazy-module.js +11 -0
- package/dist/core/shared/lazy-module.js.map +1 -0
- package/dist/core/shared/option-alias-visibility.d.ts +44 -0
- package/dist/core/shared/option-alias-visibility.js +76 -0
- package/dist/core/shared/option-alias-visibility.js.map +1 -0
- package/dist/core/shared/text-normalization.d.ts +0 -1
- package/dist/core/shared/text-normalization.js +2 -5
- package/dist/core/shared/text-normalization.js.map +1 -1
- package/dist/core/store/item-store.d.ts +2 -0
- package/dist/core/store/item-store.js +70 -39
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +106 -0
- package/dist/core/store/settings-validator.js +279 -0
- package/dist/core/store/settings-validator.js.map +1 -0
- package/dist/core/store/settings.js +6 -343
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/runtime.js +5 -3
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.js +64 -13
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +9 -2
- package/dist/sdk/cli-contracts.js +204 -13
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/runtime.d.ts +25 -1
- package/dist/sdk/runtime.js +46 -3
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.js +10 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +7 -1
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/COMMANDS.md +39 -6
- package/docs/CONFIGURATION.md +1 -1
- package/docs/RELEASING.md +11 -7
- package/docs/SDK.md +11 -2
- package/package.json +12 -11
- package/packages/pm-calendar/README.md +3 -1
- package/packages/pm-calendar/extensions/calendar/index.js +21 -2
- package/packages/pm-calendar/extensions/calendar/index.ts +21 -2
- package/packages/pm-search-advanced/README.md +8 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +74 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +74 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +67 -9
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +67 -9
- package/packages/pm-templates/extensions/templates/runtime.js +11 -202
- package/packages/pm-templates/extensions/templates/runtime.ts +38 -230
- package/dist/core/output/command-aware.d.ts +0 -1
- package/dist/core/output/command-aware.js +0 -397
- package/dist/core/output/command-aware.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="69ff4814-0641-5d85-962e-a798cfd1a78e")}catch(e){}}();
|
|
3
3
|
import { execFile } from "node:child_process";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
5
|
import os from "node:os";
|
|
@@ -9,6 +9,7 @@ import { promisify } from "node:util";
|
|
|
9
9
|
import { activateExtensions, loadExtensions, nextExtensionReloadToken } from "../../core/extensions/index.js";
|
|
10
10
|
import { EXTENSION_CAPABILITY_CONTRACT, KNOWN_EXTENSION_CAPABILITIES, parseLegacyExtensionCapabilityAliasWarning, parseUnknownExtensionCapabilityWarning, resolveExtensionRoots, } from "../../core/extensions/loader.js";
|
|
11
11
|
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
12
|
+
import { isPathWithinDirectory } from "../../core/fs/path-utils.js";
|
|
12
13
|
import { PM_PACKAGE_RESOURCE_KINDS, collectPackageExtensionDirectories, readPmPackageManifest, } from "../../core/packages/manifest.js";
|
|
13
14
|
import { resolvePmPackageRootFromModule } from "../../core/packages/root.js";
|
|
14
15
|
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
@@ -255,13 +256,6 @@ function parseExtensionManifest(raw) {
|
|
|
255
256
|
capabilities,
|
|
256
257
|
};
|
|
257
258
|
}
|
|
258
|
-
function isPathWithinDirectory(directory, targetPath) {
|
|
259
|
-
const relative = path.relative(directory, targetPath);
|
|
260
|
-
if (relative.length === 0) {
|
|
261
|
-
return true;
|
|
262
|
-
}
|
|
263
|
-
return !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
264
|
-
}
|
|
265
259
|
async function isCanonicalPathWithinDirectory(directory, targetPath) {
|
|
266
260
|
const [resolvedDirectory, resolvedTargetPath] = await Promise.all([fs.realpath(directory), fs.realpath(targetPath)]);
|
|
267
261
|
return isPathWithinDirectory(resolvedDirectory, resolvedTargetPath);
|
|
@@ -322,6 +316,21 @@ function sortManagedEntries(entries) {
|
|
|
322
316
|
return left.directory.localeCompare(right.directory);
|
|
323
317
|
});
|
|
324
318
|
}
|
|
319
|
+
function managedExtensionSourcesEquivalent(left, right) {
|
|
320
|
+
if (left.kind !== right.kind || left.input !== right.input || left.location !== right.location) {
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
if (left.kind === "npm" && right.kind === "npm") {
|
|
324
|
+
return left.package === right.package && left.version === right.version;
|
|
325
|
+
}
|
|
326
|
+
if (left.kind === "github" && right.kind === "github") {
|
|
327
|
+
return left.repository === right.repository && left.ref === right.ref && left.subpath === right.subpath && left.commit === right.commit;
|
|
328
|
+
}
|
|
329
|
+
if (left.kind === "builtin" && right.kind === "builtin") {
|
|
330
|
+
return left.name === right.name;
|
|
331
|
+
}
|
|
332
|
+
return true;
|
|
333
|
+
}
|
|
325
334
|
function normalizeManagedState(raw) {
|
|
326
335
|
if (typeof raw !== "object" || raw === null) {
|
|
327
336
|
return null;
|
|
@@ -587,7 +596,7 @@ function resolveScope(options) {
|
|
|
587
596
|
}
|
|
588
597
|
return global ? "global" : "project";
|
|
589
598
|
}
|
|
590
|
-
async function buildBundledPackageCatalog(scope, global) {
|
|
599
|
+
async function buildBundledPackageCatalog(scope, global, options = {}) {
|
|
591
600
|
const roots = resolveExtensionRoots(resolvePmRoot(process.cwd(), global.path), process.cwd());
|
|
592
601
|
const selectedRoot = scope === "global" ? roots.global : roots.project;
|
|
593
602
|
const managedStateRead = await readManagedExtensionState(selectedRoot);
|
|
@@ -634,7 +643,6 @@ async function buildBundledPackageCatalog(scope, global) {
|
|
|
634
643
|
installed: installedBuiltinAliases.has(alias) || installedLocations.has(path.resolve(packageRoot)),
|
|
635
644
|
install_target: alias,
|
|
636
645
|
install_command: `pm install ${alias} ${installScopeFlag}`,
|
|
637
|
-
package_root: packageRoot,
|
|
638
646
|
package_name: manifest.package_name,
|
|
639
647
|
package_version: manifest.package_version,
|
|
640
648
|
description: manifest.catalog?.summary ?? manifest.package_description,
|
|
@@ -658,14 +666,68 @@ async function buildBundledPackageCatalog(scope, global) {
|
|
|
658
666
|
},
|
|
659
667
|
});
|
|
660
668
|
}
|
|
669
|
+
const fields = parsePackageCatalogFields(options.fields);
|
|
670
|
+
const outputPackages = fields ? packages.map((entry) => projectPackageCatalogEntry(entry, fields)) : packages;
|
|
661
671
|
return {
|
|
662
|
-
total:
|
|
672
|
+
total: outputPackages.length,
|
|
663
673
|
scope,
|
|
664
674
|
installable_resource_kinds: ["extensions"],
|
|
665
675
|
metadata_only_resource_kinds: PM_PACKAGE_RESOURCE_KINDS.filter((resourceKind) => resourceKind !== "extensions"),
|
|
666
|
-
packages,
|
|
676
|
+
packages: outputPackages,
|
|
667
677
|
};
|
|
668
678
|
}
|
|
679
|
+
const PACKAGE_CATALOG_FIELD_KEYS = new Set([
|
|
680
|
+
"alias",
|
|
681
|
+
"bundled",
|
|
682
|
+
"available",
|
|
683
|
+
"installed",
|
|
684
|
+
"install_target",
|
|
685
|
+
"install_command",
|
|
686
|
+
"package_name",
|
|
687
|
+
"package_version",
|
|
688
|
+
"description",
|
|
689
|
+
"keywords",
|
|
690
|
+
"resources",
|
|
691
|
+
"installable_resources",
|
|
692
|
+
"metadata_only_resources",
|
|
693
|
+
"catalog",
|
|
694
|
+
"category",
|
|
695
|
+
"display_name",
|
|
696
|
+
]);
|
|
697
|
+
function parsePackageCatalogFields(raw) {
|
|
698
|
+
if (raw === undefined) {
|
|
699
|
+
return undefined;
|
|
700
|
+
}
|
|
701
|
+
const fields = [...new Set(raw.split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0))];
|
|
702
|
+
if (fields.length === 0) {
|
|
703
|
+
throw new PmCliError("Package catalog --fields requires a comma-separated list of field names", EXIT_CODE.USAGE);
|
|
704
|
+
}
|
|
705
|
+
const unknown = fields.filter((field) => !PACKAGE_CATALOG_FIELD_KEYS.has(field));
|
|
706
|
+
if (unknown.length > 0) {
|
|
707
|
+
throw new PmCliError(`Unknown package catalog --fields value(s): ${unknown.join(", ")}`, EXIT_CODE.USAGE, {
|
|
708
|
+
examples: [
|
|
709
|
+
"pm package list --project --fields alias,installed,install_command",
|
|
710
|
+
"pm package catalog --project --fields alias,package_name,category",
|
|
711
|
+
],
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
return fields;
|
|
715
|
+
}
|
|
716
|
+
function projectPackageCatalogEntry(entry, fields) {
|
|
717
|
+
const projected = {};
|
|
718
|
+
for (const field of fields) {
|
|
719
|
+
if (field === "category") {
|
|
720
|
+
projected[field] = entry.catalog?.category ?? null;
|
|
721
|
+
}
|
|
722
|
+
else if (field === "display_name") {
|
|
723
|
+
projected[field] = entry.catalog?.display_name ?? null;
|
|
724
|
+
}
|
|
725
|
+
else {
|
|
726
|
+
projected[field] = entry[field] ?? null;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
return projected;
|
|
730
|
+
}
|
|
669
731
|
function parseGithubPathSpec(pathSpec, input, refOverride) {
|
|
670
732
|
const segments = pathSpec
|
|
671
733
|
.split("/")
|
|
@@ -866,6 +928,7 @@ async function resolveNpmSourceDirectory(source) {
|
|
|
866
928
|
const packed = parsePackedNpmPackage(packStdout, packDirectory);
|
|
867
929
|
await execFileAsync("tar", ["-xzf", packed.tarball, "-C", extractDirectory], { encoding: "utf8" });
|
|
868
930
|
const packageRoot = path.join(extractDirectory, "package");
|
|
931
|
+
await installNpmPackageRuntimeDependencies(packageRoot);
|
|
869
932
|
const directory = await resolvePackageExtensionDirectory(packageRoot, source.input);
|
|
870
933
|
return {
|
|
871
934
|
directory,
|
|
@@ -881,6 +944,50 @@ async function resolveNpmSourceDirectory(source) {
|
|
|
881
944
|
throw error;
|
|
882
945
|
}
|
|
883
946
|
}
|
|
947
|
+
async function installNpmPackageRuntimeDependencies(packageRoot) {
|
|
948
|
+
const packageJsonPath = path.join(packageRoot, "package.json");
|
|
949
|
+
if (!(await pathExists(packageJsonPath))) {
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
952
|
+
let parsed;
|
|
953
|
+
try {
|
|
954
|
+
parsed = JSON.parse(await fs.readFile(packageJsonPath, "utf8"));
|
|
955
|
+
}
|
|
956
|
+
catch {
|
|
957
|
+
return;
|
|
958
|
+
}
|
|
959
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
const manifest = parsed;
|
|
963
|
+
const dependencySpecs = runtimeDependencyInstallSpecs(manifest);
|
|
964
|
+
if (dependencySpecs.length === 0) {
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
const runtimeOnlyManifest = { ...parsed };
|
|
968
|
+
delete runtimeOnlyManifest.devDependencies;
|
|
969
|
+
await fs.writeFile(packageJsonPath, `${JSON.stringify(runtimeOnlyManifest, null, 2)}\n`, "utf8");
|
|
970
|
+
await Promise.all([
|
|
971
|
+
fs.rm(path.join(packageRoot, "package-lock.json"), { force: true }),
|
|
972
|
+
fs.rm(path.join(packageRoot, "npm-shrinkwrap.json"), { force: true }),
|
|
973
|
+
]);
|
|
974
|
+
await runNpmCommand(["install", "--ignore-scripts", "--no-audit", "--fund=false", "--package-lock=false", "--no-save", ...dependencySpecs], packageRoot);
|
|
975
|
+
}
|
|
976
|
+
function runtimeDependencyInstallSpecs(manifest) {
|
|
977
|
+
const specs = new Map();
|
|
978
|
+
for (const dependencyMap of [manifest.dependencies, manifest.optionalDependencies, manifest.peerDependencies]) {
|
|
979
|
+
if (typeof dependencyMap !== "object" || dependencyMap === null) {
|
|
980
|
+
continue;
|
|
981
|
+
}
|
|
982
|
+
for (const [name, version] of Object.entries(dependencyMap)) {
|
|
983
|
+
if (typeof version !== "string" || version.trim().length === 0 || specs.has(name)) {
|
|
984
|
+
continue;
|
|
985
|
+
}
|
|
986
|
+
specs.set(name, `${name}@${version.trim()}`);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
return [...specs.values()];
|
|
990
|
+
}
|
|
884
991
|
async function resolvePackageExtensionDirectory(packageRoot, sourceLabel) {
|
|
885
992
|
const discovered = await collectPackageExtensionDirectories(packageRoot);
|
|
886
993
|
if (discovered.length === 1) {
|
|
@@ -1770,12 +1877,19 @@ export async function runExtension(target, options, global) {
|
|
|
1770
1877
|
ok: true,
|
|
1771
1878
|
action,
|
|
1772
1879
|
scope,
|
|
1773
|
-
roots:
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1880
|
+
roots: action === "catalog" && typeof options.fields === "string" && options.fields.trim().length > 0
|
|
1881
|
+
? {
|
|
1882
|
+
project: "project",
|
|
1883
|
+
global: "global",
|
|
1884
|
+
selected: scope,
|
|
1885
|
+
settings_root: "project",
|
|
1886
|
+
}
|
|
1887
|
+
: {
|
|
1888
|
+
project: resolvedRoots.roots.project,
|
|
1889
|
+
global: resolvedRoots.roots.global,
|
|
1890
|
+
selected: resolvedRoots.selected_root,
|
|
1891
|
+
settings_root: resolvedRoots.settings_root,
|
|
1892
|
+
},
|
|
1779
1893
|
warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
|
|
1780
1894
|
details,
|
|
1781
1895
|
});
|
|
@@ -1855,7 +1969,7 @@ export async function runExtension(target, options, global) {
|
|
|
1855
1969
|
if (typeof normalizedTarget === "string" && normalizedTarget.length > 0 && normalizedTarget !== "catalog") {
|
|
1856
1970
|
throw new PmCliError('Action "catalog" does not accept a package target.', EXIT_CODE.USAGE);
|
|
1857
1971
|
}
|
|
1858
|
-
return withResult(await buildBundledPackageCatalog(scope, global));
|
|
1972
|
+
return withResult(await buildBundledPackageCatalog(scope, global, options));
|
|
1859
1973
|
}
|
|
1860
1974
|
if (action === "install") {
|
|
1861
1975
|
const githubOption = resolveGithubOption(options);
|
|
@@ -1948,6 +2062,9 @@ export async function runExtension(target, options, global) {
|
|
|
1948
2062
|
};
|
|
1949
2063
|
const now = nowIso();
|
|
1950
2064
|
const existingManagedEntry = managedStateRead.state.entries.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name));
|
|
2065
|
+
const sourceUnchanged = existingManagedEntry !== undefined &&
|
|
2066
|
+
existingManagedEntry.manifest_version === validated.manifest.version &&
|
|
2067
|
+
managedExtensionSourcesEquivalent(existingManagedEntry.source, sourceRecord);
|
|
1951
2068
|
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
1952
2069
|
name: validated.manifest.name,
|
|
1953
2070
|
directory: destinationDirectoryName,
|
|
@@ -1956,7 +2073,7 @@ export async function runExtension(target, options, global) {
|
|
|
1956
2073
|
manifest_entry: validated.manifest.entry,
|
|
1957
2074
|
capabilities: [...validated.manifest.capabilities],
|
|
1958
2075
|
installed_at: existingManagedEntry?.installed_at ?? now,
|
|
1959
|
-
updated_at: now,
|
|
2076
|
+
updated_at: sourceUnchanged ? existingManagedEntry.updated_at : now,
|
|
1960
2077
|
source: sourceRecord,
|
|
1961
2078
|
});
|
|
1962
2079
|
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
@@ -2495,4 +2612,4 @@ export async function runExtension(target, options, global) {
|
|
|
2495
2612
|
throw new PmCliError(`Unsupported extension action "${action}".`, EXIT_CODE.USAGE);
|
|
2496
2613
|
}
|
|
2497
2614
|
//# sourceMappingURL=extension.js.map
|
|
2498
|
-
//# debugId=
|
|
2615
|
+
//# debugId=69ff4814-0641-5d85-962e-a798cfd1a78e
|