@optique/man 0.10.0-dev.378 → 0.10.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/dist/cli.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- const require_generator = require('./generator-ztP0iNeX.cjs');
2
+ const require_generator = require('./generator-zoVk04OH.cjs');
3
3
  require('./roff-EpcecLXU.cjs');
4
- require('./man-DxOvqYHv.cjs');
4
+ require('./man-DGnow1Jr.cjs');
5
5
  const __optique_core_constructs = require_generator.__toESM(require("@optique/core/constructs"));
6
6
  const __optique_core_primitives = require_generator.__toESM(require("@optique/core/primitives"));
7
7
  const __optique_core_valueparser = require_generator.__toESM(require("@optique/core/valueparser"));
@@ -17,7 +17,7 @@ const node_url = require_generator.__toESM(require("node:url"));
17
17
 
18
18
  //#region deno.json
19
19
  var name = "@optique/man";
20
- var version = "0.10.0-dev.378+995d618d";
20
+ var version = "0.10.0";
21
21
  var license = "MIT";
22
22
  var exports$1 = {
23
23
  ".": "./src/index.ts",
@@ -224,9 +224,9 @@ async function importModule(filePath) {
224
224
  const absolutePath = (0, node_path.resolve)(filePath);
225
225
  if (!(0, node_fs.existsSync)(absolutePath)) fileNotFoundError(filePath);
226
226
  const isTypeScript = /\.[mc]?ts$/.test(filePath);
227
- if (typeof globalThis.Deno !== "undefined") return await import(absolutePath);
228
- if (typeof globalThis.Bun !== "undefined") return await import(absolutePath);
229
- if (isTypeScript && !nodeSupportsNativeTypeScript()) try {
227
+ const isDeno = typeof globalThis.Deno !== "undefined";
228
+ const isBun = typeof globalThis.Bun !== "undefined";
229
+ if (!isDeno && !isBun && isTypeScript && !nodeSupportsNativeTypeScript()) try {
230
230
  const tsx = await import("tsx/esm/api");
231
231
  tsx.register();
232
232
  } catch {
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import "./roff-C_MiRXVS.js";
3
- import "./man-BR1BE_cj.js";
4
- import { generateManPageAsync } from "./generator-BVZlyiaq.js";
3
+ import "./man-Leuf7kOn.js";
4
+ import { generateManPageAsync } from "./generator-CCa36YC2.js";
5
5
  import { object } from "@optique/core/constructs";
6
6
  import { argument, option } from "@optique/core/primitives";
7
7
  import { choice, string } from "@optique/core/valueparser";
@@ -17,7 +17,7 @@ import { fileURLToPath, pathToFileURL } from "node:url";
17
17
 
18
18
  //#region deno.json
19
19
  var name = "@optique/man";
20
- var version = "0.10.0-dev.378+995d618d";
20
+ var version = "0.10.0";
21
21
  var license = "MIT";
22
22
  var exports = {
23
23
  ".": "./src/index.ts",
@@ -224,9 +224,9 @@ async function importModule(filePath) {
224
224
  const absolutePath = resolve(filePath);
225
225
  if (!existsSync(absolutePath)) fileNotFoundError(filePath);
226
226
  const isTypeScript = /\.[mc]?ts$/.test(filePath);
227
- if (typeof globalThis.Deno !== "undefined") return await import(absolutePath);
228
- if (typeof globalThis.Bun !== "undefined") return await import(absolutePath);
229
- if (isTypeScript && !nodeSupportsNativeTypeScript()) try {
227
+ const isDeno = typeof globalThis.Deno !== "undefined";
228
+ const isBun = typeof globalThis.Bun !== "undefined";
229
+ if (!isDeno && !isBun && isTypeScript && !nodeSupportsNativeTypeScript()) try {
230
230
  const tsx = await import("tsx/esm/api");
231
231
  tsx.register();
232
232
  } catch {
@@ -1,4 +1,4 @@
1
- import { formatDocPageAsMan } from "./man-BR1BE_cj.js";
1
+ import { formatDocPageAsMan } from "./man-Leuf7kOn.js";
2
2
  import { getDocPageAsync, getDocPageSync } from "@optique/core/parser";
3
3
 
4
4
  //#region src/generator.ts
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  }) : target, mod));
22
22
 
23
23
  //#endregion
24
- const require_man = require('./man-DxOvqYHv.cjs');
24
+ const require_man = require('./man-DGnow1Jr.cjs');
25
25
  const __optique_core_parser = __toESM(require("@optique/core/parser"));
26
26
 
27
27
  //#region src/generator.ts
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
- const require_generator = require('./generator-ztP0iNeX.cjs');
1
+ const require_generator = require('./generator-zoVk04OH.cjs');
2
2
  const require_roff = require('./roff-EpcecLXU.cjs');
3
- const require_man = require('./man-DxOvqYHv.cjs');
3
+ const require_man = require('./man-DGnow1Jr.cjs');
4
4
 
5
5
  exports.escapeHyphens = require_roff.escapeHyphens;
6
6
  exports.escapeRoff = require_roff.escapeRoff;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { escapeHyphens, escapeRoff, formatMessageAsRoff } from "./roff-C_MiRXVS.js";
2
- import { formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-BR1BE_cj.js";
3
- import { generateManPage, generateManPageAsync, generateManPageSync } from "./generator-BVZlyiaq.js";
2
+ import { formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-Leuf7kOn.js";
3
+ import { generateManPage, generateManPageAsync, generateManPageSync } from "./generator-CCa36YC2.js";
4
4
 
5
5
  export { escapeHyphens, escapeRoff, formatDateForMan, formatDocPageAsMan, formatMessageAsRoff, formatUsageTermAsRoff, generateManPage, generateManPageAsync, generateManPageSync };
@@ -27,6 +27,9 @@ function formatDateForMan(date) {
27
27
  ];
28
28
  return `${months[date.getMonth()]} ${date.getFullYear()}`;
29
29
  }
30
+ function escapeThField(value) {
31
+ return value.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
32
+ }
30
33
  /**
31
34
  * Formats a single {@link UsageTerm} as roff markup for the SYNOPSIS section.
32
35
  *
@@ -143,15 +146,15 @@ function formatDocSectionEntries(section) {
143
146
  */
144
147
  function formatDocPageAsMan(page, options) {
145
148
  const lines = [];
146
- const thParts = [options.name.toUpperCase(), options.section.toString()];
149
+ const thParts = [escapeThField(options.name.toUpperCase()), options.section.toString()];
147
150
  const hasDate = options.date != null;
148
151
  const hasVersion = options.version != null;
149
152
  const hasManual = options.manual != null;
150
- if (hasDate) thParts.push(`"${formatDateForMan(options.date)}"`);
153
+ if (hasDate) thParts.push(`"${escapeThField(formatDateForMan(options.date))}"`);
151
154
  else if (hasVersion || hasManual) thParts.push("\"\"");
152
- if (hasVersion) thParts.push(`"${options.name} ${options.version}"`);
155
+ if (hasVersion) thParts.push(`"${escapeThField(`${options.name} ${options.version}`)}"`);
153
156
  else if (hasManual) thParts.push("\"\"");
154
- if (hasManual) thParts.push(`"${options.manual}"`);
157
+ if (hasManual) thParts.push(`"${escapeThField(options.manual)}"`);
155
158
  lines.push(`.TH ${thParts.join(" ")}`);
156
159
  lines.push(".SH NAME");
157
160
  if (page.brief) lines.push(`${options.name} \\- ${require_roff.formatMessageAsRoff(page.brief)}`);
@@ -27,6 +27,9 @@ function formatDateForMan(date) {
27
27
  ];
28
28
  return `${months[date.getMonth()]} ${date.getFullYear()}`;
29
29
  }
30
+ function escapeThField(value) {
31
+ return value.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
32
+ }
30
33
  /**
31
34
  * Formats a single {@link UsageTerm} as roff markup for the SYNOPSIS section.
32
35
  *
@@ -143,15 +146,15 @@ function formatDocSectionEntries(section) {
143
146
  */
144
147
  function formatDocPageAsMan(page, options) {
145
148
  const lines = [];
146
- const thParts = [options.name.toUpperCase(), options.section.toString()];
149
+ const thParts = [escapeThField(options.name.toUpperCase()), options.section.toString()];
147
150
  const hasDate = options.date != null;
148
151
  const hasVersion = options.version != null;
149
152
  const hasManual = options.manual != null;
150
- if (hasDate) thParts.push(`"${formatDateForMan(options.date)}"`);
153
+ if (hasDate) thParts.push(`"${escapeThField(formatDateForMan(options.date))}"`);
151
154
  else if (hasVersion || hasManual) thParts.push("\"\"");
152
- if (hasVersion) thParts.push(`"${options.name} ${options.version}"`);
155
+ if (hasVersion) thParts.push(`"${escapeThField(`${options.name} ${options.version}`)}"`);
153
156
  else if (hasManual) thParts.push("\"\"");
154
- if (hasManual) thParts.push(`"${options.manual}"`);
157
+ if (hasManual) thParts.push(`"${escapeThField(options.manual)}"`);
155
158
  lines.push(`.TH ${thParts.join(" ")}`);
156
159
  lines.push(".SH NAME");
157
160
  if (page.brief) lines.push(`${options.name} \\- ${formatMessageAsRoff(page.brief)}`);
package/dist/man.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  require('./roff-EpcecLXU.cjs');
2
- const require_man = require('./man-DxOvqYHv.cjs');
2
+ const require_man = require('./man-DGnow1Jr.cjs');
3
3
 
4
4
  exports.formatDateForMan = require_man.formatDateForMan;
5
5
  exports.formatDocPageAsMan = require_man.formatDocPageAsMan;
package/dist/man.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import "./roff-C_MiRXVS.js";
2
- import { formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-BR1BE_cj.js";
2
+ import { formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff } from "./man-Leuf7kOn.js";
3
3
 
4
4
  export { formatDateForMan, formatDocPageAsMan, formatUsageTermAsRoff };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/man",
3
- "version": "0.10.0-dev.378+995d618d",
3
+ "version": "0.10.0",
4
4
  "description": "Man page generator for Optique CLI parsers",
5
5
  "keywords": [
6
6
  "CLI",
@@ -84,8 +84,8 @@
84
84
  "optique-man": "./dist/cli.js"
85
85
  },
86
86
  "dependencies": {
87
- "@optique/core": "0.10.0-dev.378+995d618d",
88
- "@optique/run": "0.10.0-dev.378+995d618d"
87
+ "@optique/core": "0.10.0",
88
+ "@optique/run": "0.10.0"
89
89
  },
90
90
  "devDependencies": {
91
91
  "@types/node": "^20.19.9",