defuss-ssg 0.2.1 → 0.3.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/dist/cli.mjs +11 -7
- package/dist/index.cjs +451 -210
- package/dist/index.d.cts +14 -8
- package/dist/index.d.mts +14 -8
- package/dist/index.mjs +5 -4
- package/dist/plugins/index.d.cts +1 -1
- package/dist/plugins/index.d.mts +1 -1
- package/dist/{serve-w6eyG8f3.mjs → serve-C7GCBFVo.mjs} +452 -211
- package/dist/{types-Be8_Y5-t.d.cts → types-CDQPtj1-.d.cts} +6 -0
- package/dist/{types-Be8_Y5-t.d.mts → types-CDQPtj1-.d.mts} +6 -0
- package/package.json +9 -7
package/dist/cli.mjs
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { v as validateProjectDir, b as build, s as serve } from './serve-
|
|
2
|
+
import { v as validateProjectDir, b as build, s as serve } from './serve-C7GCBFVo.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';
|
|
6
|
+
import 'node:os';
|
|
6
7
|
import 'chokidar';
|
|
7
|
-
import '
|
|
8
|
+
import 'elysia';
|
|
9
|
+
import '@elysiajs/static';
|
|
10
|
+
import 'node:fs/promises';
|
|
8
11
|
import 'esbuild';
|
|
9
12
|
import 'rehype-katex';
|
|
10
13
|
import 'rehype-stringify';
|
|
@@ -18,9 +21,7 @@ import './tailwind-DV23JSh-.mjs';
|
|
|
18
21
|
import '@mdx-js/esbuild';
|
|
19
22
|
import 'fast-glob';
|
|
20
23
|
import 'defuss/server';
|
|
21
|
-
import 'node:fs/promises';
|
|
22
24
|
import 'node:url';
|
|
23
|
-
import 'node:module';
|
|
24
25
|
|
|
25
26
|
const canResolve = (dep, dir) => {
|
|
26
27
|
let current = dir;
|
|
@@ -91,7 +92,7 @@ const setup = async (projectDir) => {
|
|
|
91
92
|
}
|
|
92
93
|
const packageManager = packageJson.packageManager || "npm";
|
|
93
94
|
const pm = packageManager.split("@")[0];
|
|
94
|
-
const validPMs = ["
|
|
95
|
+
const validPMs = ["bun", "npm", "yarn", "pnpm"];
|
|
95
96
|
if (!validPMs.includes(pm)) {
|
|
96
97
|
return {
|
|
97
98
|
code: "UNSUPPORTED_PM",
|
|
@@ -166,10 +167,11 @@ Continuing anyway \u2014 dependencies may already be available.`
|
|
|
166
167
|
(async () => {
|
|
167
168
|
const args = process.argv.slice(2);
|
|
168
169
|
const debug = args.includes("--debug") || args.includes("-d");
|
|
170
|
+
const multicore = args.includes("--multicore");
|
|
169
171
|
const positional = args.filter((a) => !a.startsWith("-"));
|
|
170
172
|
const command = positional[0];
|
|
171
173
|
const folder = positional[1];
|
|
172
|
-
const usage = "Usage: defuss-ssg <build|serve> <folder> [--debug]";
|
|
174
|
+
const usage = "Usage: defuss-ssg <build|serve> <folder> [--debug] [--multicore]";
|
|
173
175
|
if (!command || !folder) {
|
|
174
176
|
console.error(usage);
|
|
175
177
|
process.exit(1);
|
|
@@ -187,7 +189,9 @@ Continuing anyway \u2014 dependencies may already be available.`
|
|
|
187
189
|
console.log(`Serving ${folder}...`);
|
|
188
190
|
await serve({
|
|
189
191
|
projectDir,
|
|
190
|
-
debug
|
|
192
|
+
debug,
|
|
193
|
+
multicore
|
|
194
|
+
});
|
|
191
195
|
} else {
|
|
192
196
|
console.error(usage);
|
|
193
197
|
process.exit(1);
|