@p11-core/cli 0.0.14 → 0.0.16

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/bin.js ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __p11CreateRequire } from "node:module"; const require = __p11CreateRequire(import.meta.url);
3
+
4
+ // src/bin.ts
5
+ var minimumNodeVersion = "22.12.0";
6
+ if (!isSupportedNodeVersion(process.versions.node)) {
7
+ console.error(`p11 requires Node.js >=${minimumNodeVersion}.`);
8
+ console.error(`Current Node.js: v${process.versions.node}.`);
9
+ console.error("Upgrade Node.js, then run p11 again.");
10
+ process.exit(1);
11
+ }
12
+ try {
13
+ const cliEntryUrl = new URL("./index.js", import.meta.url).href;
14
+ const { runCli } = await import(cliEntryUrl);
15
+ await runCli();
16
+ } catch (error) {
17
+ console.error(error instanceof Error ? error.message : String(error));
18
+ process.exit(1);
19
+ }
20
+ function isSupportedNodeVersion(version) {
21
+ const [major = 0, minor = 0, patch = 0] = version.split(".").map((part) => Number(part));
22
+ if (major > 22) return true;
23
+ if (major < 22) return false;
24
+ if (minor > 12) return true;
25
+ if (minor < 12) return false;
26
+ return patch >= 0;
27
+ }
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env node
2
1
  import { createRequire as __p11CreateRequire } from "node:module"; const require = __p11CreateRequire(import.meta.url);
3
2
  var __create = Object.create;
4
3
  var __defProp = Object.defineProperty;
@@ -3619,7 +3618,7 @@ var P11_CODE_SOURCE_LINE_ATTRIBUTE = "data-p11-code-source-line";
3619
3618
  var P11_SOURCE_FILE_ATTRIBUTE = "data-p11-source-file";
3620
3619
  var P11_SOURCE_LINE_ATTRIBUTE = "data-p11-source-line";
3621
3620
  if (isCliEntrypoint()) {
3622
- main().catch((error) => {
3621
+ runCli().catch((error) => {
3623
3622
  console.error(error instanceof Error ? error.message : String(error));
3624
3623
  process.exit(1);
3625
3624
  });
@@ -3633,7 +3632,7 @@ function isCliEntrypoint() {
3633
3632
  return path.resolve(process.argv[1]) === modulePath;
3634
3633
  }
3635
3634
  }
3636
- async function main() {
3635
+ async function runCli() {
3637
3636
  const program2 = createCliProgram();
3638
3637
  if (process.argv.length <= 2) {
3639
3638
  program2.outputHelp();
@@ -4771,5 +4770,6 @@ export {
4771
4770
  publishOutputLines,
4772
4771
  readHistoryEntries,
4773
4772
  resolveBuildParentDir,
4773
+ runCli,
4774
4774
  validatePageSource
4775
4775
  };
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@p11-core/cli",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "bin": {
7
- "p11": "dist/index.js"
7
+ "p11": "dist/bin.js"
8
+ },
9
+ "engines": {
10
+ "node": ">=22.12.0"
8
11
  },
9
12
  "files": [
10
13
  "dist",
@@ -22,7 +25,7 @@
22
25
  "@babel/parser": "^7.27.2",
23
26
  "@babel/traverse": "^7.27.1",
24
27
  "@babel/types": "^7.27.1",
25
- "@p11-core/components": "0.0.2",
28
+ "@p11-core/components": "0.0.3",
26
29
  "@recogito/text-annotator": "^4.0.0",
27
30
  "@tailwindcss/vite": "^4.3.0",
28
31
  "@vitejs/plugin-react": "^6.0.1",