Compare commits

...
1 Commits
Author SHA1 Message Date
wc24 187c6f6030 v0.6.1: 改为编译 ship,通过 npm prepare hook 自动构建
- 加 tsconfig.build.json,排除 test,rootDir 设为 src
- package.json: main/types/exports 指向 dist/main/index.{js,d.ts}
- prepare hook: 消费侧 git 安装后自动 tsc,产物不进 git
- 解决消费侧 "tsc + 裸 node" 链路 (theseus-server 等) 找不到 .js 的问题
2026-06-01 19:32:48 +08:00
2 changed files with 16 additions and 6 deletions
+8 -6
View File
@@ -1,22 +1,24 @@
{ {
"name": "shrimp-server", "name": "shrimp-server",
"version": "0.6.0", "version": "0.6.1",
"private": true,
"description": "Shrimp 框架后端 — 声明式字段驱动的 Node.js 管理后台框架(Express + Mongoose + JWT)", "description": "Shrimp 框架后端 — 声明式字段驱动的 Node.js 管理后台框架(Express + Mongoose + JWT)",
"main": "src/main/index.ts", "main": "dist/main/index.js",
"types": "src/main/index.ts", "types": "dist/main/index.d.ts",
"exports": { "exports": {
".": { ".": {
"types": "./src/main/index.ts", "types": "./dist/main/index.d.ts",
"default": "./src/main/index.ts" "default": "./dist/main/index.js"
}, },
"./package.json": "./package.json" "./package.json": "./package.json"
}, },
"files": [ "files": [
"dist",
"src", "src",
"README.md" "README.md"
], ],
"scripts": { "scripts": {
"build": "tsc -p tsconfig.build.json",
"prepare": "tsc -p tsconfig.build.json",
"test": "vitest run", "test": "vitest run",
"test:watch": "vitest", "test:watch": "vitest",
"typecheck": "tsc --noEmit" "typecheck": "tsc --noEmit"
+8
View File
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "test"]
}