impel-cli 0.20.63-canary.6 → 0.20.63

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.
@@ -1,62 +0,0 @@
1
- #!/usr/bin/env node
2
- import assert from "node:assert/strict";
3
- import { execFileSync } from "node:child_process";
4
- import path from "node:path";
5
- import { fileURLToPath, pathToFileURL } from "node:url";
6
-
7
- export function assertCanaryInstall({ version, expectedVersion, brand, origins }) {
8
- assert.equal(version, `${expectedVersion} (canary)`);
9
- assert.deepEqual({
10
- channel: brand.channel,
11
- gateway: brand.gateway,
12
- sessions: brand.sessions,
13
- resolvedSessions: brand.resolvedSessions,
14
- controlPlane: brand.controlPlane,
15
- }, {
16
- channel: "canary",
17
- gateway: origins.gateway,
18
- sessions: origins.sessions,
19
- resolvedSessions: origins.sessions,
20
- controlPlane: origins.controlPlane,
21
- });
22
- }
23
-
24
- async function main([prefix, expectedVersion]) {
25
- if (!prefix || !expectedVersion) throw new Error("usage: node scripts/verify-canary-install.mjs <npm-prefix> <version>");
26
- // Assert the installed package's defaults, never an Actions-level override.
27
- for (const name of ["IMPEL_GATEWAY_URL", "IMPEL_SESSIONS_URL", "IMPEL_APP_URL", "IMPEL_CLI_RUNTIME_BRAND"]) {
28
- delete process.env[name];
29
- }
30
- const cli = path.join(prefix, "bin", "impel");
31
- const root = path.join(prefix, "lib", "node_modules", "impel-cli");
32
- const version = execFileSync(cli, ["--version"], {
33
- encoding: "utf8",
34
- env: { ...process.env, IMPEL_SKIP_UPDATE_CHECK: "1", IMPEL_DISABLE_TELEMETRY: "1" },
35
- }).trim();
36
- const load = (file) => import(pathToFileURL(path.join(root, "src", file)).href);
37
- const [config, sessions, runtime] = await Promise.all([
38
- load("config.js"),
39
- load("sessionCollector.js"),
40
- load("runtimeBrand.js"),
41
- ]);
42
- const { resolveDefaultGateway, resolveDefaultAppUrl } = config;
43
- const { DEFAULT_SESSIONS_URL, resolveSessionsUrl } = sessions;
44
- const { CHANNEL_ORIGINS, RUNTIME_BRAND } = runtime;
45
- assertCanaryInstall({
46
- version,
47
- expectedVersion,
48
- brand: {
49
- channel: RUNTIME_BRAND.channel,
50
- gateway: resolveDefaultGateway(),
51
- sessions: DEFAULT_SESSIONS_URL,
52
- resolvedSessions: resolveSessionsUrl({}),
53
- controlPlane: resolveDefaultAppUrl(),
54
- },
55
- origins: CHANNEL_ORIGINS.canary,
56
- });
57
- console.log(`Installed canary ${version} resolves ${JSON.stringify(CHANNEL_ORIGINS.canary)}.`);
58
- }
59
-
60
- if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
61
- await main(process.argv.slice(2));
62
- }