defuss-ssg 0.5.2 → 0.6.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 +8 -5
- package/dist/cli.mjs +14 -9
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{serve-CSH82zKY.mjs → serve-Cd4Pw98E.mjs} +1 -1
- package/dist/{vite-CQJBNUfy.cjs → vite-CBAZNNYA.cjs} +682 -100
- package/dist/{vite-DcjFCDSl.mjs → vite-CaqPNORI.mjs} +682 -100
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,14 +12,15 @@ Use Bun for package management. The published package targets Node `^20.19.0 ||
|
|
|
12
12
|
|
|
13
13
|
## What It Supports
|
|
14
14
|
|
|
15
|
-
- Markdown and MDX pages from `pages/`
|
|
15
|
+
- Markdown and MDX pages from `pages/` or `src/pages/`
|
|
16
16
|
- YAML or TOML frontmatter exposed as `meta`
|
|
17
17
|
- GitHub Flavored Markdown via `remark-gfm`
|
|
18
18
|
- KaTeX math via `$...$` and `$$...$$`
|
|
19
19
|
- defuss components imported into MDX and HTML-like pages
|
|
20
|
-
- Automatic hydration boundaries for components rendered from `components/`
|
|
21
|
-
- Static assets copied from `assets/`
|
|
20
|
+
- Automatic hydration boundaries for components rendered from `components/`, `src/components/`, `csr/`, or `src/csr/`
|
|
21
|
+
- Static assets copied from `assets/` or `src/assets/`
|
|
22
22
|
- File-based API routes from `pages/**/*.ts` and `pages/**/*.js`
|
|
23
|
+
- Root `index.mdx`, `index.md`, or `index.html` fallback when no pages directory exists
|
|
23
24
|
- Pre-rendered endpoints via `prerender = true` and `getStaticPaths()`
|
|
24
25
|
- RPC auto-discovery from `rpc.ts` or `rpc.js` when `defuss-rpc` is installed
|
|
25
26
|
- Plugin hooks for `pre`, `page-vdom`, `page-dom`, `page-html`, and `post`
|
|
@@ -275,12 +276,14 @@ Most projects only need the main package export.
|
|
|
275
276
|
```bash
|
|
276
277
|
defuss-ssg [dev|build|serve] [folder] [--debug] [--multicore]
|
|
277
278
|
|
|
278
|
-
No args ->
|
|
279
|
-
Single path ->
|
|
279
|
+
No args -> dev .
|
|
280
|
+
Single path -> dev <path>
|
|
280
281
|
Single command -> <command> .
|
|
281
282
|
Command + folder -> <command> <folder>
|
|
282
283
|
```
|
|
283
284
|
|
|
285
|
+
When `pages`, `components`, or `assets` are not configured explicitly, `defuss-ssg` prefers `src/pages`, `src/components`, `src/csr`, and `src/assets` before falling back to their project-root equivalents. If no pages directory exists, it falls back to root `index.mdx`, then `index.md`, then `index.html`.
|
|
286
|
+
|
|
284
287
|
Commands:
|
|
285
288
|
|
|
286
289
|
- `dev`: starts the Vite dev server on port `3000` by default
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { v as validateProjectDir, b as build } from './vite-
|
|
3
|
-
import { d as dev, s as serve } from './serve-
|
|
2
|
+
import { v as validateProjectDir, b as build } from './vite-CaqPNORI.mjs';
|
|
3
|
+
import { d as dev, s as serve } from './serve-Cd4Pw98E.mjs';
|
|
4
4
|
import { join, dirname, resolve } from 'node:path';
|
|
5
5
|
import { existsSync, readFileSync } from 'node:fs';
|
|
6
6
|
import { spawn } from 'node:child_process';
|
|
@@ -173,27 +173,32 @@ Continuing anyway - dependencies may already be available.`
|
|
|
173
173
|
const debug = args.includes("--debug") || args.includes("-d");
|
|
174
174
|
const multicore = args.includes("--multicore");
|
|
175
175
|
const positional = args.filter((a) => !a.startsWith("-"));
|
|
176
|
-
const
|
|
176
|
+
const commands = /* @__PURE__ */ new Set(["dev", "build", "serve"]);
|
|
177
|
+
const usage = "Usage: defuss-ssg [dev|build|serve] [folder]\n No args => dev .\n Single path => dev <path>\n Single command => <command> .\n Command + folder => <command> <folder>\n Flags: [--debug] [--multicore]";
|
|
177
178
|
let command;
|
|
178
179
|
let folder;
|
|
179
180
|
if (positional.length === 0) {
|
|
180
|
-
command = "
|
|
181
|
+
command = "dev";
|
|
181
182
|
folder = ".";
|
|
182
183
|
} else if (positional.length === 1) {
|
|
183
184
|
const arg = positional[0];
|
|
184
|
-
if (arg
|
|
185
|
+
if (commands.has(arg)) {
|
|
185
186
|
command = arg;
|
|
186
187
|
folder = ".";
|
|
187
|
-
} else if (arg.startsWith(".") || arg.startsWith("/")) {
|
|
188
|
-
command = "serve";
|
|
189
|
-
folder = arg;
|
|
190
188
|
} else {
|
|
189
|
+
command = "dev";
|
|
190
|
+
folder = arg;
|
|
191
|
+
}
|
|
192
|
+
} else if (positional.length === 2) {
|
|
193
|
+
if (!commands.has(positional[0])) {
|
|
191
194
|
console.error(usage);
|
|
192
195
|
process.exit(1);
|
|
193
196
|
}
|
|
194
|
-
} else {
|
|
195
197
|
command = positional[0];
|
|
196
198
|
folder = positional[1];
|
|
199
|
+
} else {
|
|
200
|
+
console.error(usage);
|
|
201
|
+
process.exit(1);
|
|
197
202
|
}
|
|
198
203
|
const projectDir = resolve(folder);
|
|
199
204
|
await setup(projectDir);
|
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { H as HTTP_METHODS, b as build, a as buildEndpoints, c as compileEndpoints, d as compileRpcModule, e as configDefaults, f as defussSsg, g as discoverEndpointSourceFiles, h as discoverRpcFile, i as endpointFileToRoute, j as handleEndpointRoute, k as handleRpcRequest, l as initializeRpc, m as loadEndpointModule, n as matchRoutePattern, r as readConfig, o as registerEndpoints, p as resolveEndpoints, q as routeToExpressPattern } from './vite-
|
|
2
|
-
export { d as dev, s as serve } from './serve-
|
|
1
|
+
export { H as HTTP_METHODS, b as build, a as buildEndpoints, c as compileEndpoints, d as compileRpcModule, e as configDefaults, f as defussSsg, g as discoverEndpointSourceFiles, h as discoverRpcFile, i as endpointFileToRoute, j as handleEndpointRoute, k as handleRpcRequest, l as initializeRpc, m as loadEndpointModule, n as matchRoutePattern, r as readConfig, o as registerEndpoints, p as resolveEndpoints, q as routeToExpressPattern } from './vite-CaqPNORI.mjs';
|
|
2
|
+
export { d as dev, s as serve } from './serve-Cd4Pw98E.mjs';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:fs/promises';
|
|
5
5
|
import 'node:path';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import mdx from '@mdx-js/rollup';
|
|
2
2
|
import { createServer } from 'vite';
|
|
3
3
|
import defuss from 'defuss-vite';
|
|
4
|
-
import { v as validateProjectDir, r as readConfig, f as defussSsg, o as registerEndpoints, l as initializeRpc, s as readIncomingBody, t as createWebRequest, k as handleRpcRequest, u as sendWebResponse } from './vite-
|
|
4
|
+
import { v as validateProjectDir, r as readConfig, f as defussSsg, o as registerEndpoints, l as initializeRpc, s as readIncomingBody, t as createWebRequest, k as handleRpcRequest, u as sendWebResponse } from './vite-CaqPNORI.mjs';
|
|
5
5
|
import { existsSync } from 'node:fs';
|
|
6
6
|
import { join } from 'node:path';
|
|
7
7
|
import { express, startServer } from 'defuss-express';
|