@nudojs/service 1.0.1 → 2.0.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/{chunk-2VHITMTM.js → chunk-ADFCZP72.js} +70 -2
- package/dist/config-Cqj8zeZH.d.ts +117 -0
- package/dist/evaluator/evaluator-api.d.ts +3 -12
- package/dist/evaluator/evaluator-api.js +3 -1
- package/dist/index.d.ts +367 -16
- package/dist/index.js +1814 -228
- package/package.json +5 -5
- package/dist/config-NqDRWWpn.d.ts +0 -68
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nudojs/service",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20"
|
|
6
6
|
},
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@babel/traverse": "^7.29.0",
|
|
47
47
|
"@babel/types": "^7.29.0",
|
|
48
|
-
"@nudojs/core": "
|
|
49
|
-
"@nudojs/parser": "0.
|
|
50
|
-
"@nudojs/env": "0.
|
|
51
|
-
"@nudojs/harvester": "0.2.
|
|
48
|
+
"@nudojs/core": "2.0.0",
|
|
49
|
+
"@nudojs/parser": "0.5.0",
|
|
50
|
+
"@nudojs/env": "0.3.0",
|
|
51
|
+
"@nudojs/harvester": "0.2.5"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "tsup src/index.ts src/evaluator/evaluator-api.ts --format esm --dts"
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Abs } from '@nudojs/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 调用点记录(CallRecord)。Abs 唯一真理源。
|
|
5
|
-
* argAbs/resultAbs/throwsAbs 必填;展示/外延在 CaseResult 边界再桥。
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
type CallRecord = {
|
|
9
|
-
fnName: string;
|
|
10
|
-
/** 无损参数 Abs */
|
|
11
|
-
argAbs: Abs[];
|
|
12
|
-
/** 无损结果 Abs(threw 时为 never) */
|
|
13
|
-
resultAbs: Abs;
|
|
14
|
-
/** 无损抛出值 Abs(未抛为 never) */
|
|
15
|
-
throwsAbs: Abs;
|
|
16
|
-
/** Line-relative. Per-fn cache replay shifts this by lineDelta — if you
|
|
17
|
-
* add another position field (callee loc, arg loc), extend
|
|
18
|
-
* shiftCallRecordLines in analyzer.ts in the same change. */
|
|
19
|
-
callLoc?: {
|
|
20
|
-
line: number;
|
|
21
|
-
column: number;
|
|
22
|
-
};
|
|
23
|
-
targetModule?: string;
|
|
24
|
-
targetExport?: string;
|
|
25
|
-
/** export names the same function value was re-exported under after its
|
|
26
|
-
* defining module (barrel `index.js`, CJS forwarding shims); usage-site
|
|
27
|
-
* records stay name-matchable against them */
|
|
28
|
-
targetAliases?: string[];
|
|
29
|
-
/** module whose evaluation created the function value (definition site). */
|
|
30
|
-
fnModule?: string;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
type NudoConfig = {
|
|
34
|
-
env?: string[];
|
|
35
|
-
mocks?: Record<string, string>;
|
|
36
|
-
interface?: {
|
|
37
|
-
/** 侧车 ambient 绑定总开关(check/LSP 执法与 interface 打印共用) */
|
|
38
|
-
autoBind?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* emit 白名单(Phase 3,§7.3):glob 数组,相对 projectDir。
|
|
41
|
-
* 省略/空 = 不按路径过滤(仍受 --fn/--all 与「默认只刷已有生成段」约束)。
|
|
42
|
-
*/
|
|
43
|
-
emit?: string[] | string;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
type InterfaceConfig = {
|
|
47
|
-
autoBind: boolean;
|
|
48
|
-
/** emit 路径白名单(已归一化;空数组 = 不限制) */
|
|
49
|
-
emit: string[];
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* 归一化 `nudo.interface` 配置段。
|
|
53
|
-
* - autoBind 默认 true
|
|
54
|
-
* - emit:string | string[] → string[](空 = 不限制路径)
|
|
55
|
-
*/
|
|
56
|
-
declare function interfaceConfig(config: NudoConfig | null | undefined): InterfaceConfig;
|
|
57
|
-
/**
|
|
58
|
-
* 极简 glob(`**` / `*` / `?`):相对 projectDir 匹配**源文件**绝对路径
|
|
59
|
-
* (不是侧车路径;侧车随源文件同目录写出)。无白名单 → true。
|
|
60
|
-
* 路径分隔符归一为 `/`。
|
|
61
|
-
*/
|
|
62
|
-
declare function matchesEmitAllowlist(absPath: string, projectDir: string | undefined, patterns: string[]): boolean;
|
|
63
|
-
declare function findProjectConfig(startDir: string): {
|
|
64
|
-
config: NudoConfig;
|
|
65
|
-
projectDir: string;
|
|
66
|
-
} | null;
|
|
67
|
-
|
|
68
|
-
export { type CallRecord as C, type InterfaceConfig as I, type NudoConfig as N, findProjectConfig as f, interfaceConfig as i, matchesEmitAllowlist as m };
|