defuss-ssg 0.2.0 → 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 CHANGED
@@ -1,10 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import { v as validateProjectDir, b as build, s as serve } from './serve-BZhZ9J90.mjs';
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 'ultimate-express';
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 = ["npm", "yarn", "pnpm", "bun"];
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);