@bakers-build/core 0.10.1-next.2 → 0.10.1-next.3
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.
|
@@ -9,7 +9,13 @@ export declare const UPDATE_CHECK_TTL_MS: number;
|
|
|
9
9
|
* the one place that decides where `.bakers` lives.
|
|
10
10
|
*/
|
|
11
11
|
export declare function defaultUpdateCachePath(): string;
|
|
12
|
+
/** The version this process started with: the first read, cached. */
|
|
12
13
|
export declare function resolveCliVersion(): string;
|
|
14
|
+
/**
|
|
15
|
+
* The `@bakers-build/core` version installed on disk now, read uncached, so a
|
|
16
|
+
* long-running process sees an upgrade that replaced its files.
|
|
17
|
+
*/
|
|
18
|
+
export declare function readCliVersion(from?: string): string;
|
|
13
19
|
export declare function fetchLatestVersion(fetchImpl?: typeof fetch, timeoutMs?: number): Promise<string | null>;
|
|
14
20
|
export declare function updateNotice(current: string, latest: string): string | null;
|
|
15
21
|
export interface UpdateCheckResult {
|
|
@@ -17,23 +17,27 @@ export function defaultUpdateCachePath() {
|
|
|
17
17
|
return join(homeBbDir(), 'update-check.json');
|
|
18
18
|
}
|
|
19
19
|
let cachedCliVersion;
|
|
20
|
+
/** The version this process started with: the first read, cached. */
|
|
20
21
|
export function resolveCliVersion() {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
cachedCliVersion ??= readCliVersion();
|
|
23
|
+
return cachedCliVersion;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The `@bakers-build/core` version installed on disk now, read uncached, so a
|
|
27
|
+
* long-running process sees an upgrade that replaced its files.
|
|
28
|
+
*/
|
|
29
|
+
export function readCliVersion(from = dirname(fileURLToPath(import.meta.url))) {
|
|
30
|
+
let dir = from;
|
|
24
31
|
for (let i = 0; i < 7; i++) {
|
|
25
32
|
try {
|
|
26
33
|
const pkg = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8'));
|
|
27
|
-
if (pkg.name === '@bakers-build/core')
|
|
28
|
-
|
|
29
|
-
return cachedCliVersion;
|
|
30
|
-
}
|
|
34
|
+
if (pkg.name === '@bakers-build/core')
|
|
35
|
+
return pkg.version ?? UNKNOWN_VERSION;
|
|
31
36
|
}
|
|
32
37
|
catch { }
|
|
33
38
|
dir = dirname(dir);
|
|
34
39
|
}
|
|
35
|
-
|
|
36
|
-
return cachedCliVersion;
|
|
40
|
+
return UNKNOWN_VERSION;
|
|
37
41
|
}
|
|
38
42
|
export async function fetchLatestVersion(fetchImpl = globalThis.fetch, timeoutMs = 1500) {
|
|
39
43
|
const controller = new AbortController();
|
package/dist/src/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export { isValidMachineConnectionUrl } from './cli/machine-connection.js';
|
|
|
14
14
|
export { type AgentRoutes, assertSchemaVersion, CONFIG_SCHEMA_VERSION, type MachineContext, machineContextPath, readMachineContext, resolveMachineContextPath, } from './cli/machine-context.js';
|
|
15
15
|
export { corePackageRoot } from './cli/paths.js';
|
|
16
16
|
export { resolveModuleEslintStyle } from './cli/resolve-module.js';
|
|
17
|
-
export { BB_PACKAGE, checkForUpdate, declineUpdate, defaultUpdateCachePath, fetchLatestVersion, fetchUpdateNotice, printVersionLine, REGISTRY_LATEST_URL, resolveCliVersion, UNKNOWN_VERSION, UPDATE_CHECK_TTL_MS, type UpdateCheckOptions, type UpdateCheckResult, updateNotice, } from './cli/version-check.js';
|
|
17
|
+
export { BB_PACKAGE, checkForUpdate, declineUpdate, defaultUpdateCachePath, fetchLatestVersion, fetchUpdateNotice, printVersionLine, REGISTRY_LATEST_URL, readCliVersion, resolveCliVersion, UNKNOWN_VERSION, UPDATE_CHECK_TTL_MS, type UpdateCheckOptions, type UpdateCheckResult, updateNotice, } from './cli/version-check.js';
|
|
18
18
|
export { discoverBbWorkspaces, loadReadyBbConnection, resolveWorkspaceSelector, type WorkspaceChoice, type WorkspaceRecoveryOptions, workspaceSearchCommand, } from './cli/workspace-recovery.js';
|
|
19
19
|
export type { ConnectionConfig, MachineConfig, ProjectConfig, } from './config-types.generated.js';
|
|
20
20
|
export { configHomeOf, defaultRootGitExec, deriveCheckoutRoot, type RootGitExec, } from './core/checkout-root.js';
|
package/dist/src/index.js
CHANGED
|
@@ -16,7 +16,7 @@ export { isValidMachineConnectionUrl } from './cli/machine-connection.js';
|
|
|
16
16
|
export { assertSchemaVersion, CONFIG_SCHEMA_VERSION, machineContextPath, readMachineContext, resolveMachineContextPath, } from './cli/machine-context.js';
|
|
17
17
|
export { corePackageRoot } from './cli/paths.js';
|
|
18
18
|
export { resolveModuleEslintStyle } from './cli/resolve-module.js';
|
|
19
|
-
export { BB_PACKAGE, checkForUpdate, declineUpdate, defaultUpdateCachePath, fetchLatestVersion, fetchUpdateNotice, printVersionLine, REGISTRY_LATEST_URL, resolveCliVersion, UNKNOWN_VERSION, UPDATE_CHECK_TTL_MS, updateNotice, } from './cli/version-check.js';
|
|
19
|
+
export { BB_PACKAGE, checkForUpdate, declineUpdate, defaultUpdateCachePath, fetchLatestVersion, fetchUpdateNotice, printVersionLine, REGISTRY_LATEST_URL, readCliVersion, resolveCliVersion, UNKNOWN_VERSION, UPDATE_CHECK_TTL_MS, updateNotice, } from './cli/version-check.js';
|
|
20
20
|
export { discoverBbWorkspaces, loadReadyBbConnection, resolveWorkspaceSelector, workspaceSearchCommand, } from './cli/workspace-recovery.js';
|
|
21
21
|
export { configHomeOf, defaultRootGitExec, deriveCheckoutRoot, } from './core/checkout-root.js';
|
|
22
22
|
export { CommandRunner, ExecError, exec, setDefaultCommandRunner, } from './core/exec.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakers-build/core",
|
|
3
|
-
"version": "0.10.1-next.
|
|
3
|
+
"version": "0.10.1-next.3",
|
|
4
4
|
"description": "bakers.build surface-agnostic kernel: host contract, split-config helpers, addon preset/discovery machinery, shared primitives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"yaml": "^2.7.0"
|
|
41
41
|
},
|
|
42
42
|
"bakersBuild": {
|
|
43
|
-
"commit": "
|
|
43
|
+
"commit": "0eec088d2c0daf5127b57de523f251d83c497cc4",
|
|
44
44
|
"channel": "next"
|
|
45
45
|
}
|
|
46
46
|
}
|