defuss-ssg 0.1.1 → 0.2.0

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/README.md CHANGED
@@ -23,7 +23,7 @@ Usage
23
23
  Simply generate a static site from a content directory to an output directory with full defuss-MDX (GFM + Frontmatter) support:
24
24
 
25
25
  ```bash
26
- npx defuss-ssg build ./folder
26
+ bunx defuss-ssg build ./folder
27
27
  ```
28
28
 
29
29
  Or install globally or locally in a project:
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { v as validateProjectDir, b as build, s as serve } from './serve-BR2MS6bN.mjs';
2
+ import { v as validateProjectDir, b as build, s as serve } from './serve-BZhZ9J90.mjs';
3
3
  import { join, dirname, resolve } from 'node:path';
4
4
  import { existsSync, readFileSync } from 'node:fs';
5
5
  import { spawn } from 'node:child_process';
@@ -165,9 +165,11 @@ Continuing anyway \u2014 dependencies may already be available.`
165
165
 
166
166
  (async () => {
167
167
  const args = process.argv.slice(2);
168
- const command = args[0];
169
- const folder = args[1];
170
- const usage = "Usage: defuss-ssg <build|serve> <folder>";
168
+ const debug = args.includes("--debug") || args.includes("-d");
169
+ const positional = args.filter((a) => !a.startsWith("-"));
170
+ const command = positional[0];
171
+ const folder = positional[1];
172
+ const usage = "Usage: defuss-ssg <build|serve> <folder> [--debug]";
171
173
  if (!command || !folder) {
172
174
  console.error(usage);
173
175
  process.exit(1);
@@ -178,14 +180,14 @@ Continuing anyway \u2014 dependencies may already be available.`
178
180
  console.log(`Building ${folder}...`);
179
181
  await build({
180
182
  projectDir,
181
- debug: true,
183
+ debug,
182
184
  mode: "build"
183
185
  });
184
186
  } else if (command === "serve") {
185
187
  console.log(`Serving ${folder}...`);
186
188
  await serve({
187
189
  projectDir,
188
- debug: true});
190
+ debug});
189
191
  } else {
190
192
  console.error(usage);
191
193
  process.exit(1);