@detergent-software/atk 8.1.2-dev.3 → 8.1.2-dev.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +195 -0
- package/build/commands/browse.js +5 -9
- package/build/commands/browse.js.map +1 -1
- package/build/commands/install.js +2 -2
- package/build/commands/install.js.map +1 -1
- package/build/commands/list.js +2 -2
- package/build/commands/list.js.map +1 -1
- package/build/commands/login.js +2 -2
- package/build/commands/login.js.map +1 -1
- package/build/commands/register.js +3 -3
- package/build/commands/register.js.map +1 -1
- package/build/commands/sync.d.ts.map +1 -1
- package/build/commands/sync.js +16 -11
- package/build/commands/sync.js.map +1 -1
- package/build/commands/uninstall.d.ts +9 -1
- package/build/commands/uninstall.d.ts.map +1 -1
- package/build/commands/uninstall.js +23 -26
- package/build/commands/uninstall.js.map +1 -1
- package/build/commands/update.d.ts +9 -1
- package/build/commands/update.d.ts.map +1 -1
- package/build/commands/update.js +54 -14
- package/build/commands/update.js.map +1 -1
- package/build/components/InstallConfirmBar.d.ts.map +1 -1
- package/build/components/InstallConfirmBar.js +2 -1
- package/build/components/InstallConfirmBar.js.map +1 -1
- package/build/components/ListActionBar.d.ts.map +1 -1
- package/build/components/ListActionBar.js +3 -2
- package/build/components/ListActionBar.js.map +1 -1
- package/build/components/RunStoppedHint.d.ts +13 -0
- package/build/components/RunStoppedHint.d.ts.map +1 -0
- package/build/components/RunStoppedHint.js +12 -0
- package/build/components/RunStoppedHint.js.map +1 -0
- package/build/components/SkippedAssetSection.d.ts +2 -0
- package/build/components/SkippedAssetSection.d.ts.map +1 -1
- package/build/components/SkippedAssetSection.js +1 -1
- package/build/components/SkippedAssetSection.js.map +1 -1
- package/build/components/SyncDriftedList.d.ts +3 -2
- package/build/components/SyncDriftedList.d.ts.map +1 -1
- package/build/components/SyncDriftedList.js +11 -3
- package/build/components/SyncDriftedList.js.map +1 -1
- package/build/components/index.d.ts +1 -0
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +1 -0
- package/build/components/index.js.map +1 -1
- package/build/hooks/useCommand.js +2 -2
- package/build/hooks/useCommand.js.map +1 -1
- package/build/hooks/useInitState.js +5 -5
- package/build/hooks/useInitState.js.map +1 -1
- package/build/hooks/useListActions.d.ts.map +1 -1
- package/build/hooks/useListActions.js +34 -18
- package/build/hooks/useListActions.js.map +1 -1
- package/build/hooks/usePruneState.js +7 -7
- package/build/hooks/usePruneState.js.map +1 -1
- package/build/hooks/usePublishState.js +3 -3
- package/build/hooks/usePublishState.js.map +1 -1
- package/build/hooks/useRegistryChangeState.js +2 -2
- package/build/hooks/useRegistryChangeState.js.map +1 -1
- package/build/hooks/useSetupState.js +3 -3
- package/build/hooks/useSetupState.js.map +1 -1
- package/build/hooks/useUninstallState.d.ts +16 -29
- package/build/hooks/useUninstallState.d.ts.map +1 -1
- package/build/hooks/useUninstallState.js +147 -140
- package/build/hooks/useUninstallState.js.map +1 -1
- package/build/lib/adapter.d.ts.map +1 -1
- package/build/lib/adapter.js +3 -3
- package/build/lib/adapter.js.map +1 -1
- package/build/lib/asset-tools.d.ts +5 -0
- package/build/lib/asset-tools.d.ts.map +1 -1
- package/build/lib/asset-tools.js +7 -0
- package/build/lib/asset-tools.js.map +1 -1
- package/build/lib/auth.d.ts.map +1 -1
- package/build/lib/auth.js +3 -3
- package/build/lib/auth.js.map +1 -1
- package/build/lib/checksum.d.ts.map +1 -1
- package/build/lib/checksum.js +2 -1
- package/build/lib/checksum.js.map +1 -1
- package/build/lib/diagnostics.d.ts.map +1 -1
- package/build/lib/diagnostics.js +6 -5
- package/build/lib/diagnostics.js.map +1 -1
- package/build/lib/diff-command.d.ts.map +1 -1
- package/build/lib/diff-command.js +10 -6
- package/build/lib/diff-command.js.map +1 -1
- package/build/lib/entra.d.ts.map +1 -1
- package/build/lib/entra.js +3 -2
- package/build/lib/entra.js.map +1 -1
- package/build/lib/errors.d.ts +9 -0
- package/build/lib/errors.d.ts.map +1 -1
- package/build/lib/errors.js +29 -0
- package/build/lib/errors.js.map +1 -1
- package/build/lib/file-snapshot.d.ts +17 -0
- package/build/lib/file-snapshot.d.ts.map +1 -0
- package/build/lib/file-snapshot.js +41 -0
- package/build/lib/file-snapshot.js.map +1 -0
- package/build/lib/installer.d.ts +61 -0
- package/build/lib/installer.d.ts.map +1 -1
- package/build/lib/installer.js +148 -43
- package/build/lib/installer.js.map +1 -1
- package/build/lib/lockfile.d.ts +23 -4
- package/build/lib/lockfile.d.ts.map +1 -1
- package/build/lib/lockfile.js +32 -14
- package/build/lib/lockfile.js.map +1 -1
- package/build/lib/org.d.ts +16 -0
- package/build/lib/org.d.ts.map +1 -1
- package/build/lib/org.js +18 -0
- package/build/lib/org.js.map +1 -1
- package/build/lib/owned-paths.d.ts +9 -0
- package/build/lib/owned-paths.d.ts.map +1 -0
- package/build/lib/owned-paths.js +23 -0
- package/build/lib/owned-paths.js.map +1 -0
- package/build/lib/publisher.d.ts.map +1 -1
- package/build/lib/publisher.js +2 -1
- package/build/lib/publisher.js.map +1 -1
- package/build/lib/registry.d.ts.map +1 -1
- package/build/lib/registry.js +10 -6
- package/build/lib/registry.js.map +1 -1
- package/build/lib/setup.d.ts.map +1 -1
- package/build/lib/setup.js +4 -3
- package/build/lib/setup.js.map +1 -1
- package/build/lib/sync.d.ts +17 -4
- package/build/lib/sync.d.ts.map +1 -1
- package/build/lib/sync.js +110 -41
- package/build/lib/sync.js.map +1 -1
- package/build/lib/uninstaller.d.ts +21 -4
- package/build/lib/uninstaller.d.ts.map +1 -1
- package/build/lib/uninstaller.js +45 -36
- package/build/lib/uninstaller.js.map +1 -1
- package/build/lib/updater.d.ts +64 -3
- package/build/lib/updater.d.ts.map +1 -1
- package/build/lib/updater.js +355 -83
- package/build/lib/updater.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSetupState.js","sourceRoot":"","sources":["../../src/hooks/useSetupState.ts"],"names":[],"mappings":"AAAA,OAA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,SAAS;gBAAE,OAAO;YAEtB,yCAAyC;YACzC,MAAM,OAAO,GAAG,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;YACpC,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACtC,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;YACtD,CAAC;YAED,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;QAC7C,CAAC,CAAC;QAEF,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;YAC9B,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,QAAQ,CAAC;oBACP,GAAG,aAAa,CAAC,GAAG,CAAC;oBACrB,OAAO,EAAE,YAAY,CAAC,GAAG,CAAC;oBAC1B,IAAI,EAAE,OAAO;iBACd,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC,CAAC;QACF,yDAAyD;QACzD,uDAAuD;IACzD,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAElB,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAU,CAAC;AACpC,CAAC"}
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import type { Adapter } from '../lib/schemas/adapter.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AssetType } from '../lib/schemas/index.js';
|
|
3
3
|
import type { BundleUninstallPlan, BundleUninstallResult, UninstallOptions, UninstallPlan, UninstallResult } from '../lib/uninstaller.js';
|
|
4
4
|
import { type LockfileEffect } from '../lib/asset-tools.js';
|
|
5
|
+
/** A bundle run that hit per-asset errors is partial if it removed anything, else failed. */
|
|
6
|
+
export type BundleResultOutcome = 'bundle-failed' | 'bundle-partial' | 'bundle-success';
|
|
5
7
|
export interface ToolUninstallSuccess {
|
|
6
8
|
plan: UninstallPlan;
|
|
7
9
|
results: UninstallResult[];
|
|
8
10
|
tool: string;
|
|
9
11
|
}
|
|
10
12
|
export type UninstallAction = {
|
|
11
|
-
bundleError?: null | string;
|
|
12
|
-
bundleErrorCommand?: string;
|
|
13
|
-
bundleErrorHint?: string;
|
|
14
|
-
bundleResult?: BundleUninstallResult | null;
|
|
15
|
-
singleError?: null | string;
|
|
16
|
-
singleErrorCommand?: string;
|
|
17
|
-
singleErrorHint?: string;
|
|
18
|
-
singleResult?: null | UninstallResult[];
|
|
19
|
-
type: 'EXECUTE_DONE';
|
|
20
|
-
} | {
|
|
21
13
|
code?: string;
|
|
22
14
|
command?: string;
|
|
23
15
|
hint?: string;
|
|
@@ -35,6 +27,11 @@ export type UninstallAction = {
|
|
|
35
27
|
} | {
|
|
36
28
|
message: string;
|
|
37
29
|
type: 'LOAD_PROGRESS';
|
|
30
|
+
} | {
|
|
31
|
+
outcome: Extract<UninstallOutcome, {
|
|
32
|
+
outcome: 'success' | BundleResultOutcome;
|
|
33
|
+
}>;
|
|
34
|
+
type: 'EXECUTE_DONE';
|
|
38
35
|
} | {
|
|
39
36
|
outcome: UninstallOutcome;
|
|
40
37
|
type: 'LOAD_DONE';
|
|
@@ -51,6 +48,7 @@ export interface UninstallFlags {
|
|
|
51
48
|
projectRoot?: string;
|
|
52
49
|
refresh: boolean;
|
|
53
50
|
tool?: string;
|
|
51
|
+
type?: AssetType;
|
|
54
52
|
yes: boolean;
|
|
55
53
|
}
|
|
56
54
|
/**
|
|
@@ -59,21 +57,18 @@ export interface UninstallFlags {
|
|
|
59
57
|
* carried from the loading phase to the executing phase for the same reason.
|
|
60
58
|
*/
|
|
61
59
|
export type UninstallOutcome = {
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
bundleName: string;
|
|
61
|
+
outcome: 'bundle-not-installed';
|
|
62
|
+
} | {
|
|
64
63
|
lockfileEffects?: LockfileEffect[];
|
|
65
64
|
org?: string;
|
|
66
65
|
outcome: 'confirming';
|
|
67
66
|
plan: UninstallPlan;
|
|
68
|
-
tool: string;
|
|
69
67
|
tools: Array<{
|
|
70
68
|
adapter: Adapter;
|
|
71
69
|
tool: string;
|
|
72
70
|
}>;
|
|
73
71
|
toolScope?: UninstallOptions['toolScope'];
|
|
74
|
-
} | {
|
|
75
|
-
bundleName: string;
|
|
76
|
-
outcome: 'bundle-not-installed';
|
|
77
72
|
} | {
|
|
78
73
|
lockfileEffects?: LockfileEffect[];
|
|
79
74
|
outcome: 'bundle-confirming';
|
|
@@ -100,20 +95,16 @@ export type UninstallOutcome = {
|
|
|
100
95
|
name: string;
|
|
101
96
|
outcome: 'not-installed';
|
|
102
97
|
} | {
|
|
103
|
-
outcome: '
|
|
98
|
+
outcome: 'success';
|
|
99
|
+
toolResults: ToolUninstallSuccess[];
|
|
100
|
+
} | {
|
|
101
|
+
outcome: BundleResultOutcome;
|
|
104
102
|
plan: BundleUninstallPlan;
|
|
105
103
|
result: BundleUninstallResult;
|
|
106
104
|
tools: string[];
|
|
107
|
-
} | {
|
|
108
|
-
outcome: 'success';
|
|
109
|
-
toolResults: ToolUninstallSuccess[];
|
|
110
105
|
};
|
|
111
106
|
export type UninstallPhase = 'confirming' | 'done' | 'error' | 'executing' | 'loading';
|
|
112
107
|
export interface UninstallState {
|
|
113
|
-
bundleError: null | string;
|
|
114
|
-
bundleErrorCommand?: string;
|
|
115
|
-
bundleErrorHint?: string;
|
|
116
|
-
bundleResult: BundleUninstallResult | null;
|
|
117
108
|
errorCode?: string;
|
|
118
109
|
errorCommand?: string;
|
|
119
110
|
errorHint?: string;
|
|
@@ -122,10 +113,6 @@ export interface UninstallState {
|
|
|
122
113
|
outcome: null | UninstallOutcome;
|
|
123
114
|
phase: UninstallPhase;
|
|
124
115
|
progress: string;
|
|
125
|
-
singleError: null | string;
|
|
126
|
-
singleErrorCommand?: string;
|
|
127
|
-
singleErrorHint?: string;
|
|
128
|
-
singleResult: null | UninstallResult[];
|
|
129
116
|
}
|
|
130
117
|
export declare function createInitialState(flags: UninstallFlags): UninstallState;
|
|
131
118
|
export declare function uninstallReducer(state: UninstallState, action: UninstallAction): UninstallState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUninstallState.d.ts","sourceRoot":"","sources":["../../src/hooks/useUninstallState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"useUninstallState.d.ts","sourceRoot":"","sources":["../../src/hooks/useUninstallState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA0BrF,6FAA6F;AAC7F,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAExF,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAClF;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OA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,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,EAAE,IAAI,GAAG,gBAAgB,CAAC;IACjC,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,GAAG,cAAc,CAQxE;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,GAAG,cAAc,CA8E/F;AAMD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CAAC,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAkUnH"}
|
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
import { useEffect, useReducer, useRef } from 'react';
|
|
2
2
|
import { describeLockfileEffects } from '../lib/asset-tools.js';
|
|
3
3
|
import { loadConfig } from '../lib/config.js';
|
|
4
|
-
import { errorGuidance } from '../lib/errors.js';
|
|
5
|
-
import { findInstalledAssetWithFallback, LockfileLockedError, readLockfile, withLockfileLock, } from '../lib/lockfile.js';
|
|
4
|
+
import { errorGuidance, errorMessage } from '../lib/errors.js';
|
|
5
|
+
import { findInstalledAssetWithFallback, LOCKFILE_LOCKED_MESSAGE, LockfileLockedError, readLockfile, withLockfileLock, } from '../lib/lockfile.js';
|
|
6
6
|
import { parseBundleSpec, resolveActiveOrg } from '../lib/org.js';
|
|
7
7
|
import { findProjectRoot } from '../lib/paths.js';
|
|
8
8
|
import { fetchRegistry, findBundle } from '../lib/registry.js';
|
|
9
9
|
import { resolveTools } from '../lib/tool-resolver.js';
|
|
10
|
-
import { executeBundleUninstall, planBundleUninstall, planUninstall, uninstallAsset } from '../lib/uninstaller.js';
|
|
10
|
+
import { executeBundleUninstall, planBundleUninstall, planUninstall, uninstallAsset, UninstallerError, } from '../lib/uninstaller.js';
|
|
11
11
|
// ---------------------------------------------------------------------------
|
|
12
12
|
// Initial state factory
|
|
13
13
|
// ---------------------------------------------------------------------------
|
|
14
14
|
export function createInitialState(flags) {
|
|
15
15
|
return {
|
|
16
|
-
bundleError: null,
|
|
17
|
-
bundleResult: null,
|
|
18
16
|
errorMessage: '',
|
|
19
17
|
flags,
|
|
20
18
|
outcome: null,
|
|
21
19
|
phase: 'loading',
|
|
22
20
|
progress: 'Initializing...',
|
|
23
|
-
singleError: null,
|
|
24
|
-
singleResult: null,
|
|
25
21
|
};
|
|
26
22
|
}
|
|
27
23
|
// ---------------------------------------------------------------------------
|
|
@@ -51,18 +47,7 @@ export function uninstallReducer(state, action) {
|
|
|
51
47
|
phase: 'error',
|
|
52
48
|
};
|
|
53
49
|
case 'EXECUTE_DONE': {
|
|
54
|
-
return {
|
|
55
|
-
...state,
|
|
56
|
-
bundleError: action.bundleError ?? state.bundleError,
|
|
57
|
-
bundleErrorCommand: action.bundleErrorCommand ?? state.bundleErrorCommand,
|
|
58
|
-
bundleErrorHint: action.bundleErrorHint ?? state.bundleErrorHint,
|
|
59
|
-
bundleResult: action.bundleResult ?? state.bundleResult,
|
|
60
|
-
phase: 'done',
|
|
61
|
-
singleError: action.singleError ?? state.singleError,
|
|
62
|
-
singleErrorCommand: action.singleErrorCommand ?? state.singleErrorCommand,
|
|
63
|
-
singleErrorHint: action.singleErrorHint ?? state.singleErrorHint,
|
|
64
|
-
singleResult: action.singleResult ?? state.singleResult,
|
|
65
|
-
};
|
|
50
|
+
return { ...state, outcome: action.outcome, phase: 'done' };
|
|
66
51
|
}
|
|
67
52
|
case 'EXECUTE_ERROR': {
|
|
68
53
|
return {
|
|
@@ -88,7 +73,9 @@ export function uninstallReducer(state, action) {
|
|
|
88
73
|
case 'confirming':
|
|
89
74
|
return { ...state, outcome, phase: 'confirming' };
|
|
90
75
|
// Terminal outcomes — go straight to done
|
|
76
|
+
case 'bundle-failed':
|
|
91
77
|
case 'bundle-not-installed':
|
|
78
|
+
case 'bundle-partial':
|
|
92
79
|
case 'bundle-success':
|
|
93
80
|
case 'dry-run-bundle':
|
|
94
81
|
// falls through
|
|
@@ -125,7 +112,7 @@ export function useUninstallState(flags) {
|
|
|
125
112
|
hasLoadedRef.current = true;
|
|
126
113
|
let cancelled = false;
|
|
127
114
|
const load = async () => {
|
|
128
|
-
const { cascade, dryRun, name: rawName, org: cliOrg, projectRoot, refresh, tool, yes } = state.flags;
|
|
115
|
+
const { cascade, dryRun, name: rawName, org: cliOrg, projectRoot, refresh, tool, type, yes } = state.flags;
|
|
129
116
|
const projectDir = findProjectRoot(projectRoot);
|
|
130
117
|
// Extract org from @org/name syntax if present (shared bundle/asset spec parser)
|
|
131
118
|
const { name: nameFromOrg, org: inlineOrg } = parseBundleSpec(rawName);
|
|
@@ -136,6 +123,7 @@ export function useUninstallState(flags) {
|
|
|
136
123
|
// still have keep their lockfile entry. Without it every tool is cleaned and the
|
|
137
124
|
// entries are dropped.
|
|
138
125
|
const toolScope = tool ? { configuredAdapters: await loadConfiguredAdapters(projectDir) } : undefined;
|
|
126
|
+
const removingTools = toolScope ? toolNames : [];
|
|
139
127
|
const effectsFor = (assets) => describeLockfileEffects(assets, toolNames, toolScope?.configuredAdapters);
|
|
140
128
|
dispatch({ message: 'Loading configuration...', type: 'LOAD_PROGRESS' });
|
|
141
129
|
const config = await loadConfig();
|
|
@@ -145,8 +133,8 @@ export function useUninstallState(flags) {
|
|
|
145
133
|
if (cancelled)
|
|
146
134
|
return;
|
|
147
135
|
// Bundle identity is (name, org) with exact matching — `@org/name` never
|
|
148
|
-
// resolves to a same-named global bundle and vice versa.
|
|
149
|
-
const bundle = findBundle(registry, name, inlineOrg);
|
|
136
|
+
// resolves to a same-named global bundle and vice versa. `--type` names an asset.
|
|
137
|
+
const bundle = type ? undefined : findBundle(registry, name, inlineOrg);
|
|
150
138
|
if (bundle) {
|
|
151
139
|
// Bundle uninstall path
|
|
152
140
|
dispatch({ message: 'Planning bundle removal...', type: 'LOAD_PROGRESS' });
|
|
@@ -155,7 +143,7 @@ export function useUninstallState(flags) {
|
|
|
155
143
|
return;
|
|
156
144
|
// Membership is keyed on the bundle's own org (from bundleOrigin), not
|
|
157
145
|
// the project's active org.
|
|
158
|
-
const plan = planBundleUninstall(lockfile, bundle.name, bundle.version, bundle.org);
|
|
146
|
+
const plan = planBundleUninstall(lockfile, bundle.name, bundle.version, bundle.org, removingTools);
|
|
159
147
|
// If nothing to remove, return not-installed outcome
|
|
160
148
|
if (plan.assetsToRemove.length === 0 && plan.orphansToRemove.length === 0) {
|
|
161
149
|
dispatch({ outcome: { bundleName: bundle.name, outcome: 'bundle-not-installed' }, type: 'LOAD_DONE' });
|
|
@@ -192,15 +180,15 @@ export function useUninstallState(flags) {
|
|
|
192
180
|
});
|
|
193
181
|
if (cancelled)
|
|
194
182
|
return;
|
|
195
|
-
dispatch({
|
|
183
|
+
dispatch({
|
|
184
|
+
outcome: { outcome: bundleResultOutcome(result), plan, result, tools: toolNames },
|
|
185
|
+
type: 'LOAD_DONE',
|
|
186
|
+
});
|
|
196
187
|
return;
|
|
197
188
|
}
|
|
198
189
|
// Otherwise, return the plan for confirmation prompt
|
|
199
190
|
if (!process.stdin.isTTY) {
|
|
200
|
-
dispatch({
|
|
201
|
-
message: 'Confirmation required but stdin is not interactive. Use --yes (-y) to skip the prompt.',
|
|
202
|
-
type: 'ERROR',
|
|
203
|
-
});
|
|
191
|
+
dispatch({ command: skipPromptCommand(state.flags), message: CONFIRMATION_REQUIRED_MESSAGE, type: 'ERROR' });
|
|
204
192
|
return;
|
|
205
193
|
}
|
|
206
194
|
dispatch({
|
|
@@ -225,13 +213,13 @@ export function useUninstallState(flags) {
|
|
|
225
213
|
// preference: the lookup prefers that org's entry and falls back to the
|
|
226
214
|
// global entry, mirroring how `install` resolved the name.
|
|
227
215
|
const org = resolveActiveOrg(inlineOrg ?? cliOrg, lockfile.org, config.org);
|
|
228
|
-
const installed =
|
|
216
|
+
const installed = findUninstallTarget(lockfile, name, org, state.flags);
|
|
229
217
|
if (!installed) {
|
|
230
218
|
dispatch({ outcome: { name, outcome: 'not-installed' }, type: 'LOAD_DONE' });
|
|
231
219
|
return;
|
|
232
220
|
}
|
|
233
221
|
// Plan against the org of the entry actually found (may be global).
|
|
234
|
-
const plan = planUninstall(lockfile, name, installed.org);
|
|
222
|
+
const plan = planUninstall(lockfile, name, installed.org, installed.type, removingTools);
|
|
235
223
|
dispatch({
|
|
236
224
|
outcome: {
|
|
237
225
|
lockfileEffects: effectsFor(cascade ? [plan.primary, ...plan.orphanedDependencies] : [plan.primary]),
|
|
@@ -244,89 +232,61 @@ export function useUninstallState(flags) {
|
|
|
244
232
|
return;
|
|
245
233
|
}
|
|
246
234
|
// Fall through to existing single-asset uninstall logic
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
const lockfile = await readLockfile(projectDir);
|
|
251
|
-
if (cancelled)
|
|
252
|
-
return null;
|
|
253
|
-
// Resolve active org (inline @org/name > --org > lockfile > config) as a
|
|
254
|
-
// preference: the lookup prefers that org's entry and falls back to the
|
|
255
|
-
// global entry, mirroring how `install` resolved the name.
|
|
256
|
-
const resolvedOrg = resolveActiveOrg(inlineOrg ?? cliOrg, lockfile.org, config.org);
|
|
257
|
-
const installed = findInstalledAssetWithFallback(lockfile, name, undefined, resolvedOrg);
|
|
258
|
-
if (!installed) {
|
|
259
|
-
return { name, outcome: 'not-installed' };
|
|
260
|
-
}
|
|
261
|
-
// From here on, key everything on the org of the entry actually found
|
|
262
|
-
// (may be global even when the project has an active org).
|
|
263
|
-
const org = installed.org;
|
|
264
|
-
// Compute the plan for display
|
|
265
|
-
const plan = planUninstall(lockfile, name, org);
|
|
266
|
-
// If dependents exist and no --yes flag, ask for confirmation
|
|
267
|
-
if (plan.dependents.length > 0 && !yes) {
|
|
268
|
-
if (!process.stdin.isTTY) {
|
|
269
|
-
throw new Error('Confirmation required but stdin is not interactive. Use --yes (-y) to skip the prompt.');
|
|
270
|
-
}
|
|
271
|
-
return {
|
|
272
|
-
adapter: tools[0].adapter,
|
|
273
|
-
lockfile,
|
|
274
|
-
lockfileEffects: effectsFor(cascade ? [plan.primary, ...plan.orphanedDependencies] : [plan.primary]),
|
|
275
|
-
org,
|
|
276
|
-
outcome: 'confirming',
|
|
277
|
-
plan,
|
|
278
|
-
tool: tools[0].tool,
|
|
279
|
-
tools,
|
|
280
|
-
toolScope,
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
// Uninstall for all tools
|
|
284
|
-
dispatch({ message: `Uninstalling ${name}...`, type: 'LOAD_PROGRESS' });
|
|
285
|
-
const toolResults = [];
|
|
286
|
-
for (const { adapter: toolAdapter, tool: toolName } of tools) {
|
|
287
|
-
const results = await uninstallAsset(name, {
|
|
288
|
-
adapter: toolAdapter,
|
|
289
|
-
cascade,
|
|
290
|
-
lockfile,
|
|
291
|
-
onProgress: (message) => {
|
|
292
|
-
if (!cancelled)
|
|
293
|
-
dispatch({ message, type: 'LOAD_PROGRESS' });
|
|
294
|
-
},
|
|
295
|
-
org,
|
|
296
|
-
plan,
|
|
297
|
-
projectDir,
|
|
298
|
-
toolScope,
|
|
299
|
-
});
|
|
300
|
-
toolResults.push({ plan, results, tool: toolName });
|
|
301
|
-
}
|
|
302
|
-
return { outcome: 'success', toolResults };
|
|
303
|
-
});
|
|
304
|
-
if (cancelled)
|
|
305
|
-
return;
|
|
306
|
-
if (result === null)
|
|
307
|
-
return;
|
|
308
|
-
dispatch({ outcome: result, type: 'LOAD_DONE' });
|
|
309
|
-
}
|
|
310
|
-
catch (error) {
|
|
235
|
+
const result = await withLockfileLock(projectDir, async () => {
|
|
236
|
+
dispatch({ message: 'Reading lockfile...', type: 'LOAD_PROGRESS' });
|
|
237
|
+
const lockfile = await readLockfile(projectDir);
|
|
311
238
|
if (cancelled)
|
|
312
|
-
return;
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
239
|
+
return null;
|
|
240
|
+
// Resolve active org (inline @org/name > --org > lockfile > config) as a
|
|
241
|
+
// preference: the lookup prefers that org's entry and falls back to the
|
|
242
|
+
// global entry, mirroring how `install` resolved the name.
|
|
243
|
+
const resolvedOrg = resolveActiveOrg(inlineOrg ?? cliOrg, lockfile.org, config.org);
|
|
244
|
+
const installed = findUninstallTarget(lockfile, name, resolvedOrg, state.flags);
|
|
245
|
+
if (!installed) {
|
|
246
|
+
return { name, outcome: 'not-installed' };
|
|
319
247
|
}
|
|
320
|
-
|
|
321
|
-
|
|
248
|
+
// From here on, key everything on the org of the entry actually found
|
|
249
|
+
// (may be global even when the project has an active org).
|
|
250
|
+
const org = installed.org;
|
|
251
|
+
// Compute the plan for display
|
|
252
|
+
const plan = planUninstall(lockfile, name, org, installed.type, removingTools);
|
|
253
|
+
// If dependents exist and no --yes flag, ask for confirmation
|
|
254
|
+
if (plan.dependents.length > 0 && !yes) {
|
|
255
|
+
if (!process.stdin.isTTY) {
|
|
256
|
+
throw new UninstallerError(CONFIRMATION_REQUIRED_MESSAGE, { command: skipPromptCommand(state.flags) });
|
|
257
|
+
}
|
|
258
|
+
return {
|
|
259
|
+
lockfileEffects: effectsFor(cascade ? [plan.primary, ...plan.orphanedDependencies] : [plan.primary]),
|
|
260
|
+
org,
|
|
261
|
+
outcome: 'confirming',
|
|
262
|
+
plan,
|
|
263
|
+
tools,
|
|
264
|
+
toolScope,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
// Uninstall for all tools
|
|
268
|
+
dispatch({ message: `Uninstalling ${name}...`, type: 'LOAD_PROGRESS' });
|
|
269
|
+
const toolResults = await uninstallForTools(tools, lockfile, plan, {
|
|
270
|
+
cascade,
|
|
271
|
+
onProgress: (message) => {
|
|
272
|
+
if (!cancelled)
|
|
273
|
+
dispatch({ message, type: 'LOAD_PROGRESS' });
|
|
274
|
+
},
|
|
275
|
+
org,
|
|
276
|
+
projectDir,
|
|
277
|
+
toolScope,
|
|
278
|
+
});
|
|
279
|
+
return { outcome: 'success', toolResults };
|
|
280
|
+
});
|
|
281
|
+
if (cancelled)
|
|
282
|
+
return;
|
|
283
|
+
if (result === null)
|
|
284
|
+
return;
|
|
285
|
+
dispatch({ outcome: result, type: 'LOAD_DONE' });
|
|
322
286
|
};
|
|
323
287
|
load().catch((err) => {
|
|
324
288
|
if (!cancelled) {
|
|
325
|
-
dispatch({
|
|
326
|
-
...errorGuidance(err),
|
|
327
|
-
message: err instanceof Error ? err.message : String(err),
|
|
328
|
-
type: 'ERROR',
|
|
329
|
-
});
|
|
289
|
+
dispatch({ ...failure(err), type: 'ERROR' });
|
|
330
290
|
}
|
|
331
291
|
});
|
|
332
292
|
return () => {
|
|
@@ -366,69 +326,54 @@ export function useUninstallState(flags) {
|
|
|
366
326
|
});
|
|
367
327
|
if (cancelled)
|
|
368
328
|
return;
|
|
369
|
-
dispatch({
|
|
329
|
+
dispatch({
|
|
330
|
+
outcome: { outcome: bundleResultOutcome(result), plan, result, tools: tools.map((t) => t.tool) },
|
|
331
|
+
type: 'EXECUTE_DONE',
|
|
332
|
+
});
|
|
370
333
|
}
|
|
371
334
|
catch (err) {
|
|
372
335
|
if (cancelled)
|
|
373
336
|
return;
|
|
374
|
-
|
|
375
|
-
dispatch({
|
|
376
|
-
bundleError: err instanceof Error ? err.message : String(err),
|
|
377
|
-
bundleErrorCommand: typeof errObj?.command === 'string' ? errObj.command : undefined,
|
|
378
|
-
bundleErrorHint: typeof errObj?.hint === 'string' ? errObj.hint : undefined,
|
|
379
|
-
type: 'EXECUTE_DONE',
|
|
380
|
-
});
|
|
337
|
+
dispatch({ ...failure(err), type: 'EXECUTE_ERROR' });
|
|
381
338
|
}
|
|
382
339
|
return;
|
|
383
340
|
}
|
|
384
341
|
// Handle single-asset confirmation execution for all tools
|
|
385
342
|
if (outcome.outcome === 'confirming') {
|
|
386
|
-
const {
|
|
387
|
-
const
|
|
343
|
+
const { org, plan: confirmedPlan, tools, toolScope } = outcome;
|
|
344
|
+
const { name, type } = confirmedPlan.primary;
|
|
388
345
|
try {
|
|
389
|
-
//
|
|
390
|
-
const
|
|
391
|
-
|
|
392
|
-
const
|
|
393
|
-
|
|
346
|
+
// The lock was released while the prompt was open, so plan again from a fresh read.
|
|
347
|
+
const toolResults = await withLockfileLock(projectDir, async () => {
|
|
348
|
+
const lockfile = await readLockfile(projectDir);
|
|
349
|
+
const removingTools = toolScope ? tools.map((t) => t.tool) : [];
|
|
350
|
+
const plan = planUninstall(lockfile, name, org, type, removingTools);
|
|
351
|
+
return uninstallForTools(tools, lockfile, plan, {
|
|
394
352
|
cascade,
|
|
395
|
-
lockfile,
|
|
396
353
|
onProgress: (message) => {
|
|
397
354
|
if (!cancelled)
|
|
398
355
|
dispatch({ message, type: 'EXECUTE_PROGRESS' });
|
|
399
356
|
},
|
|
400
357
|
org,
|
|
401
|
-
plan,
|
|
402
358
|
projectDir,
|
|
403
359
|
toolScope,
|
|
404
360
|
});
|
|
405
|
-
|
|
406
|
-
}
|
|
361
|
+
});
|
|
407
362
|
if (cancelled)
|
|
408
363
|
return;
|
|
409
|
-
dispatch({
|
|
364
|
+
dispatch({ outcome: { outcome: 'success', toolResults }, type: 'EXECUTE_DONE' });
|
|
410
365
|
}
|
|
411
366
|
catch (err) {
|
|
412
367
|
if (cancelled)
|
|
413
368
|
return;
|
|
414
|
-
|
|
415
|
-
dispatch({
|
|
416
|
-
singleError: err instanceof Error ? err.message : String(err),
|
|
417
|
-
singleErrorCommand: typeof errObj?.command === 'string' ? errObj.command : undefined,
|
|
418
|
-
singleErrorHint: typeof errObj?.hint === 'string' ? errObj.hint : undefined,
|
|
419
|
-
type: 'EXECUTE_DONE',
|
|
420
|
-
});
|
|
369
|
+
dispatch({ ...failure(err), type: 'EXECUTE_ERROR' });
|
|
421
370
|
}
|
|
422
371
|
return;
|
|
423
372
|
}
|
|
424
373
|
};
|
|
425
374
|
execute().catch((err) => {
|
|
426
375
|
if (!cancelled) {
|
|
427
|
-
dispatch({
|
|
428
|
-
...errorGuidance(err),
|
|
429
|
-
message: err instanceof Error ? err.message : String(err),
|
|
430
|
-
type: 'EXECUTE_ERROR',
|
|
431
|
-
});
|
|
376
|
+
dispatch({ ...failure(err), type: 'EXECUTE_ERROR' });
|
|
432
377
|
}
|
|
433
378
|
});
|
|
434
379
|
return () => {
|
|
@@ -452,4 +397,66 @@ async function loadConfiguredAdapters(projectDir) {
|
|
|
452
397
|
return [];
|
|
453
398
|
}
|
|
454
399
|
}
|
|
400
|
+
const CONFIRMATION_REQUIRED_MESSAGE = 'Confirmation required but stdin is not interactive. Use --yes (-y) to skip the prompt.';
|
|
401
|
+
function bundleResultOutcome(result) {
|
|
402
|
+
if (result.errors.length === 0)
|
|
403
|
+
return 'bundle-success';
|
|
404
|
+
return result.removedAssets.length + result.removedOrphans.length > 0 ? 'bundle-partial' : 'bundle-failed';
|
|
405
|
+
}
|
|
406
|
+
/** A failed run's message and guidance; a held lockfile gets the shared lock message. */
|
|
407
|
+
function failure(err) {
|
|
408
|
+
return {
|
|
409
|
+
...errorGuidance(err),
|
|
410
|
+
message: err instanceof LockfileLockedError ? LOCKFILE_LOCKED_MESSAGE : errorMessage(err),
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* The installed asset an uninstall names: the org's entry, else the global one, as `install`
|
|
415
|
+
* resolved the name. A name installed as more than one type needs `--type` to pick one.
|
|
416
|
+
*/
|
|
417
|
+
function findUninstallTarget(lockfile, name, org, flags) {
|
|
418
|
+
const installed = findInstalledAssetWithFallback(lockfile, name, flags.type, org);
|
|
419
|
+
if (!installed || flags.type)
|
|
420
|
+
return installed;
|
|
421
|
+
const types = (lockfile.assets ?? [])
|
|
422
|
+
.filter((a) => a.name === installed.name && a.org === installed.org)
|
|
423
|
+
.map((a) => a.type)
|
|
424
|
+
.sort();
|
|
425
|
+
if (types.length > 1) {
|
|
426
|
+
throw new UninstallerError(`"${name}" is installed as more than one type (${types.join(', ')}). Name the one to uninstall with --type.`, { command: uninstallCommand({ ...flags, type: types[0] }) });
|
|
427
|
+
}
|
|
428
|
+
return installed;
|
|
429
|
+
}
|
|
430
|
+
/** The same uninstall with `--yes`, for a run that can't show the confirmation prompt. */
|
|
431
|
+
function skipPromptCommand(flags) {
|
|
432
|
+
return uninstallCommand(flags, '--yes');
|
|
433
|
+
}
|
|
434
|
+
/** `atk uninstall` with the run's flags, followed by `extra`. */
|
|
435
|
+
function uninstallCommand({ cascade, name, org, projectRoot, tool, type }, ...extra) {
|
|
436
|
+
const spec = org && !name.startsWith('@') ? `@${org}/${name}` : name;
|
|
437
|
+
return [
|
|
438
|
+
'atk uninstall',
|
|
439
|
+
spec,
|
|
440
|
+
...(type ? ['--type', type] : []),
|
|
441
|
+
...(tool ? ['--tool', tool] : []),
|
|
442
|
+
...(cascade ? [] : ['--no-cascade']),
|
|
443
|
+
...(projectRoot ? ['--project-root', JSON.stringify(projectRoot)] : []),
|
|
444
|
+
...extra,
|
|
445
|
+
].join(' ');
|
|
446
|
+
}
|
|
447
|
+
/** Uninstall the planned asset for each tool. */
|
|
448
|
+
async function uninstallForTools(tools, lockfile, plan, options) {
|
|
449
|
+
const toolResults = [];
|
|
450
|
+
for (const { adapter, tool } of tools) {
|
|
451
|
+
const results = await uninstallAsset(plan.primary.name, {
|
|
452
|
+
...options,
|
|
453
|
+
adapter,
|
|
454
|
+
lockfile,
|
|
455
|
+
plan,
|
|
456
|
+
type: plan.primary.type,
|
|
457
|
+
});
|
|
458
|
+
toolResults.push({ plan, results, tool });
|
|
459
|
+
}
|
|
460
|
+
return toolResults;
|
|
461
|
+
}
|
|
455
462
|
//# sourceMappingURL=useUninstallState.js.map
|