create-book 11.0.4 → 11.1.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.js CHANGED
@@ -22,28 +22,28 @@ import fs$1 from "node:fs/promises";
22
22
  const CONTAINER_URL = "ghcr.io/vivliostyle/cli";
23
23
  const DEFAULT_BROWSER_VERSIONS = {
24
24
  chrome: {
25
- "linux": "150.0.7871.24",
26
- "linux_arm": "150.0.7871.24",
27
- "mac": "150.0.7871.24",
28
- "mac_arm": "150.0.7871.24",
29
- "win32": "150.0.7871.24",
30
- "win64": "150.0.7871.24"
25
+ "linux": "150.0.7871.115",
26
+ "linux_arm": "150.0.7871.115",
27
+ "mac": "150.0.7871.115",
28
+ "mac_arm": "150.0.7871.115",
29
+ "win32": "150.0.7871.115",
30
+ "win64": "150.0.7871.115"
31
31
  },
32
32
  chromium: {
33
- "linux": "1651380",
34
- "linux_arm": "1651380",
35
- "mac": "1651385",
36
- "mac_arm": "1651385",
37
- "win32": "1651280",
38
- "win64": "1651309"
33
+ "linux": "1660895",
34
+ "linux_arm": "1660895",
35
+ "mac": "1660898",
36
+ "mac_arm": "1660899",
37
+ "win32": "1660891",
38
+ "win64": "1660891"
39
39
  },
40
40
  firefox: {
41
- "linux": "stable_152.0.2",
42
- "linux_arm": "stable_152.0.2",
43
- "mac": "stable_152.0.2",
44
- "mac_arm": "stable_152.0.2",
45
- "win32": "stable_152.0.2",
46
- "win64": "stable_152.0.2"
41
+ "linux": "stable_152.0.5",
42
+ "linux_arm": "stable_152.0.5",
43
+ "mac": "stable_152.0.5",
44
+ "mac_arm": "stable_152.0.5",
45
+ "win32": "stable_152.0.5",
46
+ "win64": "stable_152.0.5"
47
47
  }
48
48
  };
49
49
  const DEFAULT_CONFIG_FILENAME = "vivliostyle.config.js";
@@ -10547,6 +10547,7 @@ const defaultSpinner = {
10547
10547
  };
10548
10548
  const SYNCHRONIZED_OUTPUT_ENABLE = "\x1B[?2026h";
10549
10549
  const SYNCHRONIZED_OUTPUT_DISABLE = "\x1B[?2026l";
10550
+ const oscSequenceRegex = /][\s\S]*?(?:|\\)/g;
10550
10551
  const activeHooksPerStream = /* @__PURE__ */ new Set();
10551
10552
  var YoctoSpinner = class {
10552
10553
  #frames;
@@ -10753,7 +10754,7 @@ var YoctoSpinner = class {
10753
10754
  }
10754
10755
  #lineCount(text) {
10755
10756
  const width = this.#stream.columns ?? 80;
10756
- const lines = stripVTControlCharacters(text).split("\n");
10757
+ const lines = stripVTControlCharacters(text.replaceAll(oscSequenceRegex, "")).split("\n");
10757
10758
  let lineCount = 0;
10758
10759
  for (const line of lines) lineCount += Math.max(1, Math.ceil(line.length / width));
10759
10760
  return lineCount;
@@ -10784,7 +10785,7 @@ function yoctoSpinner(options) {
10784
10785
  return new YoctoSpinner(options);
10785
10786
  }
10786
10787
  //#endregion
10787
- //#region ../../dist/util-DRLHkKnG.js
10788
+ //#region ../../dist/util-CsmUMRtR.js
10788
10789
  const isUnicodeSupported = process.platform !== "win32" || Boolean(process.env.WT_SESSION);
10789
10790
  [
10790
10791
  "📕",
@@ -10822,6 +10823,11 @@ var Logger = class Logger {
10822
10823
  static #stdout = process.stdout;
10823
10824
  static #stderr = process.stderr;
10824
10825
  static #signal;
10826
+ /**
10827
+ * True in the forked build subprocess (renderMode: docker),
10828
+ * which logs non-interactively.
10829
+ */
10830
+ static #containerForkMode = false;
10825
10831
  static {
10826
10832
  this.debug = (0, import_src$2.default)("vs-cli");
10827
10833
  }
@@ -10851,7 +10857,7 @@ var Logger = class Logger {
10851
10857
  return this.#signal;
10852
10858
  }
10853
10859
  static get isInteractive() {
10854
- return !this.#customLogger && this.#stderr.isTTY && process.env.TERM !== "dumb" && !("CI" in process.env) && !import.meta.env?.VITEST && !import_src$2.default.enabled("vs-cli") && !isInContainer();
10860
+ return !this.#customLogger && this.#stderr.isTTY && process.env.TERM !== "dumb" && !("CI" in process.env) && !import.meta.env?.VITEST && !import_src$2.default.enabled("vs-cli") && !this.#containerForkMode;
10855
10861
  }
10856
10862
  static startLogging(text) {
10857
10863
  if (this.#logLevel === 0) return;
@@ -10897,6 +10903,16 @@ var Logger = class Logger {
10897
10903
  this.#spinner.start(messages.join(" "));
10898
10904
  this.#nonBlockingLogPrinted = false;
10899
10905
  }
10906
+ /**
10907
+ * Update the text of the running spinner in place without printing a
10908
+ * checkpoint line. Unlike `logUpdate`, this method does nothing when the
10909
+ * output is not interactive, so it is safe to call at a high frequency.
10910
+ */
10911
+ static logUpdateProgress(...messages) {
10912
+ if (this.#logLevel < 1 || !this.#spinner || !this.isInteractive) return;
10913
+ this.#spinner.text = messages.join(" ");
10914
+ this.#nonBlockingLogPrinted = true;
10915
+ }
10900
10916
  static getMessage(message, symbol) {
10901
10917
  return !this.#customLogger && symbol ? `${symbol} ${message}` : message;
10902
10918
  }
@@ -10932,7 +10948,7 @@ var Logger = class Logger {
10932
10948
  if (this.#logLevel < 2) return;
10933
10949
  this.#nonBlockingLog("info", this.getMessage(messages.join(" ")));
10934
10950
  }
10935
- static setLogOptions({ logLevel, logger, stdin, stdout, stderr, signal }) {
10951
+ static setLogOptions({ logLevel, logger, stdin, stdout, stderr, signal, containerForkMode }) {
10936
10952
  if (logLevel) {
10937
10953
  this.#logLevel = {
10938
10954
  silent: 0,
@@ -10947,6 +10963,7 @@ var Logger = class Logger {
10947
10963
  if (stdout) this.#stdout = stdout;
10948
10964
  if (stderr) this.#stderr = stderr;
10949
10965
  if (signal) this.#signal = signal;
10966
+ if (containerForkMode !== void 0) this.#containerForkMode = containerForkMode;
10950
10967
  }
10951
10968
  static setLogPrefix(prefix) {
10952
10969
  this.#logPrefix = prefix;
@@ -11084,9 +11101,6 @@ function cachedFn(fn) {
11084
11101
  let cache = null;
11085
11102
  return () => cache ?? (cache = fn());
11086
11103
  }
11087
- const isInContainer = cachedFn(function isInContainer() {
11088
- return fs.existsSync("/opt/vivliostyle-cli/.vs-cli-version");
11089
- });
11090
11104
  let cachedLocale;
11091
11105
  function getOsLocale() {
11092
11106
  if (import.meta.env?.VITEST) return process.env.TEST_LOCALE || "en";
@@ -79200,7 +79214,7 @@ import_remove.default.removeSync;
79200
79214
  ...import_remove.default
79201
79215
  });
79202
79216
  //#endregion
79203
- //#region ../../dist/asset-Cv7iIlt0.js
79217
+ //#region ../../dist/asset-DBj3nifv.js
79204
79218
  function createParserProgram({ setupProgram, parseArgs }) {
79205
79219
  return (argv) => {
79206
79220
  const program = setupProgram();
@@ -79298,7 +79312,7 @@ var GlobMatcher = class {
79298
79312
  }
79299
79313
  };
79300
79314
  //#endregion
79301
- //#region ../../dist/entry-util-DKwn9x2e.js
79315
+ //#region ../../dist/entry-util-Bh1ksaYK.js
79302
79316
  var CliInterruptError = class extends Error {
79303
79317
  constructor(exitCode) {
79304
79318
  super(exitCode === 130 ? "Interrupted by SIGINT" : `Terminated by signal: ${exitCode}`);
@@ -88690,7 +88704,7 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
88690
88704
  /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
88691
88705
  /*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
88692
88706
  //#endregion
88693
- //#region ../../dist/create-DSCYbAc9.js
88707
+ //#region ../../dist/create-BF3vSlSR.js
88694
88708
  var import_proxy = (/* @__PURE__ */ __commonJSMin(((exports) => {
88695
88709
  var Ye = Object.defineProperty;
88696
88710
  var Re = (A) => {
@@ -104122,7 +104136,7 @@ const { program, createCommand, createArgument, createOption, CommanderError, In
104122
104136
  exports.InvalidOptionArgumentError = InvalidArgumentError;
104123
104137
  })))(), 1)).default;
104124
104138
  //#endregion
104125
- //#region ../../dist/create.runner-Dg-K7HGv.js
104139
+ //#region ../../dist/create.runner-C4VHkWP9.js
104126
104140
  function setupCreateParserProgram() {
104127
104141
  const program = new Command();
104128
104142
  program.name("vivliostyle create").description("scaffold a new Vivliostyle project").arguments("[projectPath]").option("--title <title>", "title").option("--author <author>", "author").option("-l, --language <language>", "language").option("-s, --size <size>", "paper size").option("-T, --theme <theme>", "theme").option("--no-theme", "Do not include a theme.").option("--template <template>", `Template source in the format of \`[provider]:repo[/subpath][#ref]\` or as a local directory to copy from.`).option("--install-dependencies", "Install dependencies after creating a project.").option("--no-install-dependencies", "Do not install dependencies after creating a project.").option("--create-config-file-only", `Create a Vivliostyle config file without generating project template files.`).addOption(new Option("--proxy-server <proxyServer>", `HTTP/SOCK proxy server url`)).addOption(new Option("--proxy-bypass <proxyBypass>", `optional comma-separated domains to bypass proxy`)).addOption(new Option("--proxy-user <proxyUser>", `optional username for HTTP proxy authentication`)).addOption(new Option("--proxy-pass <proxyPass>", `optional password for HTTP proxy authentication`)).addOption(new Option("--log-level <level>", "specify a log level of console outputs").choices([