@detergent-software/atk 3.0.0-dev.2 → 3.0.0-dev.4
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/build/commands/browse.d.ts.map +1 -1
- package/build/commands/browse.js +3 -80
- package/build/commands/browse.js.map +1 -1
- package/build/commands/init.d.ts.map +1 -1
- package/build/commands/init.js +39 -405
- package/build/commands/init.js.map +1 -1
- package/build/commands/prune.d.ts.map +1 -1
- package/build/commands/prune.js +14 -32
- package/build/commands/prune.js.map +1 -1
- package/build/commands/publish.d.ts +3 -1
- package/build/commands/publish.d.ts.map +1 -1
- package/build/commands/publish.js +65 -390
- package/build/commands/publish.js.map +1 -1
- package/build/commands/setup.d.ts.map +1 -1
- package/build/commands/setup.js +37 -238
- package/build/commands/setup.js.map +1 -1
- package/build/commands/uninstall.d.ts.map +1 -1
- package/build/commands/uninstall.js +93 -211
- package/build/commands/uninstall.js.map +1 -1
- package/build/components/InitSuccess.d.ts +5 -0
- package/build/components/InitSuccess.d.ts.map +1 -0
- package/build/components/InitSuccess.js +20 -0
- package/build/components/InitSuccess.js.map +1 -0
- package/build/components/PromptField.d.ts +19 -0
- package/build/components/PromptField.d.ts.map +1 -0
- package/build/components/PromptField.js +7 -0
- package/build/components/PromptField.js.map +1 -0
- package/build/components/index.d.ts +2 -0
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +2 -0
- package/build/components/index.js.map +1 -1
- package/build/hooks/useBrowseState.d.ts +23 -0
- package/build/hooks/useBrowseState.d.ts.map +1 -1
- package/build/hooks/useBrowseState.js +77 -1
- package/build/hooks/useBrowseState.js.map +1 -1
- package/build/hooks/useConfirmation.d.ts +18 -0
- package/build/hooks/useConfirmation.d.ts.map +1 -0
- package/build/hooks/useConfirmation.js +56 -0
- package/build/hooks/useConfirmation.js.map +1 -0
- package/build/hooks/useInitState.d.ts +72 -0
- package/build/hooks/useInitState.d.ts.map +1 -0
- package/build/hooks/useInitState.js +371 -0
- package/build/hooks/useInitState.js.map +1 -0
- package/build/hooks/usePublishState.d.ts +115 -0
- package/build/hooks/usePublishState.d.ts.map +1 -0
- package/build/hooks/usePublishState.js +667 -0
- package/build/hooks/usePublishState.js.map +1 -0
- package/build/hooks/useSetupState.d.ts +57 -0
- package/build/hooks/useSetupState.d.ts.map +1 -0
- package/build/hooks/useSetupState.js +283 -0
- package/build/hooks/useSetupState.js.map +1 -0
- package/build/hooks/useUninstallState.d.ts +91 -0
- package/build/hooks/useUninstallState.d.ts.map +1 -0
- package/build/hooks/useUninstallState.js +322 -0
- package/build/hooks/useUninstallState.js.map +1 -0
- package/build/lib/checksum.d.ts +5 -0
- package/build/lib/checksum.d.ts.map +1 -1
- package/build/lib/checksum.js +18 -18
- package/build/lib/checksum.js.map +1 -1
- package/build/lib/publisher.d.ts +35 -0
- package/build/lib/publisher.d.ts.map +1 -1
- package/build/lib/publisher.js +212 -16
- package/build/lib/publisher.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { useEffect, useReducer, useRef } from 'react';
|
|
2
|
+
import { findInstalledAsset, LockfileLockedError, readLockfile, withLockfileLock } from '../lib/lockfile.js';
|
|
3
|
+
import { findProjectRoot } from '../lib/paths.js';
|
|
4
|
+
import { fetchRegistry, findBundle } from '../lib/registry.js';
|
|
5
|
+
import { resolveTool } from '../lib/tool-resolver.js';
|
|
6
|
+
import { executeBundleUninstall, planBundleUninstall, planUninstall, uninstallAsset, } from '../lib/uninstaller.js';
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
// Initial state factory
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
export function createInitialState(flags) {
|
|
11
|
+
return {
|
|
12
|
+
bundleError: null,
|
|
13
|
+
bundleResult: null,
|
|
14
|
+
errorMessage: '',
|
|
15
|
+
flags,
|
|
16
|
+
outcome: null,
|
|
17
|
+
phase: 'loading',
|
|
18
|
+
progress: 'Initializing...',
|
|
19
|
+
singleError: null,
|
|
20
|
+
singleResult: null,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// Pure reducer
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
export function uninstallReducer(state, action) {
|
|
27
|
+
switch (action.type) {
|
|
28
|
+
case 'CANCEL': {
|
|
29
|
+
// Cancellation from the confirming phase leads to done
|
|
30
|
+
if (state.phase !== 'confirming')
|
|
31
|
+
return state;
|
|
32
|
+
return { ...state, phase: 'done' };
|
|
33
|
+
}
|
|
34
|
+
case 'CONFIRM': {
|
|
35
|
+
// Confirmation from the confirming phase transitions to executing
|
|
36
|
+
if (state.phase !== 'confirming')
|
|
37
|
+
return state;
|
|
38
|
+
return { ...state, phase: 'executing', progress: 'Executing...' };
|
|
39
|
+
}
|
|
40
|
+
case 'ERROR':
|
|
41
|
+
return { ...state, errorMessage: action.message, phase: 'error' };
|
|
42
|
+
case 'EXECUTE_DONE': {
|
|
43
|
+
return {
|
|
44
|
+
...state,
|
|
45
|
+
bundleError: action.bundleError ?? state.bundleError,
|
|
46
|
+
bundleResult: action.bundleResult ?? state.bundleResult,
|
|
47
|
+
phase: 'done',
|
|
48
|
+
singleError: action.singleError ?? state.singleError,
|
|
49
|
+
singleResult: action.singleResult ?? state.singleResult,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
case 'EXECUTE_ERROR': {
|
|
53
|
+
return { ...state, errorMessage: action.message, phase: 'error' };
|
|
54
|
+
}
|
|
55
|
+
case 'EXECUTE_PROGRESS': {
|
|
56
|
+
if (state.phase !== 'executing')
|
|
57
|
+
return state;
|
|
58
|
+
return { ...state, progress: action.message };
|
|
59
|
+
}
|
|
60
|
+
case 'LOAD_DONE': {
|
|
61
|
+
const { outcome } = action;
|
|
62
|
+
// Determine the next phase based on the outcome variant
|
|
63
|
+
switch (outcome.outcome) {
|
|
64
|
+
// Confirmation needed
|
|
65
|
+
case 'bundle-confirming':
|
|
66
|
+
case 'confirming':
|
|
67
|
+
return { ...state, outcome, phase: 'confirming' };
|
|
68
|
+
// Terminal outcomes — go straight to done
|
|
69
|
+
case 'bundle-not-installed':
|
|
70
|
+
case 'bundle-success':
|
|
71
|
+
case 'dry-run-bundle':
|
|
72
|
+
// falls through
|
|
73
|
+
case 'dry-run-single':
|
|
74
|
+
case 'not-installed':
|
|
75
|
+
case 'success':
|
|
76
|
+
return { ...state, outcome, phase: 'done' };
|
|
77
|
+
default:
|
|
78
|
+
return { ...state, outcome, phase: 'done' };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
case 'LOAD_PROGRESS': {
|
|
82
|
+
if (state.phase !== 'loading')
|
|
83
|
+
return state;
|
|
84
|
+
return { ...state, progress: action.message };
|
|
85
|
+
}
|
|
86
|
+
default:
|
|
87
|
+
return state;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
// Hook
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
export function useUninstallState(flags) {
|
|
94
|
+
const [state, dispatch] = useReducer(uninstallReducer, undefined, () => createInitialState(flags));
|
|
95
|
+
// Guard against React development-mode double-firing of effects.
|
|
96
|
+
const hasLoadedRef = useRef(false);
|
|
97
|
+
// --- Loading phase-gated effect ---
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
if (state.phase !== 'loading')
|
|
100
|
+
return;
|
|
101
|
+
if (hasLoadedRef.current)
|
|
102
|
+
return;
|
|
103
|
+
hasLoadedRef.current = true;
|
|
104
|
+
let cancelled = false;
|
|
105
|
+
const load = async () => {
|
|
106
|
+
const { cascade, dryRun, name, projectRoot, refresh, tool, yes } = state.flags;
|
|
107
|
+
const projectDir = findProjectRoot(projectRoot);
|
|
108
|
+
const { adapter, tool: resolvedTool } = await resolveTool(tool);
|
|
109
|
+
// Step 1: Try bundle detection first
|
|
110
|
+
dispatch({ message: 'Fetching registry...', type: 'LOAD_PROGRESS' });
|
|
111
|
+
const registry = await fetchRegistry({ force: refresh });
|
|
112
|
+
if (cancelled)
|
|
113
|
+
return;
|
|
114
|
+
const bundle = findBundle(registry, name);
|
|
115
|
+
if (bundle) {
|
|
116
|
+
// Bundle uninstall path
|
|
117
|
+
dispatch({ message: 'Planning bundle removal...', type: 'LOAD_PROGRESS' });
|
|
118
|
+
const lockfile = await readLockfile(projectDir);
|
|
119
|
+
if (cancelled)
|
|
120
|
+
return;
|
|
121
|
+
const plan = planBundleUninstall(lockfile, bundle.name, bundle.version);
|
|
122
|
+
// If nothing to remove, return not-installed outcome
|
|
123
|
+
if (plan.assetsToRemove.length === 0 && plan.orphansToRemove.length === 0) {
|
|
124
|
+
dispatch({ outcome: { bundleName: bundle.name, outcome: 'bundle-not-installed' }, type: 'LOAD_DONE' });
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
// Dry-run: return plan without executing
|
|
128
|
+
if (dryRun) {
|
|
129
|
+
dispatch({ outcome: { outcome: 'dry-run-bundle', plan, tool: resolvedTool }, type: 'LOAD_DONE' });
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
// If --yes flag, execute immediately
|
|
133
|
+
if (yes) {
|
|
134
|
+
dispatch({ message: 'Removing bundle assets...', type: 'LOAD_PROGRESS' });
|
|
135
|
+
const result = await executeBundleUninstall(plan, {
|
|
136
|
+
adapter,
|
|
137
|
+
cascade,
|
|
138
|
+
onProgress: (message) => {
|
|
139
|
+
if (!cancelled)
|
|
140
|
+
dispatch({ message, type: 'LOAD_PROGRESS' });
|
|
141
|
+
},
|
|
142
|
+
projectDir,
|
|
143
|
+
});
|
|
144
|
+
if (cancelled)
|
|
145
|
+
return;
|
|
146
|
+
dispatch({ outcome: { outcome: 'bundle-success', plan, result, tool: resolvedTool }, type: 'LOAD_DONE' });
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
// Otherwise, return the plan for confirmation prompt
|
|
150
|
+
if (!process.stdin.isTTY) {
|
|
151
|
+
dispatch({
|
|
152
|
+
message: 'Confirmation required but stdin is not interactive. Use --yes (-y) to skip the prompt.',
|
|
153
|
+
type: 'ERROR',
|
|
154
|
+
});
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
dispatch({ outcome: { adapter, outcome: 'bundle-confirming', plan, tool: resolvedTool }, type: 'LOAD_DONE' });
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
// Dry-run for single asset: read lockfile directly (skip lock), compute plan, return
|
|
161
|
+
if (dryRun) {
|
|
162
|
+
dispatch({ message: 'Reading lockfile...', type: 'LOAD_PROGRESS' });
|
|
163
|
+
const lockfile = await readLockfile(projectDir);
|
|
164
|
+
if (cancelled)
|
|
165
|
+
return;
|
|
166
|
+
const installed = findInstalledAsset(lockfile, name);
|
|
167
|
+
if (!installed) {
|
|
168
|
+
dispatch({ outcome: { name, outcome: 'not-installed' }, type: 'LOAD_DONE' });
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const plan = planUninstall(lockfile, name);
|
|
172
|
+
dispatch({ outcome: { adapter, outcome: 'dry-run-single', plan, tool: resolvedTool }, type: 'LOAD_DONE' });
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
// Fall through to existing single-asset uninstall logic
|
|
176
|
+
try {
|
|
177
|
+
const result = await withLockfileLock(projectDir, async () => {
|
|
178
|
+
dispatch({ message: 'Reading lockfile...', type: 'LOAD_PROGRESS' });
|
|
179
|
+
const lockfile = await readLockfile(projectDir);
|
|
180
|
+
if (cancelled)
|
|
181
|
+
return null;
|
|
182
|
+
const installed = findInstalledAsset(lockfile, name);
|
|
183
|
+
if (!installed) {
|
|
184
|
+
return { name, outcome: 'not-installed' };
|
|
185
|
+
}
|
|
186
|
+
// Compute the plan for display
|
|
187
|
+
const plan = planUninstall(lockfile, name);
|
|
188
|
+
// If dependents exist and no --yes flag, ask for confirmation
|
|
189
|
+
if (plan.dependents.length > 0 && !yes) {
|
|
190
|
+
if (!process.stdin.isTTY) {
|
|
191
|
+
throw new Error('Confirmation required but stdin is not interactive. Use --yes (-y) to skip the prompt.');
|
|
192
|
+
}
|
|
193
|
+
return { adapter, lockfile, outcome: 'confirming', plan, tool: resolvedTool };
|
|
194
|
+
}
|
|
195
|
+
dispatch({ message: `Uninstalling ${name}...`, type: 'LOAD_PROGRESS' });
|
|
196
|
+
const results = await uninstallAsset(name, {
|
|
197
|
+
adapter,
|
|
198
|
+
cascade,
|
|
199
|
+
lockfile,
|
|
200
|
+
onProgress: (message) => {
|
|
201
|
+
if (!cancelled)
|
|
202
|
+
dispatch({ message, type: 'LOAD_PROGRESS' });
|
|
203
|
+
},
|
|
204
|
+
plan,
|
|
205
|
+
projectDir,
|
|
206
|
+
});
|
|
207
|
+
return { outcome: 'success', plan, results, tool: resolvedTool };
|
|
208
|
+
});
|
|
209
|
+
if (cancelled)
|
|
210
|
+
return;
|
|
211
|
+
if (result === null)
|
|
212
|
+
return;
|
|
213
|
+
dispatch({ outcome: result, type: 'LOAD_DONE' });
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
if (cancelled)
|
|
217
|
+
return;
|
|
218
|
+
if (error instanceof LockfileLockedError) {
|
|
219
|
+
dispatch({
|
|
220
|
+
message: 'Another ATK process is currently modifying this project. Please wait and try again.',
|
|
221
|
+
type: 'ERROR',
|
|
222
|
+
});
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
throw error;
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
load().catch((err) => {
|
|
229
|
+
if (!cancelled) {
|
|
230
|
+
dispatch({ message: err instanceof Error ? err.message : String(err), type: 'ERROR' });
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
return () => {
|
|
234
|
+
cancelled = true;
|
|
235
|
+
};
|
|
236
|
+
// Phase-gated effect: only runs when entering 'loading'
|
|
237
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
238
|
+
}, [state.phase]);
|
|
239
|
+
// --- Executing phase-gated effect ---
|
|
240
|
+
useEffect(() => {
|
|
241
|
+
if (state.phase !== 'executing')
|
|
242
|
+
return;
|
|
243
|
+
let cancelled = false;
|
|
244
|
+
const execute = async () => {
|
|
245
|
+
const { outcome } = state;
|
|
246
|
+
if (!outcome) {
|
|
247
|
+
dispatch({ message: 'Internal error: no outcome available for execution.', type: 'EXECUTE_ERROR' });
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const { cascade, name, projectRoot } = state.flags;
|
|
251
|
+
const projectDir = findProjectRoot(projectRoot);
|
|
252
|
+
// Handle bundle confirmation execution
|
|
253
|
+
if (outcome.outcome === 'bundle-confirming') {
|
|
254
|
+
const { adapter, plan } = outcome;
|
|
255
|
+
try {
|
|
256
|
+
const result = await executeBundleUninstall(plan, {
|
|
257
|
+
adapter,
|
|
258
|
+
cascade,
|
|
259
|
+
onProgress: (message) => {
|
|
260
|
+
if (!cancelled)
|
|
261
|
+
dispatch({ message, type: 'EXECUTE_PROGRESS' });
|
|
262
|
+
},
|
|
263
|
+
projectDir,
|
|
264
|
+
});
|
|
265
|
+
if (cancelled)
|
|
266
|
+
return;
|
|
267
|
+
dispatch({ bundleResult: result, type: 'EXECUTE_DONE' });
|
|
268
|
+
}
|
|
269
|
+
catch (err) {
|
|
270
|
+
if (cancelled)
|
|
271
|
+
return;
|
|
272
|
+
dispatch({
|
|
273
|
+
bundleError: err instanceof Error ? err.message : String(err),
|
|
274
|
+
type: 'EXECUTE_DONE',
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
// Handle single-asset confirmation execution
|
|
280
|
+
if (outcome.outcome === 'confirming') {
|
|
281
|
+
const { adapter, lockfile, plan } = outcome;
|
|
282
|
+
try {
|
|
283
|
+
const results = await uninstallAsset(name, {
|
|
284
|
+
adapter,
|
|
285
|
+
cascade,
|
|
286
|
+
lockfile,
|
|
287
|
+
onProgress: (message) => {
|
|
288
|
+
if (!cancelled)
|
|
289
|
+
dispatch({ message, type: 'EXECUTE_PROGRESS' });
|
|
290
|
+
},
|
|
291
|
+
plan,
|
|
292
|
+
projectDir,
|
|
293
|
+
});
|
|
294
|
+
if (cancelled)
|
|
295
|
+
return;
|
|
296
|
+
dispatch({ singleResult: results, type: 'EXECUTE_DONE' });
|
|
297
|
+
}
|
|
298
|
+
catch (err) {
|
|
299
|
+
if (cancelled)
|
|
300
|
+
return;
|
|
301
|
+
dispatch({
|
|
302
|
+
singleError: err instanceof Error ? err.message : String(err),
|
|
303
|
+
type: 'EXECUTE_DONE',
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
execute().catch((err) => {
|
|
310
|
+
if (!cancelled) {
|
|
311
|
+
dispatch({ message: err instanceof Error ? err.message : String(err), type: 'EXECUTE_ERROR' });
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
return () => {
|
|
315
|
+
cancelled = true;
|
|
316
|
+
};
|
|
317
|
+
// Phase-gated effect: only runs when entering 'executing'
|
|
318
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
319
|
+
}, [state.phase]);
|
|
320
|
+
return [state, dispatch];
|
|
321
|
+
}
|
|
322
|
+
//# sourceMappingURL=useUninstallState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUninstallState.js","sourceRoot":"","sources":["../../src/hooks/useUninstallState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAWtD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO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AE;YAC/B,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;YACjG,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC,CAAC;QACF,0DAA0D;QAC1D,uDAAuD;IACzD,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAElB,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAU,CAAC;AACpC,CAAC"}
|
package/build/lib/checksum.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/** Recursively collect all files in a directory. */
|
|
2
|
+
export declare function collectFilesRecursive(dirPath: string, baseDir: string): Promise<Array<{
|
|
3
|
+
absolutePath: string;
|
|
4
|
+
relativePath: string;
|
|
5
|
+
}>>;
|
|
1
6
|
/**
|
|
2
7
|
* Compute a combined SHA-256 hash for all files in a directory (recursively).
|
|
3
8
|
* Files are sorted by relative path to ensure deterministic output.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checksum.d.ts","sourceRoot":"","sources":["../../src/lib/checksum.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAcpE;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGhE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,G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AE,MAAM,CAAA;CAAE,CAAC,CAAC,CAgBpE"}
|
package/build/lib/checksum.js
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { readdir, readFile } from 'node:fs/promises';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
+
/** Recursively collect all files in a directory. */
|
|
5
|
+
export async function collectFilesRecursive(dirPath, baseDir) {
|
|
6
|
+
const results = [];
|
|
7
|
+
const entries = await readdir(dirPath, { withFileTypes: true });
|
|
8
|
+
for (const entry of entries) {
|
|
9
|
+
const fullPath = join(dirPath, entry.name);
|
|
10
|
+
if (entry.isDirectory()) {
|
|
11
|
+
const subFiles = await collectFilesRecursive(fullPath, baseDir);
|
|
12
|
+
results.push(...subFiles);
|
|
13
|
+
}
|
|
14
|
+
else if (entry.isFile()) {
|
|
15
|
+
const relativePath = fullPath.slice(baseDir.length + 1).replace(/\\/g, '/');
|
|
16
|
+
results.push({ absolutePath: fullPath, relativePath });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return results;
|
|
20
|
+
}
|
|
4
21
|
/**
|
|
5
22
|
* Compute a combined SHA-256 hash for all files in a directory (recursively).
|
|
6
23
|
* Files are sorted by relative path to ensure deterministic output.
|
|
7
24
|
*/
|
|
8
25
|
export async function hashDirectory(dirPath) {
|
|
9
|
-
const files = await
|
|
26
|
+
const files = await collectFilesRecursive(dirPath, dirPath);
|
|
10
27
|
files.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
|
|
11
28
|
const hash = createHash('sha256');
|
|
12
29
|
for (const file of files) {
|
|
@@ -58,21 +75,4 @@ export async function verifyChecksums(files) {
|
|
|
58
75
|
}
|
|
59
76
|
return failures;
|
|
60
77
|
}
|
|
61
|
-
/** Recursively collect all files in a directory. */
|
|
62
|
-
async function collectFiles(dirPath, baseDir) {
|
|
63
|
-
const results = [];
|
|
64
|
-
const entries = await readdir(dirPath, { withFileTypes: true });
|
|
65
|
-
for (const entry of entries) {
|
|
66
|
-
const fullPath = join(dirPath, entry.name);
|
|
67
|
-
if (entry.isDirectory()) {
|
|
68
|
-
const subFiles = await collectFiles(fullPath, baseDir);
|
|
69
|
-
results.push(...subFiles);
|
|
70
|
-
}
|
|
71
|
-
else if (entry.isFile()) {
|
|
72
|
-
const relativePath = fullPath.slice(baseDir.length + 1).replace(/\\/g, '/');
|
|
73
|
-
results.push({ absolutePath: fullPath, relativePath });
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return results;
|
|
77
|
-
}
|
|
78
78
|
//# sourceMappingURL=checksum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checksum.js","sourceRoot":"","sources":["../../src/lib/checksum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,OAAe;IACjD,MAAM,KAAK,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"checksum.js","sourceRoot":"","sources":["../../src/lib/checksum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,oDAAoD;AACpD,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAAe,EACf,OAAe;IAEf,MAAM,OAAO,GAA0D,EAAE,CAAC;IAC1E,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAEhE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAA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,CAAC;YACtE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,mBAAmB,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACnG,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/build/lib/publisher.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Adapter } from './schemas/adapter.js';
|
|
1
2
|
import type { Bundle } from './schemas/bundle.js';
|
|
2
3
|
import type { AssetType, Manifest } from './schemas/manifest.js';
|
|
3
4
|
import type { Registry } from './schemas/registry.js';
|
|
@@ -20,6 +21,15 @@ export interface PublishTarget {
|
|
|
20
21
|
type: PublishType;
|
|
21
22
|
}
|
|
22
23
|
export type PublishType = 'asset' | 'bundle';
|
|
24
|
+
export interface RawAssetDetection {
|
|
25
|
+
assetType: AssetType;
|
|
26
|
+
files: Array<{
|
|
27
|
+
absolutePath: string;
|
|
28
|
+
relativePath: string;
|
|
29
|
+
}>;
|
|
30
|
+
name: string;
|
|
31
|
+
sourceDir: string;
|
|
32
|
+
}
|
|
23
33
|
export interface ValidationResult {
|
|
24
34
|
errors: string[];
|
|
25
35
|
valid: boolean;
|
|
@@ -44,8 +54,33 @@ type PublishResultPr = {
|
|
|
44
54
|
prUrl: string;
|
|
45
55
|
};
|
|
46
56
|
export declare function buildPublishPlan(target: PublishTarget, resolvedVersion: string, isUpdate: boolean, message?: string): Promise<PublishPlan>;
|
|
57
|
+
/**
|
|
58
|
+
* Build a temporary staging directory containing the collected files and a
|
|
59
|
+
* programmatically generated `manifest.json`, ready for the existing publish
|
|
60
|
+
* pipeline. The caller is responsible for cleaning up the returned temp directory.
|
|
61
|
+
*/
|
|
62
|
+
export declare function buildStagingArea(detection: RawAssetDetection, metadata: {
|
|
63
|
+
author: string;
|
|
64
|
+
description: string;
|
|
65
|
+
org?: string;
|
|
66
|
+
tags: string[];
|
|
67
|
+
tools: Array<{
|
|
68
|
+
tool: string;
|
|
69
|
+
}>;
|
|
70
|
+
version?: string;
|
|
71
|
+
}): Promise<string>;
|
|
47
72
|
export declare function bumpVersion(currentVersion: string, bumpType: 'major' | 'minor' | 'patch'): string;
|
|
48
73
|
export declare function checkRegistryVersion(target: PublishTarget, registry: Registry): VersionCheckResult;
|
|
74
|
+
/**
|
|
75
|
+
* Inspect a filesystem path against adapter placement patterns to detect the asset type,
|
|
76
|
+
* extract the asset name, and collect the relevant files.
|
|
77
|
+
*
|
|
78
|
+
* Supports three input shapes:
|
|
79
|
+
* - A directory that matches a directory-based placement pattern
|
|
80
|
+
* - A single file that matches a file-based placement pattern
|
|
81
|
+
* - An entrypoint file inside a directory-based placement (expands to the parent directory)
|
|
82
|
+
*/
|
|
83
|
+
export declare function detectAssetFromPath(inputPath: string, adapter: Adapter, projectDir: string): Promise<RawAssetDetection>;
|
|
49
84
|
export declare function detectPublishType(directoryPath: string): Promise<PublishTarget>;
|
|
50
85
|
export declare function executeDirectPublish(plan: PublishPlan, token: string, progressCallback: (msg: string) => void): Promise<PublishResult>;
|
|
51
86
|
export declare function executePublish(plan: PublishPlan, token: string, progressCallback: (msg: string) => void): Promise<PublishResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publisher.d.ts","sourceRoot":"","sources":["../../src/lib/publisher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"publisher.d.ts","sourceRoot":"","sources":["../../src/lib/publisher.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAiBtD,MAAM,WAAW,WAAW;I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