@detergent-software/atk 9.3.1-dev.1 → 9.4.0-dev.10

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.
Files changed (100) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/build/command-manifest.json +9 -9
  3. package/build/commands/freeze.d.ts.map +1 -1
  4. package/build/commands/freeze.js +3 -1
  5. package/build/commands/freeze.js.map +1 -1
  6. package/build/commands/info.js +1 -0
  7. package/build/commands/info.js.map +1 -1
  8. package/build/commands/install.d.ts.map +1 -1
  9. package/build/commands/install.js +289 -90
  10. package/build/commands/install.js.map +1 -1
  11. package/build/commands/outdated.d.ts.map +1 -1
  12. package/build/commands/outdated.js +2 -1
  13. package/build/commands/outdated.js.map +1 -1
  14. package/build/commands/pin.js +1 -1
  15. package/build/commands/pin.js.map +1 -1
  16. package/build/commands/sync.d.ts.map +1 -1
  17. package/build/commands/sync.js +26 -13
  18. package/build/commands/sync.js.map +1 -1
  19. package/build/commands/thaw.d.ts.map +1 -1
  20. package/build/commands/thaw.js +5 -1
  21. package/build/commands/thaw.js.map +1 -1
  22. package/build/commands/uninstall.d.ts.map +1 -1
  23. package/build/commands/uninstall.js +6 -1
  24. package/build/commands/uninstall.js.map +1 -1
  25. package/build/commands/unpin.d.ts.map +1 -1
  26. package/build/commands/unpin.js +5 -1
  27. package/build/commands/unpin.js.map +1 -1
  28. package/build/commands/update.d.ts.map +1 -1
  29. package/build/commands/update.js +18 -8
  30. package/build/commands/update.js.map +1 -1
  31. package/build/components/AssetDetail.d.ts.map +1 -1
  32. package/build/components/AssetDetail.js +1 -1
  33. package/build/components/AssetDetail.js.map +1 -1
  34. package/build/components/PreferredScopeQuestion.d.ts +16 -0
  35. package/build/components/PreferredScopeQuestion.d.ts.map +1 -0
  36. package/build/components/PreferredScopeQuestion.js +20 -0
  37. package/build/components/PreferredScopeQuestion.js.map +1 -0
  38. package/build/components/PreferredScopeWarning.d.ts +17 -0
  39. package/build/components/PreferredScopeWarning.d.ts.map +1 -0
  40. package/build/components/PreferredScopeWarning.js +13 -0
  41. package/build/components/PreferredScopeWarning.js.map +1 -0
  42. package/build/components/index.d.ts +2 -0
  43. package/build/components/index.d.ts.map +1 -1
  44. package/build/components/index.js +2 -0
  45. package/build/components/index.js.map +1 -1
  46. package/build/hooks/useListActions.d.ts.map +1 -1
  47. package/build/hooks/useListActions.js +5 -1
  48. package/build/hooks/useListActions.js.map +1 -1
  49. package/build/hooks/useUninstallState.d.ts.map +1 -1
  50. package/build/hooks/useUninstallState.js +16 -12
  51. package/build/hooks/useUninstallState.js.map +1 -1
  52. package/build/lib/asset-tools.d.ts +2 -0
  53. package/build/lib/asset-tools.d.ts.map +1 -1
  54. package/build/lib/asset-tools.js +4 -0
  55. package/build/lib/asset-tools.js.map +1 -1
  56. package/build/lib/atk-schemas/index.d.ts +1 -1
  57. package/build/lib/atk-schemas/index.d.ts.map +1 -1
  58. package/build/lib/atk-schemas/index.js +1 -1
  59. package/build/lib/atk-schemas/index.js.map +1 -1
  60. package/build/lib/atk-schemas/manifest.d.ts +14 -0
  61. package/build/lib/atk-schemas/manifest.d.ts.map +1 -1
  62. package/build/lib/atk-schemas/manifest.js +3 -0
  63. package/build/lib/atk-schemas/manifest.js.map +1 -1
  64. package/build/lib/atk-schemas/registry.d.ts +16 -0
  65. package/build/lib/atk-schemas/registry.d.ts.map +1 -1
  66. package/build/lib/atk-schemas/registry.js +2 -1
  67. package/build/lib/atk-schemas/registry.js.map +1 -1
  68. package/build/lib/diff-command.d.ts +6 -1
  69. package/build/lib/diff-command.d.ts.map +1 -1
  70. package/build/lib/diff-command.js +25 -28
  71. package/build/lib/diff-command.js.map +1 -1
  72. package/build/lib/install-targets.d.ts +35 -8
  73. package/build/lib/install-targets.d.ts.map +1 -1
  74. package/build/lib/install-targets.js +78 -11
  75. package/build/lib/install-targets.js.map +1 -1
  76. package/build/lib/installer.d.ts +9 -3
  77. package/build/lib/installer.d.ts.map +1 -1
  78. package/build/lib/installer.js +28 -10
  79. package/build/lib/installer.js.map +1 -1
  80. package/build/lib/multi-tool-install.d.ts +35 -6
  81. package/build/lib/multi-tool-install.d.ts.map +1 -1
  82. package/build/lib/multi-tool-install.js +128 -31
  83. package/build/lib/multi-tool-install.js.map +1 -1
  84. package/build/lib/named-entry.d.ts +10 -2
  85. package/build/lib/named-entry.d.ts.map +1 -1
  86. package/build/lib/named-entry.js +23 -9
  87. package/build/lib/named-entry.js.map +1 -1
  88. package/build/lib/org.d.ts +32 -13
  89. package/build/lib/org.d.ts.map +1 -1
  90. package/build/lib/org.js +36 -12
  91. package/build/lib/org.js.map +1 -1
  92. package/build/lib/preferred-scope.d.ts +38 -0
  93. package/build/lib/preferred-scope.d.ts.map +1 -0
  94. package/build/lib/preferred-scope.js +53 -0
  95. package/build/lib/preferred-scope.js.map +1 -0
  96. package/build/lib/updater.d.ts +30 -5
  97. package/build/lib/updater.d.ts.map +1 -1
  98. package/build/lib/updater.js +114 -27
  99. package/build/lib/updater.js.map +1 -1
  100. package/package.json +1 -1
@@ -1,9 +1,10 @@
1
1
  import { satisfies } from 'semver';
2
- import { declaresTool, isExcludedForTool, isUndeclaredForTool, placesAsset, supportsType, withToolExcluded, } from './asset-tools.js';
2
+ import { declaresTool, isExcludedForTool, isUninstalledForTool, placesAsset, supportsType, withToolExcluded, } from './asset-tools.js';
3
3
  import { errorMessage } from './errors.js';
4
4
  import { isInstalledForTool } from './installed-for-tool.js';
5
5
  import { assertInstalledByAnyTool, executeInstallPlan, fetchPlanFiles, InstallerError, InstallPlanError, placeableEntries, rollBackInstalledAssets, } from './installer.js';
6
6
  import { addAssetToLockfile, findDependencyAsset, findInstalledAsset, identityKey, readLockfile, writeLockfile, } from './lockfile.js';
7
+ import { entrySpec } from './named-entry.js';
7
8
  import { formatOrgName } from './org.js';
8
9
  import { isLatestAlias } from './registry.js';
9
10
  import { scopedCommand } from './scope.js';
@@ -19,16 +20,17 @@ import { scopedCommand } from './scope.js';
19
20
  * the failing pass kept itself that way ({@link InstallPlanError.keptInstall}), every pass stays.
20
21
  *
21
22
  * A dependency already in place at a version its dependents in the plan accept is left as it is,
22
- * and an install that would move a pinned dependency is refused (see {@link withoutKeptDependencies}).
23
+ * and an install that would move a pinned asset, or one an installed dependent outside the plan
24
+ * does not accept at its new version, is refused (see {@link withoutKeptDependencies}).
23
25
  */
24
26
  export async function executeInstallPlanForTools(requestedPlan, tools, options) {
25
- const { onTool, ...installOptions } = options;
27
+ const { named: _named, onTool, ...installOptions } = options;
26
28
  const before = await readLockfile(options.projectDir);
27
29
  const plan = withoutKeptDependencies(requestedPlan, before, tools, options);
28
30
  // What each tool had in place before the command, by plan entry: read now, before any pass writes.
29
31
  const inPlaceBefore = tools.map(({ adapter }) => {
30
32
  const inPlace = new Map();
31
- for (const entry of placeableEntries(plan, adapter)) {
33
+ for (const entry of placeableEntries(plan, adapter, before)) {
32
34
  const installed = findInstalledAsset(before, entry.asset.name, entry.asset.type, entry.asset.org);
33
35
  if (installed && isInstalledForTool(installed, adapter, options.projectDir))
34
36
  inPlace.set(entry, installed);
@@ -38,10 +40,10 @@ export async function executeInstallPlanForTools(requestedPlan, tools, options)
38
40
  // Every tool's files, downloaded once before any pass writes, so a refused download leaves the
39
41
  // project as it was and the passes share one copy.
40
42
  const adapters = tools.map(({ adapter }) => adapter);
41
- const downloadCount = new Set(adapters.flatMap((adapter) => placeableEntries(plan, adapter))).size;
43
+ const downloadCount = new Set(adapters.flatMap((adapter) => placeableEntries(plan, adapter, before))).size;
42
44
  if (downloadCount > 0)
43
45
  options.onProgress?.(`Downloading ${downloadCount} asset(s)...`);
44
- const files = await fetchPlanFiles(plan, adapters);
46
+ const files = await fetchPlanFiles(plan, adapters, undefined, before);
45
47
  const toolResults = [];
46
48
  try {
47
49
  for (const { adapter, tool } of tools) {
@@ -69,7 +71,7 @@ export async function executeInstallPlanForTools(requestedPlan, tools, options)
69
71
  for (let i = toolResults.length - 1; i >= 0; i--) {
70
72
  const { adapter, tool } = tools[i];
71
73
  const inPlace = inPlaceBefore[i];
72
- const entries = placeableEntries(plan, adapter);
74
+ const entries = placeableEntries(plan, adapter, before);
73
75
  const placed = toolResults[i].results.map((result, j) => ({
74
76
  asset: entries[j].asset,
75
77
  entry: entries[j],
@@ -102,9 +104,23 @@ export async function executeInstallPlanForTools(requestedPlan, tools, options)
102
104
  * entries of the plan that depend on it, at the version the plan installs, or, for one it leaves
103
105
  * as it is, at its installed version. A dependency that only the planned versions of entries it
104
106
  * leaves out need, versions that won't be installed, is left out too. The plan's direct entries,
105
- * the assets asked for, are always installed. A pinned dependency the plan would move to another
106
- * version refuses the install, before anything is written, unless the tools that lack it are ones
107
- * it was uninstalled for. Dry runs and updates trim their plans the same way.
107
+ * the assets asked for, are always installed. A tool the dependency was uninstalled for doesn't
108
+ * lack it: the installer doesn't place it there (see {@link placeableEntries}). A pinned dependency
109
+ * the plan would move to another version refuses the install, before anything is written, and so
110
+ * does a dependency it would move to a version that an installed dependent outside the plan does not
111
+ * accept. Dry runs and updates trim their plans the same way.
112
+ *
113
+ * A direct entry, an asset the command was asked for, that moves an installed asset to another
114
+ * version refuses the install the same way: when an installed dependent outside the plan does not
115
+ * accept that version, or when the asset is pinned at another version and `pin` doesn't pin it
116
+ * anew. With `named` (a command that names its assets and has `--force`), the refusal offers
117
+ * `--force`, and `named.force` moves it anyway, with a warning for the dependents.
118
+ *
119
+ * With `notInPlace` (identity key → the tools that lacked the asset when a multi-tool update
120
+ * started), those tools count as lacking it too, so every tool's pass decides the same way. With
121
+ * `changing` (identity key → dependencies), installed assets outside the plan that the command also
122
+ * changes count as dependents with those dependencies, not the ones their lockfile entry records:
123
+ * an update's other assets at the version the run updates them to, and none for one it removes.
108
124
  */
109
125
  export function withoutKeptDependencies(plan, installed, tools, options) {
110
126
  // A dependency names no org, so it resolves the way the resolver found it: in the dependent's
@@ -141,42 +157,73 @@ export function withoutKeptDependencies(plan, installed, tools, options) {
141
157
  };
142
158
  const kept = new Map();
143
159
  const unneeded = new Set();
160
+ // The plan entries the install won't place, by identity: what of them is installed stays as it
161
+ // is, with the dependencies its lockfile entry records.
162
+ const stays = new Set();
163
+ // The installed assets the plan moves to another version. Their dependents are checked once
164
+ // the walk has decided every entry: an installed dependent can come after its dependency in the
165
+ // walk when the version the plan has of it no longer depends on it.
166
+ const moved = [];
144
167
  for (const entry of plan.entries.toReversed()) {
145
168
  const { name, org, type } = entry.asset;
146
169
  const key = identityKey(entry.asset);
147
170
  const ranges = required.get(key);
148
- if (entry.reason === 'dependency' && !ranges && neededByLeftOut.has(key)) {
171
+ // The assets asked for are always installed; one already installed at another version moves.
172
+ if (entry.reason === 'direct') {
173
+ const current = findInstalledAsset(installed, name, type, org);
174
+ if (current && entry.version !== current.version) {
175
+ if (current.pinnedVersion && current.pinnedVersion !== entry.version && !options.pin) {
176
+ if (!options.named?.force)
177
+ throw pinnedAssetError(entry, current, installed, options);
178
+ options.onProgress?.(`Moving "${formatOrgName(current.org, current.name)}" from its pin at ${current.pinnedVersion} to ${entry.version}: it is no longer pinned`);
179
+ }
180
+ moved.push({ current, entry });
181
+ }
182
+ requireAll(plannedDependencies(entry));
183
+ continue;
184
+ }
185
+ if (!ranges && neededByLeftOut.has(key)) {
149
186
  unneeded.add(entry);
187
+ stays.add(key);
150
188
  leaveOut(entry);
151
189
  continue;
152
190
  }
153
- const current = entry.reason === 'dependency' ? findInstalledAsset(installed, name, type, org) : undefined;
191
+ const current = findInstalledAsset(installed, name, type, org);
154
192
  if (!current) {
155
193
  requireAll(plannedDependencies(entry));
156
194
  continue;
157
195
  }
158
196
  const accepted = (ranges ?? []).every((range) => satisfies(current.version, range));
159
- const missingFor = tools
160
- .filter(({ adapter }) => placesAsset(adapter, type, entry.versionData.tools))
161
- .filter(({ adapter }) => !isInstalledForTool(current, adapter, options.projectDir));
162
- // A pinned dependency the plan would move stays as it is when the tools that lack it are ones
163
- // it was uninstalled for: sync would not place it there either.
164
- const keep = accepted &&
165
- (missingFor.length === 0 ||
166
- (current.pinnedVersion !== undefined &&
167
- entry.version !== current.version &&
168
- missingFor.every(({ adapter }) => isUninstalledForTool(current, adapter.tool))));
169
- if (keep) {
197
+ // A tool the dependency was uninstalled for doesn't lack it: sync would not place it there either.
198
+ const places = ({ adapter }) => placesAsset(adapter, type, entry.versionData.tools) && !isUninstalledForTool(current, adapter.tool);
199
+ const missingFor = [
200
+ ...tools.filter(places).filter(({ adapter }) => !isInstalledForTool(current, adapter, options.projectDir)),
201
+ ...(options.notInPlace?.get(key) ?? []).map((adapter) => ({ adapter })).filter(places),
202
+ ];
203
+ if (accepted && missingFor.length === 0) {
170
204
  kept.set(entry, current);
205
+ stays.add(key);
171
206
  requireInstalled(entry, current);
172
207
  leaveOut(entry);
173
208
  continue;
174
209
  }
175
- if (current.pinnedVersion && entry.version !== current.version) {
176
- throw pinnedDependencyError(entry, current, accepted, options.scope);
210
+ if (entry.version !== current.version) {
211
+ if (current.pinnedVersion)
212
+ throw pinnedDependencyError(entry, current, accepted, installed, options.scope);
213
+ moved.push({ current, entry });
177
214
  }
178
215
  requireAll(plannedDependencies(entry));
179
216
  }
217
+ const replaced = (key) => planned.has(key) && !stays.has(key);
218
+ for (const { current, entry } of moved) {
219
+ const rejecting = dependentsRejecting(entry, current, installed, replaced, options.changing);
220
+ if (rejecting.length === 0)
221
+ continue;
222
+ const named = entry.reason === 'direct' ? options.named : undefined;
223
+ if (!named?.force)
224
+ throw movedDependencyError(entry, current, rejecting, named);
225
+ options.onProgress?.(`Moving "${formatOrgName(current.org, current.name)}" to ${entry.version}, ${rejectedBy(rejecting)}`);
226
+ }
180
227
  if (kept.size === 0 && unneeded.size === 0)
181
228
  return plan;
182
229
  for (const [{ asset }, current] of [...kept].toReversed()) {
@@ -188,6 +235,23 @@ export function withoutKeptDependencies(plan, installed, tools, options) {
188
235
  const entries = plan.entries.filter((entry) => !kept.has(entry) && !unneeded.has(entry));
189
236
  return { entries, totalCount: entries.length };
190
237
  }
238
+ /**
239
+ * The installed dependents of `current` that the plan doesn't replace (`replaced`, by identity key)
240
+ * whose range rejects `entry`'s version, with that range: the range their lockfile entry records,
241
+ * or, for one the command also changes, the one its `changing` dependencies give. A dependency
242
+ * resolves as {@link findDependents} resolves it. No version, like `latest`, is no range. Every tool
243
+ * shares the one installed version, so a dependent counts whichever tools it is for.
244
+ */
245
+ function dependentsRejecting(entry, current, installed, replaced, changing) {
246
+ const { name, org, type } = current;
247
+ return (installed.assets ?? []).flatMap((dependent) => {
248
+ const key = identityKey(dependent);
249
+ if (replaced(key))
250
+ return [];
251
+ const range = (changing?.get(key) ?? dependent.dependencies)?.find((d) => d.name === name && d.type === type && (findDependencyAsset(installed, d, dependent.org)?.org ?? d.org) === org)?.version;
252
+ return range && !isLatestAlias(range) && !satisfies(entry.version, range) ? [{ dependent, range }] : [];
253
+ });
254
+ }
191
255
  /**
192
256
  * Record each tool's skipped hooks as excluded for it, on the lockfile entries another tool's pass
193
257
  * (or a teammate's checkout) wrote, so sync, audit and update leave the hook alone for that tool.
@@ -212,16 +276,42 @@ async function excludeSkippedTools(toolResults, tools, before, projectDir) {
212
276
  if (changed)
213
277
  await writeLockfile(projectDir, lockfile);
214
278
  }
215
- /** Whether the asset was uninstalled for the tool, not only skipped as a hook that doesn't declare it. */
216
- function isUninstalledForTool(asset, tool) {
217
- return isExcludedForTool(asset, tool) && !isUndeclaredForTool(asset, tool);
279
+ /**
280
+ * The refusal of a plan that would move `current` to `entry`'s version, which the installed
281
+ * dependents outside the plan (`rejecting`) do not accept. It names them and gives no command:
282
+ * `atk why` lists no dependents of an asset installed directly. With `named`, the asset was asked
283
+ * for, and the hint offers `--force`.
284
+ */
285
+ function movedDependencyError(entry, current, rejecting, named) {
286
+ const move = `This would move "${formatOrgName(current.org, current.name)}" from ${current.version} to ${entry.version}`;
287
+ const names = rejecting.map(({ dependent }) => `"${formatOrgName(dependent.org, dependent.name)}"`).join(', ');
288
+ return new InstallerError(`${move}, ${rejectedBy(rejecting)}`, {
289
+ hint: named
290
+ ? `Update or uninstall ${names} first, or run the command again with --force to move it anyway.`
291
+ : `Update or uninstall ${names} first, then run the command again.`,
292
+ });
293
+ }
294
+ /**
295
+ * The refusal of a plan that would move `current`, an asset the command was asked for, to `entry`'s
296
+ * version while it is pinned at another. The commands run in `scope`, and name `current` as
297
+ * `lockfile` lets them reach it.
298
+ */
299
+ function pinnedAssetError(entry, current, lockfile, { named, scope }) {
300
+ const pinned = `"${formatOrgName(current.org, current.name)}" is pinned at ${current.pinnedVersion}`;
301
+ return new InstallerError(`${pinned}, so this would move it to ${entry.version}.`, {
302
+ command: scopedCommand(`atk unpin ${entrySpec(lockfile, current)}`, scope),
303
+ hint: named
304
+ ? `Unpin it, or run the command again with --pin to pin it at ${entry.version} instead.`
305
+ : 'Unpin it to let it move to another version.',
306
+ });
218
307
  }
219
308
  /**
220
309
  * The refusal of a plan that would move `current`, a pinned dependency, to `entry`'s version:
221
310
  * because a dependent does not accept its version (`accepted` false), or because a tool does not
222
- * have it in place, which `atk sync` puts back at the pinned version. The commands run in `scope`.
311
+ * have it in place, which `atk sync` puts back at the pinned version. The commands run in `scope`,
312
+ * and name `current` as `lockfile` lets them reach it.
223
313
  */
224
- function pinnedDependencyError(entry, current, accepted, scope) {
314
+ function pinnedDependencyError(entry, current, accepted, lockfile, scope) {
225
315
  const displayName = formatOrgName(current.org, current.name);
226
316
  const pinned = `"${displayName}" is pinned at ${current.version}`;
227
317
  if (accepted) {
@@ -232,10 +322,17 @@ function pinnedDependencyError(entry, current, accepted, scope) {
232
322
  }
233
323
  const dependent = entry.requiredBy ? `"${entry.requiredBy}"` : 'an asset in the plan';
234
324
  return new InstallerError(`${pinned}, which ${dependent} does not accept (it needs ${entry.version}).`, {
235
- command: scopedCommand(`atk unpin ${displayName}`, scope),
325
+ command: scopedCommand(`atk unpin ${entrySpec(lockfile, current)}`, scope),
236
326
  hint: 'Unpin it to let it move to another version.',
237
327
  });
238
328
  }
329
+ /** What the installed dependents (`rejecting`) need instead, as the end of a sentence. */
330
+ function rejectedBy(rejecting) {
331
+ const names = rejecting.map(({ dependent }) => `"${formatOrgName(dependent.org, dependent.name)}"`);
332
+ return rejecting.length === 1
333
+ ? `which the installed ${names[0]} does not accept (it needs ${rejecting[0].range}).`
334
+ : `which installed assets do not accept: ${rejecting.map(({ range }, i) => `${names[i]} needs ${range}`).join(', ')}.`;
335
+ }
239
336
  /**
240
337
  * What the adapter's tool made of `plan` beyond its results: the hooks it skipped because their
241
338
  * manifest doesn't declare it, and the other assets it installed although their manifest lists
@@ -1 +1 @@
1
- {"version":3,"file":"multi-tool-install.js","sourceRoot":"","sources":["../../src/lib/multi-tool-install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAOnC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,cAAc,EACd,cAAc,EAEd,gBAAgB,EAEhB,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAc,aAAa,EAAE,MAAM,YAAY,CAAC;AA8BvD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,aAA0B,EAC1B,KAAgD,EAChD,OAA4G;IAE5G,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,OA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EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC;IACD,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AACtG,CAAC"}
@@ -15,10 +15,18 @@ export interface FindNamedEntryOptions {
15
15
  /** A requested version, carried into the suggested commands. */
16
16
  version?: string;
17
17
  }
18
+ /**
19
+ * How a command names an installed entry so that {@link findNamedEntry} finds it again: `@org/name`
20
+ * for an org's entry, and the bare name for a global one, unless the lockfile org has an entry of
21
+ * that name (of `type`, when the command passes `--type`), which the bare name would reach first:
22
+ * then `global:name`.
23
+ */
24
+ export declare function entrySpec(lockfile: Lockfile, asset: Pick<InstalledAsset, 'name' | 'org' | 'type'>, type?: AssetType): string;
18
25
  /**
19
26
  * The installed asset a name given to `atk <command> <spec>` names. `@org/name` names that org's
20
- * entry only. A bare name resolves the way `install` resolved it: the lockfile org's entry, else
21
- * the global one. A name installed as more than one type needs `type` to pick one.
27
+ * entry only, and `global:name` the global one only. A bare name resolves the way `install`
28
+ * resolved it: the lockfile org's entry, else the global one. A name installed as more than one
29
+ * type needs `type` to pick one.
22
30
  */
23
31
  export declare function findNamedEntry(lockfile: Lockfile, spec: string, { command, error: NamedError, root, scope, type, version }: FindNamedEntryOptions): InstalledAsset;
24
32
  //# sourceMappingURL=named-entry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"named-entry.d.ts","sourceRoot":"","sources":["../../src/lib/named-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAA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pE,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC,EACpD,IAAI,CAAC,EAAE,SAAS,GACf,MAAM,CAMR;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,qBAAqB,GAChF,cAAc,CAmChB"}
@@ -1,16 +1,30 @@
1
- import { formatOrgName, parseOrgFromName } from './org.js';
1
+ import { formatOrgName, GLOBAL_PREFIX, inlineOrgOf, parseNameScope } from './org.js';
2
2
  import { scopedCommand, scopeLabel } from './scope.js';
3
+ /**
4
+ * How a command names an installed entry so that {@link findNamedEntry} finds it again: `@org/name`
5
+ * for an org's entry, and the bare name for a global one, unless the lockfile org has an entry of
6
+ * that name (of `type`, when the command passes `--type`), which the bare name would reach first:
7
+ * then `global:name`.
8
+ */
9
+ export function entrySpec(lockfile, asset, type) {
10
+ if (asset.org !== undefined || lockfile.org === undefined)
11
+ return formatOrgName(asset.org, asset.name);
12
+ const shadowed = (lockfile.assets ?? []).some((a) => a.name === asset.name && a.org === lockfile.org && (!type || a.type === type));
13
+ return shadowed ? `${GLOBAL_PREFIX}${asset.name}` : asset.name;
14
+ }
3
15
  /**
4
16
  * The installed asset a name given to `atk <command> <spec>` names. `@org/name` names that org's
5
- * entry only. A bare name resolves the way `install` resolved it: the lockfile org's entry, else
6
- * the global one. A name installed as more than one type needs `type` to pick one.
17
+ * entry only, and `global:name` the global one only. A bare name resolves the way `install`
18
+ * resolved it: the lockfile org's entry, else the global one. A name installed as more than one
19
+ * type needs `type` to pick one.
7
20
  */
8
21
  export function findNamedEntry(lockfile, spec, { command, error: NamedError, root, scope, type, version }) {
9
- const { name, org } = parseOrgFromName(spec);
10
- const named = (lockfile.assets ?? []).filter((a) => a.name === name && (!type || a.type === type));
11
- let matches = named.filter((a) => a.org === (org ?? lockfile.org));
12
- if (matches.length === 0 && !org && lockfile.org) {
13
- matches = named.filter((a) => a.org === undefined);
22
+ const named = parseNameScope(spec);
23
+ const sameName = (lockfile.assets ?? []).filter((a) => a.name === named.name && (!type || a.type === type));
24
+ const inOrg = (org) => sameName.filter((a) => a.org === org);
25
+ let matches = inOrg(named.kind === 'default' ? lockfile.org : inlineOrgOf(named));
26
+ if (matches.length === 0 && named.kind === 'default' && lockfile.org) {
27
+ matches = inOrg(undefined);
14
28
  }
15
29
  const versionSuffix = version ? `@${version}` : '';
16
30
  if (matches.length > 1) {
@@ -20,7 +34,7 @@ export function findNamedEntry(lockfile, spec, { command, error: NamedError, roo
20
34
  if (matches.length === 1)
21
35
  return matches[0];
22
36
  const notInstalled = `Asset "${spec}" is not installed${root ? ` in ${scopeLabel({ root, scope: scope ?? 'project' })}` : ''}.`;
23
- const elsewhere = [...new Set(named.map((a) => formatOrgName(a.org, a.name)))].sort();
37
+ const elsewhere = [...new Set(sameName.map((a) => entrySpec(lockfile, a, type)))].sort();
24
38
  if (elsewhere.length > 0) {
25
39
  throw new NamedError(`${notInstalled} Installed as: ${elsewhere.join(', ')}.`, elsewhere.length === 1
26
40
  ? {
@@ -1 +1 @@
1
- {"version":3,"file":"named-entry.js","sourceRoot":"","sources":["../../src/lib/named-entry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAc,aAAa,EAAE,UAAU,EAAE,MAAM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,EAAE,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;IAChI,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACzF,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,UAAU,CAClB,GAAG,YAAY,kBAAkB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EACxD,SAAS,CAAC,MAAM,KAAK,CAAC;YACpB,CAAC,CAAC;gBACE,OAAO,EAAE,aAAa,CACpB,OAAO,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAChF,KAAK,CACN;aACF;YACH,CAAC,CAAC,EAAE,CACP,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,UAAU,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC"}
@@ -12,19 +12,6 @@ export declare function isBareOrgScope(input: string): boolean;
12
12
  * Returns true if the name is org-scoped (starts with `@`).
13
13
  */
14
14
  export declare function isOrgScoped(name: string): boolean;
15
- /**
16
- * Parse a bundle spec into its canonical `(org | undefined, name)` identity.
17
- *
18
- * `@{org}/{name}` parses to `{ org, name }` with a bare org (the `@` is
19
- * CLI/display syntax only, never stored); bare `{name}` parses to
20
- * `{ org: undefined, name }` (a global bundle). This is the single parser for
21
- * every surface that accepts a bundle name (install, info, uninstall,
22
- * unpublish, promote) so they all resolve the same identity.
23
- */
24
- export declare function parseBundleSpec(spec: string): {
25
- name: string;
26
- org?: string;
27
- };
28
15
  /**
29
16
  * Parse an `@org/name` string into structured parts.
30
17
  * Plain names (without `@` prefix) return no org.
@@ -39,6 +26,38 @@ export declare function parseOrgFromName(input: string): {
39
26
  * Returns undefined if no org is set at any level.
40
27
  */
41
28
  export declare function resolveActiveOrg(cliOrg?: string, lockfileOrg?: string, configOrg?: string): string | undefined;
29
+ /**
30
+ * The prefix that names the global asset of a name, `global:foo`, where a bare `foo` would resolve
31
+ * to the active org's `@org/foo` first. Neither an asset name nor an org can hold a `:`.
32
+ */
33
+ export declare const GLOBAL_PREFIX = "global:";
34
+ /** What a name given to a command names: `@org/name`, `global:name`, or a bare name. */
35
+ export type NameScope = {
36
+ kind: 'default';
37
+ name: string;
38
+ } | {
39
+ kind: 'global';
40
+ name: string;
41
+ } | {
42
+ kind: 'org';
43
+ name: string;
44
+ org: string;
45
+ };
46
+ /** The org of an `@org/name`, or undefined for a bare or `global:` name. */
47
+ export declare function inlineOrgOf(spec: NameScope): string | undefined;
48
+ /**
49
+ * Parse a name as the commands that resolve a bare name in the active org read it: `@org/name`
50
+ * names that org's asset, `global:name` the global one, and a bare name the active org's, else the
51
+ * global one. A bundle's identity is exact: `@org/name` that org's bundle, and a bare or `global:`
52
+ * name the global one. The org is bare (the `@` is CLI/display syntax only, never stored). Takes no
53
+ * `@version` suffix (`parseNameVersion` splits that off first).
54
+ */
55
+ export declare function parseNameScope(spec: string): NameScope;
56
+ /**
57
+ * The org a name resolves in first, as {@link resolveActiveOrg} orders it: none for `global:name`,
58
+ * which names only the global asset. `global:` with `--org` names two scopes, so it is refused.
59
+ */
60
+ export declare function resolveSpecOrg(spec: NameScope, cliOrg?: string, lockfileOrg?: string, configOrg?: string): string | undefined;
42
61
  /**
43
62
  * Why `command` refuses an org asset whose registry lookup fell back to the global asset of the
44
63
  * same name: that is another asset, so update and sync don't switch the installed one to it, and
@@ -1 +1 @@
1
- {"version":3,"file":"org.d.ts","sourceRoot":"","sources":["../../src/lib/org.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAiB,MAAM,YA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AC,EAAE,MAAM,GACjB,MAAM,GAAG,SAAS,CAQpB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EACzC,QAAQ,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EACxC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,EACnC,KAAK,CAAC,EAAE,KAAK,GACZ;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAcpD"}
package/build/lib/org.js CHANGED
@@ -22,18 +22,6 @@ export function isBareOrgScope(input) {
22
22
  export function isOrgScoped(name) {
23
23
  return name.startsWith('@');
24
24
  }
25
- /**
26
- * Parse a bundle spec into its canonical `(org | undefined, name)` identity.
27
- *
28
- * `@{org}/{name}` parses to `{ org, name }` with a bare org (the `@` is
29
- * CLI/display syntax only, never stored); bare `{name}` parses to
30
- * `{ org: undefined, name }` (a global bundle). This is the single parser for
31
- * every surface that accepts a bundle name (install, info, uninstall,
32
- * unpublish, promote) so they all resolve the same identity.
33
- */
34
- export function parseBundleSpec(spec) {
35
- return parseOrgFromName(spec);
36
- }
37
25
  /**
38
26
  * Parse an `@org/name` string into structured parts.
39
27
  * Plain names (without `@` prefix) return no org.
@@ -59,6 +47,42 @@ export function parseOrgFromName(input) {
59
47
  export function resolveActiveOrg(cliOrg, lockfileOrg, configOrg) {
60
48
  return cliOrg ?? lockfileOrg ?? configOrg ?? undefined;
61
49
  }
50
+ /**
51
+ * The prefix that names the global asset of a name, `global:foo`, where a bare `foo` would resolve
52
+ * to the active org's `@org/foo` first. Neither an asset name nor an org can hold a `:`.
53
+ */
54
+ export const GLOBAL_PREFIX = 'global:';
55
+ /** The org of an `@org/name`, or undefined for a bare or `global:` name. */
56
+ export function inlineOrgOf(spec) {
57
+ return spec.kind === 'org' ? spec.org : undefined;
58
+ }
59
+ /**
60
+ * Parse a name as the commands that resolve a bare name in the active org read it: `@org/name`
61
+ * names that org's asset, `global:name` the global one, and a bare name the active org's, else the
62
+ * global one. A bundle's identity is exact: `@org/name` that org's bundle, and a bare or `global:`
63
+ * name the global one. The org is bare (the `@` is CLI/display syntax only, never stored). Takes no
64
+ * `@version` suffix (`parseNameVersion` splits that off first).
65
+ */
66
+ export function parseNameScope(spec) {
67
+ const globalName = spec.startsWith(GLOBAL_PREFIX) ? spec.slice(GLOBAL_PREFIX.length) : undefined;
68
+ // `global:` takes a bare name: anything else stays the literal name, which nothing has.
69
+ if (globalName && !globalName.startsWith('@'))
70
+ return { kind: 'global', name: globalName };
71
+ const { name, org } = parseOrgFromName(spec);
72
+ return org === undefined ? { kind: 'default', name } : { kind: 'org', name, org };
73
+ }
74
+ /**
75
+ * The org a name resolves in first, as {@link resolveActiveOrg} orders it: none for `global:name`,
76
+ * which names only the global asset. `global:` with `--org` names two scopes, so it is refused.
77
+ */
78
+ export function resolveSpecOrg(spec, cliOrg, lockfileOrg, configOrg) {
79
+ if (spec.kind !== 'global')
80
+ return resolveActiveOrg(inlineOrgOf(spec) ?? cliOrg, lockfileOrg, configOrg);
81
+ if (cliOrg) {
82
+ throw new Error(`"${GLOBAL_PREFIX}${spec.name}" names the global asset, and --org names @${cliOrg}. Give one of them.`);
83
+ }
84
+ return undefined;
85
+ }
62
86
  /**
63
87
  * Why `command` refuses an org asset whose registry lookup fell back to the global asset of the
64
88
  * same name: that is another asset, so update and sync don't switch the installed one to it, and
@@ -1 +1 @@
1
- {"version":3,"file":"org.js","sourceRoot":"","sources":["../../src/lib/org.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,YAAY,CAAC;AAEvD;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,GAAuB,EAAE,IAAY;IACjE,IAAI,GAAG,EAAE,CAAC;QAC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ACtD,IAAI,EAAE,aAAa,aAAa,CAAC,eAAe,YAAY,EAAE,EAAE,KAAK,CAAC,4BAA4B;QAClG,OAAO,EACL,IAAI,IAAI,yCAAyC,SAAS,CAAC,GAAG,8BAA8B;YAC5F,IAAI,YAAY,UAAU,OAAO,GAAG;KACvC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { Notice } from './notices.js';
2
+ import type { InstallPlan } from './resolver.js';
3
+ import type { AssetType } from './schemas/index.js';
4
+ import { type Scope } from './scope.js';
5
+ /** An install's direct targets whose authors say they work best at the scope it wasn't asked for. */
6
+ export interface PreferredScope {
7
+ /** Each such target, as the plan resolved it. */
8
+ assets: Array<{
9
+ name: string;
10
+ org?: string;
11
+ type: AssetType;
12
+ }>;
13
+ /**
14
+ * Whether another direct target prefers the scope asked for, so moving the install would only miss
15
+ * that author's preference instead.
16
+ */
17
+ conflict: boolean;
18
+ /** The scope they prefer. */
19
+ scope: Scope;
20
+ }
21
+ /**
22
+ * Whether an install could move to `scope`: the user scope when its root exists, and the project when
23
+ * the cwd is in one other than the user root.
24
+ */
25
+ export declare function canInstallAt(scope: Scope): Promise<boolean>;
26
+ /** `The author says atk-guide works best at the user level.` */
27
+ export declare function describePreferredScope({ assets, scope }: PreferredScope): string;
28
+ /** The `preferred-scope` notice: what the authors say, and `command`, the install at their scope. */
29
+ export declare function preferredScopeNotice(preferred: PreferredScope, command: string): Notice;
30
+ /**
31
+ * The plan's direct targets (the asset, a bundle's members, each named asset) that prefer the scope
32
+ * other than `scope`; undefined when none does. Dependencies install with what needs them, so their
33
+ * preference doesn't count.
34
+ */
35
+ export declare function preferredScopeOf(plan: InstallPlan, scope: Scope): PreferredScope | undefined;
36
+ /** How a question offers the preferred scope: `with --user`, or `in the project`. */
37
+ export declare function preferredScopeOffer(scope: Scope): string;
38
+ //# sourceMappingURL=preferred-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preferred-scope.d.ts","sourceRoot":"","sources":["../../src/lib/preferred-scope.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAIpD,OAAO,EAA+B,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAErE,qGAAqG;AACrG,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IAC/D;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,6BAA6B;IAC7B,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAMjE;AAED,gEAAgE;AAChE,wBAAgB,sBAAsB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,cAAc,GAAG,MAAM,CAMhF;AAED,qGAAqG;AACrG,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvF;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,GAAG,cAAc,GAAG,SAAS,CAa5F;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAExD"}