@aui.io/apollo 0.1.69 → 0.1.70
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/node_modules/@aui.io/apollo-cli/dist/src/meta.d.ts +11 -1
- package/node_modules/@aui.io/apollo-cli/dist/src/meta.js +49 -45
- package/node_modules/@aui.io/apollo-cli/dist/src/meta.js.map +1 -1
- package/node_modules/@aui.io/apollo-cli/package.json +3 -3
- package/node_modules/@aui.io/apollo-core/package.json +1 -1
- package/node_modules/@aui.io/apollo-tui/package.json +2 -2
- package/package.json +4 -4
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
/** The
|
|
1
|
+
/** The public distribution — CLI + TUI are bundled inside it. */
|
|
2
2
|
export declare const APOLLO_PACKAGE_NAME = "@aui.io/apollo";
|
|
3
|
+
export interface PackageMeta {
|
|
4
|
+
name: string;
|
|
5
|
+
version: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The console this module ships in. A distribution bundles this package under
|
|
9
|
+
* its own node_modules, so the nearest ancestor bundling it is the installed
|
|
10
|
+
* distribution; outside one, this package's own manifest (kept in lockstep).
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveConsoleMeta(modulePath: string): PackageMeta;
|
|
3
13
|
export declare const CLI_PACKAGE_NAME = "@aui.io/apollo";
|
|
4
14
|
export declare const CLI_VERSION: string;
|
|
@@ -1,65 +1,69 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
1
|
import { readFileSync } from "node:fs";
|
|
3
2
|
import { dirname, join } from "node:path";
|
|
4
3
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
/** The
|
|
4
|
+
/** The public distribution — CLI + TUI are bundled inside it. */
|
|
6
5
|
export const APOLLO_PACKAGE_NAME = "@aui.io/apollo";
|
|
7
|
-
|
|
6
|
+
/** This package, as the distributions name it in `bundleDependencies`. */
|
|
7
|
+
const CLI_PACKAGE = "@aui.io/apollo-cli";
|
|
8
|
+
function readManifest(path) {
|
|
8
9
|
try {
|
|
9
10
|
const raw = JSON.parse(readFileSync(path, "utf8"));
|
|
10
|
-
if (typeof raw.name
|
|
11
|
-
return
|
|
11
|
+
if (typeof raw.name !== "string" || typeof raw.version !== "string") {
|
|
12
|
+
return undefined;
|
|
12
13
|
}
|
|
14
|
+
const bundled = raw.bundleDependencies ?? raw.bundledDependencies;
|
|
15
|
+
return {
|
|
16
|
+
name: raw.name,
|
|
17
|
+
version: raw.version,
|
|
18
|
+
dependencies: typeof raw.dependencies === "object" && raw.dependencies !== null
|
|
19
|
+
? raw.dependencies
|
|
20
|
+
: {},
|
|
21
|
+
bundleDependencies: bundled === true ||
|
|
22
|
+
(Array.isArray(bundled) && bundled.every((v) => typeof v === "string"))
|
|
23
|
+
? bundled
|
|
24
|
+
: [],
|
|
25
|
+
};
|
|
13
26
|
}
|
|
14
27
|
catch {
|
|
15
|
-
|
|
28
|
+
return undefined;
|
|
16
29
|
}
|
|
17
|
-
return undefined;
|
|
18
30
|
}
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (fromInstall)
|
|
29
|
-
return { name: APOLLO_PACKAGE_NAME, version: fromInstall.version };
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
// not installed as the meta package
|
|
33
|
-
}
|
|
34
|
-
let dir = dirname(fileURLToPath(import.meta.url));
|
|
35
|
-
for (let i = 0; i < 8; i++) {
|
|
36
|
-
const sibling = readJson(join(dir, "apollo", "package.json"));
|
|
37
|
-
if (sibling?.name === APOLLO_PACKAGE_NAME) {
|
|
38
|
-
return { name: APOLLO_PACKAGE_NAME, version: sibling.version };
|
|
39
|
-
}
|
|
40
|
-
const here = readJson(join(dir, "package.json"));
|
|
41
|
-
if (here?.name === APOLLO_PACKAGE_NAME) {
|
|
42
|
-
return { name: APOLLO_PACKAGE_NAME, version: here.version };
|
|
43
|
-
}
|
|
31
|
+
/** `bundleDependencies: true` bundles every dependency (npm semantics). */
|
|
32
|
+
function bundlesCli(manifest) {
|
|
33
|
+
return manifest.bundleDependencies === true
|
|
34
|
+
? CLI_PACKAGE in manifest.dependencies
|
|
35
|
+
: manifest.bundleDependencies.includes(CLI_PACKAGE);
|
|
36
|
+
}
|
|
37
|
+
function* ancestors(dir) {
|
|
38
|
+
for (;;) {
|
|
39
|
+
yield dir;
|
|
44
40
|
const parent = dirname(dir);
|
|
45
41
|
if (parent === dir)
|
|
46
|
-
|
|
42
|
+
return;
|
|
47
43
|
dir = parent;
|
|
48
44
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The console this module ships in. A distribution bundles this package under
|
|
48
|
+
* its own node_modules, so the nearest ancestor bundling it is the installed
|
|
49
|
+
* distribution; outside one, this package's own manifest (kept in lockstep).
|
|
50
|
+
*/
|
|
51
|
+
export function resolveConsoleMeta(modulePath) {
|
|
52
|
+
let own;
|
|
53
|
+
for (const dir of ancestors(dirname(modulePath))) {
|
|
54
|
+
const manifest = readManifest(join(dir, "package.json"));
|
|
55
|
+
if (manifest === undefined)
|
|
56
|
+
continue;
|
|
57
|
+
if (bundlesCli(manifest)) {
|
|
58
|
+
return { name: manifest.name, version: manifest.version };
|
|
59
|
+
}
|
|
60
|
+
own ??= { name: manifest.name, version: manifest.version };
|
|
59
61
|
}
|
|
60
|
-
|
|
62
|
+
if (own !== undefined)
|
|
63
|
+
return own;
|
|
64
|
+
throw new Error("Unable to locate the apollo console package version.");
|
|
61
65
|
}
|
|
62
|
-
const meta =
|
|
66
|
+
const meta = resolveConsoleMeta(fileURLToPath(import.meta.url));
|
|
63
67
|
export const CLI_PACKAGE_NAME = APOLLO_PACKAGE_NAME;
|
|
64
68
|
export const CLI_VERSION = meta.version;
|
|
65
69
|
//# sourceMappingURL=meta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../src/meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../src/meta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,iEAAiE;AACjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAEpD,0EAA0E;AAC1E,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAYzC,SAAS,YAAY,CAAC,IAAY;IAChC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAMhD,CAAC;QACF,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACpE,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,OAAO,GAAG,GAAG,CAAC,kBAAkB,IAAI,GAAG,CAAC,mBAAmB,CAAC;QAClE,OAAO;YACL,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,YAAY,EACV,OAAO,GAAG,CAAC,YAAY,KAAK,QAAQ,IAAI,GAAG,CAAC,YAAY,KAAK,IAAI;gBAC/D,CAAC,CAAE,GAAG,CAAC,YAAwC;gBAC/C,CAAC,CAAC,EAAE;YACR,kBAAkB,EAChB,OAAO,KAAK,IAAI;gBAChB,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,KAAK,CA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AC7D,CAAC;IACD,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC;IAClC,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,IAAI,GAAG,kBAAkB,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AACpD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aui.io/apollo-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.70",
|
|
4
4
|
"description": "Command-line client for the Apollo runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"test": "vitest run"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@aui.io/apollo-core": "0.1.
|
|
36
|
+
"@aui.io/apollo-core": "0.1.70",
|
|
37
37
|
"commander": "^14.0.3",
|
|
38
38
|
"picocolors": "^1.1.1"
|
|
39
39
|
},
|
|
40
40
|
"optionalDependencies": {
|
|
41
|
-
"@aui.io/apollo-tui": "0.1.
|
|
41
|
+
"@aui.io/apollo-tui": "0.1.70"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@eslint/js": "^9.39.5",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aui.io/apollo-tui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.70",
|
|
4
4
|
"description": "Interactive Apollo operator TUI built on OpenTUI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"start": "node ./bin/apollo-tui.js"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@aui.io/apollo-core": "0.1.
|
|
38
|
+
"@aui.io/apollo-core": "0.1.70",
|
|
39
39
|
"@opentui/core": "^0.4.5",
|
|
40
40
|
"@opentui/react": "^0.4.5",
|
|
41
41
|
"diff": "8.0.2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aui.io/apollo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.70",
|
|
4
4
|
"description": "Apollo operator console — CLI + interactive TUI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"postpack": "node ./scripts/clean-bundle.mjs"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@aui.io/apollo-core": "0.1.
|
|
35
|
-
"@aui.io/apollo-cli": "0.1.
|
|
36
|
-
"@aui.io/apollo-tui": "0.1.
|
|
34
|
+
"@aui.io/apollo-core": "0.1.70",
|
|
35
|
+
"@aui.io/apollo-cli": "0.1.70",
|
|
36
|
+
"@aui.io/apollo-tui": "0.1.70",
|
|
37
37
|
"picocolors": "^1.1.1",
|
|
38
38
|
"yaml": "^2.9.0",
|
|
39
39
|
"commander": "^14.0.3",
|