@slidev/cli 0.48.0-beta.24 → 0.48.0-beta.25

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.
@@ -2,11 +2,11 @@ import {
2
2
  ViteSlidevPlugin,
3
3
  getIndexHtml,
4
4
  mergeViteConfigs
5
- } from "./chunk-4HUKWYZE.mjs";
6
- import "./chunk-O6TYYGU6.mjs";
7
- import "./chunk-CV7OWJOF.mjs";
5
+ } from "./chunk-YO3LH3HD.mjs";
6
+ import "./chunk-LOUKLO2C.mjs";
7
+ import "./chunk-HKSSAKUU.mjs";
8
8
 
9
- // node/build.ts
9
+ // node/commands/build.ts
10
10
  import { resolve } from "node:path";
11
11
  import http from "node:http";
12
12
  import fs from "fs-extra";
@@ -62,7 +62,7 @@ async function build(options, viteConfig = {}, args) {
62
62
  await fs.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
63
63
  `, "utf-8");
64
64
  if ([true, "true", "auto"].includes(options.data.config.download)) {
65
- const { exportSlides, getExportOptions } = await import("./export-2XPAFE22.mjs");
65
+ const { exportSlides, getExportOptions } = await import("./export-RHB5HDXR.mjs");
66
66
  const port = 12445;
67
67
  const app = connect();
68
68
  const server = http.createServer(app);
@@ -12,6 +12,9 @@ import globalDirs from "global-directory";
12
12
  import prompts from "prompts";
13
13
  import { parseNi, run } from "@antfu/ni";
14
14
  import { underline, yellow } from "kolorist";
15
+ async function resolveImportUrl(id) {
16
+ return toAtFS(await resolveImportPath(id, true));
17
+ }
15
18
  function toAtFS(path) {
16
19
  return `/@fs${ensurePrefix("/", slash(path))}`;
17
20
  }
@@ -33,7 +36,7 @@ async function resolveImportPath(importName, ensure = false) {
33
36
  }
34
37
  async function findPkgRoot(dep, parent, ensure = false) {
35
38
  const pkgJsonPath = await findDepPkgJsonPath(dep, parent);
36
- const path = pkgJsonPath ? dirname(pkgJsonPath) : isInstalledGlobally ? findGlobalPkgRoot(dep, false) : void 0;
39
+ const path = pkgJsonPath ? dirname(pkgJsonPath) : isInstalledGlobally ? await findGlobalPkgRoot(dep, false) : void 0;
37
40
  if (ensure && !path)
38
41
  throw new Error(`Failed to resolve package "${dep}"`);
39
42
  return path;
@@ -177,6 +180,7 @@ async function getRoots() {
177
180
  }
178
181
 
179
182
  export {
183
+ resolveImportUrl,
180
184
  toAtFS,
181
185
  resolveImportPath,
182
186
  resolveEntry,
@@ -1,16 +1,14 @@
1
1
  import {
2
2
  ViteSlidevPlugin,
3
- checkEngine,
4
- mergeViteConfigs,
5
- version
6
- } from "./chunk-4HUKWYZE.mjs";
3
+ mergeViteConfigs
4
+ } from "./chunk-YO3LH3HD.mjs";
7
5
  import {
8
6
  createResolver,
9
7
  getRoots,
10
8
  resolveEntry
11
- } from "./chunk-CV7OWJOF.mjs";
9
+ } from "./chunk-HKSSAKUU.mjs";
12
10
 
13
- // node/server.ts
11
+ // node/commands/server.ts
14
12
  import { join } from "node:path";
15
13
  import process from "node:process";
16
14
  import { createServer as createViteServer, mergeConfig } from "vite";
@@ -49,7 +47,10 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
49
47
  // node/parser.ts
50
48
  import * as parser from "@slidev/parser/fs";
51
49
 
52
- // node/themes.ts
50
+ // package.json
51
+ var version = "0.48.0-beta.25";
52
+
53
+ // node/integrations/themes.ts
53
54
  import { join as join2 } from "node:path";
54
55
  import fs from "fs-extra";
55
56
  import { satisfies } from "semver";
@@ -72,9 +73,10 @@ async function getThemeMeta(name, root) {
72
73
  return slidev;
73
74
  }
74
75
 
75
- // node/addons.ts
76
+ // node/integrations/addons.ts
76
77
  import { resolve } from "node:path";
77
78
  import fs2 from "fs-extra";
79
+ import { satisfies as satisfies2 } from "semver";
78
80
  async function resolveAddons(addonsInConfig) {
79
81
  const { userRoot, userPkgJson } = await getRoots();
80
82
  const resolved = [];
@@ -85,7 +87,8 @@ async function resolveAddons(addonsInConfig) {
85
87
  return;
86
88
  resolved.push(pkgRoot);
87
89
  const { slidev, engines } = await fs2.readJSON(resolve(pkgRoot, "package.json"));
88
- checkEngine(name, engines);
90
+ if (engines.slidev && !satisfies2(version, engines.slidev, { includePrerelease: true }))
91
+ throw new Error(`[slidev] addon "${name}" requires Slidev version range "${engines.slidev}" but found "${version}"`);
89
92
  if (Array.isArray(slidev?.addons))
90
93
  await Promise.all(slidev.addons.map((addon) => resolveAddon(addon, pkgRoot)));
91
94
  }
@@ -98,8 +101,8 @@ async function resolveAddons(addonsInConfig) {
98
101
 
99
102
  // node/options.ts
100
103
  import { uniq } from "@antfu/utils";
101
- import _debug from "debug";
102
- var debug = _debug("slidev:options");
104
+ import Debug from "debug";
105
+ var debug = Debug("slidev:options");
103
106
  async function resolveOptions(options, mode) {
104
107
  const rootsInfo = await getRoots();
105
108
  const entry = await resolveEntry(options.entry || "slides.md", rootsInfo);
@@ -144,6 +147,7 @@ async function resolveOptions(options, mode) {
144
147
  export {
145
148
  createServer,
146
149
  parser,
150
+ version,
147
151
  resolveTheme,
148
152
  getThemeMeta,
149
153
  resolveAddons,
@@ -1,4 +1,4 @@
1
- // node/plugins/setupNode.ts
1
+ // node/setups/load.ts
2
2
  import { resolve } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import fs from "fs-extra";