wildpig 1.0.5 → 1.0.6

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/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
- "version": "1.0.5",
2
+ "version": "1.0.6",
3
3
  "scripts": {
4
4
  "dev": "export NODE_ENV=development && bun --hot run index.ts",
5
- "prebuild": "bun run scripts/prebuild.ts",
5
+ "prebuild": "bun run scripts/run-prebuild.ts",
6
+
6
7
  "build": "export NODE_ENV=production && bun run prebuild && bun build --compile ./index.ts --outfile dist/wildpig",
7
8
  "build-linux-musl": "export NODE_ENV=production && bun build --compile --target=bun-linux-x64-musl ./index.ts --outfile dist/wildpig",
8
- "start": "cd dist && ./wildpig",
9
- "docker:build": "bun run build-linux && docker build -t wildpig .",
10
- "docker:run": "docker run -itd -p 3000:3000 wildpig",
11
- "testbin": "wildpig dev"
9
+
10
+ "start": "cd dist && ./wildpig"
12
11
  },
13
12
  "dependencies": {
14
13
  "@react-router/dev": "^7.10.1",
@@ -1,6 +1,8 @@
1
1
  import { genMetaRoutes, genRoutes } from "./genRoutes";
2
2
  import { packageStatic } from "./packageStatic";
3
3
 
4
- await packageStatic();
5
- await genRoutes();
6
- await genMetaRoutes();
4
+ export const prebuild = async () => {
5
+ await packageStatic();
6
+ await genRoutes();
7
+ await genMetaRoutes();
8
+ }
@@ -0,0 +1,2 @@
1
+ import { prebuild } from "./prebuild";
2
+ prebuild();
package/bin/wildpig.js DELETED
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env node
2
- import path from "path";
3
- import { spawn } from "child_process";
4
-
5
- // 子命令
6
- const cmd = process.argv[2]; // dev / build / ...
7
- if (!cmd) {
8
- console.error('Usage: wildpig dev|build|start');
9
- process.exit(1);
10
- }
11
-
12
- // 跑到包自身目录去 npm run xxx
13
- spawn('bun', ['run', cmd], {
14
- stdio: 'inherit',
15
- shell: true,
16
- cwd: "." // 指向 wp 包根目录
17
- });
package/tsconfig.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "moduleResolution": "bundler",
6
- "strict": true,
7
- "esModuleInterop": true,
8
- "jsx": "react-jsx",
9
- "baseUrl": ".",
10
- "paths": {
11
- "@/*": ["src/*"],
12
- "#/*": ["*"]
13
- }
14
- }
15
- }