defuss-ssg 0.6.2 → 0.7.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 +126 -7
- package/dist/cli.mjs +461 -62
- package/dist/content.cjs +112 -0
- package/dist/content.d.cts +8 -0
- package/dist/content.d.mts +8 -0
- package/dist/content.mjs +110 -0
- package/dist/index.cjs +55 -35
- package/dist/index.d.cts +8 -6
- package/dist/index.d.mts +8 -6
- package/dist/index.mjs +8 -3
- package/dist/path-Br3DXScZ.cjs +179 -0
- package/dist/path-CjHWUK8o.mjs +171 -0
- package/dist/{serve-CTYzPwKQ.mjs → serve-BFMU8uCH.mjs} +50 -35
- package/dist/{vite-DtwFnDf2.d.mts → types-CZSWRdQS.d.cts} +56 -5
- package/dist/{vite-DtwFnDf2.d.cts → types-CZSWRdQS.d.mts} +56 -5
- package/dist/{vite-CkpguLfK.cjs → vite-BC7XxFTV.cjs} +311 -304
- package/dist/{vite-DdJcWQGP.mjs → vite-CSOGjlHB.mjs} +292 -285
- package/dist/vite.cjs +3 -2
- package/dist/vite.d.cts +6 -2
- package/dist/vite.d.mts +6 -2
- package/dist/vite.mjs +3 -2
- package/package.json +29 -7
package/dist/content.cjs
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var promises = require('node:fs/promises');
|
|
4
|
+
var node_path = require('node:path');
|
|
5
|
+
var glob$1 = require('fast-glob');
|
|
6
|
+
var toml = require('toml');
|
|
7
|
+
var yaml = require('yaml');
|
|
8
|
+
var path = require('./path-Br3DXScZ.cjs');
|
|
9
|
+
require('node:fs');
|
|
10
|
+
|
|
11
|
+
const PAGE_ROUTE_EXTENSIONS = /* @__PURE__ */ new Set([".html", ".md", ".mdx"]);
|
|
12
|
+
const normalizePath = (value) => value.replace(/\\/g, "/");
|
|
13
|
+
const coerceMeta = (value) => {
|
|
14
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
return {};
|
|
18
|
+
};
|
|
19
|
+
const parseFrontmatter = (source, filePath) => {
|
|
20
|
+
const normalizedSource = source.replace(/^\uFEFF/, "");
|
|
21
|
+
const yamlMatch = normalizedSource.match(
|
|
22
|
+
/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/
|
|
23
|
+
);
|
|
24
|
+
if (yamlMatch) {
|
|
25
|
+
try {
|
|
26
|
+
return coerceMeta(yaml.parse(yamlMatch[1]));
|
|
27
|
+
} catch (error) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`Failed to parse YAML frontmatter in ${filePath}: ${error.message}`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const tomlMatch = normalizedSource.match(
|
|
34
|
+
/^\+\+\+\r?\n([\s\S]*?)\r?\n\+\+\+(?:\r?\n|$)/
|
|
35
|
+
);
|
|
36
|
+
if (tomlMatch) {
|
|
37
|
+
try {
|
|
38
|
+
return coerceMeta(toml.parse(tomlMatch[1]));
|
|
39
|
+
} catch (error) {
|
|
40
|
+
throw new Error(
|
|
41
|
+
`Failed to parse TOML frontmatter in ${filePath}: ${error.message}`
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return {};
|
|
46
|
+
};
|
|
47
|
+
const stripSlugSuffix = (value) => {
|
|
48
|
+
let normalized = value.replace(/\.(mdx?|html?)$/i, "");
|
|
49
|
+
if (normalized === "index") {
|
|
50
|
+
return "";
|
|
51
|
+
}
|
|
52
|
+
if (normalized.endsWith("/index")) {
|
|
53
|
+
normalized = normalized.slice(0, -"/index".length);
|
|
54
|
+
}
|
|
55
|
+
return normalized;
|
|
56
|
+
};
|
|
57
|
+
const isWithinDirectory = (filePath, directory) => {
|
|
58
|
+
const relativePath = normalizePath(node_path.relative(directory, filePath));
|
|
59
|
+
return relativePath.length > 0 && !relativePath.startsWith("../");
|
|
60
|
+
};
|
|
61
|
+
const resolveRouteInfo = (filePath, cwd, pagesDir) => {
|
|
62
|
+
const relativePath = normalizePath(node_path.relative(cwd, filePath));
|
|
63
|
+
const slug = stripSlugSuffix(relativePath);
|
|
64
|
+
const pagesRoot = node_path.resolve(cwd, pagesDir);
|
|
65
|
+
const extension = node_path.extname(filePath).toLowerCase();
|
|
66
|
+
if (!PAGE_ROUTE_EXTENSIONS.has(extension) || !isWithinDirectory(filePath, pagesRoot)) {
|
|
67
|
+
return {
|
|
68
|
+
route: void 0,
|
|
69
|
+
slug
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const routeConfig = {
|
|
73
|
+
pages: pagesDir,
|
|
74
|
+
components: "components",
|
|
75
|
+
assets: "assets"
|
|
76
|
+
};
|
|
77
|
+
const route = path.filePathToRoute(filePath, routeConfig, cwd);
|
|
78
|
+
return {
|
|
79
|
+
route,
|
|
80
|
+
slug: route.replace(/^\//, "")
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
const glob = async (patterns, options = {}) => {
|
|
84
|
+
const cwd = node_path.resolve(options.cwd ?? process.cwd());
|
|
85
|
+
const pagesDir = options.pagesDir ?? "pages";
|
|
86
|
+
const matchedFiles = await glob$1(patterns, {
|
|
87
|
+
absolute: true,
|
|
88
|
+
cwd,
|
|
89
|
+
ignore: options.ignore,
|
|
90
|
+
onlyFiles: true,
|
|
91
|
+
unique: true
|
|
92
|
+
});
|
|
93
|
+
const entries = await Promise.all(
|
|
94
|
+
matchedFiles.map((filePath) => node_path.resolve(filePath)).sort((left, right) => left.localeCompare(right)).map(async (filePath) => {
|
|
95
|
+
const source = await promises.readFile(filePath, "utf8");
|
|
96
|
+
const relativePath = normalizePath(node_path.relative(cwd, filePath));
|
|
97
|
+
const { route, slug } = resolveRouteInfo(filePath, cwd, pagesDir);
|
|
98
|
+
return {
|
|
99
|
+
filePath: normalizePath(filePath),
|
|
100
|
+
relativePath,
|
|
101
|
+
route,
|
|
102
|
+
slug,
|
|
103
|
+
meta: parseFrontmatter(source, filePath)
|
|
104
|
+
};
|
|
105
|
+
})
|
|
106
|
+
);
|
|
107
|
+
return entries.sort(
|
|
108
|
+
(left, right) => left.relativePath.localeCompare(right.relativePath)
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
exports.glob = glob;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { f as ContentGlobOptions, e as ContentEntry } from './types-CZSWRdQS.cjs';
|
|
2
|
+
import 'remark-rehype';
|
|
3
|
+
import 'defuss/server';
|
|
4
|
+
import 'vite';
|
|
5
|
+
|
|
6
|
+
declare const glob: (patterns: string | string[], options?: ContentGlobOptions) => Promise<ContentEntry[]>;
|
|
7
|
+
|
|
8
|
+
export { glob };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { f as ContentGlobOptions, e as ContentEntry } from './types-CZSWRdQS.mjs';
|
|
2
|
+
import 'remark-rehype';
|
|
3
|
+
import 'defuss/server';
|
|
4
|
+
import 'vite';
|
|
5
|
+
|
|
6
|
+
declare const glob: (patterns: string | string[], options?: ContentGlobOptions) => Promise<ContentEntry[]>;
|
|
7
|
+
|
|
8
|
+
export { glob };
|
package/dist/content.mjs
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { resolve, relative, extname } from 'node:path';
|
|
3
|
+
import glob$1 from 'fast-glob';
|
|
4
|
+
import toml from 'toml';
|
|
5
|
+
import { parse } from 'yaml';
|
|
6
|
+
import { f as filePathToRoute } from './path-CjHWUK8o.mjs';
|
|
7
|
+
import 'node:fs';
|
|
8
|
+
|
|
9
|
+
const PAGE_ROUTE_EXTENSIONS = /* @__PURE__ */ new Set([".html", ".md", ".mdx"]);
|
|
10
|
+
const normalizePath = (value) => value.replace(/\\/g, "/");
|
|
11
|
+
const coerceMeta = (value) => {
|
|
12
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
return {};
|
|
16
|
+
};
|
|
17
|
+
const parseFrontmatter = (source, filePath) => {
|
|
18
|
+
const normalizedSource = source.replace(/^\uFEFF/, "");
|
|
19
|
+
const yamlMatch = normalizedSource.match(
|
|
20
|
+
/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/
|
|
21
|
+
);
|
|
22
|
+
if (yamlMatch) {
|
|
23
|
+
try {
|
|
24
|
+
return coerceMeta(parse(yamlMatch[1]));
|
|
25
|
+
} catch (error) {
|
|
26
|
+
throw new Error(
|
|
27
|
+
`Failed to parse YAML frontmatter in ${filePath}: ${error.message}`
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const tomlMatch = normalizedSource.match(
|
|
32
|
+
/^\+\+\+\r?\n([\s\S]*?)\r?\n\+\+\+(?:\r?\n|$)/
|
|
33
|
+
);
|
|
34
|
+
if (tomlMatch) {
|
|
35
|
+
try {
|
|
36
|
+
return coerceMeta(toml.parse(tomlMatch[1]));
|
|
37
|
+
} catch (error) {
|
|
38
|
+
throw new Error(
|
|
39
|
+
`Failed to parse TOML frontmatter in ${filePath}: ${error.message}`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return {};
|
|
44
|
+
};
|
|
45
|
+
const stripSlugSuffix = (value) => {
|
|
46
|
+
let normalized = value.replace(/\.(mdx?|html?)$/i, "");
|
|
47
|
+
if (normalized === "index") {
|
|
48
|
+
return "";
|
|
49
|
+
}
|
|
50
|
+
if (normalized.endsWith("/index")) {
|
|
51
|
+
normalized = normalized.slice(0, -"/index".length);
|
|
52
|
+
}
|
|
53
|
+
return normalized;
|
|
54
|
+
};
|
|
55
|
+
const isWithinDirectory = (filePath, directory) => {
|
|
56
|
+
const relativePath = normalizePath(relative(directory, filePath));
|
|
57
|
+
return relativePath.length > 0 && !relativePath.startsWith("../");
|
|
58
|
+
};
|
|
59
|
+
const resolveRouteInfo = (filePath, cwd, pagesDir) => {
|
|
60
|
+
const relativePath = normalizePath(relative(cwd, filePath));
|
|
61
|
+
const slug = stripSlugSuffix(relativePath);
|
|
62
|
+
const pagesRoot = resolve(cwd, pagesDir);
|
|
63
|
+
const extension = extname(filePath).toLowerCase();
|
|
64
|
+
if (!PAGE_ROUTE_EXTENSIONS.has(extension) || !isWithinDirectory(filePath, pagesRoot)) {
|
|
65
|
+
return {
|
|
66
|
+
route: void 0,
|
|
67
|
+
slug
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const routeConfig = {
|
|
71
|
+
pages: pagesDir,
|
|
72
|
+
components: "components",
|
|
73
|
+
assets: "assets"
|
|
74
|
+
};
|
|
75
|
+
const route = filePathToRoute(filePath, routeConfig, cwd);
|
|
76
|
+
return {
|
|
77
|
+
route,
|
|
78
|
+
slug: route.replace(/^\//, "")
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
const glob = async (patterns, options = {}) => {
|
|
82
|
+
const cwd = resolve(options.cwd ?? process.cwd());
|
|
83
|
+
const pagesDir = options.pagesDir ?? "pages";
|
|
84
|
+
const matchedFiles = await glob$1(patterns, {
|
|
85
|
+
absolute: true,
|
|
86
|
+
cwd,
|
|
87
|
+
ignore: options.ignore,
|
|
88
|
+
onlyFiles: true,
|
|
89
|
+
unique: true
|
|
90
|
+
});
|
|
91
|
+
const entries = await Promise.all(
|
|
92
|
+
matchedFiles.map((filePath) => resolve(filePath)).sort((left, right) => left.localeCompare(right)).map(async (filePath) => {
|
|
93
|
+
const source = await readFile(filePath, "utf8");
|
|
94
|
+
const relativePath = normalizePath(relative(cwd, filePath));
|
|
95
|
+
const { route, slug } = resolveRouteInfo(filePath, cwd, pagesDir);
|
|
96
|
+
return {
|
|
97
|
+
filePath: normalizePath(filePath),
|
|
98
|
+
relativePath,
|
|
99
|
+
route,
|
|
100
|
+
slug,
|
|
101
|
+
meta: parseFrontmatter(source, filePath)
|
|
102
|
+
};
|
|
103
|
+
})
|
|
104
|
+
);
|
|
105
|
+
return entries.sort(
|
|
106
|
+
(left, right) => left.relativePath.localeCompare(right.relativePath)
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export { glob };
|
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var vite = require('./vite-
|
|
3
|
+
var vite = require('./vite-BC7XxFTV.cjs');
|
|
4
|
+
var content = require('./content.cjs');
|
|
4
5
|
var mdx = require('@mdx-js/rollup');
|
|
5
6
|
var vite$1 = require('vite');
|
|
6
7
|
var defuss = require('defuss-vite');
|
|
7
8
|
var node_fs = require('node:fs');
|
|
8
9
|
var node_path = require('node:path');
|
|
10
|
+
var process = require('node:process');
|
|
9
11
|
var defussExpress = require('defuss-express');
|
|
10
12
|
require('fast-glob');
|
|
11
13
|
require('node:fs/promises');
|
|
@@ -14,7 +16,7 @@ require('node:crypto');
|
|
|
14
16
|
require('node:module');
|
|
15
17
|
require('node:url');
|
|
16
18
|
require('node:os');
|
|
17
|
-
require('
|
|
19
|
+
require('rolldown');
|
|
18
20
|
require('rehype-katex');
|
|
19
21
|
require('rehype-stringify');
|
|
20
22
|
require('remark-frontmatter');
|
|
@@ -23,6 +25,9 @@ require('remark-gfm');
|
|
|
23
25
|
require('remark-parse');
|
|
24
26
|
require('remark-rehype');
|
|
25
27
|
require('remark-mdx-frontmatter');
|
|
28
|
+
require('./path-Br3DXScZ.cjs');
|
|
29
|
+
require('toml');
|
|
30
|
+
require('yaml');
|
|
26
31
|
|
|
27
32
|
const dev = async ({
|
|
28
33
|
projectDir,
|
|
@@ -34,38 +39,43 @@ const dev = async ({
|
|
|
34
39
|
const projectDirStatus = vite.validateProjectDir(projectDir);
|
|
35
40
|
if (projectDirStatus.code !== "OK") return projectDirStatus;
|
|
36
41
|
const config = await vite.readConfig(projectDir, debug);
|
|
37
|
-
const server = await vite$1.createServer(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
const server = await vite$1.createServer(
|
|
43
|
+
vite$1.mergeConfig(
|
|
44
|
+
{
|
|
45
|
+
root: projectDir,
|
|
46
|
+
configFile: false,
|
|
47
|
+
appType: "custom",
|
|
48
|
+
server: {
|
|
49
|
+
host,
|
|
50
|
+
port,
|
|
51
|
+
watch: {
|
|
52
|
+
ignored: [
|
|
53
|
+
"**/node_modules/**",
|
|
54
|
+
"**/dist/**",
|
|
55
|
+
"**/.ssg-temp/**",
|
|
56
|
+
"**/.endpoints/**",
|
|
57
|
+
"**/.rpc/**"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
plugins: [
|
|
62
|
+
defuss({ enableJsxDevMode: true }),
|
|
63
|
+
mdx({
|
|
64
|
+
jsxImportSource: "defuss",
|
|
65
|
+
development: true,
|
|
66
|
+
remarkPlugins: config.remarkPlugins,
|
|
67
|
+
rehypePlugins: config.rehypePlugins
|
|
68
|
+
}),
|
|
69
|
+
...vite.defussSsg({
|
|
70
|
+
projectDir,
|
|
71
|
+
debug,
|
|
72
|
+
writeDevOutput
|
|
73
|
+
})
|
|
51
74
|
]
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
mdx({
|
|
57
|
-
jsxImportSource: "defuss",
|
|
58
|
-
development: true,
|
|
59
|
-
remarkPlugins: config.remarkPlugins,
|
|
60
|
-
rehypePlugins: config.rehypePlugins
|
|
61
|
-
}),
|
|
62
|
-
...vite.defussSsg({
|
|
63
|
-
projectDir,
|
|
64
|
-
debug,
|
|
65
|
-
writeDevOutput
|
|
66
|
-
})
|
|
67
|
-
]
|
|
68
|
-
});
|
|
75
|
+
},
|
|
76
|
+
config.viteConfig ?? {}
|
|
77
|
+
)
|
|
78
|
+
);
|
|
69
79
|
await server.listen(port);
|
|
70
80
|
server.printUrls();
|
|
71
81
|
return {
|
|
@@ -125,6 +135,7 @@ const createRpcHandler = () => {
|
|
|
125
135
|
const serve = async ({
|
|
126
136
|
projectDir,
|
|
127
137
|
debug = false,
|
|
138
|
+
host,
|
|
128
139
|
port = 3e3,
|
|
129
140
|
workers = 1
|
|
130
141
|
}) => {
|
|
@@ -151,6 +162,9 @@ const serve = async ({
|
|
|
151
162
|
const rpcHandler = createRpcHandler();
|
|
152
163
|
app.post?.("/rpc", rpcHandler);
|
|
153
164
|
app.post?.("/rpc/schema", rpcHandler);
|
|
165
|
+
app.post?.("/rpc/upload", rpcHandler);
|
|
166
|
+
app.get?.("/rpc/upload/progress/:uploadId", rpcHandler);
|
|
167
|
+
app.head?.("/rpc/upload/:uploadId", rpcHandler);
|
|
154
168
|
}
|
|
155
169
|
const staticMiddleware = defussExpress.express.static?.(outputDir);
|
|
156
170
|
if (staticMiddleware) {
|
|
@@ -158,6 +172,7 @@ const serve = async ({
|
|
|
158
172
|
}
|
|
159
173
|
try {
|
|
160
174
|
await defussExpress.startServer(app, {
|
|
175
|
+
host,
|
|
161
176
|
port,
|
|
162
177
|
workers
|
|
163
178
|
});
|
|
@@ -167,8 +182,12 @@ const serve = async ({
|
|
|
167
182
|
message: error instanceof Error ? error.message : "Failed to start production server"
|
|
168
183
|
};
|
|
169
184
|
}
|
|
170
|
-
|
|
171
|
-
|
|
185
|
+
if (typeof process.env.DEFUSS_WORKER_INDEX !== "string") {
|
|
186
|
+
console.log(
|
|
187
|
+
`defuss-ssg production server running at http://${host ?? "localhost"}:${port}`
|
|
188
|
+
);
|
|
189
|
+
console.log(`Serving static output from ${outputDir}`);
|
|
190
|
+
}
|
|
172
191
|
return {
|
|
173
192
|
code: "OK",
|
|
174
193
|
message: `Serving ${outputDir}`
|
|
@@ -194,5 +213,6 @@ exports.readConfig = vite.readConfig;
|
|
|
194
213
|
exports.registerEndpoints = vite.registerEndpoints;
|
|
195
214
|
exports.resolveEndpoints = vite.resolveEndpoints;
|
|
196
215
|
exports.routeToExpressPattern = vite.routeToExpressPattern;
|
|
216
|
+
exports.glob = content.glob;
|
|
197
217
|
exports.dev = dev;
|
|
198
218
|
exports.serve = serve;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { S as SsgConfig, B as BuildOptions, a as Status, D as DevOptions, b as ServeOptions, E as EndpointRouteContext, c as EndpointRouteRegistrar } from './
|
|
2
|
-
export { d as BuildMode, e as
|
|
3
|
-
|
|
1
|
+
import { S as SsgConfig, B as BuildOptions, a as Status, D as DevOptions, b as ServeOptions, E as EndpointRouteContext, c as EndpointRouteRegistrar } from './types-CZSWRdQS.cjs';
|
|
2
|
+
export { d as BuildMode, C as ContainerRuntime, e as ContentEntry, f as ContentGlobOptions, g as DefussSsgViteOptions, h as DevChangeKind, i as EndpointRouteMethod, j as EndpointRouteResponder, P as PluginFn, k as PluginFnPageDom, l as PluginFnPageHtml, m as PluginFnPageVdom, n as PluginFnPrePost, R as RehypePlugins, o as RemarkPlugins, p as SsgPlugin, q as StatusCode } from './types-CZSWRdQS.cjs';
|
|
3
|
+
export { glob } from './content.cjs';
|
|
4
|
+
export { defussSsg } from './vite.cjs';
|
|
4
5
|
import 'remark-rehype';
|
|
5
6
|
import 'defuss/server';
|
|
7
|
+
import 'vite';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* Reads the SSG configuration from the project directory.
|
|
@@ -30,7 +32,7 @@ declare const dev: ({ projectDir, debug, host, port, writeDevOutput, }: DevOptio
|
|
|
30
32
|
/**
|
|
31
33
|
* Serve an already-built defuss-ssg project with defuss-express.
|
|
32
34
|
*/
|
|
33
|
-
declare const serve: ({ projectDir, debug, port, workers, }: ServeOptions) => Promise<Status>;
|
|
35
|
+
declare const serve: ({ projectDir, debug, host, port, workers, }: ServeOptions) => Promise<Status>;
|
|
34
36
|
|
|
35
37
|
/** HTTP method names that endpoint files may export. */
|
|
36
38
|
declare const HTTP_METHODS: readonly ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "ALL"];
|
|
@@ -135,7 +137,7 @@ declare const loadEndpointModule: (filePath: string) => Promise<EndpointModule>;
|
|
|
135
137
|
/**
|
|
136
138
|
* Discover, compile, load and resolve all endpoint files.
|
|
137
139
|
*
|
|
138
|
-
* Source `.ts`/`.js` files are compiled with
|
|
140
|
+
* Source `.ts`/`.js` files are compiled with Rolldown into the
|
|
139
141
|
* `.endpoints/` directory as `.mjs` modules. The compiled modules
|
|
140
142
|
* are then dynamically imported so we can inspect their exports.
|
|
141
143
|
*
|
|
@@ -193,7 +195,7 @@ declare const registerEndpoints: (registrar: EndpointRouteRegistrar, projectDir:
|
|
|
193
195
|
*/
|
|
194
196
|
declare const discoverRpcFile: (projectDir: string) => string | null;
|
|
195
197
|
/**
|
|
196
|
-
* Compile the RPC module source file with
|
|
198
|
+
* Compile the RPC module source file with Rolldown into the `.rpc/` directory.
|
|
197
199
|
*
|
|
198
200
|
* @param rpcFilePath Absolute path to the rpc.ts / rpc.js source file
|
|
199
201
|
* @param projectDir The project root directory
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { S as SsgConfig, B as BuildOptions, a as Status, D as DevOptions, b as ServeOptions, E as EndpointRouteContext, c as EndpointRouteRegistrar } from './
|
|
2
|
-
export { d as BuildMode, e as
|
|
3
|
-
|
|
1
|
+
import { S as SsgConfig, B as BuildOptions, a as Status, D as DevOptions, b as ServeOptions, E as EndpointRouteContext, c as EndpointRouteRegistrar } from './types-CZSWRdQS.mjs';
|
|
2
|
+
export { d as BuildMode, C as ContainerRuntime, e as ContentEntry, f as ContentGlobOptions, g as DefussSsgViteOptions, h as DevChangeKind, i as EndpointRouteMethod, j as EndpointRouteResponder, P as PluginFn, k as PluginFnPageDom, l as PluginFnPageHtml, m as PluginFnPageVdom, n as PluginFnPrePost, R as RehypePlugins, o as RemarkPlugins, p as SsgPlugin, q as StatusCode } from './types-CZSWRdQS.mjs';
|
|
3
|
+
export { glob } from './content.mjs';
|
|
4
|
+
export { defussSsg } from './vite.mjs';
|
|
4
5
|
import 'remark-rehype';
|
|
5
6
|
import 'defuss/server';
|
|
7
|
+
import 'vite';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* Reads the SSG configuration from the project directory.
|
|
@@ -30,7 +32,7 @@ declare const dev: ({ projectDir, debug, host, port, writeDevOutput, }: DevOptio
|
|
|
30
32
|
/**
|
|
31
33
|
* Serve an already-built defuss-ssg project with defuss-express.
|
|
32
34
|
*/
|
|
33
|
-
declare const serve: ({ projectDir, debug, port, workers, }: ServeOptions) => Promise<Status>;
|
|
35
|
+
declare const serve: ({ projectDir, debug, host, port, workers, }: ServeOptions) => Promise<Status>;
|
|
34
36
|
|
|
35
37
|
/** HTTP method names that endpoint files may export. */
|
|
36
38
|
declare const HTTP_METHODS: readonly ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "ALL"];
|
|
@@ -135,7 +137,7 @@ declare const loadEndpointModule: (filePath: string) => Promise<EndpointModule>;
|
|
|
135
137
|
/**
|
|
136
138
|
* Discover, compile, load and resolve all endpoint files.
|
|
137
139
|
*
|
|
138
|
-
* Source `.ts`/`.js` files are compiled with
|
|
140
|
+
* Source `.ts`/`.js` files are compiled with Rolldown into the
|
|
139
141
|
* `.endpoints/` directory as `.mjs` modules. The compiled modules
|
|
140
142
|
* are then dynamically imported so we can inspect their exports.
|
|
141
143
|
*
|
|
@@ -193,7 +195,7 @@ declare const registerEndpoints: (registrar: EndpointRouteRegistrar, projectDir:
|
|
|
193
195
|
*/
|
|
194
196
|
declare const discoverRpcFile: (projectDir: string) => string | null;
|
|
195
197
|
/**
|
|
196
|
-
* Compile the RPC module source file with
|
|
198
|
+
* Compile the RPC module source file with Rolldown into the `.rpc/` directory.
|
|
197
199
|
*
|
|
198
200
|
* @param rpcFilePath Absolute path to the rpc.ts / rpc.js source file
|
|
199
201
|
* @param projectDir The project root directory
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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 {
|
|
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-CSOGjlHB.mjs';
|
|
2
|
+
export { glob } from './content.mjs';
|
|
3
|
+
export { d as dev, s as serve } from './serve-BFMU8uCH.mjs';
|
|
3
4
|
import 'fast-glob';
|
|
4
5
|
import 'node:fs';
|
|
5
6
|
import 'node:fs/promises';
|
|
@@ -12,7 +13,7 @@ import 'defuss-vite';
|
|
|
12
13
|
import 'node:module';
|
|
13
14
|
import 'node:url';
|
|
14
15
|
import 'node:os';
|
|
15
|
-
import '
|
|
16
|
+
import 'rolldown';
|
|
16
17
|
import 'rehype-katex';
|
|
17
18
|
import 'rehype-stringify';
|
|
18
19
|
import 'remark-frontmatter';
|
|
@@ -21,4 +22,8 @@ import 'remark-gfm';
|
|
|
21
22
|
import 'remark-parse';
|
|
22
23
|
import 'remark-rehype';
|
|
23
24
|
import 'remark-mdx-frontmatter';
|
|
25
|
+
import './path-CjHWUK8o.mjs';
|
|
26
|
+
import 'toml';
|
|
27
|
+
import 'yaml';
|
|
28
|
+
import 'node:process';
|
|
24
29
|
import 'defuss-express';
|