pmcf 1.29.0 → 1.30.0
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/bin/pmcf-host-defs +1 -1
- package/bin/pmcf-info +2 -4
- package/bin/pmcf-location-defs +1 -3
- package/bin/pmcf-named-defs +1 -3
- package/bin/pmcf-network +1 -1
- package/package.json +1 -1
- package/src/cmd.mjs +5 -3
- package/types/cmd.d.mts +2 -2
package/bin/pmcf-host-defs
CHANGED
|
@@ -6,7 +6,7 @@ import { Host } from "pmcf";
|
|
|
6
6
|
import { writeLines, sectionLines } from "../src/utils.mjs";
|
|
7
7
|
import { prepare } from "../src/cmd.mjs";
|
|
8
8
|
|
|
9
|
-
const { root, args, options } = prepare();
|
|
9
|
+
const { root, args, options } = await prepare();
|
|
10
10
|
|
|
11
11
|
const hostName = args[0];
|
|
12
12
|
|
package/bin/pmcf-info
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { prepare } from "../src/cmd.mjs";
|
|
3
|
-
const { root, args } = prepare();
|
|
4
|
-
|
|
5
|
-
await root.loadAll();
|
|
3
|
+
const { root, args } = await prepare();
|
|
6
4
|
|
|
7
5
|
const objectName = args[0];
|
|
8
6
|
|
|
9
7
|
if (objectName) {
|
|
10
|
-
const object =
|
|
8
|
+
const object = root.named(objectName);
|
|
11
9
|
console.log(object.toJSON());
|
|
12
10
|
} else {
|
|
13
11
|
for await (const location of root.locations()) {
|
package/bin/pmcf-location-defs
CHANGED
|
@@ -6,9 +6,7 @@ import { Location } from "pmcf";
|
|
|
6
6
|
import { writeLines, sectionLines } from "../src/utils.mjs";
|
|
7
7
|
import { prepare } from "../src/cmd.mjs";
|
|
8
8
|
|
|
9
|
-
const { root, args, options } = prepare();
|
|
10
|
-
|
|
11
|
-
await root.loadAll();
|
|
9
|
+
const { root, args, options } = await prepare();
|
|
12
10
|
|
|
13
11
|
const location = await root.load(args[0], { type: Location });
|
|
14
12
|
|
package/bin/pmcf-named-defs
CHANGED
|
@@ -9,9 +9,7 @@ import {
|
|
|
9
9
|
} from "../src/utils.mjs";
|
|
10
10
|
import { prepare } from "../src/cmd.mjs";
|
|
11
11
|
|
|
12
|
-
const { root, args, options } = prepare();
|
|
13
|
-
|
|
14
|
-
await root.loadAll();
|
|
12
|
+
const { root, args, options } = await prepare();
|
|
15
13
|
|
|
16
14
|
const owner = await root.load(args[0]);
|
|
17
15
|
const updates = [
|
package/bin/pmcf-network
CHANGED
package/package.json
CHANGED
package/src/cmd.mjs
CHANGED
|
@@ -2,14 +2,14 @@ import { parseArgs } from "node:util";
|
|
|
2
2
|
import { argv, cwd, env } from "node:process";
|
|
3
3
|
import { Root } from "./model.mjs";
|
|
4
4
|
|
|
5
|
-
export function prepare() {
|
|
5
|
+
export async function prepare() {
|
|
6
6
|
const { values, positionals } = parseArgs({
|
|
7
7
|
args: argv.slice(2),
|
|
8
8
|
options: {
|
|
9
9
|
root: {
|
|
10
10
|
type: "string",
|
|
11
|
-
short: "
|
|
12
|
-
default: env.
|
|
11
|
+
short: "r",
|
|
12
|
+
default: env.PMCF_ROOT || cwd()
|
|
13
13
|
},
|
|
14
14
|
output: {
|
|
15
15
|
type: "string",
|
|
@@ -22,5 +22,7 @@ export function prepare() {
|
|
|
22
22
|
|
|
23
23
|
const root = new Root(values.root);
|
|
24
24
|
|
|
25
|
+
await root.loadAll();
|
|
26
|
+
|
|
25
27
|
return { root, options: values, args: positionals };
|
|
26
28
|
}
|