@dsh-workbench/adapter-probe 1.0.0 → 1.0.1
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/dist/self-update.js +18 -1
- package/package.json +5 -5
package/dist/self-update.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import writeFileAtomic from 'write-file-atomic';
|
|
2
2
|
import { quoteShellArg } from '@dsh-workbench/shared/host';
|
|
3
3
|
import { hostSurface } from './platform.js';
|
|
4
|
-
import { chmodSync, closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, statSync, } from 'node:fs';
|
|
4
|
+
import { chmodSync, closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, statSync, } from 'node:fs';
|
|
5
5
|
import { dirname, join } from 'node:path';
|
|
6
6
|
import { runDetached } from './runtime-seed.js';
|
|
7
7
|
import { SELF_UPDATE_STATES, } from '@dsh-workbench/shared/contract/protocol/bundle-install';
|
|
@@ -241,6 +241,19 @@ function readTail(file) {
|
|
|
241
241
|
return undefined;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
+
function hasEntries(dir) {
|
|
245
|
+
try {
|
|
246
|
+
return readdirSync(dir).some((name) => name !== '.DS_Store');
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function legacyDataIn(dir) {
|
|
253
|
+
return (existsSync(join(dir, 'storages', 'workspace.json')) ||
|
|
254
|
+
hasEntries(join(dir, 'sessions')) ||
|
|
255
|
+
hasEntries(join(dir, 'attachments')));
|
|
256
|
+
}
|
|
244
257
|
export function readSelfUpdateView(home, profile) {
|
|
245
258
|
const paths = selfUpdatePaths(home);
|
|
246
259
|
let raw;
|
|
@@ -264,6 +277,9 @@ export function readSelfUpdateView(home, profile) {
|
|
|
264
277
|
const version = asText(record.version);
|
|
265
278
|
const at = asText(record.at);
|
|
266
279
|
const tail = readTail(paths.log);
|
|
280
|
+
const migration = state === 'ok' && legacyDataIn(paths.dir) && !existsSync(join(paths.dir, '.data-root-shared'))
|
|
281
|
+
? 'needed'
|
|
282
|
+
: undefined;
|
|
267
283
|
return {
|
|
268
284
|
state: state,
|
|
269
285
|
...(owner === undefined ? {} : { profile: owner }),
|
|
@@ -272,6 +288,7 @@ export function readSelfUpdateView(home, profile) {
|
|
|
272
288
|
...(version === undefined ? {} : { version }),
|
|
273
289
|
...(at === undefined ? {} : { at }),
|
|
274
290
|
...(tail === undefined ? {} : { tail }),
|
|
291
|
+
...(migration === undefined ? {} : { migration }),
|
|
275
292
|
};
|
|
276
293
|
}
|
|
277
294
|
export { runningVersionOf } from '@dsh-workbench/shared/host';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-workbench/adapter-probe",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Workbench adapter-probe adapter.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"execa": "^10.2.0",
|
|
17
17
|
"proper-lockfile": "^4.1.2",
|
|
18
18
|
"write-file-atomic": "^8.0.0",
|
|
19
|
-
"@dsh-workbench/adapter-profile": "1.0.
|
|
20
|
-
"@dsh-workbench/adapter-runtime": "1.0.
|
|
21
|
-
"@dsh-workbench/shared": "1.0.
|
|
22
|
-
"@dsh-workbench/adapter-supply": "1.0.
|
|
19
|
+
"@dsh-workbench/adapter-profile": "1.0.1",
|
|
20
|
+
"@dsh-workbench/adapter-runtime": "1.0.1",
|
|
21
|
+
"@dsh-workbench/shared": "1.0.1",
|
|
22
|
+
"@dsh-workbench/adapter-supply": "1.0.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^24.19.0",
|