@slidev/cli 0.48.0-beta.23 → 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.
package/dist/cli.mjs CHANGED
@@ -4,17 +4,16 @@ import {
4
4
  parser,
5
5
  resolveAddons,
6
6
  resolveOptions,
7
- resolveTheme
8
- } from "./chunk-TKQ4IRDS.mjs";
9
- import {
7
+ resolveTheme,
10
8
  version
11
- } from "./chunk-7IY2RRV6.mjs";
9
+ } from "./chunk-HU4YBG2Z.mjs";
10
+ import "./chunk-YO3LH3HD.mjs";
12
11
  import {
13
12
  loadSetups
14
- } from "./chunk-O6TYYGU6.mjs";
13
+ } from "./chunk-LOUKLO2C.mjs";
15
14
  import {
16
15
  getRoots
17
- } from "./chunk-CV7OWJOF.mjs";
16
+ } from "./chunk-HKSSAKUU.mjs";
18
17
 
19
18
  // node/cli.ts
20
19
  import path from "node:path";
@@ -51,7 +50,6 @@ var FILES_CREATE_RESTART_GLOBS = [
51
50
  "unocss.config.ts"
52
51
  ];
53
52
  var FILES_CHANGE_RESTART_GLOBS = [
54
- "vite.config.*",
55
53
  "setup/shiki.ts",
56
54
  "setup/katex.ts",
57
55
  "setup/preparser.ts"
@@ -326,7 +324,7 @@ cli.command(
326
324
  }).strict().help(),
327
325
  async (args) => {
328
326
  const { entry, theme, watch, base, download, out, inspect } = args;
329
- const { build } = await import("./build-PDGXAWGC.mjs");
327
+ const { build } = await import("./build-LYRLCEWM.mjs");
330
328
  for (const entryFile of entry) {
331
329
  const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
332
330
  if (download && !options.data.config.download)
@@ -401,7 +399,7 @@ cli.command(
401
399
  (args) => exportOptions(commonOptions(args)).strict().help(),
402
400
  async (args) => {
403
401
  const { entry, theme } = args;
404
- const { exportSlides, getExportOptions } = await import("./export-2XPAFE22.mjs");
402
+ const { exportSlides, getExportOptions } = await import("./export-RHB5HDXR.mjs");
405
403
  const port = await getPort(12445);
406
404
  for (const entryFile of entry) {
407
405
  const options = await resolveOptions({ entry: entryFile, theme }, "export");
@@ -445,7 +443,7 @@ cli.command(
445
443
  output,
446
444
  timeout
447
445
  }) => {
448
- const { exportNotes } = await import("./export-2XPAFE22.mjs");
446
+ const { exportNotes } = await import("./export-RHB5HDXR.mjs");
449
447
  const port = await getPort(12445);
450
448
  for (const entryFile of entry) {
451
449
  const options = await resolveOptions({ entry: entryFile }, "export");
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  getRoots
3
- } from "./chunk-CV7OWJOF.mjs";
3
+ } from "./chunk-HKSSAKUU.mjs";
4
4
 
5
- // node/export.ts
5
+ // node/commands/export.ts
6
6
  import path from "node:path";
7
7
  import { Buffer } from "node:buffer";
8
8
  import fs from "fs-extra";
package/dist/index.d.mts CHANGED
@@ -1,92 +1,13 @@
1
- import Vue from '@vitejs/plugin-vue';
2
- import VueJsx from '@vitejs/plugin-vue-jsx';
3
- import Icons from 'unplugin-icons/vite';
4
- import Components from 'unplugin-vue-components/vite';
5
- import Markdown from 'unplugin-vue-markdown/vite';
6
- import { VitePluginConfig } from 'unocss/vite';
7
- import RemoteAssets from 'vite-plugin-remote-assets';
8
- import ServerRef from 'vite-plugin-vue-server-ref';
9
- import { ArgumentsType } from '@antfu/utils';
10
- import { SlidevData } from '@slidev/types';
11
1
  import * as vite from 'vite';
12
- import { InlineConfig, Plugin } from 'vite';
2
+ import { Plugin, InlineConfig } from 'vite';
3
+ import { ResolvedSlidevOptions, SlidevPluginOptions, SlidevServerOptions, SlidevEntryOptions } from '@slidev/types';
13
4
  import * as fs from '@slidev/parser/fs';
14
5
  export { fs as parser };
15
6
 
16
- interface RootsInfo {
17
- cliRoot: string;
18
- clientRoot: string;
19
- userRoot: string;
20
- userPkgJson: Record<string, any>;
21
- userWorkspaceRoot: string;
22
- }
23
-
24
- interface SlidevEntryOptions {
25
- /**
26
- * Markdown entry
27
- *
28
- * @default 'slides.md'
29
- */
30
- entry?: string;
31
- /**
32
- * Theme id
33
- */
34
- theme?: string;
35
- /**
36
- * Remote password
37
- */
38
- remote?: string;
39
- /**
40
- * Enable inspect plugin
41
- */
42
- inspect?: boolean;
43
- }
44
- interface ResolvedSlidevOptions extends RootsInfo {
45
- data: SlidevData;
46
- entry: string;
47
- themeRaw: string;
48
- theme: string;
49
- themeRoots: string[];
50
- addonRoots: string[];
51
- /**
52
- * =`[...themeRoots, ...addonRoots, userRoot]` (`clientRoot` excluded)
53
- */
54
- roots: string[];
55
- mode: 'dev' | 'build' | 'export';
56
- remote?: string;
57
- inspect?: boolean;
58
- }
59
- interface SlidevPluginOptions extends SlidevEntryOptions {
60
- vue?: ArgumentsType<typeof Vue>[0];
61
- vuejsx?: ArgumentsType<typeof VueJsx>[0];
62
- markdown?: ArgumentsType<typeof Markdown>[0];
63
- components?: ArgumentsType<typeof Components>[0];
64
- icons?: ArgumentsType<typeof Icons>[0];
65
- remoteAssets?: ArgumentsType<typeof RemoteAssets>[0];
66
- serverRef?: ArgumentsType<typeof ServerRef>[0];
67
- unocss?: VitePluginConfig;
68
- }
69
- interface SlidevServerOptions {
70
- /**
71
- * @returns `false` if server should be restarted
72
- */
73
- loadData?: () => Promise<SlidevData | false>;
74
- }
75
- declare function resolveOptions(options: SlidevEntryOptions, mode: ResolvedSlidevOptions['mode']): Promise<ResolvedSlidevOptions>;
76
-
77
- declare module 'vite' {
78
- interface UserConfig {
79
- /**
80
- * Custom internal plugin options for Slidev (advanced)
81
- *
82
- * @see https://github.com/slidevjs/slidev/blob/main/packages/slidev/node/options.ts#L50
83
- */
84
- slidev?: SlidevPluginOptions;
85
- }
86
- }
7
+ declare function ViteSlidevPlugin(options: ResolvedSlidevOptions, pluginOptions: SlidevPluginOptions, serverOptions?: SlidevServerOptions): Promise<Plugin[]>;
87
8
 
88
9
  declare function createServer(options: ResolvedSlidevOptions, viteConfig?: InlineConfig, serverOptions?: SlidevServerOptions): Promise<vite.ViteDevServer>;
89
10
 
90
- declare function ViteSlidevPlugin(options: ResolvedSlidevOptions, pluginOptions: SlidevPluginOptions, serverOptions?: SlidevServerOptions): Promise<Plugin[]>;
11
+ declare function resolveOptions(options: SlidevEntryOptions, mode: ResolvedSlidevOptions['mode']): Promise<ResolvedSlidevOptions>;
91
12
 
92
- export { type ResolvedSlidevOptions, type SlidevEntryOptions, type SlidevPluginOptions, type SlidevServerOptions, ViteSlidevPlugin, createServer, resolveOptions };
13
+ export { ViteSlidevPlugin, createServer, resolveOptions };
package/dist/index.mjs CHANGED
@@ -2,12 +2,12 @@ import {
2
2
  createServer,
3
3
  parser,
4
4
  resolveOptions
5
- } from "./chunk-TKQ4IRDS.mjs";
5
+ } from "./chunk-HU4YBG2Z.mjs";
6
6
  import {
7
7
  ViteSlidevPlugin
8
- } from "./chunk-7IY2RRV6.mjs";
9
- import "./chunk-O6TYYGU6.mjs";
10
- import "./chunk-CV7OWJOF.mjs";
8
+ } from "./chunk-YO3LH3HD.mjs";
9
+ import "./chunk-LOUKLO2C.mjs";
10
+ import "./chunk-HKSSAKUU.mjs";
11
11
  export {
12
12
  ViteSlidevPlugin,
13
13
  createServer,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  loadSetups
3
- } from "./chunk-O6TYYGU6.mjs";
3
+ } from "./chunk-LOUKLO2C.mjs";
4
4
 
5
- // node/plugins/unocss.ts
5
+ // node/vite/unocss.ts
6
6
  import { resolve } from "node:path";
7
7
  import { existsSync } from "node:fs";
8
8
  import { fileURLToPath } from "node:url";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.48.0-beta.23",
3
+ "version": "0.48.0-beta.25",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -106,9 +106,9 @@
106
106
  "vitefu": "^0.2.5",
107
107
  "vue": "^3.4.21",
108
108
  "yargs": "^17.7.2",
109
- "@slidev/parser": "0.48.0-beta.23",
110
- "@slidev/client": "0.48.0-beta.23",
111
- "@slidev/types": "0.48.0-beta.23"
109
+ "@slidev/client": "0.48.0-beta.25",
110
+ "@slidev/parser": "0.48.0-beta.25",
111
+ "@slidev/types": "0.48.0-beta.25"
112
112
  },
113
113
  "devDependencies": {
114
114
  "@hedgedoc/markdown-it-plugins": "^2.1.4",