@slidev/cli 0.35.5 → 0.36.1

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ViteSlidevPlugin,
3
3
  mergeViteConfigs
4
- } from "./chunk-QPGEWKWZ.mjs";
4
+ } from "./chunk-DRWWOOWC.mjs";
5
5
  import {
6
6
  __commonJS,
7
7
  __dirname,
@@ -13,7 +13,7 @@ import {
13
13
  init_esm_shims,
14
14
  packageExists,
15
15
  resolveImportPath
16
- } from "./chunk-GVA336JI.mjs";
16
+ } from "./chunk-IAMILGBS.mjs";
17
17
 
18
18
  // ../../node_modules/.pnpm/semver@7.3.7/node_modules/semver/internal/constants.js
19
19
  var require_constants = __commonJS({
@@ -163,7 +163,9 @@ var require_semver = __commonJS({
163
163
  throw new TypeError(`Invalid Version: ${version3}`);
164
164
  }
165
165
  if (version3.length > MAX_LENGTH) {
166
- throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
166
+ throw new TypeError(
167
+ `version is longer than ${MAX_LENGTH} characters`
168
+ );
167
169
  }
168
170
  debug2("SemVer", version3, options);
169
171
  this.options = options;
@@ -436,7 +438,10 @@ var require_inc = __commonJS({
436
438
  options = void 0;
437
439
  }
438
440
  try {
439
- return new SemVer(version3 instanceof SemVer ? version3.version : version3, options).inc(release, identifier).version;
441
+ return new SemVer(
442
+ version3 instanceof SemVer ? version3.version : version3,
443
+ options
444
+ ).inc(release, identifier).version;
440
445
  } catch (er) {
441
446
  return null;
442
447
  }
@@ -2378,19 +2383,26 @@ init_esm_shims();
2378
2383
  import { join } from "path";
2379
2384
  import { createServer as createViteServer, resolveConfig } from "vite";
2380
2385
  async function createServer(options, viteConfig = {}, serverOptions = {}) {
2381
- const rawConfig = await resolveConfig({}, "serve");
2386
+ const rawConfig = await resolveConfig({}, "serve", options.entry);
2382
2387
  const pluginOptions = rawConfig.slidev || {};
2383
2388
  process.env.EDITOR = process.env.EDITOR || "code";
2384
- const server = await createViteServer(await mergeViteConfigs(options, viteConfig, {
2385
- optimizeDeps: {
2386
- entries: [
2387
- join(options.clientRoot, "main.ts")
2388
- ]
2389
- },
2390
- plugins: [
2391
- await ViteSlidevPlugin(options, pluginOptions, serverOptions)
2392
- ]
2393
- }, "serve"));
2389
+ const server = await createViteServer(
2390
+ await mergeViteConfigs(
2391
+ options,
2392
+ viteConfig,
2393
+ {
2394
+ optimizeDeps: {
2395
+ entries: [
2396
+ join(options.clientRoot, "main.ts")
2397
+ ]
2398
+ },
2399
+ plugins: [
2400
+ await ViteSlidevPlugin(options, pluginOptions, serverOptions)
2401
+ ]
2402
+ },
2403
+ "serve"
2404
+ )
2405
+ );
2394
2406
  return server;
2395
2407
  }
2396
2408
 
@@ -2399,16 +2411,16 @@ init_esm_shims();
2399
2411
  import * as parser from "@slidev/parser/fs";
2400
2412
 
2401
2413
  // package.json
2402
- var version = "0.35.5";
2414
+ var version = "0.36.1";
2403
2415
 
2404
2416
  // node/themes.ts
2405
2417
  init_esm_shims();
2406
2418
  import prompts2 from "prompts";
2407
2419
 
2408
- // ../../node_modules/.pnpm/@antfu+ni@0.17.2/node_modules/@antfu/ni/dist/index.mjs
2420
+ // ../../node_modules/.pnpm/@antfu+ni@0.18.0/node_modules/@antfu/ni/dist/index.mjs
2409
2421
  init_esm_shims();
2410
2422
 
2411
- // ../../node_modules/.pnpm/@antfu+ni@0.17.2/node_modules/@antfu/ni/dist/chunks/runner.mjs
2423
+ // ../../node_modules/.pnpm/@antfu+ni@0.18.0/node_modules/@antfu/ni/dist/chunks/runner.mjs
2412
2424
  init_esm_shims();
2413
2425
  import require$$0, { resolve } from "path";
2414
2426
  import require$$0$5 from "readline";
@@ -2428,7 +2440,7 @@ import require$$0$3 from "stream";
2428
2440
  import require$$2$1 from "util";
2429
2441
  import { promises } from "fs";
2430
2442
  import require$$1 from "tty";
2431
- var version2 = "0.17.2";
2443
+ var version2 = "0.18.0";
2432
2444
  var npmRun = (agent) => (args) => {
2433
2445
  if (args.length > 1)
2434
2446
  return `${agent} run ${args[0]} -- ${args.slice(1).join(" ")}`;
@@ -2514,11 +2526,11 @@ var LOCKS = {
2514
2526
  };
2515
2527
  var INSTALL_PAGE = {
2516
2528
  "bun": "https://bun.sh",
2517
- "pnpm": "https://pnpm.js.org/en/installation",
2518
- "pnpm@6": "https://pnpm.js.org/en/installation",
2529
+ "pnpm": "https://pnpm.io/installation",
2530
+ "pnpm@6": "https://pnpm.io/6.x/installation",
2519
2531
  "yarn": "https://classic.yarnpkg.com/en/docs/install",
2520
2532
  "yarn@berry": "https://yarnpkg.com/getting-started/install",
2521
- "npm": "https://www.npmjs.com/get-npm"
2533
+ "npm": "https://docs.npmjs.com/cli/v8/configuring-npm/install"
2522
2534
  };
2523
2535
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
2524
2536
  var windows = isexe$3;
@@ -3961,10 +3973,25 @@ var signals$1 = { exports: {} };
3961
3973
  "SIGTERM"
3962
3974
  ];
3963
3975
  if (process.platform !== "win32") {
3964
- module.exports.push("SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
3976
+ module.exports.push(
3977
+ "SIGVTALRM",
3978
+ "SIGXCPU",
3979
+ "SIGXFSZ",
3980
+ "SIGUSR2",
3981
+ "SIGTRAP",
3982
+ "SIGSYS",
3983
+ "SIGQUIT",
3984
+ "SIGIOT"
3985
+ );
3965
3986
  }
3966
3987
  if (process.platform === "linux") {
3967
- module.exports.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT", "SIGUNUSED");
3988
+ module.exports.push(
3989
+ "SIGIO",
3990
+ "SIGPOLL",
3991
+ "SIGPWR",
3992
+ "SIGSTKFLT",
3993
+ "SIGUNUSED"
3994
+ );
3968
3995
  }
3969
3996
  })(signals$1);
3970
3997
  var process$1 = commonjsGlobal.process;
@@ -8417,8 +8444,11 @@ var DatePrompt = class extends Prompt$4 {
8417
8444
  this.parts.reduce((arr, p, idx) => arr.concat(idx === this.cursor && !this.done ? color$5.cyan().underline(p.toString()) : p), []).join("")
8418
8445
  ].join(" ");
8419
8446
  if (this.error) {
8420
- this.outputText += this.errorMsg.split("\n").reduce((a, l, i) => a + `
8421
- ${i ? ` ` : figures$4.pointerSmall} ${color$5.red().italic(l)}`, ``);
8447
+ this.outputText += this.errorMsg.split("\n").reduce(
8448
+ (a, l, i) => a + `
8449
+ ${i ? ` ` : figures$4.pointerSmall} ${color$5.red().italic(l)}`,
8450
+ ``
8451
+ );
8422
8452
  }
8423
8453
  this.out.write(erase$3.line + cursor$5.to(0) + this.outputText);
8424
8454
  }
@@ -9031,7 +9061,12 @@ var AutocompletePrompt = class extends Prompt$1 {
9031
9061
  this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input)
9032
9062
  ].join(" ");
9033
9063
  if (!this.done) {
9034
- const suggestions = this.suggestions.slice(startIndex, endIndex).map((item2, i) => this.renderOption(item2, this.select === i + startIndex, i === 0 && startIndex > 0, i + startIndex === endIndex - 1 && endIndex < this.choices.length)).join("\n");
9064
+ const suggestions = this.suggestions.slice(startIndex, endIndex).map((item2, i) => this.renderOption(
9065
+ item2,
9066
+ this.select === i + startIndex,
9067
+ i === 0 && startIndex > 0,
9068
+ i + startIndex === endIndex - 1 && endIndex < this.choices.length
9069
+ )).join("\n");
9035
9070
  this.outputText += `
9036
9071
  ` + (suggestions || color$2.gray(this.fallback.title));
9037
9072
  }
@@ -9329,7 +9364,9 @@ var elements = {
9329
9364
  onSubmit: toSelected
9330
9365
  });
9331
9366
  };
9332
- const byTitle = (input, choices) => Promise.resolve(choices.filter((item2) => item2.title.slice(0, input.length).toLowerCase() === input.toLowerCase()));
9367
+ const byTitle = (input, choices) => Promise.resolve(
9368
+ choices.filter((item2) => item2.title.slice(0, input.length).toLowerCase() === input.toLowerCase())
9369
+ );
9333
9370
  $2.autocomplete = (args) => {
9334
9371
  args.suggest = args.suggest || byTitle;
9335
9372
  args.choices = [].concat(args.choices || []);
@@ -9597,7 +9634,7 @@ function getUserRoot(options) {
9597
9634
  return { entry: fullEntry, userRoot: dirname(fullEntry) };
9598
9635
  }
9599
9636
  async function resolveOptions(options, mode2, promptForInstallation = true) {
9600
- const { remote } = options;
9637
+ const { remote, inspect } = options;
9601
9638
  const {
9602
9639
  entry,
9603
9640
  userRoot
@@ -9623,7 +9660,7 @@ async function resolveOptions(options, mode2, promptForInstallation = true) {
9623
9660
  const themeMeta = await getThemeMeta(theme, join2(themeRoots[0], "package.json"));
9624
9661
  data.themeMeta = themeMeta;
9625
9662
  if (themeMeta)
9626
- data.config = parser.resolveConfig(data.headmatter, themeMeta);
9663
+ data.config = parser.resolveConfig(data.headmatter, themeMeta, options.entry);
9627
9664
  }
9628
9665
  debug({
9629
9666
  config: data.config,
@@ -9649,7 +9686,8 @@ async function resolveOptions(options, mode2, promptForInstallation = true) {
9649
9686
  themeRoots,
9650
9687
  addonRoots,
9651
9688
  roots,
9652
- remote
9689
+ remote,
9690
+ inspect
9653
9691
  };
9654
9692
  }
9655
9693