@atolis-hq/wake 0.4.9 → 0.4.11
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.
|
@@ -19,7 +19,7 @@ import { createSelfUpdateApplication, } from './self-update-application.js';
|
|
|
19
19
|
import { createSelfUpdateFailureLog } from './self-update-failure-log.js';
|
|
20
20
|
import { createSourceUpdatePort } from './source-update-port.js';
|
|
21
21
|
import { createUpdateLedger } from './update-ledger.js';
|
|
22
|
-
import { resolveWakeVersion,
|
|
22
|
+
import { resolveWakeVersion, wakePackageVersion } from './version.js';
|
|
23
23
|
const execFile = promisify(nodeExecFile);
|
|
24
24
|
export function createSurfaceCliApplications(root, api, now) {
|
|
25
25
|
const runnerTick = new TickHost(createOneShotRunnerAdvance(root));
|
|
@@ -334,7 +334,7 @@ async function resolveSandboxBuildVersion(root) {
|
|
|
334
334
|
const development = root.config.host.development;
|
|
335
335
|
return development.mode === 'source' && development.repoRoot !== undefined
|
|
336
336
|
? resolveWakeVersion({ repoRoot: development.repoRoot })
|
|
337
|
-
:
|
|
337
|
+
: wakePackageVersion;
|
|
338
338
|
}
|
|
339
339
|
function sandboxWakeInvocation(root) {
|
|
340
340
|
return root.config.host.development.mode === 'source'
|
|
@@ -11,3 +11,5 @@ export interface ResolveWakeVersionOptions {
|
|
|
11
11
|
}
|
|
12
12
|
export declare function resolveWakeVersion(options?: ResolveWakeVersionOptions): string;
|
|
13
13
|
export declare const wakeVersion: string;
|
|
14
|
+
/** The registry-installable version used by packaged sandbox images. */
|
|
15
|
+
export declare const wakePackageVersion: string;
|
|
@@ -3,6 +3,22 @@ import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
|
3
3
|
import { dirname, resolve } from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
const defaultRepoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
6
|
+
function packageVersion(repoRoot) {
|
|
7
|
+
for (const candidate of [
|
|
8
|
+
resolve(repoRoot, 'package.json'),
|
|
9
|
+
resolve(repoRoot, '..', 'package.json'),
|
|
10
|
+
]) {
|
|
11
|
+
try {
|
|
12
|
+
const manifest = JSON.parse(readFileSync(candidate, 'utf8'));
|
|
13
|
+
if (typeof manifest.version === 'string' && manifest.version.length > 0)
|
|
14
|
+
return manifest.version;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
// Source and compiled layouts place the package manifest at different depths.
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
6
22
|
function gitOutputFromRoot(repoRoot, args) {
|
|
7
23
|
try {
|
|
8
24
|
return execFileSync('git', args, {
|
|
@@ -108,4 +124,6 @@ export function resolveWakeVersion(options = {}) {
|
|
|
108
124
|
return `g${headHash.slice(0, 7)}`;
|
|
109
125
|
return '0.1.0-dev';
|
|
110
126
|
}
|
|
111
|
-
export const wakeVersion = "
|
|
127
|
+
export const wakeVersion = "g712edc9";
|
|
128
|
+
/** The registry-installable version used by packaged sandbox images. */
|
|
129
|
+
export const wakePackageVersion = packageVersion(defaultRepoRoot) ?? wakeVersion;
|