@octonodes/cli 0.2.9 → 0.2.11
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/apps/source.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/apps/source.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAU7D;AACD,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,GAAE,MAAM,EAAO
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/apps/source.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAU7D;AACD,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,GAAE,MAAM,EAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBnE;AACD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CA6CrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/plugins/publish.ts"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/plugins/publish.ts"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBhD;AAED,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC,CAiClB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octonodes/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "Octonode API and plugin development CLI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"prepack": "tsc -b"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@octonodes/sdk": "0.2.
|
|
25
|
-
"@octonodes/ui-extensions": "0.2.
|
|
24
|
+
"@octonodes/sdk": "0.2.11",
|
|
25
|
+
"@octonodes/ui-extensions": "0.2.11",
|
|
26
26
|
"@supabase/supabase-js": "2.107.0",
|
|
27
27
|
"esbuild": "0.28.1",
|
|
28
28
|
"tar": "7.5.22",
|
|
@@ -1368,6 +1368,7 @@ var require_plugin = __commonJS({
|
|
|
1368
1368
|
implementation: zod_1.z.object({
|
|
1369
1369
|
module: zod_1.z.string(),
|
|
1370
1370
|
export: zod_1.z.string(),
|
|
1371
|
+
methodPath: zod_1.z.array(zod_1.z.string().regex(/^[$A-Z_a-z][$\w]*$/).refine((part) => !["__proto__", "prototype", "constructor"].includes(part))).min(1).max(8).optional(),
|
|
1371
1372
|
parameters: zod_1.z.array(zod_1.z.string())
|
|
1372
1373
|
}).strict().optional()
|
|
1373
1374
|
});
|
|
@@ -11876,7 +11877,8 @@ var require_toolkit = __commonJS({
|
|
|
11876
11877
|
"packages/schema/dist/toolkit.js"(exports2) {
|
|
11877
11878
|
"use strict";
|
|
11878
11879
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
11879
|
-
exports2.ToolkitInstallRequest = exports2.ToolkitRelease = exports2.ToolkitResolvedMember = exports2.ToolkitQuery = exports2.ToolkitDefinition = exports2.ToolkitMember = exports2.ToolkitVisibility = exports2.ToolkitOwner = void 0;
|
|
11880
|
+
exports2.ToolkitInstallRequest = exports2.ToolkitRelease = exports2.ToolkitResolvedMember = exports2.ToolkitQuery = exports2.ToolkitDefinition = exports2.ToolkitAction = exports2.ToolkitMember = exports2.ToolkitVisibility = exports2.ToolkitOwner = void 0;
|
|
11881
|
+
exports2.toolkitForMode = toolkitForMode2;
|
|
11880
11882
|
var zod_1 = require("zod");
|
|
11881
11883
|
var plugin_1 = require_plugin();
|
|
11882
11884
|
var version_1 = require_version();
|
|
@@ -11886,20 +11888,42 @@ var require_toolkit = __commonJS({
|
|
|
11886
11888
|
}).strict();
|
|
11887
11889
|
exports2.ToolkitVisibility = zod_1.z.enum(["user", "team", "org", "public"]);
|
|
11888
11890
|
exports2.ToolkitMember = zod_1.z.object({
|
|
11891
|
+
development: zod_1.z.boolean().optional(),
|
|
11889
11892
|
pluginId: zod_1.z.string().min(1).max(240),
|
|
11890
11893
|
version: version_1.PluginVersion,
|
|
11891
11894
|
alias: zod_1.z.string().regex(/^[a-z][a-z0-9-]*$/).max(100)
|
|
11892
11895
|
}).strict();
|
|
11896
|
+
exports2.ToolkitAction = zod_1.z.object({
|
|
11897
|
+
id: zod_1.z.string().regex(/^[a-z][a-z0-9-]*$/).max(100),
|
|
11898
|
+
development: zod_1.z.boolean().optional(),
|
|
11899
|
+
description: zod_1.z.string().max(1e3).default(""),
|
|
11900
|
+
kind: zod_1.z.enum(["plugin", "script", "command"]),
|
|
11901
|
+
plugin: zod_1.z.string().regex(/^[a-z][a-z0-9-]*$/).max(100),
|
|
11902
|
+
target: zod_1.z.string().regex(/^[a-zA-Z0-9_@][a-zA-Z0-9_@:./-]*$/).max(200),
|
|
11903
|
+
expected: zod_1.z.string().max(4e3).optional(),
|
|
11904
|
+
args: zod_1.z.array(zod_1.z.string().max(4e3)).max(100).default([]),
|
|
11905
|
+
timeoutMs: zod_1.z.number().int().min(100).max(3e5).default(6e4)
|
|
11906
|
+
}).strict();
|
|
11893
11907
|
exports2.ToolkitDefinition = zod_1.z.object({
|
|
11894
11908
|
name: zod_1.z.string().trim().min(1).max(200),
|
|
11895
11909
|
description: zod_1.z.string().max(4e3).default(""),
|
|
11896
11910
|
version: version_1.PluginVersion,
|
|
11897
11911
|
owner: exports2.ToolkitOwner,
|
|
11898
11912
|
visibility: exports2.ToolkitVisibility,
|
|
11899
|
-
plugins: zod_1.z.array(exports2.ToolkitMember).max(100)
|
|
11913
|
+
plugins: zod_1.z.array(exports2.ToolkitMember).max(100),
|
|
11914
|
+
actions: zod_1.z.array(exports2.ToolkitAction).max(100).optional()
|
|
11900
11915
|
}).strict().superRefine((value, ctx) => {
|
|
11901
11916
|
if (value.visibility !== "public" && value.visibility !== value.owner.kind)
|
|
11902
11917
|
ctx.addIssue({ code: "custom", path: ["visibility"], message: "Visibility must match the owner or be public" });
|
|
11918
|
+
if (new Set(value.actions?.map((action) => action.id)).size !== (value.actions?.length ?? 0))
|
|
11919
|
+
ctx.addIssue({ code: "custom", path: ["actions"], message: "Duplicate action ID" });
|
|
11920
|
+
for (const [index, action] of (value.actions ?? []).entries())
|
|
11921
|
+
if (!value.plugins.some((plugin) => plugin.alias === action.plugin))
|
|
11922
|
+
ctx.addIssue({
|
|
11923
|
+
code: "custom",
|
|
11924
|
+
path: ["actions", index, "plugin"],
|
|
11925
|
+
message: "Action must reference an included plugin"
|
|
11926
|
+
});
|
|
11903
11927
|
for (const field of ["pluginId", "alias"])
|
|
11904
11928
|
if (new Set(value.plugins.map((plugin) => plugin[field])).size !== value.plugins.length)
|
|
11905
11929
|
ctx.addIssue({ code: "custom", path: ["plugins"], message: `Duplicate plugin ${field}` });
|
|
@@ -11946,13 +11970,22 @@ var require_toolkit = __commonJS({
|
|
|
11946
11970
|
revision: zod_1.z.number().int(),
|
|
11947
11971
|
sha256: zod_1.z.string().nullable(),
|
|
11948
11972
|
status: zod_1.z.enum(["draft", "published"]),
|
|
11949
|
-
plugins: zod_1.z.array(exports2.ToolkitResolvedMember).max(100)
|
|
11973
|
+
plugins: zod_1.z.array(exports2.ToolkitResolvedMember).max(100),
|
|
11974
|
+
actions: zod_1.z.array(exports2.ToolkitAction).max(100).optional()
|
|
11950
11975
|
});
|
|
11951
11976
|
exports2.ToolkitInstallRequest = zod_1.z.object({
|
|
11952
11977
|
version: version_1.PluginVersion,
|
|
11953
11978
|
sha256: zod_1.z.string().regex(/^[a-f0-9]{64}$/),
|
|
11954
11979
|
destination: exports2.ToolkitOwner
|
|
11955
11980
|
}).strict();
|
|
11981
|
+
function toolkitForMode2(release2, mode) {
|
|
11982
|
+
const plugins = release2.plugins.filter((plugin) => mode === "development" || !plugin.development);
|
|
11983
|
+
return {
|
|
11984
|
+
...release2,
|
|
11985
|
+
plugins,
|
|
11986
|
+
actions: release2.actions?.map((action) => release2.plugins.find((plugin) => plugin.alias === action.plugin)?.development ? { ...action, development: true } : action).filter((action) => (mode === "development" || !action.development) && plugins.some((plugin) => plugin.alias === action.plugin))
|
|
11987
|
+
};
|
|
11988
|
+
}
|
|
11956
11989
|
}
|
|
11957
11990
|
});
|
|
11958
11991
|
|
|
@@ -12049,7 +12082,7 @@ var require_dist = __commonJS({
|
|
|
12049
12082
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
|
|
12050
12083
|
};
|
|
12051
12084
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
12052
|
-
exports2.schemaVersion = exports2.octonodeJsonSchema = void 0;
|
|
12085
|
+
exports2.ToolkitAction = exports2.schemaVersion = exports2.octonodeJsonSchema = void 0;
|
|
12053
12086
|
__exportStar(require_ipc_envelope(), exports2);
|
|
12054
12087
|
__exportStar(require_octonode_config(), exports2);
|
|
12055
12088
|
__exportStar(require_entry(), exports2);
|
|
@@ -12099,6 +12132,10 @@ var require_dist = __commonJS({
|
|
|
12099
12132
|
__exportStar(require_toolkit(), exports2);
|
|
12100
12133
|
__exportStar(require_allowlist(), exports2);
|
|
12101
12134
|
__exportStar(require_app_runtime(), exports2);
|
|
12135
|
+
var toolkit_1 = require_toolkit();
|
|
12136
|
+
Object.defineProperty(exports2, "ToolkitAction", { enumerable: true, get: function() {
|
|
12137
|
+
return toolkit_1.ToolkitAction;
|
|
12138
|
+
} });
|
|
12102
12139
|
}
|
|
12103
12140
|
});
|
|
12104
12141
|
|
|
@@ -13191,6 +13228,7 @@ var LockEntry = import_zod.z.object({
|
|
|
13191
13228
|
var Lockfile = import_zod.z.object({
|
|
13192
13229
|
lockfileVersion: import_zod.z.literal(1).default(1),
|
|
13193
13230
|
plugins: import_zod.z.record(LockEntry).default({}),
|
|
13231
|
+
managedDependencies: import_zod.z.record(import_zod.z.string()).optional(),
|
|
13194
13232
|
toolkits: import_zod.z.record(
|
|
13195
13233
|
import_zod.z.object({
|
|
13196
13234
|
id: import_zod.z.string(),
|
|
@@ -13198,7 +13236,10 @@ var Lockfile = import_zod.z.object({
|
|
|
13198
13236
|
version: import_zod.z.string(),
|
|
13199
13237
|
sha256: import_zod.z.string().regex(/^[a-f0-9]{64}$/),
|
|
13200
13238
|
plugins: import_zod.z.array(import_zod.z.string()),
|
|
13201
|
-
|
|
13239
|
+
developmentPlugins: import_zod.z.array(import_zod.z.string()).optional(),
|
|
13240
|
+
destination: import_schema.ToolkitOwner,
|
|
13241
|
+
mode: import_zod.z.enum(["development", "production"]).optional(),
|
|
13242
|
+
actions: import_zod.z.array(import_schema.ToolkitAction).max(100).optional()
|
|
13202
13243
|
}).strict()
|
|
13203
13244
|
).optional(),
|
|
13204
13245
|
generated: import_zod.z.object({
|
|
@@ -13825,7 +13866,7 @@ async function reconcileDependencies(cwd, dependencies, options = {}) {
|
|
|
13825
13866
|
);
|
|
13826
13867
|
}
|
|
13827
13868
|
const reusable = dependencies.length > 0 && !options.remove?.length && dependencies.every(
|
|
13828
|
-
({ name, spec }) => existing[name] === spec && /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(spec)
|
|
13869
|
+
({ name, spec, development }) => (development ? declared.devDependencies?.[name] === spec : declared.dependencies?.[name] === spec) && existing[name] === spec && /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(spec)
|
|
13829
13870
|
);
|
|
13830
13871
|
const reuse = reusable && await verifyProjectDependencies(
|
|
13831
13872
|
project,
|
|
@@ -13919,16 +13960,27 @@ async function reconcileDependencies(cwd, dependencies, options = {}) {
|
|
|
13919
13960
|
await run(current, [current.manager, [...args, ...options.remove]], current.target, options.cacheRoot);
|
|
13920
13961
|
}
|
|
13921
13962
|
const restored = snapshot ? restoreDependencySnapshot(snapshot) : false;
|
|
13922
|
-
if (!restored)
|
|
13923
|
-
|
|
13924
|
-
current,
|
|
13925
|
-
|
|
13963
|
+
if (!restored) {
|
|
13964
|
+
if (!dependencies.length)
|
|
13965
|
+
await run(current, installCommand(current, options.frozen ?? false), current.root, options.cacheRoot);
|
|
13966
|
+
for (const development of [false, true]) {
|
|
13967
|
+
const group = dependencies.filter((item) => !!item.development === development);
|
|
13968
|
+
if (!group.length) continue;
|
|
13969
|
+
const manifest2 = JSON.parse((0, import_node_fs6.readFileSync)(packageJson, "utf8"));
|
|
13970
|
+
const previousSection = development ? "dependencies" : "devDependencies";
|
|
13971
|
+
if (group.some(({ name }) => manifest2[previousSection]?.[name])) {
|
|
13972
|
+
for (const { name } of group) delete manifest2[previousSection]?.[name];
|
|
13973
|
+
(0, import_node_fs6.writeFileSync)(packageJson, JSON.stringify(manifest2, null, 2) + "\n");
|
|
13974
|
+
}
|
|
13975
|
+
const [command, args] = packageManagerAdd(
|
|
13926
13976
|
current.manager,
|
|
13927
|
-
...
|
|
13928
|
-
)
|
|
13929
|
-
|
|
13930
|
-
|
|
13931
|
-
|
|
13977
|
+
...group.map(({ name, spec }) => spec.startsWith(`${name}@`) ? spec : `${name}@${spec}`)
|
|
13978
|
+
);
|
|
13979
|
+
if (development) args.splice(1, 0, current.manager === "yarn" ? "--dev" : "--save-dev");
|
|
13980
|
+
else if (current.manager === "npm") args.splice(1, 0, "--save-prod");
|
|
13981
|
+
await run(current, [command, args], current.target, options.cacheRoot);
|
|
13982
|
+
}
|
|
13983
|
+
}
|
|
13932
13984
|
await verifyProjectDependencies(
|
|
13933
13985
|
current,
|
|
13934
13986
|
dependencies.flatMap(({ name, subpaths }) => subpaths ? subpaths.map((path) => name + path.slice(1)) : [name])
|
|
@@ -14372,7 +14424,9 @@ async function reconcilePluginLock(cwd, next, options = {}) {
|
|
|
14372
14424
|
const manifest2 = loadPluginManifest(directory);
|
|
14373
14425
|
if (manifest2.id !== (pin.pluginId ?? alias) || manifest2.version !== pin.version || hashPluginDir(directory) !== pin.sha256)
|
|
14374
14426
|
throw new Error(`Plugin identity or integrity mismatch: ${alias}`);
|
|
14375
|
-
|
|
14427
|
+
const users = Object.values(next.toolkits ?? {}).filter((toolkit) => toolkit.plugins.includes(alias));
|
|
14428
|
+
const development = pin.direct === false && users.length > 0 && users.every((toolkit) => toolkit.developmentPlugins?.includes(alias));
|
|
14429
|
+
return { alias, development, directory, sha256: pin.sha256, manifest: manifest2, remote: preparedPluginPin(directory, pin) };
|
|
14376
14430
|
});
|
|
14377
14431
|
assertUniqueNpmPlugins([
|
|
14378
14432
|
...discoverPluginCatalog({ cwd, storeRoot: options.storeRoot }).plugins.filter((item) => item.source === "project" && !loaded.some((pin) => pin.alias === item.manifest.id)).map((item) => ({ alias: item.manifest.id, manifest: item.manifest })),
|
|
@@ -14388,7 +14442,7 @@ async function reconcilePluginLock(cwd, next, options = {}) {
|
|
|
14388
14442
|
"Existing @octonodes/plugin dependency is not managed by this lock; pass --migrate to replace it explicitly"
|
|
14389
14443
|
);
|
|
14390
14444
|
const dependencies = loaded.filter((item) => !item.remote || item.manifest.library).flatMap(
|
|
14391
|
-
({ manifest: manifest2 }) => pluginNpmDependencies(manifest2).map((npm) => {
|
|
14445
|
+
({ manifest: manifest2, development }) => pluginNpmDependencies(manifest2).map((npm) => {
|
|
14392
14446
|
const spec = npm.spec.startsWith(`${npm.package}@`) ? npm.spec.slice(npm.package.length + 1) : npm.spec;
|
|
14393
14447
|
const sameLocal = typeof declared[npm.package] === "string" && declared[npm.package].startsWith("file:") && spec.startsWith("file:") && (0, import_node_path10.resolve)(project.target, declared[npm.package].slice(5)) === (0, import_node_path10.resolve)(project.target, spec.slice(5));
|
|
14394
14448
|
if (declared[npm.package] && declared[npm.package] !== spec && !sameLocal)
|
|
@@ -14398,27 +14452,58 @@ async function reconcilePluginLock(cwd, next, options = {}) {
|
|
|
14398
14452
|
const subpaths = manifest2.nodes.filter((node) => node.source?.kind === "npm" && node.source.package === npm.package).flatMap(
|
|
14399
14453
|
(node) => node.implementation?.module.startsWith(`${npm.package}/`) ? ["." + node.implementation.module.slice(npm.package.length)] : []
|
|
14400
14454
|
);
|
|
14401
|
-
return {
|
|
14455
|
+
return {
|
|
14456
|
+
name: npm.package,
|
|
14457
|
+
spec,
|
|
14458
|
+
development: development && (!packageJson.dependencies?.[npm.package] || before.managedDependencies?.[npm.package] === declared[npm.package]) && !packageJson.optionalDependencies?.[npm.package] ? true : void 0,
|
|
14459
|
+
...subpaths.length ? { subpaths: [...new Set(subpaths)] } : {}
|
|
14460
|
+
};
|
|
14402
14461
|
})
|
|
14403
14462
|
);
|
|
14404
|
-
const unique = [
|
|
14463
|
+
const unique = [
|
|
14464
|
+
...new Map(
|
|
14465
|
+
dependencies.map((item) => [
|
|
14466
|
+
item.name,
|
|
14467
|
+
{
|
|
14468
|
+
...item,
|
|
14469
|
+
development: dependencies.filter((other) => other.name === item.name).every((other) => other.development) ? true : void 0
|
|
14470
|
+
}
|
|
14471
|
+
])
|
|
14472
|
+
).values()
|
|
14473
|
+
];
|
|
14405
14474
|
if (dependencies.some((item) => unique.some((other) => item.name === other.name && item.spec !== other.spec)))
|
|
14406
14475
|
throw new Error("Selected plugins require conflicting npm dependency versions");
|
|
14407
|
-
const
|
|
14476
|
+
const managedDependencies = Object.fromEntries(
|
|
14477
|
+
unique.filter((item) => !declared[item.name] || before.managedDependencies?.[item.name] === declared[item.name]).map((item) => [item.name, item.spec])
|
|
14478
|
+
);
|
|
14479
|
+
const remove = Object.entries(before.managedDependencies ?? {}).filter(([name, spec]) => declared[name] === spec && !unique.some((item) => item.name === name)).map(([name]) => name);
|
|
14480
|
+
if (!generated && before.generated) remove.push(before.generated.name);
|
|
14481
|
+
const committed = { ...next, generated, managedDependencies };
|
|
14408
14482
|
if (options.dryRun) return committed;
|
|
14409
|
-
if (generated || before.generated || unique.length || options.commit) {
|
|
14483
|
+
if (generated || before.generated || unique.length || remove.length || options.commit) {
|
|
14410
14484
|
await reconcileDependencies(project.target, [...unique, ...generated ? [generated] : []], {
|
|
14411
14485
|
cacheRoot: options.cacheRoot,
|
|
14412
|
-
metadataOnly: !generated && !before.generated && !unique.length,
|
|
14413
|
-
remove
|
|
14486
|
+
metadataOnly: !generated && !before.generated && !unique.length && !remove.length,
|
|
14487
|
+
remove,
|
|
14414
14488
|
transactionFiles: [lockfilePath(cwd), ...options.transactionFiles ?? []],
|
|
14415
14489
|
commit: () => {
|
|
14416
14490
|
options.commit?.();
|
|
14417
|
-
|
|
14491
|
+
const installedManifest = (0, import_node_fs10.existsSync)(packageFile) ? JSON.parse((0, import_node_fs10.readFileSync)(packageFile, "utf8")) : {};
|
|
14492
|
+
const installedDependencies = {
|
|
14493
|
+
...installedManifest.devDependencies,
|
|
14494
|
+
...installedManifest.optionalDependencies,
|
|
14495
|
+
...installedManifest.dependencies
|
|
14496
|
+
};
|
|
14497
|
+
writeLockfile(cwd, {
|
|
14498
|
+
...committed,
|
|
14499
|
+
managedDependencies: Object.fromEntries(
|
|
14500
|
+
Object.keys(managedDependencies).filter((name) => installedDependencies[name]).map((name) => [name, installedDependencies[name]])
|
|
14501
|
+
)
|
|
14502
|
+
});
|
|
14418
14503
|
}
|
|
14419
14504
|
});
|
|
14420
14505
|
} else writeLockfile(cwd, committed);
|
|
14421
|
-
return
|
|
14506
|
+
return readLockfile(cwd);
|
|
14422
14507
|
}
|
|
14423
14508
|
async function activatePluginPin(alias, pin, options = {}) {
|
|
14424
14509
|
const cwd = resolveDependencyProject(options.cwd ?? process.cwd()).target;
|
|
@@ -14460,6 +14545,8 @@ async function removePluginPin(alias, options = {}) {
|
|
|
14460
14545
|
}
|
|
14461
14546
|
|
|
14462
14547
|
// packages/plugin/src/restore.ts
|
|
14548
|
+
var import_node_util3 = require("node:util");
|
|
14549
|
+
var import_schema7 = __toESM(require_dist());
|
|
14463
14550
|
var import_node_fs14 = require("node:fs");
|
|
14464
14551
|
var import_node_path14 = require("node:path");
|
|
14465
14552
|
|
|
@@ -15044,7 +15131,7 @@ async function installFromLock(opts = {}) {
|
|
|
15044
15131
|
for (const toolkit of Object.values(lock.toolkits ?? {})) {
|
|
15045
15132
|
try {
|
|
15046
15133
|
if (opts.offline) throw new Error("Toolkit access must be reauthorized online before restore");
|
|
15047
|
-
const
|
|
15134
|
+
const resolved = await new RemoteRegistry({ baseUrl: toolkit.registry, token: opts.token }).resolveToolkit(
|
|
15048
15135
|
toolkit.id,
|
|
15049
15136
|
{
|
|
15050
15137
|
version: toolkit.version,
|
|
@@ -15052,7 +15139,8 @@ async function installFromLock(opts = {}) {
|
|
|
15052
15139
|
destination: toolkit.destination
|
|
15053
15140
|
}
|
|
15054
15141
|
);
|
|
15055
|
-
|
|
15142
|
+
const release2 = (0, import_schema7.toolkitForMode)(resolved, toolkit.mode ?? "development");
|
|
15143
|
+
if (!(0, import_node_util3.isDeepStrictEqual)(release2.actions ?? [], toolkit.actions ?? []) || release2.plugins.length !== toolkit.plugins.length || release2.plugins.some((member) => {
|
|
15056
15144
|
const pin = lock.plugins[member.alias];
|
|
15057
15145
|
return !toolkit.plugins.includes(member.alias) || !pin || pin.remoteId !== member.pluginId || pin.registry !== toolkit.registry || pin.version !== member.version || pin.archiveSha256 !== member.sha256;
|
|
15058
15146
|
}))
|
|
@@ -15064,6 +15152,8 @@ async function installFromLock(opts = {}) {
|
|
|
15064
15152
|
if (result.errors.length) return result;
|
|
15065
15153
|
const libraries = [];
|
|
15066
15154
|
const dependencies = [];
|
|
15155
|
+
const packageFile = (0, import_node_path14.join)(cwd, "package.json");
|
|
15156
|
+
const packageJson = (0, import_node_fs14.existsSync)(packageFile) ? JSON.parse((0, import_node_fs14.readFileSync)(packageFile, "utf8")) : {};
|
|
15067
15157
|
for (const [alias, pin] of Object.entries(lock.plugins)) {
|
|
15068
15158
|
try {
|
|
15069
15159
|
const id = pin.pluginId ?? alias;
|
|
@@ -15124,7 +15214,13 @@ async function installFromLock(opts = {}) {
|
|
|
15124
15214
|
if (installed.depsError) throw new Error(installed.depsError);
|
|
15125
15215
|
}
|
|
15126
15216
|
}
|
|
15127
|
-
dependencies.push(
|
|
15217
|
+
dependencies.push(
|
|
15218
|
+
...pluginNpmDependencies(manifest2).map((npm) => ({
|
|
15219
|
+
name: npm.package,
|
|
15220
|
+
spec: npm.spec,
|
|
15221
|
+
development: !!packageJson.devDependencies?.[npm.package] && !packageJson.dependencies?.[npm.package] && !packageJson.optionalDependencies?.[npm.package]
|
|
15222
|
+
}))
|
|
15223
|
+
);
|
|
15128
15224
|
} catch (error) {
|
|
15129
15225
|
result.errors.push({ id: alias, message: error.message });
|
|
15130
15226
|
}
|
|
@@ -15157,11 +15253,11 @@ async function installFromLock(opts = {}) {
|
|
|
15157
15253
|
}
|
|
15158
15254
|
|
|
15159
15255
|
// packages/plugin/src/consumer/lifecycle.ts
|
|
15160
|
-
var
|
|
15256
|
+
var import_schema8 = __toESM(require_dist());
|
|
15161
15257
|
async function runPluginLifecycle(command, target, flags) {
|
|
15162
15258
|
const cwd = resolveDependencyProject(typeof flags.cwd === "string" ? (0, import_node_path15.resolve)(flags.cwd) : process.cwd()).target;
|
|
15163
15259
|
const scope = typeof flags.scope === "string" ? flags.scope : void 0;
|
|
15164
|
-
if (scope && !
|
|
15260
|
+
if (scope && !import_schema8.MARKETPLACE_SCOPES.includes(scope)) throw new Error("Invalid marketplace scope");
|
|
15165
15261
|
const options = {
|
|
15166
15262
|
cwd,
|
|
15167
15263
|
alias: typeof flags.alias === "string" ? flags.alias : void 0,
|