@detergent-software/atk 9.4.0-dev.2 → 9.4.0-dev.21

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 (163) hide show
  1. package/CHANGELOG.md +165 -0
  2. package/README.md +2 -2
  3. package/build/command-manifest.json +5 -5
  4. package/build/commands/audit.d.ts.map +1 -1
  5. package/build/commands/audit.js +7 -4
  6. package/build/commands/audit.js.map +1 -1
  7. package/build/commands/diff.d.ts.map +1 -1
  8. package/build/commands/diff.js +10 -10
  9. package/build/commands/diff.js.map +1 -1
  10. package/build/commands/info.d.ts.map +1 -1
  11. package/build/commands/info.js +17 -14
  12. package/build/commands/info.js.map +1 -1
  13. package/build/commands/install.d.ts.map +1 -1
  14. package/build/commands/install.js +279 -81
  15. package/build/commands/install.js.map +1 -1
  16. package/build/commands/move.d.ts.map +1 -1
  17. package/build/commands/move.js +5 -4
  18. package/build/commands/move.js.map +1 -1
  19. package/build/commands/outdated.js +1 -1
  20. package/build/commands/outdated.js.map +1 -1
  21. package/build/commands/update.d.ts.map +1 -1
  22. package/build/commands/update.js +14 -7
  23. package/build/commands/update.js.map +1 -1
  24. package/build/commands/why.d.ts.map +1 -1
  25. package/build/commands/why.js +28 -7
  26. package/build/commands/why.js.map +1 -1
  27. package/build/components/AssetDetail.d.ts.map +1 -1
  28. package/build/components/AssetDetail.js +1 -1
  29. package/build/components/AssetDetail.js.map +1 -1
  30. package/build/components/DiffView.d.ts +3 -1
  31. package/build/components/DiffView.d.ts.map +1 -1
  32. package/build/components/DiffView.js +2 -2
  33. package/build/components/DiffView.js.map +1 -1
  34. package/build/components/InitSuccess.d.ts.map +1 -1
  35. package/build/components/InitSuccess.js +4 -1
  36. package/build/components/InitSuccess.js.map +1 -1
  37. package/build/components/InstallSummary.d.ts +7 -2
  38. package/build/components/InstallSummary.d.ts.map +1 -1
  39. package/build/components/InstallSummary.js +3 -1
  40. package/build/components/InstallSummary.js.map +1 -1
  41. package/build/components/PreferredScopeQuestion.d.ts +16 -0
  42. package/build/components/PreferredScopeQuestion.d.ts.map +1 -0
  43. package/build/components/PreferredScopeQuestion.js +20 -0
  44. package/build/components/PreferredScopeQuestion.js.map +1 -0
  45. package/build/components/PreferredScopeWarning.d.ts +17 -0
  46. package/build/components/PreferredScopeWarning.d.ts.map +1 -0
  47. package/build/components/PreferredScopeWarning.js +13 -0
  48. package/build/components/PreferredScopeWarning.js.map +1 -0
  49. package/build/components/index.d.ts +2 -0
  50. package/build/components/index.d.ts.map +1 -1
  51. package/build/components/index.js +2 -0
  52. package/build/components/index.js.map +1 -1
  53. package/build/hooks/useInitState.d.ts +9 -1
  54. package/build/hooks/useInitState.d.ts.map +1 -1
  55. package/build/hooks/useInitState.js +43 -6
  56. package/build/hooks/useInitState.js.map +1 -1
  57. package/build/hooks/useListActions.d.ts.map +1 -1
  58. package/build/hooks/useListActions.js +9 -2
  59. package/build/hooks/useListActions.js.map +1 -1
  60. package/build/lib/adapter.d.ts +14 -9
  61. package/build/lib/adapter.d.ts.map +1 -1
  62. package/build/lib/adapter.js +46 -8
  63. package/build/lib/adapter.js.map +1 -1
  64. package/build/lib/asset-tools.d.ts +10 -0
  65. package/build/lib/asset-tools.d.ts.map +1 -1
  66. package/build/lib/asset-tools.js +18 -0
  67. package/build/lib/asset-tools.js.map +1 -1
  68. package/build/lib/atk-schemas/index.d.ts +1 -1
  69. package/build/lib/atk-schemas/index.d.ts.map +1 -1
  70. package/build/lib/atk-schemas/index.js +1 -1
  71. package/build/lib/atk-schemas/index.js.map +1 -1
  72. package/build/lib/atk-schemas/manifest.d.ts +14 -0
  73. package/build/lib/atk-schemas/manifest.d.ts.map +1 -1
  74. package/build/lib/atk-schemas/manifest.js +3 -0
  75. package/build/lib/atk-schemas/manifest.js.map +1 -1
  76. package/build/lib/atk-schemas/registry.d.ts +16 -0
  77. package/build/lib/atk-schemas/registry.d.ts.map +1 -1
  78. package/build/lib/atk-schemas/registry.js +2 -1
  79. package/build/lib/atk-schemas/registry.js.map +1 -1
  80. package/build/lib/completion/candidates.d.ts.map +1 -1
  81. package/build/lib/completion/candidates.js +21 -8
  82. package/build/lib/completion/candidates.js.map +1 -1
  83. package/build/lib/config-entries.d.ts +3 -3
  84. package/build/lib/config-entries.d.ts.map +1 -1
  85. package/build/lib/config-entries.js +16 -6
  86. package/build/lib/config-entries.js.map +1 -1
  87. package/build/lib/config-lock.d.ts +2 -1
  88. package/build/lib/config-lock.d.ts.map +1 -1
  89. package/build/lib/config-lock.js +10 -2
  90. package/build/lib/config-lock.js.map +1 -1
  91. package/build/lib/cross-scope.d.ts +6 -2
  92. package/build/lib/cross-scope.d.ts.map +1 -1
  93. package/build/lib/cross-scope.js +20 -13
  94. package/build/lib/cross-scope.js.map +1 -1
  95. package/build/lib/diagnostics.d.ts +3 -2
  96. package/build/lib/diagnostics.d.ts.map +1 -1
  97. package/build/lib/diagnostics.js +6 -4
  98. package/build/lib/diagnostics.js.map +1 -1
  99. package/build/lib/diff-command.d.ts +7 -2
  100. package/build/lib/diff-command.d.ts.map +1 -1
  101. package/build/lib/diff-command.js +14 -10
  102. package/build/lib/diff-command.js.map +1 -1
  103. package/build/lib/gitignore.d.ts +8 -0
  104. package/build/lib/gitignore.d.ts.map +1 -1
  105. package/build/lib/gitignore.js +51 -6
  106. package/build/lib/gitignore.js.map +1 -1
  107. package/build/lib/hook-config.d.ts +60 -5
  108. package/build/lib/hook-config.d.ts.map +1 -1
  109. package/build/lib/hook-config.js +97 -5
  110. package/build/lib/hook-config.js.map +1 -1
  111. package/build/lib/hook-script.d.ts +10 -0
  112. package/build/lib/hook-script.d.ts.map +1 -1
  113. package/build/lib/hook-script.js +31 -1
  114. package/build/lib/hook-script.js.map +1 -1
  115. package/build/lib/init.d.ts +12 -4
  116. package/build/lib/init.d.ts.map +1 -1
  117. package/build/lib/init.js +78 -16
  118. package/build/lib/init.js.map +1 -1
  119. package/build/lib/install-targets.d.ts +35 -8
  120. package/build/lib/install-targets.d.ts.map +1 -1
  121. package/build/lib/install-targets.js +87 -14
  122. package/build/lib/install-targets.js.map +1 -1
  123. package/build/lib/installer.d.ts +19 -3
  124. package/build/lib/installer.d.ts.map +1 -1
  125. package/build/lib/installer.js +112 -32
  126. package/build/lib/installer.js.map +1 -1
  127. package/build/lib/mover.d.ts +5 -4
  128. package/build/lib/mover.d.ts.map +1 -1
  129. package/build/lib/mover.js +23 -27
  130. package/build/lib/mover.js.map +1 -1
  131. package/build/lib/multi-tool-install.d.ts +48 -11
  132. package/build/lib/multi-tool-install.d.ts.map +1 -1
  133. package/build/lib/multi-tool-install.js +167 -38
  134. package/build/lib/multi-tool-install.js.map +1 -1
  135. package/build/lib/named-entry.d.ts +12 -0
  136. package/build/lib/named-entry.d.ts.map +1 -1
  137. package/build/lib/named-entry.js +16 -8
  138. package/build/lib/named-entry.js.map +1 -1
  139. package/build/lib/preferred-scope.d.ts +38 -0
  140. package/build/lib/preferred-scope.d.ts.map +1 -0
  141. package/build/lib/preferred-scope.js +53 -0
  142. package/build/lib/preferred-scope.js.map +1 -0
  143. package/build/lib/schemas/adapter.d.ts +24 -0
  144. package/build/lib/schemas/adapter.d.ts.map +1 -1
  145. package/build/lib/schemas/adapter.js +18 -4
  146. package/build/lib/schemas/adapter.js.map +1 -1
  147. package/build/lib/sync.d.ts +7 -0
  148. package/build/lib/sync.d.ts.map +1 -1
  149. package/build/lib/sync.js +41 -3
  150. package/build/lib/sync.js.map +1 -1
  151. package/build/lib/touched-paths.d.ts.map +1 -1
  152. package/build/lib/touched-paths.js +2 -1
  153. package/build/lib/touched-paths.js.map +1 -1
  154. package/build/lib/uninstaller.d.ts.map +1 -1
  155. package/build/lib/uninstaller.js +11 -3
  156. package/build/lib/uninstaller.js.map +1 -1
  157. package/build/lib/updater.d.ts +32 -5
  158. package/build/lib/updater.d.ts.map +1 -1
  159. package/build/lib/updater.js +129 -14
  160. package/build/lib/updater.js.map +1 -1
  161. package/package.json +1 -1
  162. package/tool-adapters/codex-cli.json +5 -1
  163. package/tool-adapters/copilot-cli.json +55 -9
@@ -1,8 +1,8 @@
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, takesEntrypoint, withToolExcluded, } from './asset-tools.js';
3
3
  import { errorMessage } from './errors.js';
4
4
  import { isInstalledForTool } from './installed-for-tool.js';
5
- import { assertInstalledByAnyTool, executeInstallPlan, fetchPlanFiles, InstallerError, InstallPlanError, placeableEntries, rollBackInstalledAssets, } from './installer.js';
5
+ import { assertInstalledByAnyTool, entrypointRefusal, executeInstallPlan, fetchPlanFiles, InstallerError, InstallPlanError, placeableEntries, planEntryKey, rollBackInstalledAssets, } from './installer.js';
6
6
  import { addAssetToLockfile, findDependencyAsset, findInstalledAsset, identityKey, readLockfile, writeLockfile, } from './lockfile.js';
7
7
  import { entrySpec } from './named-entry.js';
8
8
  import { formatOrgName } from './org.js';
@@ -20,16 +20,17 @@ import { scopedCommand } from './scope.js';
20
20
  * the failing pass kept itself that way ({@link InstallPlanError.keptInstall}), every pass stays.
21
21
  *
22
22
  * A dependency already in place at a version its dependents in the plan accept is left as it is,
23
- * 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}).
24
25
  */
25
26
  export async function executeInstallPlanForTools(requestedPlan, tools, options) {
26
- const { onTool, ...installOptions } = options;
27
+ const { named: _named, onTool, ...installOptions } = options;
27
28
  const before = await readLockfile(options.projectDir);
28
29
  const plan = withoutKeptDependencies(requestedPlan, before, tools, options);
29
30
  // What each tool had in place before the command, by plan entry: read now, before any pass writes.
30
31
  const inPlaceBefore = tools.map(({ adapter }) => {
31
32
  const inPlace = new Map();
32
- for (const entry of placeableEntries(plan, adapter)) {
33
+ for (const entry of placeableEntries(plan, adapter, before)) {
33
34
  const installed = findInstalledAsset(before, entry.asset.name, entry.asset.type, entry.asset.org);
34
35
  if (installed && isInstalledForTool(installed, adapter, options.projectDir))
35
36
  inPlace.set(entry, installed);
@@ -39,10 +40,12 @@ export async function executeInstallPlanForTools(requestedPlan, tools, options)
39
40
  // Every tool's files, downloaded once before any pass writes, so a refused download leaves the
40
41
  // project as it was and the passes share one copy.
41
42
  const adapters = tools.map(({ adapter }) => adapter);
42
- const downloadCount = new Set(adapters.flatMap((adapter) => placeableEntries(plan, adapter))).size;
43
+ const downloadCount = new Set(adapters.flatMap((adapter) => placeableEntries(plan, adapter, before))).size;
43
44
  if (downloadCount > 0)
44
45
  options.onProgress?.(`Downloading ${downloadCount} asset(s)...`);
45
- const files = await fetchPlanFiles(plan, adapters);
46
+ const files = await fetchPlanFiles(plan, adapters, undefined, before);
47
+ // A tool skips a hook whose entrypoint it can't take only beside other tools; alone, it refuses it.
48
+ const skipFiles = tools.length > 1 ? files : undefined;
46
49
  const toolResults = [];
47
50
  try {
48
51
  for (const { adapter, tool } of tools) {
@@ -54,12 +57,15 @@ export async function executeInstallPlanForTools(requestedPlan, tools, options)
54
57
  installedBefore: before,
55
58
  skipUnsupported: tools.length > 1,
56
59
  });
57
- toolResults.push({ results, tool, ...toolSupportNotes(plan, adapter) });
60
+ toolResults.push({ results, tool, ...toolSupportNotes(plan, adapter, skipFiles) });
58
61
  }
59
- if (tools.length > 1)
62
+ if (tools.length > 1) {
63
+ assertEntrypointTakenByAnyTool(toolResults, tools, options.scope);
60
64
  assertInstalledByAnyTool(plan, toolResults, options.scope);
61
- if (toolResults.some((r) => r.skipped))
65
+ }
66
+ if (toolResults.some((r) => r.skipped?.some((s) => s.reason === 'unsupported-tool'))) {
62
67
  await excludeSkippedTools(toolResults, tools, before, options.projectDir);
68
+ }
63
69
  }
64
70
  catch (error) {
65
71
  // The failing tool kept its pass, whose lockfile entries the other passes' rollback would undo.
@@ -70,7 +76,7 @@ export async function executeInstallPlanForTools(requestedPlan, tools, options)
70
76
  for (let i = toolResults.length - 1; i >= 0; i--) {
71
77
  const { adapter, tool } = tools[i];
72
78
  const inPlace = inPlaceBefore[i];
73
- const entries = placeableEntries(plan, adapter);
79
+ const entries = placeableEntries(plan, adapter, before, skipFiles);
74
80
  const placed = toolResults[i].results.map((result, j) => ({
75
81
  asset: entries[j].asset,
76
82
  entry: entries[j],
@@ -103,9 +109,23 @@ export async function executeInstallPlanForTools(requestedPlan, tools, options)
103
109
  * entries of the plan that depend on it, at the version the plan installs, or, for one it leaves
104
110
  * as it is, at its installed version. A dependency that only the planned versions of entries it
105
111
  * leaves out need, versions that won't be installed, is left out too. The plan's direct entries,
106
- * the assets asked for, are always installed. A pinned dependency the plan would move to another
107
- * version refuses the install, before anything is written, unless the tools that lack it are ones
108
- * it was uninstalled for. Dry runs and updates trim their plans the same way.
112
+ * the assets asked for, are always installed. A tool the dependency was uninstalled for doesn't
113
+ * lack it: the installer doesn't place it there (see {@link placeableEntries}). A pinned dependency
114
+ * the plan would move to another version refuses the install, before anything is written, and so
115
+ * does a dependency it would move to a version that an installed dependent outside the plan does not
116
+ * accept. Dry runs and updates trim their plans the same way.
117
+ *
118
+ * A direct entry, an asset the command was asked for, that moves an installed asset to another
119
+ * version refuses the install the same way: when an installed dependent outside the plan does not
120
+ * accept that version, or when the asset is pinned at another version and `pin` doesn't pin it
121
+ * anew. With `named` (a command that names its assets and has `--force`), the refusal offers
122
+ * `--force`, and `named.force` moves it anyway, with a warning for the dependents.
123
+ *
124
+ * With `notInPlace` (identity key → the tools that lacked the asset when a multi-tool update
125
+ * started), those tools count as lacking it too, so every tool's pass decides the same way. With
126
+ * `changing` (identity key → dependencies), installed assets outside the plan that the command also
127
+ * changes count as dependents with those dependencies, not the ones their lockfile entry records:
128
+ * an update's other assets at the version the run updates them to, and none for one it removes.
109
129
  */
110
130
  export function withoutKeptDependencies(plan, installed, tools, options) {
111
131
  // A dependency names no org, so it resolves the way the resolver found it: in the dependent's
@@ -142,42 +162,76 @@ export function withoutKeptDependencies(plan, installed, tools, options) {
142
162
  };
143
163
  const kept = new Map();
144
164
  const unneeded = new Set();
165
+ // The plan entries the install won't place, by identity: what of them is installed stays as it
166
+ // is, with the dependencies its lockfile entry records.
167
+ const stays = new Set();
168
+ // The installed assets the plan moves to another version. Their dependents are checked once
169
+ // the walk has decided every entry: an installed dependent can come after its dependency in the
170
+ // walk when the version the plan has of it no longer depends on it.
171
+ const moved = [];
145
172
  for (const entry of plan.entries.toReversed()) {
146
173
  const { name, org, type } = entry.asset;
147
174
  const key = identityKey(entry.asset);
148
175
  const ranges = required.get(key);
149
- if (entry.reason === 'dependency' && !ranges && neededByLeftOut.has(key)) {
176
+ // The assets asked for are always installed; one already installed at another version moves.
177
+ if (entry.reason === 'direct') {
178
+ const current = findInstalledAsset(installed, name, type, org);
179
+ if (current && entry.version !== current.version) {
180
+ if (current.pinnedVersion && current.pinnedVersion !== entry.version && !options.pin) {
181
+ if (!options.named?.force)
182
+ throw pinnedAssetError(entry, current, installed, options);
183
+ options.onProgress?.(`Moving "${formatOrgName(current.org, current.name)}" from its pin at ${current.pinnedVersion} to ${entry.version}: it is no longer pinned`);
184
+ }
185
+ moved.push({ current, entry });
186
+ }
187
+ requireAll(plannedDependencies(entry));
188
+ continue;
189
+ }
190
+ if (!ranges && neededByLeftOut.has(key)) {
150
191
  unneeded.add(entry);
192
+ stays.add(key);
151
193
  leaveOut(entry);
152
194
  continue;
153
195
  }
154
- const current = entry.reason === 'dependency' ? findInstalledAsset(installed, name, type, org) : undefined;
196
+ const current = findInstalledAsset(installed, name, type, org);
155
197
  if (!current) {
156
198
  requireAll(plannedDependencies(entry));
157
199
  continue;
158
200
  }
159
201
  const accepted = (ranges ?? []).every((range) => satisfies(current.version, range));
160
- const missingFor = tools
161
- .filter(({ adapter }) => placesAsset(adapter, type, entry.versionData.tools))
162
- .filter(({ adapter }) => !isInstalledForTool(current, adapter, options.projectDir));
163
- // A pinned dependency the plan would move stays as it is when the tools that lack it are ones
164
- // it was uninstalled for: sync would not place it there either.
165
- const keep = accepted &&
166
- (missingFor.length === 0 ||
167
- (current.pinnedVersion !== undefined &&
168
- entry.version !== current.version &&
169
- missingFor.every(({ adapter }) => isUninstalledForTool(current, adapter.tool))));
170
- if (keep) {
202
+ // A tool the dependency was uninstalled for doesn't lack it: sync would not place it there
203
+ // either. Nor does one that can't take its entrypoint (see takesEntrypoint).
204
+ const places = ({ adapter }) => placesAsset(adapter, type, entry.versionData.tools) &&
205
+ !isUninstalledForTool(current, adapter.tool) &&
206
+ takesEntrypoint(adapter, type, current.entrypoint);
207
+ const missingFor = [
208
+ ...tools.filter(places).filter(({ adapter }) => !isInstalledForTool(current, adapter, options.projectDir)),
209
+ ...(options.notInPlace?.get(key) ?? []).map((adapter) => ({ adapter })).filter(places),
210
+ ];
211
+ if (accepted && missingFor.length === 0) {
171
212
  kept.set(entry, current);
213
+ stays.add(key);
172
214
  requireInstalled(entry, current);
173
215
  leaveOut(entry);
174
216
  continue;
175
217
  }
176
- if (current.pinnedVersion && entry.version !== current.version) {
177
- throw pinnedDependencyError(entry, current, accepted, installed, options.scope);
218
+ if (entry.version !== current.version) {
219
+ if (current.pinnedVersion)
220
+ throw pinnedDependencyError(entry, current, accepted, installed, options.scope);
221
+ moved.push({ current, entry });
178
222
  }
179
223
  requireAll(plannedDependencies(entry));
180
224
  }
225
+ const replaced = (key) => planned.has(key) && !stays.has(key);
226
+ for (const { current, entry } of moved) {
227
+ const rejecting = dependentsRejecting(entry, current, installed, replaced, options.changing);
228
+ if (rejecting.length === 0)
229
+ continue;
230
+ const named = entry.reason === 'direct' ? options.named : undefined;
231
+ if (!named?.force)
232
+ throw movedDependencyError(entry, current, rejecting, named);
233
+ options.onProgress?.(`Moving "${formatOrgName(current.org, current.name)}" to ${entry.version}, ${rejectedBy(rejecting)}`);
234
+ }
181
235
  if (kept.size === 0 && unneeded.size === 0)
182
236
  return plan;
183
237
  for (const [{ asset }, current] of [...kept].toReversed()) {
@@ -189,6 +243,38 @@ export function withoutKeptDependencies(plan, installed, tools, options) {
189
243
  const entries = plan.entries.filter((entry) => !kept.has(entry) && !unneeded.has(entry));
190
244
  return { entries, totalCount: entries.length };
191
245
  }
246
+ /**
247
+ * The refusal of an install no tool placed anything of when a tool skipped a hook because it can't
248
+ * take its entrypoint: the other tools didn't take it either, so the reason that tool gives is the
249
+ * one to name.
250
+ */
251
+ function assertEntrypointTakenByAnyTool(toolResults, tools, scope) {
252
+ if (toolResults.some((r) => r.results.length > 0))
253
+ return;
254
+ for (const [i, { skipped = [] }] of toolResults.entries()) {
255
+ const misfit = skipped.find((s) => s.reason === 'unsupported-entrypoint');
256
+ if (misfit?.reason === 'unsupported-entrypoint') {
257
+ throw entrypointRefusal(misfit, tools[i].adapter, misfit.entrypoint, scope);
258
+ }
259
+ }
260
+ }
261
+ /**
262
+ * The installed dependents of `current` that the plan doesn't replace (`replaced`, by identity key)
263
+ * whose range rejects `entry`'s version, with that range: the range their lockfile entry records,
264
+ * or, for one the command also changes, the one its `changing` dependencies give. A dependency
265
+ * resolves as {@link findDependents} resolves it. No version, like `latest`, is no range. Every tool
266
+ * shares the one installed version, so a dependent counts whichever tools it is for.
267
+ */
268
+ function dependentsRejecting(entry, current, installed, replaced, changing) {
269
+ const { name, org, type } = current;
270
+ return (installed.assets ?? []).flatMap((dependent) => {
271
+ const key = identityKey(dependent);
272
+ if (replaced(key))
273
+ return [];
274
+ 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;
275
+ return range && !isLatestAlias(range) && !satisfies(entry.version, range) ? [{ dependent, range }] : [];
276
+ });
277
+ }
192
278
  /**
193
279
  * Record each tool's skipped hooks as excluded for it, on the lockfile entries another tool's pass
194
280
  * (or a teammate's checkout) wrote, so sync, audit and update leave the hook alone for that tool.
@@ -199,7 +285,8 @@ async function excludeSkippedTools(toolResults, tools, before, projectDir) {
199
285
  let changed = false;
200
286
  for (const [i, { skipped = [], tool }] of toolResults.entries()) {
201
287
  const { adapter } = tools[i];
202
- for (const { name, org, type } of skipped) {
288
+ // A hook skipped for its entrypoint records nothing: sync, audit and update read the locked one.
289
+ for (const { name, org, type } of skipped.filter((s) => s.reason === 'unsupported-tool')) {
203
290
  const installed = findInstalledAsset(lockfile, name, type, org);
204
291
  if (!installed || isExcludedForTool(installed, tool))
205
292
  continue;
@@ -213,9 +300,34 @@ async function excludeSkippedTools(toolResults, tools, before, projectDir) {
213
300
  if (changed)
214
301
  await writeLockfile(projectDir, lockfile);
215
302
  }
216
- /** Whether the asset was uninstalled for the tool, not only skipped as a hook that doesn't declare it. */
217
- function isUninstalledForTool(asset, tool) {
218
- return isExcludedForTool(asset, tool) && !isUndeclaredForTool(asset, tool);
303
+ /**
304
+ * The refusal of a plan that would move `current` to `entry`'s version, which the installed
305
+ * dependents outside the plan (`rejecting`) do not accept. It names them and gives no command:
306
+ * `atk why` lists no dependents of an asset installed directly. With `named`, the asset was asked
307
+ * for, and the hint offers `--force`.
308
+ */
309
+ function movedDependencyError(entry, current, rejecting, named) {
310
+ const move = `This would move "${formatOrgName(current.org, current.name)}" from ${current.version} to ${entry.version}`;
311
+ const names = rejecting.map(({ dependent }) => `"${formatOrgName(dependent.org, dependent.name)}"`).join(', ');
312
+ return new InstallerError(`${move}, ${rejectedBy(rejecting)}`, {
313
+ hint: named
314
+ ? `Update or uninstall ${names} first, or run the command again with --force to move it anyway.`
315
+ : `Update or uninstall ${names} first, then run the command again.`,
316
+ });
317
+ }
318
+ /**
319
+ * The refusal of a plan that would move `current`, an asset the command was asked for, to `entry`'s
320
+ * version while it is pinned at another. The commands run in `scope`, and name `current` as
321
+ * `lockfile` lets them reach it.
322
+ */
323
+ function pinnedAssetError(entry, current, lockfile, { named, scope }) {
324
+ const pinned = `"${formatOrgName(current.org, current.name)}" is pinned at ${current.pinnedVersion}`;
325
+ return new InstallerError(`${pinned}, so this would move it to ${entry.version}.`, {
326
+ command: scopedCommand(`atk unpin ${entrySpec(lockfile, current)}`, scope),
327
+ hint: named
328
+ ? `Unpin it, or run the command again with --pin to pin it at ${entry.version} instead.`
329
+ : 'Unpin it to let it move to another version.',
330
+ });
219
331
  }
220
332
  /**
221
333
  * The refusal of a plan that would move `current`, a pinned dependency, to `entry`'s version:
@@ -238,18 +350,35 @@ function pinnedDependencyError(entry, current, accepted, lockfile, scope) {
238
350
  hint: 'Unpin it to let it move to another version.',
239
351
  });
240
352
  }
353
+ /** What the installed dependents (`rejecting`) need instead, as the end of a sentence. */
354
+ function rejectedBy(rejecting) {
355
+ const names = rejecting.map(({ dependent }) => `"${formatOrgName(dependent.org, dependent.name)}"`);
356
+ return rejecting.length === 1
357
+ ? `which the installed ${names[0]} does not accept (it needs ${rejecting[0].range}).`
358
+ : `which installed assets do not accept: ${rejecting.map(({ range }, i) => `${names[i]} needs ${range}`).join(', ')}.`;
359
+ }
241
360
  /**
242
361
  * What the adapter's tool made of `plan` beyond its results: the hooks it skipped because their
243
- * manifest doesn't declare it, and the other assets it installed although their manifest lists
244
- * only other tools.
362
+ * manifest doesn't declare it, or, with the plan's downloaded `files`, because it can't take their
363
+ * entrypoint, and the other assets it installed although their manifest lists only other tools.
245
364
  */
246
- function toolSupportNotes(plan, adapter) {
365
+ function toolSupportNotes(plan, adapter, files) {
247
366
  const skipped = [];
248
367
  const warnings = [];
249
- for (const { asset, versionData } of plan.entries) {
250
- if (!supportsType(adapter, asset.type) || declaresTool(versionData.tools, adapter.tool))
368
+ for (const entry of plan.entries) {
369
+ const { asset, versionData } = entry;
370
+ if (!supportsType(adapter, asset.type))
251
371
  continue;
252
372
  const identity = { name: asset.name, ...(asset.org ? { org: asset.org } : {}), tools: versionData.tools };
373
+ const entrypoint = files?.get(planEntryKey(entry))?.entrypoint;
374
+ if (placesAsset(adapter, asset.type, versionData.tools) &&
375
+ entrypoint !== undefined &&
376
+ !takesEntrypoint(adapter, asset.type, entrypoint)) {
377
+ skipped.push({ ...identity, entrypoint, reason: 'unsupported-entrypoint', type: asset.type });
378
+ continue;
379
+ }
380
+ if (declaresTool(versionData.tools, adapter.tool))
381
+ continue;
253
382
  if (placesAsset(adapter, asset.type, versionData.tools)) {
254
383
  const message = `${formatOrgName(asset.org, asset.name)} lists ${versionData.tools.join(', ')}, ` +
255
384
  `not ${adapter.tool}; it may not work there.`;
@@ -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,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,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,OAAO,CAAC;IAC9C,MAAM,MAAM,GAAG,MAAM,YA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S;QAC5D,IAAI,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;YACxD,MAAM,OAAO,GACX,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,UAAU,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;gBACjF,OAAO,OAAO,CAAC,IAAI,0BAA0B,CAAC;YAChD,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QACrF,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,kBAAkB,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,6 +15,13 @@ export interface FindNamedEntryOptions {
15
15
  /** A requested version, carried into the suggested commands. */
16
16
  version?: string;
17
17
  }
18
+ /** What a name reaches in a lockfile, as {@link lookupNamedEntry} resolves it. */
19
+ export interface NamedEntryLookup {
20
+ /** When the name reaches no entry: how the commands name the entries of that name it missed. */
21
+ elsewhere: string[];
22
+ /** The entries the name reaches: one, or one per type when it needs `--type`. */
23
+ matches: InstalledAsset[];
24
+ }
18
25
  /**
19
26
  * How a command names an installed entry so that {@link findNamedEntry} finds it again: `@org/name`
20
27
  * for an org's entry, and the bare name for a global one, unless the lockfile org has an entry of
@@ -29,4 +36,9 @@ export declare function entrySpec(lockfile: Lockfile, asset: Pick<InstalledAsset
29
36
  * type needs `type` to pick one.
30
37
  */
31
38
  export declare function findNamedEntry(lockfile: Lockfile, spec: string, { command, error: NamedError, root, scope, type, version }: FindNamedEntryOptions): InstalledAsset;
39
+ /**
40
+ * The entries a name reaches, as {@link findNamedEntry} resolves it, for a command that reports a
41
+ * name it doesn't reach instead of refusing it (`why`), or words its own refusal (`move`).
42
+ */
43
+ export declare function lookupNamedEntry(lockfile: Lockfile, spec: string, type?: AssetType): NamedEntryLookup;
32
44
  //# 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,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtE,OAAO,EAAE,KAAK,KAAK,EAA6B,MAAM,YAAY,CAAC;AAEnE,MAAM,WAAW,qBAAqB;IACpC,sGAAsG;IACtG,OAAO,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,KAAK,EAAE,KAAK,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,KAAK,KAAK,CAAC;IACpE,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,MAA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c,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,CA4BhB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,gBAAgB,CAUrG"}
@@ -19,13 +19,7 @@ export function entrySpec(lockfile, asset, type) {
19
19
  * type needs `type` to pick one.
20
20
  */
21
21
  export function findNamedEntry(lockfile, spec, { command, error: NamedError, root, scope, type, version }) {
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);
28
- }
22
+ const { elsewhere, matches } = lookupNamedEntry(lockfile, spec, type);
29
23
  const versionSuffix = version ? `@${version}` : '';
30
24
  if (matches.length > 1) {
31
25
  const types = matches.map((a) => a.type).sort();
@@ -34,7 +28,6 @@ export function findNamedEntry(lockfile, spec, { command, error: NamedError, roo
34
28
  if (matches.length === 1)
35
29
  return matches[0];
36
30
  const notInstalled = `Asset "${spec}" is not installed${root ? ` in ${scopeLabel({ root, scope: scope ?? 'project' })}` : ''}.`;
37
- const elsewhere = [...new Set(sameName.map((a) => entrySpec(lockfile, a, type)))].sort();
38
31
  if (elsewhere.length > 0) {
39
32
  throw new NamedError(`${notInstalled} Installed as: ${elsewhere.join(', ')}.`, elsewhere.length === 1
40
33
  ? {
@@ -44,4 +37,19 @@ export function findNamedEntry(lockfile, spec, { command, error: NamedError, roo
44
37
  }
45
38
  throw new NamedError(notInstalled);
46
39
  }
40
+ /**
41
+ * The entries a name reaches, as {@link findNamedEntry} resolves it, for a command that reports a
42
+ * name it doesn't reach instead of refusing it (`why`), or words its own refusal (`move`).
43
+ */
44
+ export function lookupNamedEntry(lockfile, spec, type) {
45
+ const named = parseNameScope(spec);
46
+ const sameName = (lockfile.assets ?? []).filter((a) => a.name === named.name && (!type || a.type === type));
47
+ const inOrg = (org) => sameName.filter((a) => a.org === org);
48
+ let matches = inOrg(named.kind === 'default' ? lockfile.org : inlineOrgOf(named));
49
+ if (matches.length === 0 && named.kind === 'default' && lockfile.org) {
50
+ matches = inOrg(undefined);
51
+ }
52
+ const elsewhere = matches.length > 0 ? [] : [...new Set(sameName.map((a) => entrySpec(lockfile, a, type)))].sort();
53
+ return { elsewhere, matches };
54
+ }
47
55
  //# sourceMappingURL=named-entry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"named-entry.js","sourceRoot":"","sources":["../../src/lib/named-entry.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACrF,OAAO,EAAc,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAgBnE;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CACvB,QAAkB,EAClB,KAAoD,EACpD,IAAgB;IAEhB,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,IAAI,QAAQ,CAAC,GAAG,KAAK,SAAS;QAAE,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACvG,MAAM,QAAQ,GAAG,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,CAC3C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IA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I,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;IACnH,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAChC,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"}
@@ -0,0 +1,53 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { formatOrgName } from './org.js';
3
+ import { findProjectRoot } from './paths.js';
4
+ import { isUserRoot, resolveUserRoot } from './scope.js';
5
+ /**
6
+ * Whether an install could move to `scope`: the user scope when its root exists, and the project when
7
+ * the cwd is in one other than the user root.
8
+ */
9
+ export async function canInstallAt(scope) {
10
+ try {
11
+ return scope === 'user' ? existsSync(await resolveUserRoot()) : !(await isUserRoot(findProjectRoot()));
12
+ }
13
+ catch {
14
+ return false;
15
+ }
16
+ }
17
+ /** `The author says atk-guide works best at the user level.` */
18
+ export function describePreferredScope({ assets, scope }) {
19
+ const names = assets.map((asset) => formatOrgName(asset.org, asset.name)).join(', ');
20
+ const where = scope === 'user' ? 'at the user level' : 'in a project';
21
+ return assets.length === 1
22
+ ? `The author says ${names} works best ${where}.`
23
+ : `The authors say ${names} work best ${where}.`;
24
+ }
25
+ /** The `preferred-scope` notice: what the authors say, and `command`, the install at their scope. */
26
+ export function preferredScopeNotice(preferred, command) {
27
+ return { command, kind: 'preferred-scope', text: describePreferredScope(preferred) };
28
+ }
29
+ /**
30
+ * The plan's direct targets (the asset, a bundle's members, each named asset) that prefer the scope
31
+ * other than `scope`; undefined when none does. Dependencies install with what needs them, so their
32
+ * preference doesn't count.
33
+ */
34
+ export function preferredScopeOf(plan, scope) {
35
+ const declared = plan.entries.filter((entry) => entry.reason === 'direct' && entry.versionData.preferredScope);
36
+ const other = declared.filter((entry) => entry.versionData.preferredScope !== scope);
37
+ if (other.length === 0)
38
+ return undefined;
39
+ return {
40
+ assets: other.map(({ asset, org = asset.org }) => ({
41
+ name: asset.name,
42
+ ...(org ? { org } : {}),
43
+ type: asset.type,
44
+ })),
45
+ conflict: other.length < declared.length,
46
+ scope: other[0].versionData.preferredScope,
47
+ };
48
+ }
49
+ /** How a question offers the preferred scope: `with --user`, or `in the project`. */
50
+ export function preferredScopeOffer(scope) {
51
+ return scope === 'user' ? 'with --user' : 'in the project';
52
+ }
53
+ //# sourceMappingURL=preferred-scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preferred-scope.js","sourceRoot":"","sources":["../../src/lib/preferred-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAA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