slidev-workspace 0.6.1 → 0.6.2

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
@@ -15,7 +15,7 @@ import { spawn } from "child_process";
15
15
  //#region src/scripts/config.ts
16
16
  const DEFAULT_CONFIG = {
17
17
  slidesDir: ["./slides"],
18
- outputDir: "./dist",
18
+ outputDir: "./_gh-pages",
19
19
  baseUrl: "/",
20
20
  exclude: ["node_modules", ".git"],
21
21
  hero: {
@@ -405,31 +405,26 @@ async function exportOgImages() {
405
405
  process.exit(1);
406
406
  }
407
407
  }
408
- async function copyToGhPages() {
408
+ async function copySlidesToOutputDir() {
409
409
  const workspaceCwd = process.env.SLIDEV_WORKSPACE_CWD || process.cwd();
410
410
  const config = loadConfig(workspaceCwd);
411
411
  const slidesDirs = resolveSlidesDirs(config, workspaceCwd);
412
- const ghPagesDir = join(workspaceCwd, "_gh-pages");
413
- console.log("📁 Copying files to _gh-pages directory...");
414
- if (!existsSync(ghPagesDir)) mkdirSync(ghPagesDir, { recursive: true });
412
+ const deployDir = resolve(workspaceCwd, config.outputDir);
413
+ console.log(`📁 Copying slide builds into ${deployDir}...`);
414
+ if (!existsSync(deployDir)) mkdirSync(deployDir, { recursive: true });
415
415
  for (const slidesDir of slidesDirs) {
416
416
  if (!existsSync(slidesDir)) continue;
417
417
  const slides = readdirSync(slidesDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name);
418
418
  for (const slideName of slides) {
419
419
  const slideDistDir = join(slidesDir, slideName, "dist");
420
- const targetDir = join(ghPagesDir, slideName);
420
+ const targetDir = join(deployDir, slideName);
421
421
  if (existsSync(slideDistDir)) {
422
- console.log(`📋 Copying ${slideName} to _gh-pages...`);
422
+ console.log(`📋 Copying ${slideName}...`);
423
423
  await cp(slideDistDir, targetDir, { recursive: true });
424
424
  }
425
425
  }
426
426
  }
427
- const previewDistDir = join(workspaceCwd, config.outputDir);
428
- if (existsSync(previewDistDir)) {
429
- console.log("📋 Copying preview app as index...");
430
- await cp(previewDistDir, ghPagesDir, { recursive: true });
431
- }
432
- console.log("✅ All files copied to _gh-pages successfully!");
427
+ console.log(`✅ All slide assets copied into ${deployDir}!`);
433
428
  }
434
429
  async function runViteBuild() {
435
430
  try {
@@ -437,7 +432,7 @@ async function runViteBuild() {
437
432
  console.log("📦 Building Slidev Workspace for production...");
438
433
  const config = createViteConfig();
439
434
  await build(config);
440
- await copyToGhPages();
435
+ await copySlidesToOutputDir();
441
436
  console.log("✅ Build completed successfully!");
442
437
  } catch (error) {
443
438
  console.error("❌ Build failed:", error);
package/dist/index.d.ts CHANGED
@@ -55,14 +55,24 @@ declare function useSlides(): {
55
55
  //#endregion
56
56
  //#region src/types/config.d.ts
57
57
  interface HeroConfig {
58
+ /** Main heading displayed at the top of the workspace page. */
58
59
  title: string;
60
+ /** Supporting copy shown under the hero title. */
59
61
  description: string;
60
62
  }
63
+ /**
64
+ * Slidev Workspace configuration loaded from slidev-workspace.yaml.
65
+ */
61
66
  interface SlidevWorkspaceConfig {
67
+ /** One or more directories that contain slide packages. */
62
68
  slidesDir: string[];
69
+ /** Where the aggregated preview app should output its build. */
63
70
  outputDir: string;
71
+ /** Public base URL used when serving or building slides. */
64
72
  baseUrl: string;
73
+ /** Folder names to ignore when scanning for slides. */
65
74
  exclude: string[];
75
+ /** Hero content surfaced by the preview application. */
66
76
  hero: HeroConfig;
67
77
  }
68
78
  //#endregion
@@ -6,7 +6,7 @@ import { spawn } from "child_process";
6
6
  //#region src/scripts/config.ts
7
7
  const DEFAULT_CONFIG = {
8
8
  slidesDir: ["./slides"],
9
- outputDir: "./dist",
9
+ outputDir: "./_gh-pages",
10
10
  baseUrl: "/",
11
11
  exclude: ["node_modules", ".git"],
12
12
  hero: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slidev-workspace",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "A workspace tool for managing multiple Slidev presentations with API-based content management",
5
5
  "type": "module",
6
6
  "license": "MIT",