@rbbtsn0w/adg 0.7.1-beta.2 → 0.7.1-beta.3
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.
|
@@ -355,13 +355,18 @@ export async function addPlugins(opts) {
|
|
|
355
355
|
try {
|
|
356
356
|
let { candidates, converted } = discoverPlugins(workRoot);
|
|
357
357
|
const existingLock = readLock(lockPath(opts.pluginsDir));
|
|
358
|
-
if (candidates.size > 0
|
|
359
|
-
|
|
358
|
+
if (candidates.size > 0) {
|
|
359
|
+
if (opts.structuralIdentity && !candidates.has(opts.structuralIdentity)) {
|
|
360
|
+
throw new Error(`source definition changed from Default DSL to explicit plugin(s), but none match the installed identity "${opts.structuralIdentity}"; re-add or migrate the plugin explicitly`);
|
|
361
|
+
}
|
|
362
|
+
if (opts.as && !opts.structuralIdentity) {
|
|
363
|
+
throw new Error("--as is only supported for a default structural plugin source");
|
|
364
|
+
}
|
|
360
365
|
}
|
|
361
366
|
if (candidates.size === 0) {
|
|
362
367
|
if (parsed.kind === "github" && !opts.preparedSourceDir && !opts.defaultDescription)
|
|
363
368
|
defaultDescription = await githubRepositoryDescription(parsed.source);
|
|
364
|
-
const structuralIdentity = opts.as ?? (parsed.kind === "github" ? parsed.source : basename(workRoot));
|
|
369
|
+
const structuralIdentity = opts.as ?? opts.structuralIdentity ?? (parsed.kind === "github" ? parsed.source : basename(workRoot));
|
|
365
370
|
const generated = resolveDefaultDsl(workRoot, {
|
|
366
371
|
name: structuralIdentity,
|
|
367
372
|
description: defaultDescription ?? opts.defaultDescription ?? structuralIdentity,
|
|
@@ -423,7 +428,9 @@ export async function addPlugins(opts) {
|
|
|
423
428
|
}
|
|
424
429
|
// A generated Default DSL replay retains its definition profile. Only an
|
|
425
430
|
// explicit manifest discovered from the source may replace that profile.
|
|
426
|
-
const definitionSwitches = definition
|
|
431
|
+
const definitionSwitches = definition
|
|
432
|
+
? []
|
|
433
|
+
: order.filter((name) => existingLock.plugins[name]?.definition && name !== opts.structuralIdentity);
|
|
427
434
|
if (definitionSwitches.length > 0) {
|
|
428
435
|
const names = definitionSwitches.sort().map((name) => `"${name}"`).join(", ");
|
|
429
436
|
throw new Error(`source definition changed from default DSL to a manifest for ${names}; re-add or migrate the plugin explicitly`);
|
|
@@ -136,6 +136,7 @@ export async function updatePlugins(opts) {
|
|
|
136
136
|
...structural.map(({ name, definition, selection }) => ({
|
|
137
137
|
plugins: [name],
|
|
138
138
|
as: definition.as,
|
|
139
|
+
structuralIdentity: name,
|
|
139
140
|
defaultDescription: definition.description,
|
|
140
141
|
authorizedComponents: definition.authorizedComponents,
|
|
141
142
|
replaySelection: selection ?? (definition.authorizedComponents ? { components: definition.authorizedComponents } : undefined),
|
|
@@ -163,6 +164,7 @@ export async function updatePlugins(opts) {
|
|
|
163
164
|
skipUnchanged: true,
|
|
164
165
|
nonInteractive: true,
|
|
165
166
|
...(request.authorizedComponents ? { authorizedComponents: request.authorizedComponents } : {}),
|
|
167
|
+
...(request.structuralIdentity ? { structuralIdentity: request.structuralIdentity } : {}),
|
|
166
168
|
...(request.replaySelection ? { replaySelection: request.replaySelection } : {}),
|
|
167
169
|
targets: opts.targets,
|
|
168
170
|
marketplaceName: group.source,
|