@nudojs/parser 0.3.0 → 0.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/dist/index.js +4 -3
- package/package.json +11 -4
- package/CHANGELOG.md +0 -43
- package/src/__tests__/directives-inline.test.ts +0 -95
- package/src/__tests__/directives-phase2.test.ts +0 -113
- package/src/__tests__/directives-phase3.test.ts +0 -75
- package/src/__tests__/directives.test.ts +0 -411
- package/src/__tests__/mock-directive.test.ts +0 -115
- package/src/__tests__/sinon-directive.test.ts +0 -200
- package/src/directives.ts +0 -754
- package/src/index.ts +0 -23
- package/src/parse.ts +0 -15
- package/tsconfig.json +0 -9
package/src/index.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export { parse } from "./parse.ts";
|
|
2
|
-
// stripTypes 单源在 core(parser 依赖 core,避免双份拷贝漂移)
|
|
3
|
-
export { stripTypes } from "@nudojs/core";
|
|
4
|
-
export {
|
|
5
|
-
type Directive,
|
|
6
|
-
type FileDirective,
|
|
7
|
-
type InlineDirective,
|
|
8
|
-
type AsDirective,
|
|
9
|
-
type ReplaceDirective,
|
|
10
|
-
type CaseDirective,
|
|
11
|
-
type MockDirective,
|
|
12
|
-
type PureDirective,
|
|
13
|
-
type SkipDirective,
|
|
14
|
-
type SampleDirective,
|
|
15
|
-
type EnvDirective,
|
|
16
|
-
type MockModuleDirective,
|
|
17
|
-
type FunctionWithDirectives,
|
|
18
|
-
type SinonExpression,
|
|
19
|
-
extractDirectives,
|
|
20
|
-
extractFileDirectives,
|
|
21
|
-
extractInlineDirectives,
|
|
22
|
-
parseTypeValueExpr,
|
|
23
|
-
} from "./directives.ts";
|
package/src/parse.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { parseSource } from "@nudojs/core";
|
|
2
|
-
import type { File } from "@babel/types";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* 与 core `parseSource` 同一实现与 AST LRU:
|
|
6
|
-
* 决策:parse() 统一做 TS 剥除(不按 .ts 路径开关)。理由:parse() 的产物被
|
|
7
|
-
* CLI/service/LSP/evaluator 全链消费,按调用方 opt-in 会漏掉无法感知文件扩展名
|
|
8
|
-
* 的消费方(analyzer 的模块解析、LSP 等);对纯 JS 源码剥除是结构性 no-op,
|
|
9
|
-
* 默认行为不变,因此无条件执行可让 .ts 输入在所有入口零接线生效。
|
|
10
|
-
*
|
|
11
|
-
* errorRecovery 走 core 的非缓存路径,避免污染会话 AST。
|
|
12
|
-
*/
|
|
13
|
-
export function parse(source: string, opts?: { errorRecovery?: boolean }): File {
|
|
14
|
-
return parseSource(source, opts);
|
|
15
|
-
}
|