@faapi/task-pgboss 0.0.0-canary.0 → 6.4.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/LICENSE +21 -0
- package/README.md +48 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.js +139 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 faapi contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
1
|
# @faapi/task-pgboss
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
faapi 任务子系统的 **pg-boss 驱动**(PostgreSQL 持久化队列)。
|
|
4
|
+
|
|
5
|
+
基于 PostgreSQL 的任务队列——任务不丢(持久化)、多实例天然防重跑(worker 领取制)、cron 重复投递由 pg-boss 消费语义兜底。复用业务方已有的 Postgres,不引入 Redis。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @faapi/task-pgboss pgboss
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 使用
|
|
14
|
+
|
|
15
|
+
任务定义不变(主包文件约定 `src/tasks/<name>/task.ts`),只切驱动:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
// faapi.config.ts
|
|
19
|
+
import type { FaapiConfig } from '@faapi/faapi';
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
task: {
|
|
23
|
+
driver: 'pgboss',
|
|
24
|
+
pgboss: { connectionString: 'postgres://localhost:5432/app' }, // 透传给 new PgBoss(...)
|
|
25
|
+
},
|
|
26
|
+
} satisfies FaapiConfig;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
// handler 里用法完全不变
|
|
31
|
+
export function POST(body, tasks) {
|
|
32
|
+
return tasks.enqueue('send-email', { to: body.email });
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 语义映射
|
|
37
|
+
|
|
38
|
+
| faapi 驱动接口 | pg-boss |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `enqueue(name, payload, { retries, delayMs })` | `boss.send(name, payload, { retryLimit, retryDelay: 1, retryBackoff: true, startAfter })` |
|
|
41
|
+
| `startWorker(name, { concurrency, process })` | `boss.work(name, { batchSize: concurrency }, handler)` |
|
|
42
|
+
| `stop(timeoutMs)` | 停 work + `boss.stop({ close: true, timeout })` |
|
|
43
|
+
| `stopWorkers()` | `offWork()`(不断开连接,dev 热替换重注册用) |
|
|
44
|
+
| 失败重试 | pg-boss 侧执行(retryLimit + retryBackoff 指数退避) |
|
|
45
|
+
|
|
46
|
+
注意:pg-boss 不提供执行中任务的取消信号——`run` 的 `taskCtx.signal` 永不 abort,长任务请自行做超时控制。
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TaskDriver } from '@faapi/faapi';
|
|
2
|
+
import PgBoss from 'pg-boss';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* pg-boss 驱动选项(透传给 PgBoss 构造函数)
|
|
6
|
+
*
|
|
7
|
+
* 常用:`connectionString`;其余见 pg-boss 文档(ConstructorOptions)。
|
|
8
|
+
*/
|
|
9
|
+
type PgBossDriverOptions = PgBoss.ConstructorOptions;
|
|
10
|
+
declare function createPgBossDriver(options?: PgBossDriverOptions): TaskDriver;
|
|
11
|
+
|
|
12
|
+
export { type PgBossDriverOptions, createPgBossDriver };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { createHash } from "crypto";
|
|
3
|
+
import PgBoss from "pg-boss";
|
|
4
|
+
function dedupIdToUuid(dedupId) {
|
|
5
|
+
const h = createHash("sha1").update(dedupId).digest("hex");
|
|
6
|
+
return [
|
|
7
|
+
h.slice(0, 8),
|
|
8
|
+
h.slice(8, 12),
|
|
9
|
+
`5${h.slice(13, 16)}`,
|
|
10
|
+
// version 5
|
|
11
|
+
`${(parseInt(h.slice(16, 17), 16) & 3 | 8).toString(16)}${h.slice(17, 20)}`,
|
|
12
|
+
// variant
|
|
13
|
+
h.slice(20, 32)
|
|
14
|
+
].join("-");
|
|
15
|
+
}
|
|
16
|
+
function createPgBossDriver(options = {}) {
|
|
17
|
+
let boss = null;
|
|
18
|
+
let stopped = false;
|
|
19
|
+
const workerIds = /* @__PURE__ */ new Map();
|
|
20
|
+
const inflight = /* @__PURE__ */ new Map();
|
|
21
|
+
async function ensureBoss() {
|
|
22
|
+
if (!boss) {
|
|
23
|
+
boss = new PgBoss(options);
|
|
24
|
+
await boss.start();
|
|
25
|
+
}
|
|
26
|
+
return boss;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
async enqueue(name, payload, opts) {
|
|
30
|
+
if (stopped) {
|
|
31
|
+
throw new Error("[faapi] Task queue is stopped and no longer accepts jobs");
|
|
32
|
+
}
|
|
33
|
+
const b = await ensureBoss();
|
|
34
|
+
const sendOptions = {
|
|
35
|
+
retryLimit: opts?.retries ?? 0,
|
|
36
|
+
retryDelay: 1,
|
|
37
|
+
// 秒;配合 retryBackoff 指数退避
|
|
38
|
+
retryBackoff: true,
|
|
39
|
+
...opts?.dedupId ? { id: dedupIdToUuid(opts.dedupId) } : {},
|
|
40
|
+
...opts?.delayMs ? { startAfter: new Date(Date.now() + opts.delayMs) } : {}
|
|
41
|
+
};
|
|
42
|
+
const id = await b.send(name, payload, sendOptions);
|
|
43
|
+
if (!id) {
|
|
44
|
+
if (opts?.dedupId) {
|
|
45
|
+
return dedupIdToUuid(opts.dedupId);
|
|
46
|
+
}
|
|
47
|
+
throw new Error(`[faapi] pg-boss send failed for task "${name}"`);
|
|
48
|
+
}
|
|
49
|
+
return id;
|
|
50
|
+
},
|
|
51
|
+
async startWorker(name, workerOpts) {
|
|
52
|
+
const b = await ensureBoss();
|
|
53
|
+
const process = workerOpts.process;
|
|
54
|
+
const existing = workerIds.get(name);
|
|
55
|
+
if (existing) {
|
|
56
|
+
await b.offWork(existing);
|
|
57
|
+
}
|
|
58
|
+
const workerId = await b.work(
|
|
59
|
+
name,
|
|
60
|
+
{ batchSize: workerOpts.concurrency, includeMetadata: true },
|
|
61
|
+
async (jobs) => {
|
|
62
|
+
for (const job of jobs) {
|
|
63
|
+
const attempt = job.retryCount + 1;
|
|
64
|
+
const controller = new AbortController();
|
|
65
|
+
inflight.set(job.id, controller);
|
|
66
|
+
try {
|
|
67
|
+
await process({
|
|
68
|
+
id: job.id,
|
|
69
|
+
name,
|
|
70
|
+
payload: job.data,
|
|
71
|
+
attempt,
|
|
72
|
+
signal: controller.signal
|
|
73
|
+
});
|
|
74
|
+
} finally {
|
|
75
|
+
inflight.delete(job.id);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
workerIds.set(name, workerId);
|
|
81
|
+
},
|
|
82
|
+
async stop(timeoutMs = 1e4) {
|
|
83
|
+
stopped = true;
|
|
84
|
+
const abortTimer = setTimeout(() => {
|
|
85
|
+
for (const controller of inflight.values()) controller.abort();
|
|
86
|
+
}, timeoutMs);
|
|
87
|
+
try {
|
|
88
|
+
const b = boss;
|
|
89
|
+
if (b) {
|
|
90
|
+
for (const workerId of workerIds.values()) {
|
|
91
|
+
await b.offWork(workerId).catch(() => {
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
workerIds.clear();
|
|
95
|
+
await b.stop({ close: true, graceful: true, timeout: Math.floor(timeoutMs / 1e3) });
|
|
96
|
+
boss = null;
|
|
97
|
+
}
|
|
98
|
+
} finally {
|
|
99
|
+
clearTimeout(abortTimer);
|
|
100
|
+
for (const controller of inflight.values()) controller.abort();
|
|
101
|
+
inflight.clear();
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
async stopWorkers() {
|
|
105
|
+
const b = boss;
|
|
106
|
+
if (b) {
|
|
107
|
+
for (const workerId of workerIds.values()) {
|
|
108
|
+
await b.offWork(workerId).catch(() => {
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
workerIds.clear();
|
|
113
|
+
},
|
|
114
|
+
async cancel(name, id) {
|
|
115
|
+
if (stopped) {
|
|
116
|
+
throw new Error(
|
|
117
|
+
"[faapi] Task queue is stopped and no longer accepts management operations"
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
const b = await ensureBoss();
|
|
121
|
+
await b.cancel(name, id);
|
|
122
|
+
},
|
|
123
|
+
async retry(name, id) {
|
|
124
|
+
if (stopped) {
|
|
125
|
+
throw new Error(
|
|
126
|
+
"[faapi] Task queue is stopped and no longer accepts management operations"
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
const b = await ensureBoss();
|
|
130
|
+
await b.resume(name, id);
|
|
131
|
+
}
|
|
132
|
+
// list 未实现:pg-boss v10 无批量列出 jobs 的公开 API(getJobById/getQueueSize 只能单查/计数),
|
|
133
|
+
// 不硬造内部 SQL 依赖——语义层 listQueued 显式抛错,管理走 pg-boss 自身 API/SQL
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
export {
|
|
137
|
+
createPgBossDriver
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\nimport type { TaskDriver, TaskDriverProcess } from '@faapi/faapi';\nimport PgBoss from 'pg-boss';\n\n/**\n * pg-boss 驱动选项(透传给 PgBoss 构造函数)\n *\n * 常用:`connectionString`;其余见 pg-boss 文档(ConstructorOptions)。\n */\nexport type PgBossDriverOptions = PgBoss.ConstructorOptions;\n\n/**\n * faapi 任务队列 pg-boss 驱动(PostgreSQL 持久化队列)\n *\n * 与 faapi 主包 `config.task.driver: 'pgboss'` 配合使用:\n *\n * ```ts\n * // faapi.config.ts\n * export default {\n * task: {\n * driver: 'pgboss',\n * pgboss: { connectionString: 'postgres://localhost:5432/app' },\n * },\n * } satisfies FaapiConfig;\n * ```\n *\n * 语义映射(详见包根 README):\n * - `enqueue` → `boss.send(name, payload, { retryLimit, retryDelay, retryBackoff, startAfter })`\n * - `startWorker` → `boss.work(name, { batchSize: concurrency, includeMetadata: true }, handler)`\n * - `stop` → `offWork` + `boss.stop({ close: true, graceful: true, timeout })`;超时后 abort 在跑任务的 signal\n * - 重试 → pg-boss 侧执行(retryLimit + retryBackoff 指数退避)\n */\n/**\n * dedupId → 确定性 UUID:pg-boss 的 send 自定义 id 要求 UUID 格式(SQL 侧 cast),\n * 任意字符串键经 SHA-1 映射为合法 UUID——同键必同 UUID(幂等),不同键碰撞可忽略\n */\nfunction dedupIdToUuid(dedupId: string): string {\n const h = createHash('sha1').update(dedupId).digest('hex');\n return [\n h.slice(0, 8),\n h.slice(8, 12),\n `5${h.slice(13, 16)}`, // version 5\n `${((parseInt(h.slice(16, 17), 16) & 0x3) | 0x8).toString(16)}${h.slice(17, 20)}`, // variant\n h.slice(20, 32),\n ].join('-');\n}\n\nexport function createPgBossDriver(options: PgBossDriverOptions = {}): TaskDriver {\n let boss: PgBoss | null = null;\n let stopped = false;\n /** 已创建的 pg-boss worker id(stopWorkers 时 offWork) */\n const workerIds = new Map<string, string>();\n /** 在跑任务的取消控制器(stop 超时 abort——run 监听 signal 可尽快退出) */\n const inflight = new Map<string, AbortController>();\n\n async function ensureBoss(): Promise<PgBoss> {\n if (!boss) {\n boss = new PgBoss(options);\n // pg-boss 惰性连接:start 后才连库;驱动在首次 enqueue/startWorker 前建立\n await boss.start();\n }\n return boss;\n }\n\n return {\n async enqueue(name, payload, opts) {\n if (stopped) {\n throw new Error('[faapi] Task queue is stopped and no longer accepts jobs');\n }\n const b = await ensureBoss();\n const sendOptions: PgBoss.SendOptions = {\n retryLimit: opts?.retries ?? 0,\n retryDelay: 1, // 秒;配合 retryBackoff 指数退避\n retryBackoff: true,\n ...(opts?.dedupId ? { id: dedupIdToUuid(opts.dedupId) } : {}),\n ...(opts?.delayMs ? { startAfter: new Date(Date.now() + opts.delayMs) } : {}),\n };\n // pg-boss data 形参为 object——基础类型 payload(cron 空任务等)按 JSON 语义透传\n const id = await b.send(name, payload as object, sendOptions);\n if (!id) {\n // dedupId 幂等投递:同键已存在(主键冲突 DO NOTHING → send 返回 null),\n // 返回已存在任务的确定性 id;无 dedupId 的失败投递才是异常\n if (opts?.dedupId) {\n return dedupIdToUuid(opts.dedupId);\n }\n throw new Error(`[faapi] pg-boss send failed for task \"${name}\"`);\n }\n return id;\n },\n\n async startWorker(name, workerOpts) {\n const b = await ensureBoss();\n const process: TaskDriverProcess = workerOpts.process;\n // 二次注册(reload 场景)先 offWork 旧 worker\n const existing = workerIds.get(name);\n if (existing) {\n await b.offWork(existing);\n }\n const workerId = await b.work<unknown>(\n name,\n { batchSize: workerOpts.concurrency, includeMetadata: true },\n async (jobs) => {\n for (const job of jobs) {\n // retryCount 从 0 起(首次执行为 0)→ faapi attempt 从 1 起\n const attempt = job.retryCount + 1;\n // 信号由驱动自管:stop 超时 abort(pg-boss 自身不提供执行中任务的取消能力)\n const controller = new AbortController();\n inflight.set(job.id, controller);\n try {\n await process({\n id: job.id,\n name,\n payload: job.data,\n attempt,\n signal: controller.signal,\n });\n } finally {\n inflight.delete(job.id);\n }\n }\n // handler 正常返回 = 本批全部完成;抛错 = 整批失败由 pg-boss 按 retryLimit 重试\n },\n );\n workerIds.set(name, workerId);\n },\n\n async stop(timeoutMs = 10_000) {\n stopped = true;\n // 等待超时到点 abort 在跑任务(run 监听 signal 尽快退出);等待结束后兜底 abort 残留\n const abortTimer = setTimeout(() => {\n for (const controller of inflight.values()) controller.abort();\n }, timeoutMs);\n try {\n const b = boss;\n if (b) {\n for (const workerId of workerIds.values()) {\n await b.offWork(workerId).catch(() => {});\n }\n workerIds.clear();\n // graceful: 等 in-flight 任务完成;timeout 秒后强制处置\n await b.stop({ close: true, graceful: true, timeout: Math.floor(timeoutMs / 1000) });\n boss = null;\n }\n } finally {\n clearTimeout(abortTimer);\n for (const controller of inflight.values()) controller.abort();\n inflight.clear();\n }\n },\n\n async stopWorkers() {\n const b = boss;\n if (b) {\n for (const workerId of workerIds.values()) {\n await b.offWork(workerId).catch(() => {});\n }\n }\n workerIds.clear();\n },\n\n async cancel(name, id) {\n if (stopped) {\n throw new Error(\n '[faapi] Task queue is stopped and no longer accepts management operations',\n );\n }\n const b = await ensureBoss();\n await b.cancel(name, id);\n },\n\n async retry(name, id) {\n if (stopped) {\n throw new Error(\n '[faapi] Task queue is stopped and no longer accepts management operations',\n );\n }\n const b = await ensureBoss();\n // pg-boss v10 语义:resume 恢复 cancelled 任务;failed 任务无原生重试 API\n await b.resume(name, id);\n },\n // list 未实现:pg-boss v10 无批量列出 jobs 的公开 API(getJobById/getQueueSize 只能单查/计数),\n // 不硬造内部 SQL 依赖——语义层 listQueued 显式抛错,管理走 pg-boss 自身 API/SQL\n };\n}\n"],"mappings":";AAAA,SAAS,kBAAkB;AAE3B,OAAO,YAAY;AAkCnB,SAAS,cAAc,SAAyB;AAC9C,QAAM,IAAI,WAAW,MAAM,EAAE,OAAO,OAAO,EAAE,OAAO,KAAK;AACzD,SAAO;AAAA,IACL,EAAE,MAAM,GAAG,CAAC;AAAA,IACZ,EAAE,MAAM,GAAG,EAAE;AAAA,IACb,IAAI,EAAE,MAAM,IAAI,EAAE,CAAC;AAAA;AAAA,IACnB,IAAK,SAAS,EAAE,MAAM,IAAI,EAAE,GAAG,EAAE,IAAI,IAAO,GAAK,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,IAAI,EAAE,CAAC;AAAA;AAAA,IAC/E,EAAE,MAAM,IAAI,EAAE;AAAA,EAChB,EAAE,KAAK,GAAG;AACZ;AAEO,SAAS,mBAAmB,UAA+B,CAAC,GAAe;AAChF,MAAI,OAAsB;AAC1B,MAAI,UAAU;AAEd,QAAM,YAAY,oBAAI,IAAoB;AAE1C,QAAM,WAAW,oBAAI,IAA6B;AAElD,iBAAe,aAA8B;AAC3C,QAAI,CAAC,MAAM;AACT,aAAO,IAAI,OAAO,OAAO;AAEzB,YAAM,KAAK,MAAM;AAAA,IACnB;AACA,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,MAAM,QAAQ,MAAM,SAAS,MAAM;AACjC,UAAI,SAAS;AACX,cAAM,IAAI,MAAM,0DAA0D;AAAA,MAC5E;AACA,YAAM,IAAI,MAAM,WAAW;AAC3B,YAAM,cAAkC;AAAA,QACtC,YAAY,MAAM,WAAW;AAAA,QAC7B,YAAY;A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|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "6.4.0",
|
|
4
|
+
"description": "pg-boss task queue driver for faapi — persistent queue on PostgreSQL",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./index.js",
|
|
7
|
-
"
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=24"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^24.3.0",
|
|
23
|
+
"pg-boss": "^10.1.5",
|
|
24
|
+
"tsup": "^8.4.0",
|
|
25
|
+
"typescript": "^5.7.0",
|
|
26
|
+
"vitest": "^4.1.11",
|
|
27
|
+
"@faapi/faapi": "6.4.0"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"pg-boss": "^10.0.0",
|
|
31
|
+
"@faapi/faapi": "^6.4.0"
|
|
32
|
+
},
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/faapi/faapi.git",
|
|
37
|
+
"directory": "packages/task-pgboss"
|
|
38
|
+
},
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/faapi/faapi/issues"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"faapi",
|
|
44
|
+
"task-queue",
|
|
45
|
+
"pg-boss",
|
|
46
|
+
"postgres",
|
|
47
|
+
"driver"
|
|
48
|
+
],
|
|
49
|
+
"sideEffects": false,
|
|
8
50
|
"publishConfig": {
|
|
9
|
-
"access": "public"
|
|
51
|
+
"access": "public",
|
|
52
|
+
"provenance": true
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "tsup",
|
|
56
|
+
"test": "vitest run --passWithNoTests",
|
|
57
|
+
"typecheck": "tsc --noEmit",
|
|
58
|
+
"typecheck:test": "tsc --noEmit -p tsconfig.test.json"
|
|
10
59
|
}
|
|
11
|
-
}
|
|
60
|
+
}
|