@adhdev/daemon-core 0.9.76-rc.2 → 0.9.76-rc.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/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/commands/router.ts +5 -0
package/package.json
CHANGED
package/src/commands/router.ts
CHANGED
|
@@ -41,6 +41,10 @@ import { execNpmCommandSync, resolveCurrentGlobalInstallSurface, spawnDetachedDa
|
|
|
41
41
|
|
|
42
42
|
type ReleaseChannel = 'stable' | 'preview';
|
|
43
43
|
const CHANNEL_NPM_TAG: Record<ReleaseChannel, 'latest' | 'next'> = { stable: 'latest', preview: 'next' };
|
|
44
|
+
const CHANNEL_SERVER_URL: Record<ReleaseChannel, string> = {
|
|
45
|
+
stable: 'https://api.adhf.dev',
|
|
46
|
+
preview: 'https://api-preview.adhf.dev',
|
|
47
|
+
};
|
|
44
48
|
|
|
45
49
|
function normalizeReleaseChannel(value: unknown): ReleaseChannel | null {
|
|
46
50
|
if (typeof value !== 'string') return null;
|
|
@@ -892,6 +896,7 @@ export class DaemonCommandRouter {
|
|
|
892
896
|
// Check channel-pinned dist-tag and resolve it to a concrete install version.
|
|
893
897
|
const latest = String(execNpmCommandSync(['view', `${pkgName}@${npmTag}`, 'version'], { encoding: 'utf-8', timeout: 10000 }, npmSurface)).trim();
|
|
894
898
|
LOG.info('Upgrade', `Latest ${pkgName}@${npmTag}: v${latest}`);
|
|
899
|
+
updateConfig({ updateChannel: channel, serverUrl: CHANNEL_SERVER_URL[channel] } as any);
|
|
895
900
|
let currentInstalled: string | null = null;
|
|
896
901
|
try {
|
|
897
902
|
const currentJson = String(execNpmCommandSync(['ls', '-g', pkgName, '--depth=0', '--json'], {
|