@slidev/cli 0.43.7 → 0.43.9

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/bin/slidev.mjs ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ 'use strict'
3
+ import ('../dist/cli.mjs')
@@ -2,10 +2,10 @@ import {
2
2
  ViteSlidevPlugin,
3
3
  getIndexHtml,
4
4
  mergeViteConfigs
5
- } from "./chunk-PNMZABHE.mjs";
6
- import "./chunk-43ON36K4.mjs";
7
- import "./chunk-CPYGYVJ2.mjs";
8
- import "./chunk-QHOBBTS4.mjs";
5
+ } from "./chunk-CNR3FZCA.mjs";
6
+ import "./chunk-CYLMMBRG.mjs";
7
+ import "./chunk-2ZQP2W7X.mjs";
8
+ import "./chunk-65ITIFTL.mjs";
9
9
 
10
10
  // node/build.ts
11
11
  import { join as join3, resolve as resolve3 } from "node:path";
@@ -722,7 +722,7 @@ async function build(options, viteConfig = {}, args) {
722
722
  await fs2.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
723
723
  `, "utf-8");
724
724
  if ([true, "true", "auto"].includes(options.data.config.download)) {
725
- const { exportSlides, getExportOptions } = await import("./export-GFE5VFSA.mjs");
725
+ const { exportSlides, getExportOptions } = await import("./export-HQUH6WSD.mjs");
726
726
  const port = 12445;
727
727
  const app = connect();
728
728
  const server = http.createServer(app);
@@ -1,30 +1,31 @@
1
- import {
2
- __require
3
- } from "./chunk-QHOBBTS4.mjs";
4
-
5
1
  // node/utils.ts
6
- import { join } from "node:path";
2
+ import { dirname, join } from "node:path";
3
+ import { createRequire } from "node:module";
4
+ import { fileURLToPath } from "node:url";
7
5
  import { ensurePrefix, slash } from "@antfu/utils";
8
6
  import isInstalledGlobally from "is-installed-globally";
9
- import { sync as resolve } from "resolve";
7
+ import resolve from "resolve";
10
8
  import globalDirs from "global-dirs";
9
+ var require2 = createRequire(import.meta.url);
10
+ var __dirname = dirname(fileURLToPath(import.meta.url));
11
11
  function toAtFS(path) {
12
12
  return `/@fs${ensurePrefix("/", slash(path))}`;
13
13
  }
14
14
  function resolveImportPath(importName, ensure = false) {
15
15
  try {
16
- return resolve(importName, {
17
- preserveSymlinks: false
16
+ return resolve.sync(importName, {
17
+ preserveSymlinks: false,
18
+ basedir: __dirname
18
19
  });
19
20
  } catch {
20
21
  }
21
22
  if (isInstalledGlobally) {
22
23
  try {
23
- return __require.resolve(join(globalDirs.yarn.packages, importName));
24
+ return require2.resolve(join(globalDirs.yarn.packages, importName));
24
25
  } catch {
25
26
  }
26
27
  try {
27
- return __require.resolve(join(globalDirs.npm.packages, importName));
28
+ return require2.resolve(join(globalDirs.npm.packages, importName));
28
29
  } catch {
29
30
  }
30
31
  }
@@ -34,15 +35,18 @@ function resolveImportPath(importName, ensure = false) {
34
35
  }
35
36
  function resolveGlobalImportPath(importName) {
36
37
  try {
37
- return resolve(importName, { preserveSymlinks: false, basedir: __dirname });
38
+ return resolve.sync(importName, {
39
+ preserveSymlinks: false,
40
+ basedir: __dirname
41
+ });
38
42
  } catch {
39
43
  }
40
44
  try {
41
- return __require.resolve(join(globalDirs.yarn.packages, importName));
45
+ return require2.resolve(join(globalDirs.yarn.packages, importName));
42
46
  } catch {
43
47
  }
44
48
  try {
45
- return __require.resolve(join(globalDirs.npm.packages, importName));
49
+ return require2.resolve(join(globalDirs.npm.packages, importName));
46
50
  } catch {
47
51
  }
48
52
  throw new Error(`Failed to resolve global package "${importName}"`);
@@ -4,14 +4,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
- }) : x)(function(x) {
10
- if (typeof require !== "undefined")
11
- return require.apply(this, arguments);
12
- throw Error('Dynamic require of "' + x + '" is not supported');
13
- });
14
- var __commonJS = (cb, mod) => function __require2() {
7
+ var __commonJS = (cb, mod) => function __require() {
15
8
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
9
  };
17
10
  var __copyProps = (to, from, except, desc) => {
@@ -32,7 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
32
25
  ));
33
26
 
34
27
  export {
35
- __require,
36
28
  __commonJS,
37
29
  __toESM
38
30
  };
@@ -1,13 +1,14 @@
1
1
  import {
2
2
  loadSetups
3
- } from "./chunk-43ON36K4.mjs";
3
+ } from "./chunk-CYLMMBRG.mjs";
4
4
  import {
5
5
  resolveImportPath
6
- } from "./chunk-CPYGYVJ2.mjs";
6
+ } from "./chunk-2ZQP2W7X.mjs";
7
7
 
8
8
  // node/plugins/windicss.ts
9
9
  import { dirname, resolve } from "node:path";
10
10
  import { existsSync } from "node:fs";
11
+ import { fileURLToPath } from "node:url";
11
12
  import { slash, uniq } from "@antfu/utils";
12
13
  import jiti from "jiti";
13
14
  async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
@@ -20,7 +21,7 @@ async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRo
20
21
  resolve(clientRoot, "windi.config.ts")
21
22
  ]);
22
23
  const configFile = configFiles.find((i) => existsSync(i));
23
- let config = jiti(__filename)(configFile);
24
+ let config = jiti(fileURLToPath(import.meta.url))(configFile);
24
25
  if (config.default)
25
26
  config = config.default;
26
27
  config = await loadSetups(roots, "windicss.ts", {}, config, true);
@@ -1,18 +1,17 @@
1
1
  import {
2
2
  loadSetups
3
- } from "./chunk-43ON36K4.mjs";
3
+ } from "./chunk-CYLMMBRG.mjs";
4
4
  import {
5
5
  generateGoogleFontsUrl,
6
6
  resolveGlobalImportPath,
7
7
  resolveImportPath,
8
8
  stringifyMarkdownTokens,
9
9
  toAtFS
10
- } from "./chunk-CPYGYVJ2.mjs";
10
+ } from "./chunk-2ZQP2W7X.mjs";
11
11
  import {
12
12
  __commonJS,
13
- __require,
14
13
  __toESM
15
- } from "./chunk-QHOBBTS4.mjs";
14
+ } from "./chunk-65ITIFTL.mjs";
16
15
 
17
16
  // ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
18
17
  var require_fast_deep_equal = __commonJS({
@@ -114,7 +113,7 @@ async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config,
114
113
 
115
114
  // node/plugins/preset.ts
116
115
  import { join as join8 } from "node:path";
117
- import { existsSync as existsSync4 } from "node:fs";
116
+ import { existsSync as existsSync3 } from "node:fs";
118
117
  import process3 from "node:process";
119
118
  import Vue from "@vitejs/plugin-vue";
120
119
  import VueJsx from "@vitejs/plugin-vue-jsx";
@@ -186,28 +185,28 @@ var dependencies = {
186
185
  "@antfu/utils": "^0.7.6",
187
186
  "@slidev/parser": "workspace:*",
188
187
  "@slidev/types": "workspace:*",
189
- "@unocss/reset": "^0.56.5",
188
+ "@unocss/reset": "^0.57.1",
190
189
  "@vueuse/core": "^10.5.0",
191
190
  "@vueuse/head": "^2.0.0",
192
191
  "@vueuse/math": "^10.5.0",
193
192
  "@vueuse/motion": "^2.0.0",
194
193
  codemirror: "^5.65.5",
195
- defu: "^6.1.2",
194
+ defu: "^6.1.3",
196
195
  drauu: "^0.3.7",
197
196
  "file-saver": "^2.0.5",
198
- "fuse.js": "^6.6.2",
197
+ "fuse.js": "^7.0.0",
199
198
  "js-base64": "^3.7.5",
200
199
  "js-yaml": "^4.1.0",
201
200
  katex: "^0.16.9",
202
- mermaid: "^10.5.0",
201
+ mermaid: "^10.6.0",
203
202
  "monaco-editor": "^0.37.1",
204
- nanoid: "^5.0.1",
203
+ nanoid: "^5.0.2",
205
204
  prettier: "^3.0.3",
206
205
  recordrtc: "^5.6.2",
207
- resolve: "^1.22.6",
208
- unocss: "^0.56.5",
206
+ resolve: "^1.22.8",
207
+ unocss: "^0.57.1",
209
208
  "vite-plugin-windicss": "^1.9.1",
210
- vue: "^3.3.4",
209
+ vue: "^3.3.7",
211
210
  "vue-router": "^4.2.5",
212
211
  "vue-starport": "^0.4.0",
213
212
  windicss: "^3.5.6"
@@ -369,7 +368,7 @@ import { basename as basename2, join as join5 } from "node:path";
369
368
  import process from "node:process";
370
369
  import { isString, notNullish, objectMap, range, slash, uniq as uniq3 } from "@antfu/utils";
371
370
  import fg2 from "fast-glob";
372
- import fs4, { existsSync as existsSync2 } from "fs-extra";
371
+ import fs4 from "fs-extra";
373
372
  import Markdown from "markdown-it";
374
373
  import { bold, gray, red, yellow } from "kolorist";
375
374
  import mila from "markdown-it-link-attributes";
@@ -809,7 +808,7 @@ defineProps<{ no: number | string }>()`);
809
808
  join5(root, "style.css")
810
809
  ];
811
810
  for (const style of styles) {
812
- if (existsSync2(style)) {
811
+ if (fs4.existsSync(style)) {
813
812
  imports.push(`import "${toAtFS(style)}"`);
814
813
  continue;
815
814
  }
@@ -937,18 +936,20 @@ export default {
937
936
  }
938
937
 
939
938
  // node/plugins/monacoTransform.ts
940
- import { join as join6 } from "node:path";
939
+ import { dirname as dirname4, join as join6 } from "node:path";
940
+ import fs5 from "node:fs/promises";
941
941
  import process2 from "node:process";
942
942
  import { slash as slash2 } from "@antfu/utils";
943
+ import { findDepPkgJsonPath } from "vitefu";
943
944
  async function getPackageData(pkg) {
944
- const { resolvePackageData } = await eval('import("vite")');
945
- const info = resolvePackageData(pkg, process2.cwd());
946
- if (!info)
945
+ const pkgJsonPath = await findDepPkgJsonPath(pkg, process2.cwd());
946
+ if (!pkgJsonPath)
947
947
  return;
948
- const typePath = info.data.types || info.data.typings;
948
+ const pkgJson = JSON.parse(await fs5.readFile(pkgJsonPath, "utf-8"));
949
+ const typePath = pkgJson.types || pkgJson.typings;
949
950
  if (!typePath)
950
951
  return;
951
- return [info, typePath];
952
+ return [dirname4(pkgJsonPath), pkgJson, typePath];
952
953
  }
953
954
  function createMonacoTypesLoader() {
954
955
  return {
@@ -961,16 +962,16 @@ function createMonacoTypesLoader() {
961
962
  async load(id) {
962
963
  const match = id.match(/^\/\@slidev-monaco-types\/(.*)$/);
963
964
  if (match) {
964
- const pkg2 = match[1];
965
- const packageData = await getPackageData(pkg2) || await getPackageData(`@types/${pkg2}`);
965
+ const pkg = match[1];
966
+ const packageData = await getPackageData(pkg) || await getPackageData(`@types/${pkg}`);
966
967
  if (!packageData)
967
968
  return;
968
- const [info2, typePath2] = packageData;
969
+ const [pkgDir, pkgJson, typePath] = packageData;
969
970
  return [
970
971
  "import * as monaco from 'monaco-editor'",
971
- `import Type from "${slash2(join6(info2.dir, typePath2))}?raw"`,
972
- ...Object.keys(info2.data.dependencies || {}).map((i) => `import "/@slidev-monaco-types/${i}"`),
973
- `monaco.languages.typescript.typescriptDefaults.addExtraLib(\`declare module "${pkg2}" { \${Type} }\`)`
972
+ `import Type from "${slash2(join6(pkgDir, typePath))}?raw"`,
973
+ ...Object.keys(pkgJson.dependencies || {}).map((i) => `import "/@slidev-monaco-types/${i}"`),
974
+ `monaco.languages.typescript.typescriptDefaults.addExtraLib(\`declare module "${pkg}" { \${Type} }\`)`
974
975
  ].join("\n");
975
976
  }
976
977
  }
@@ -978,7 +979,7 @@ function createMonacoTypesLoader() {
978
979
  }
979
980
 
980
981
  // node/plugins/setupClient.ts
981
- import { existsSync as existsSync3 } from "node:fs";
982
+ import { existsSync as existsSync2 } from "node:fs";
982
983
  import { join as join7, resolve as resolve2 } from "node:path";
983
984
  import { slash as slash3, uniq as uniq4 } from "@antfu/utils";
984
985
  function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot }) {
@@ -1001,7 +1002,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
1001
1002
  userRoot
1002
1003
  ]).map((i) => join7(i, "setup", name));
1003
1004
  setups.forEach((path, idx) => {
1004
- if (!existsSync3(path))
1005
+ if (!existsSync2(path))
1005
1006
  return;
1006
1007
  imports.push(`import __n${idx} from '${toAtFS(path)}'`);
1007
1008
  let fn = `:AWAIT:__n${idx}`;
@@ -1191,9 +1192,11 @@ function math_plugin(md2, options) {
1191
1192
  }
1192
1193
 
1193
1194
  // node/plugins/markdown-it-prism.ts
1195
+ import { createRequire } from "node:module";
1194
1196
  import Prism from "prismjs";
1195
- import loadLanguages from "prismjs/components/";
1197
+ import loadLanguages from "prismjs/components/index.js";
1196
1198
  import * as htmlparser2 from "htmlparser2";
1199
+ var require2 = createRequire(import.meta.url);
1197
1200
  var Tag = class {
1198
1201
  constructor(tagname, attributes) {
1199
1202
  this.tagname = tagname;
@@ -1226,7 +1229,7 @@ function loadPrismLang(lang) {
1226
1229
  }
1227
1230
  function loadPrismPlugin(name) {
1228
1231
  try {
1229
- __require(`prismjs/plugins/${name}/prism-${name}`);
1232
+ require2(`prismjs/plugins/${name}/prism-${name}`);
1230
1233
  } catch (e) {
1231
1234
  throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
1232
1235
  }
@@ -1612,7 +1615,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1612
1615
  const VueJsxPlugin = VueJsx(vuejsxOptions);
1613
1616
  const MarkdownPlugin = await createMarkdownPlugin(options, pluginOptions);
1614
1617
  const drawingData = await loadDrawings(options);
1615
- const publicRoots = themeRoots.map((i) => join8(i, "public")).filter(existsSync4);
1618
+ const publicRoots = themeRoots.map((i) => join8(i, "public")).filter(existsSync3);
1616
1619
  const plugins = [
1617
1620
  MarkdownPlugin,
1618
1621
  VueJsxPlugin,
@@ -1690,7 +1693,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1690
1693
  dev: true,
1691
1694
  build: true
1692
1695
  })) : null,
1693
- config.css === "none" ? null : config.css === "windicss" ? import("./windicss-5I6DSVQN.mjs").then((r) => r.createWindiCSSPlugin(options, pluginOptions)) : import("./unocss-EBBZWMQM.mjs").then((r) => r.createUnocssPlugin(options, pluginOptions))
1696
+ config.css === "none" ? null : config.css === "windicss" ? import("./windicss-GLRSRVVQ.mjs").then((r) => r.createWindiCSSPlugin(options, pluginOptions)) : import("./unocss-BTVZWCXM.mjs").then((r) => r.createUnocssPlugin(options, pluginOptions))
1694
1697
  ];
1695
1698
  return (await Promise.all(plugins)).flat().filter(notNullish2);
1696
1699
  }
@@ -1,6 +1,7 @@
1
1
  // node/plugins/setupNode.ts
2
2
  import { resolve } from "node:path";
3
- import { pathExists } from "fs-extra";
3
+ import { fileURLToPath } from "node:url";
4
+ import fs from "fs-extra";
4
5
  import { isObject } from "@antfu/utils";
5
6
  import jiti from "jiti";
6
7
  function deepMerge(a, b, rootPath = "") {
@@ -19,8 +20,8 @@ async function loadSetups(roots, name, arg, initial, merge = true) {
19
20
  let returns = initial;
20
21
  for (const root of roots) {
21
22
  const path = resolve(root, "setup", name);
22
- if (await pathExists(path)) {
23
- const { default: setup } = jiti(__filename)(path);
23
+ if (await fs.pathExists(path)) {
24
+ const { default: setup } = jiti(fileURLToPath(import.meta.url))(path);
24
25
  const result = await setup(arg);
25
26
  if (result !== null) {
26
27
  returns = typeof merge === "function" ? merge(returns, result) : merge ? deepMerge(returns, result) : result;
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  ViteSlidevPlugin,
3
3
  mergeViteConfigs
4
- } from "./chunk-PNMZABHE.mjs";
4
+ } from "./chunk-CNR3FZCA.mjs";
5
5
  import {
6
6
  packageExists,
7
7
  resolveImportPath
8
- } from "./chunk-CPYGYVJ2.mjs";
8
+ } from "./chunk-2ZQP2W7X.mjs";
9
9
  import {
10
10
  __commonJS,
11
11
  __toESM
12
- } from "./chunk-QHOBBTS4.mjs";
12
+ } from "./chunk-65ITIFTL.mjs";
13
13
 
14
14
  // ../../node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/constants.js
15
15
  var require_constants = __commonJS({
@@ -2519,7 +2519,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
2519
2519
  import * as parser from "@slidev/parser/fs";
2520
2520
 
2521
2521
  // package.json
2522
- var version = "0.43.7";
2522
+ var version = "0.43.9";
2523
2523
 
2524
2524
  // node/themes.ts
2525
2525
  import prompts2 from "prompts";
@@ -7613,6 +7613,7 @@ import fs3 from "fs-extra";
7613
7613
  // node/options.ts
7614
7614
  import { dirname as dirname2, join as join3, resolve as resolve2 } from "node:path";
7615
7615
  import process3 from "node:process";
7616
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
7616
7617
  import { uniq } from "@antfu/utils";
7617
7618
  import _debug from "debug";
7618
7619
 
@@ -7663,6 +7664,7 @@ function resolvePluginName(name) {
7663
7664
 
7664
7665
  // node/options.ts
7665
7666
  var debug = _debug("slidev:options");
7667
+ var __dirname = dirname2(fileURLToPath2(import.meta.url));
7666
7668
  function getClientRoot() {
7667
7669
  return dirname2(resolveImportPath("@slidev/client/package.json", true));
7668
7670
  }
package/dist/cli.mjs CHANGED
@@ -9,17 +9,17 @@ import {
9
9
  resolveOptions,
10
10
  resolveThemeName,
11
11
  version
12
- } from "./chunk-7MRMXJYO.mjs";
12
+ } from "./chunk-P35Z4724.mjs";
13
13
  import {
14
14
  require_fast_deep_equal
15
- } from "./chunk-PNMZABHE.mjs";
15
+ } from "./chunk-CNR3FZCA.mjs";
16
16
  import {
17
17
  loadSetups
18
- } from "./chunk-43ON36K4.mjs";
19
- import "./chunk-CPYGYVJ2.mjs";
18
+ } from "./chunk-CYLMMBRG.mjs";
19
+ import "./chunk-2ZQP2W7X.mjs";
20
20
  import {
21
21
  __toESM
22
- } from "./chunk-QHOBBTS4.mjs";
22
+ } from "./chunk-65ITIFTL.mjs";
23
23
 
24
24
  // node/cli.ts
25
25
  var import_fast_deep_equal = __toESM(require_fast_deep_equal());
@@ -59,7 +59,7 @@ injectPreparserExtensionLoader(async (headmatter, filepath) => {
59
59
  const mergeArrays = (a, b) => a.concat(b);
60
60
  return await loadSetups(roots, "preparser.ts", { filepath, headmatter }, [], mergeArrays);
61
61
  });
62
- var cli = yargs.scriptName("slidev").usage("$0 [args]").version(version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
62
+ var cli = yargs(process.argv.slice(2)).scriptName("slidev").usage("$0 [args]").version(version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
63
63
  cli.command(
64
64
  "* [entry]",
65
65
  "Start a local server for Slidev",
@@ -149,7 +149,10 @@ cli.command(
149
149
  else
150
150
  console.log(yellow("\n --remote is required for tunneling, localtunnel is not enabled.\n"));
151
151
  }
152
- lastRemoteUrl = printInfo(options, port, remote, tunnelUrl);
152
+ let publicIp;
153
+ if (remote)
154
+ publicIp = await import("public-ip").then((r) => r.publicIpv4());
155
+ lastRemoteUrl = printInfo(options, port, remote, tunnelUrl, publicIp);
153
156
  }
154
157
  async function openTunnel(port2) {
155
158
  const localtunnel = await import("localtunnel").then((r) => r.default || r);
@@ -198,13 +201,18 @@ cli.command(
198
201
  async action() {
199
202
  if (!lastRemoteUrl)
200
203
  return;
201
- await import("uqr").then((r) => {
204
+ await import("uqr").then(async (r) => {
202
205
  const code = r.renderUnicodeCompact(lastRemoteUrl);
203
206
  console.log(`
204
207
  ${dim(" QR Code for remote control: ")}
205
208
  ${blue(lastRemoteUrl)}
206
209
  `);
207
210
  console.log(code.split("\n").map((i) => ` ${i}`).join("\n"));
211
+ const publicIp = await import("public-ip").then((r2) => r2.publicIpv4());
212
+ if (publicIp)
213
+ console.log(`
214
+ ${dim(" Public IP: ")} ${blue(publicIp)}
215
+ `);
208
216
  });
209
217
  }
210
218
  }
@@ -260,7 +268,7 @@ cli.command(
260
268
  }).strict().help(),
261
269
  async (args) => {
262
270
  const { entry, theme, watch, base, download, out, inspect } = args;
263
- const { build } = await import("./build-E7VPPALW.mjs");
271
+ const { build } = await import("./build-O4767R4S.mjs");
264
272
  for (const entryFile of entry) {
265
273
  const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
266
274
  if (download && !options.data.config.download)
@@ -339,7 +347,7 @@ cli.command(
339
347
  async (args) => {
340
348
  const { entry, theme } = args;
341
349
  process.env.NODE_ENV = "production";
342
- const { exportSlides, getExportOptions } = await import("./export-GFE5VFSA.mjs");
350
+ const { exportSlides, getExportOptions } = await import("./export-HQUH6WSD.mjs");
343
351
  const port = await findFreePort(12445);
344
352
  for (const entryFile of entry) {
345
353
  const options = await resolveOptions({ entry: entryFile, theme }, "export");
@@ -385,7 +393,7 @@ cli.command(
385
393
  timeout
386
394
  }) => {
387
395
  process.env.NODE_ENV = "production";
388
- const { exportNotes } = await import("./export-GFE5VFSA.mjs");
396
+ const { exportNotes } = await import("./export-HQUH6WSD.mjs");
389
397
  const port = await findFreePort(12445);
390
398
  for (const entryFile of entry) {
391
399
  const options = await resolveOptions({ entry: entryFile }, "export");
@@ -455,7 +463,7 @@ function exportOptions(args) {
455
463
  describe: "slide slides slide by slide. Works better with global components, but will break cross slide links and TOC in PDF"
456
464
  });
457
465
  }
458
- function printInfo(options, port, remote, tunnelUrl) {
466
+ function printInfo(options, port, remote, tunnelUrl, publicIp) {
459
467
  console.log();
460
468
  console.log();
461
469
  console.log(` ${cyan("\u25CF") + blue("\u25A0") + yellow("\u25B2")}`);
@@ -468,6 +476,7 @@ function printInfo(options, port, remote, tunnelUrl) {
468
476
  if (port) {
469
477
  const query = remote ? `?password=${remote}` : "";
470
478
  const presenterPath = `${options.data.config.routerMode === "hash" ? "/#/" : "/"}presenter/${query}`;
479
+ const entryPath = `${options.data.config.routerMode === "hash" ? "/#/" : "/"}entry${query}/`;
471
480
  console.log();
472
481
  console.log(`${dim(" public slide show ")} > ${cyan(`http://localhost:${bold(port)}/`)}`);
473
482
  if (query)
@@ -478,11 +487,15 @@ function printInfo(options, port, remote, tunnelUrl) {
478
487
  let lastRemoteUrl = "";
479
488
  if (remote !== void 0) {
480
489
  Object.values(os.networkInterfaces()).forEach((v) => (v || []).filter((details) => String(details.family).slice(-1) === "4" && !details.address.includes("127.0.0.1")).forEach(({ address }) => {
481
- lastRemoteUrl = `http://${address}:${port}${presenterPath}`;
490
+ lastRemoteUrl = `http://${address}:${port}${entryPath}`;
482
491
  console.log(`${dim(" remote control ")} > ${blue(lastRemoteUrl)}`);
483
492
  }));
493
+ if (publicIp) {
494
+ lastRemoteUrl = `http://${publicIp}:${port}${entryPath}`;
495
+ console.log(`${dim(" remote control ")} > ${blue(lastRemoteUrl)}`);
496
+ }
484
497
  if (tunnelUrl) {
485
- lastRemoteUrl = `${tunnelUrl}${presenterPath}`;
498
+ lastRemoteUrl = `${tunnelUrl}${entryPath}`;
486
499
  console.log(`${dim(" remote via tunnel")} > ${yellow(lastRemoteUrl)}`);
487
500
  }
488
501
  } else {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  packageExists
3
- } from "./chunk-CPYGYVJ2.mjs";
4
- import "./chunk-QHOBBTS4.mjs";
3
+ } from "./chunk-2ZQP2W7X.mjs";
4
+ import "./chunk-65ITIFTL.mjs";
5
5
 
6
6
  // node/export.ts
7
7
  import path from "node:path";
package/dist/index.mjs CHANGED
@@ -9,16 +9,16 @@ import {
9
9
  isPath,
10
10
  parser,
11
11
  resolveOptions
12
- } from "./chunk-7MRMXJYO.mjs";
12
+ } from "./chunk-P35Z4724.mjs";
13
13
  import {
14
14
  createWindiCSSPlugin
15
- } from "./chunk-PZQGSMNY.mjs";
15
+ } from "./chunk-AA5PR2W4.mjs";
16
16
  import {
17
17
  ViteSlidevPlugin
18
- } from "./chunk-PNMZABHE.mjs";
19
- import "./chunk-43ON36K4.mjs";
20
- import "./chunk-CPYGYVJ2.mjs";
21
- import "./chunk-QHOBBTS4.mjs";
18
+ } from "./chunk-CNR3FZCA.mjs";
19
+ import "./chunk-CYLMMBRG.mjs";
20
+ import "./chunk-2ZQP2W7X.mjs";
21
+ import "./chunk-65ITIFTL.mjs";
22
22
  export {
23
23
  ViteSlidevPlugin,
24
24
  createServer,
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  loadSetups
3
- } from "./chunk-43ON36K4.mjs";
4
- import "./chunk-QHOBBTS4.mjs";
3
+ } from "./chunk-CYLMMBRG.mjs";
4
+ import "./chunk-65ITIFTL.mjs";
5
5
 
6
6
  // node/plugins/unocss.ts
7
7
  import { resolve } from "node:path";
8
8
  import { existsSync } from "node:fs";
9
+ import { fileURLToPath } from "node:url";
9
10
  import { uniq } from "@antfu/utils";
10
11
  import { mergeConfigs } from "unocss";
11
12
  import jiti from "jiti";
@@ -22,7 +23,7 @@ async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, u
22
23
  resolve(clientRoot, "unocss.config.ts")
23
24
  ]).filter((i) => existsSync(i));
24
25
  const configs = configFiles.map((i) => {
25
- const loaded = jiti(__filename)(i);
26
+ const loaded = jiti(fileURLToPath(import.meta.url))(i);
26
27
  const config2 = "default" in loaded ? loaded.default : loaded;
27
28
  return config2;
28
29
  }).filter(Boolean);
@@ -0,0 +1,9 @@
1
+ import {
2
+ createWindiCSSPlugin
3
+ } from "./chunk-AA5PR2W4.mjs";
4
+ import "./chunk-CYLMMBRG.mjs";
5
+ import "./chunk-2ZQP2W7X.mjs";
6
+ import "./chunk-65ITIFTL.mjs";
7
+ export {
8
+ createWindiCSSPlugin
9
+ };