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.
@@ -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 = await root.named(objectName);
8
+ const object = root.named(objectName);
11
9
  console.log(object.toJSON());
12
10
  } else {
13
11
  for await (const location of root.locations()) {
@@ -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
 
@@ -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
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { prepare } from "../src/cmd.mjs";
4
4
 
5
- const { root, args } = prepare();
5
+ const { root, args } = await prepare();
6
6
 
7
7
  const location = await root.load(args[0]);
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "1.29.0",
3
+ "version": "1.30.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
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: "w",
12
- default: env.PMCF_WORLD || cwd()
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
  }
package/types/cmd.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- export function prepare(): {
1
+ export function prepare(): Promise<{
2
2
  root: Root;
3
3
  options: {
4
4
  root: string;
5
5
  output: string;
6
6
  };
7
7
  args: string[];
8
- };
8
+ }>;
9
9
  import { Root } from "./model.mjs";