@weapp-vite/ast 7.5.0 → 7.7.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/babel.d.mts +1 -2
- package/dist/babel.mjs +1 -2
- package/dist/babelCore.d.mts +0 -2
- package/dist/babelCore.mjs +1 -2
- package/dist/babelLoader.d.mts +2 -0
- package/dist/babelLoader.mjs +32 -0
- package/dist/babelNodes.d.mts +1 -3
- package/dist/babelNodes.mjs +1 -2
- package/dist/{engine-CBE2OpFp.mjs → engine-DNS4Kzzw.mjs} +3 -6
- package/dist/engine.d.mts +2 -4
- package/dist/engine.mjs +1 -1
- package/dist/index.d.mts +70 -13
- package/dist/index.mjs +70 -29
- package/dist/native-D8RHiEuF.mjs +358 -0
- package/dist/{onPageScroll-n3Vptu1_.d.mts → onPageScroll-9kwtAWzG.d.mts} +1 -11
- package/dist/{onPageScroll-tuvgNooK.mjs → onPageScroll-CN_ocv9l.mjs} +6 -10
- package/dist/operations/componentProps.d.mts +2 -4
- package/dist/operations/componentProps.mjs +2 -3
- package/dist/operations/featureFlags.d.mts +2 -4
- package/dist/operations/featureFlags.mjs +3 -4
- package/dist/operations/jsxAutoComponents.d.mts +2 -12
- package/dist/operations/jsxAutoComponents.mjs +4 -8
- package/dist/operations/onPageScroll.d.mts +1 -1
- package/dist/operations/onPageScroll.mjs +1 -1
- package/dist/operations/platformApi.d.mts +2 -4
- package/dist/operations/platformApi.mjs +3 -4
- package/dist/operations/require.d.mts +2 -4
- package/dist/operations/require.mjs +3 -4
- package/dist/operations/scriptSetupImports.d.mts +2 -4
- package/dist/operations/scriptSetupImports.mjs +2 -3
- package/dist/operations/setDataPick.d.mts +2 -4
- package/dist/operations/setDataPick.mjs +2 -3
- package/dist/{types-4qG2Ubmk.d.mts → types-urOiI-JL.d.mts} +0 -2
- package/dist/types.d.mts +1 -1
- package/package.json +18 -8
- package/dist/native-C-xcrMBn.mjs +0 -54
package/dist/babel.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
2
|
import { ParserOptions, ParserPlugin } from "@babel/parser";
|
|
3
|
-
//#region src/babel.d.ts
|
|
4
3
|
export declare const BABEL_TS_MODULE_PLUGINS: ParserPlugin[];
|
|
5
4
|
export declare const BABEL_TS_MODULE_PARSER_OPTIONS: ParserOptions;
|
|
6
5
|
type BabelTraverse = typeof import('@babel/traverse').default;
|
|
@@ -16,4 +15,4 @@ export declare const generate: GenerateFn;
|
|
|
16
15
|
export declare const parse: BabelParse;
|
|
17
16
|
export declare function getVisitorKeys(): typeof import('@babel/types').VISITOR_KEYS;
|
|
18
17
|
export declare function parseJsLike(source: string): t.File;
|
|
19
|
-
|
|
18
|
+
export {};
|
package/dist/babel.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
|
|
2
|
+
// src/babel.ts
|
|
3
3
|
const BABEL_TS_MODULE_PLUGINS = [
|
|
4
4
|
"typescript",
|
|
5
5
|
"decorators-legacy",
|
|
@@ -52,5 +52,4 @@ function parseJsLike(source) {
|
|
|
52
52
|
plugins: [...BABEL_TS_MODULE_PLUGINS]
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
//#endregion
|
|
56
55
|
export { BABEL_TS_MODULE_PARSER_OPTIONS, BABEL_TS_MODULE_PLUGINS, generate, getVisitorKeys, parse, parseJsLike, traverse };
|
package/dist/babelCore.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as BabelCore from "@babel/core";
|
|
2
2
|
import { InputOptions as TransformOptions, NodePath } from "@babel/core";
|
|
3
|
-
//#region src/babelCore.d.ts
|
|
4
3
|
declare const babelCore: typeof BabelCore;
|
|
5
4
|
export declare const parse: {
|
|
6
5
|
(code: string, callback: {
|
|
@@ -30,5 +29,4 @@ export declare const parse: {
|
|
|
30
29
|
(err: null, file: BabelCore.FileResult | null): void;
|
|
31
30
|
}): void;
|
|
32
31
|
}, transformFromAstAsync: typeof BabelCore.transformFromAstAsync, transformFromAstSync: typeof BabelCore.transformFromAstSync, transformSync: typeof BabelCore.transformSync, types: typeof BabelCore.types, version: string;
|
|
33
|
-
//#endregion
|
|
34
32
|
export { type NodePath, type TransformOptions, babelCore as default };
|
package/dist/babelCore.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
|
|
2
|
+
// src/babelCore.ts
|
|
3
3
|
const babelCore = createRequire(import.meta.url)("@babel/core");
|
|
4
4
|
const { parse, parseAsync, parseSync, transform, transformAsync, transformFile, transformFileAsync, transformFileSync, transformFromAst, transformFromAstAsync, transformFromAstSync, transformSync, types, version } = babelCore;
|
|
5
|
-
//#endregion
|
|
6
5
|
export { babelCore as default, parse, parseAsync, parseSync, transform, transformAsync, transformFile, transformFileAsync, transformFileSync, transformFromAst, transformFromAstAsync, transformFromAstSync, transformSync, types, version };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
// src/babelLoader.ts
|
|
3
|
+
const nodeRequire = createRequire(import.meta.url);
|
|
4
|
+
let babelPrimed = false;
|
|
5
|
+
function primeBabelDependencies() {
|
|
6
|
+
if (babelPrimed) return;
|
|
7
|
+
nodeRequire("@babel/core");
|
|
8
|
+
nodeRequire("@babel/parser");
|
|
9
|
+
nodeRequire("@babel/generator");
|
|
10
|
+
nodeRequire("@babel/traverse");
|
|
11
|
+
nodeRequire("@babel/types");
|
|
12
|
+
babelPrimed = true;
|
|
13
|
+
}
|
|
14
|
+
/** 创建按需加载的 Babel 后端入口,在首次异步导入前完成同步 AST 依赖初始化。 */
|
|
15
|
+
function createBabelBackendLoader(importer) {
|
|
16
|
+
let pending;
|
|
17
|
+
return () => {
|
|
18
|
+
if (pending) return pending;
|
|
19
|
+
try {
|
|
20
|
+
primeBabelDependencies();
|
|
21
|
+
} catch (error) {
|
|
22
|
+
return Promise.reject(error);
|
|
23
|
+
}
|
|
24
|
+
const loading = Promise.resolve().then(importer);
|
|
25
|
+
pending = loading;
|
|
26
|
+
loading.catch(() => {
|
|
27
|
+
if (pending === loading) pending = void 0;
|
|
28
|
+
});
|
|
29
|
+
return loading;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export { createBabelBackendLoader };
|
package/dist/babelNodes.d.mts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
2
|
import { Expression, ObjectExpression, ObjectMethod, ObjectProperty, PrivateName } from "@babel/types";
|
|
3
|
-
//#region src/babelNodes.d.ts
|
|
4
3
|
export declare function unwrapTypeScriptExpression(exp: Expression): Expression;
|
|
5
4
|
export declare function toStaticObjectKey(key: Expression | PrivateName | t.Identifier): string | null;
|
|
6
5
|
export declare function getObjectPropertyByKey(node: ObjectExpression, key: string): ObjectMethod | t.ObjectPropertyNonComputed | null;
|
|
7
6
|
export declare function getRenderPropertyFromComponentOptions(componentExpr: Expression): ObjectMethod | t.ObjectPropertyNonComputed | null;
|
|
8
7
|
export declare function resolveRenderableExpression(node: ObjectMethod | ObjectProperty): Expression | null;
|
|
9
|
-
export declare function resolveRenderExpressionFromComponentOptions(componentExpr: Expression): Expression | null;
|
|
10
|
-
//#endregion
|
|
8
|
+
export declare function resolveRenderExpressionFromComponentOptions(componentExpr: Expression): Expression | null;
|
package/dist/babelNodes.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
|
-
|
|
2
|
+
// src/babelNodes.ts
|
|
3
3
|
function unwrapTypeScriptExpression(exp) {
|
|
4
4
|
let current = exp;
|
|
5
5
|
while (t.isTSAsExpression(current) || t.isTSTypeAssertion(current) || t.isTSNonNullExpression(current) || t.isParenthesizedExpression(current) || t.isTSInstantiationExpression(current)) {
|
|
@@ -62,5 +62,4 @@ function resolveRenderExpressionFromComponentOptions(componentExpr) {
|
|
|
62
62
|
if (!renderNode) return null;
|
|
63
63
|
return resolveRenderableExpression(renderNode);
|
|
64
64
|
}
|
|
65
|
-
//#endregion
|
|
66
65
|
export { getObjectPropertyByKey, getRenderPropertyFromComponentOptions, resolveRenderExpressionFromComponentOptions, resolveRenderableExpression, toStaticObjectKey, unwrapTypeScriptExpression };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseJsLike } from "./babel.mjs";
|
|
2
2
|
import { parseSync } from "oxc-parser";
|
|
3
|
-
|
|
3
|
+
// src/engines/babel.ts
|
|
4
4
|
/**
|
|
5
5
|
* Babel AST 引擎。
|
|
6
6
|
*/
|
|
@@ -10,8 +10,7 @@ const babelAstEngine = {
|
|
|
10
10
|
return parseJsLike(code);
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
//#region src/engines/oxc.ts
|
|
13
|
+
// src/engines/oxc.ts
|
|
15
14
|
/**
|
|
16
15
|
* Oxc AST 引擎。
|
|
17
16
|
*/
|
|
@@ -21,8 +20,7 @@ const oxcAstEngine = {
|
|
|
21
20
|
return parseSync(filename, code).program;
|
|
22
21
|
}
|
|
23
22
|
};
|
|
24
|
-
|
|
25
|
-
//#region src/engine.ts
|
|
23
|
+
// src/engine.ts
|
|
26
24
|
/**
|
|
27
25
|
* 统一解析 JS-like 源码,供 analysis 型 operation 复用。
|
|
28
26
|
*/
|
|
@@ -33,5 +31,4 @@ function parseJsLikeWithEngine(code, options) {
|
|
|
33
31
|
}
|
|
34
32
|
return babelAstEngine.parseJsLike(code);
|
|
35
33
|
}
|
|
36
|
-
//#endregion
|
|
37
34
|
export { oxcAstEngine as n, babelAstEngine as r, parseJsLikeWithEngine as t };
|
package/dist/engine.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { n as AstParserLike, t as AstEngineName } from "./types-
|
|
2
|
-
//#region src/engine.d.ts
|
|
1
|
+
import { n as AstParserLike, t as AstEngineName } from "./types-urOiI-JL.mjs";
|
|
3
2
|
/**
|
|
4
3
|
* 统一解析 JS-like 源码,供 analysis 型 operation 复用。
|
|
5
4
|
*/
|
|
@@ -7,5 +6,4 @@ export declare function parseJsLikeWithEngine(code: string, options?: {
|
|
|
7
6
|
engine?: AstEngineName;
|
|
8
7
|
filename?: string;
|
|
9
8
|
parserLike?: AstParserLike;
|
|
10
|
-
}): unknown;
|
|
11
|
-
//#endregion
|
|
9
|
+
}): unknown;
|
package/dist/engine.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as parseJsLikeWithEngine } from "./engine-
|
|
1
|
+
export { t as parseJsLikeWithEngine } from "./engine-DNS4Kzzw.mjs";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { BABEL_TS_MODULE_PARSER_OPTIONS, BABEL_TS_MODULE_PLUGINS, generate, getVisitorKeys, parse, parseJsLike, traverse } from "./babel.mjs";
|
|
2
2
|
import { getObjectPropertyByKey, getRenderPropertyFromComponentOptions, resolveRenderExpressionFromComponentOptions, resolveRenderableExpression, toStaticObjectKey, unwrapTypeScriptExpression } from "./babelNodes.mjs";
|
|
3
|
-
import { n as AstParserLike, r as WeappAstConfig, t as AstEngineName } from "./types-
|
|
3
|
+
import { n as AstParserLike, r as WeappAstConfig, t as AstEngineName } from "./types-urOiI-JL.mjs";
|
|
4
4
|
import { parseJsLikeWithEngine } from "./engine.mjs";
|
|
5
5
|
import { ComponentPropMap, collectComponentPropsFromCode, collectComponentPropsWithBabel, collectComponentPropsWithOxc, extractComponentProperties, extractPropertiesObject, getStaticPropertyName, mapConstructorName, mayContainComponentPropsShape, mergeComponentPropTypes, resolveOptionsObjectExpression, resolveOptionsObjectExpressionWithBabel, resolveTypeFromNode } from "./operations/componentProps.mjs";
|
|
6
6
|
import { FeatureFlagOptions, collectFeatureFlagsFromCode, collectFeatureFlagsWithBabel, collectFeatureFlagsWithNative, collectFeatureFlagsWithNativeBatch, collectFeatureFlagsWithOxc, consumeNamedFeatureFlag, consumeNamespaceFeatureFlag, mayContainFeatureFlagHints, registerNamedFeatureFlagLocal, registerNamespaceFeatureFlagLocal } from "./operations/featureFlags.mjs";
|
|
7
7
|
import { JsxAutoComponentAnalysisOptions, JsxAutoComponentContext, JsxBabelModuleAnalysisOptions, JsxImportedComponent, collectJsxAutoComponentsFromCode, collectJsxAutoComponentsWithBabel, collectJsxAutoComponentsWithOxc, collectJsxImportedComponentsAndDefaultExportFromBabelAst, collectJsxTemplateTagsFromBabelExpression, collectJsxTemplateTagsFromOxc, createJsxImportedComponent, defaultIsDefineComponentSource, defaultResolveBabelComponentExpression, defaultResolveBabelRenderExpression, getJsxImportLocalName, getJsxImportedName, getJsxOxcStaticPropertyName, isJsxDefineComponentImportSpecifier, mayContainJsxAutoComponentEntry, resolveOxcComponentExpression, resolveOxcRenderExpression, unwrapOxcExpression } from "./operations/jsxAutoComponents.mjs";
|
|
8
|
-
import { _ as collectPageScrollInspectionWithOxc, a as getCallExpressionCalleeName, c as getOnPageScrollCallbackArgument, d as getOxcStaticPropertyName, f as isOnPageScrollCallee, g as collectOnPageScrollWarningsWithOxc, h as isStaticPropertyName, i as createWarningPrefix, l as getOxcCallExpressionCalleeName, m as isOxcOnPageScrollCallee, n as collectOnPageScrollWarningsWithNative, o as getLocationFromOffset, p as isOxcFunctionLike, r as createLineStartOffsets, s as getMemberExpressionPropertyName, t as collectOnPageScrollPerformanceWarnings, u as getOxcMemberExpressionPropertyName, v as collectOnPageScrollWarningsWithBabel, y as collectPageScrollInspection } from "./onPageScroll-
|
|
8
|
+
import { _ as collectPageScrollInspectionWithOxc, a as getCallExpressionCalleeName, c as getOnPageScrollCallbackArgument, d as getOxcStaticPropertyName, f as isOnPageScrollCallee, g as collectOnPageScrollWarningsWithOxc, h as isStaticPropertyName, i as createWarningPrefix, l as getOxcCallExpressionCalleeName, m as isOxcOnPageScrollCallee, n as collectOnPageScrollWarningsWithNative, o as getLocationFromOffset, p as isOxcFunctionLike, r as createLineStartOffsets, s as getMemberExpressionPropertyName, t as collectOnPageScrollPerformanceWarnings, u as getOxcMemberExpressionPropertyName, v as collectOnPageScrollWarningsWithBabel, y as collectPageScrollInspection } from "./onPageScroll-9kwtAWzG.mjs";
|
|
9
9
|
import { hasPlatformApiMemberExpression, isPlatformApiIdentifier, isPlatformApiMemberExpression, mayContainPlatformApiAccess, mayContainPlatformApiIdentifierByText, platformApiIdentifierList, platformApiIdentifiers } from "./operations/platformApi.mjs";
|
|
10
10
|
import { DynamicImportToken, RequireCallbackToken, RequireToken, collectRequireTokens, getDynamicImportLiteralToken, getRequireAsyncLiteralToken, getRequireCallbackLiteralToken, getStaticRequireLiteralValue, hasStaticRequireCall, isStaticRequireCall, mayContainRequireCallByText, mayContainStaticRequireLiteral } from "./operations/require.mjs";
|
|
11
11
|
import { ScriptSetupImport, collectScriptSetupImportsFromCode, collectScriptSetupImportsWithBabel, collectScriptSetupImportsWithOxc, createScriptSetupImport, getScriptSetupImportedName, mayContainRelevantScriptSetupImports } from "./operations/scriptSetupImports.mjs";
|
|
12
12
|
import { collectIdentifiersFromExpression, collectIdentifiersFromExpressionWithOxc, collectLoopScopeAliases, collectPatternBindingNames, collectSetDataPickKeysFromTemplateCode, collectSetDataPickKeysWithBabel, collectSetDataPickKeysWithOxc, extractTemplateExpressions, hasBindingInScopes } from "./operations/setDataPick.mjs";
|
|
13
|
-
//#region src/engines/babel.d.ts
|
|
14
13
|
/**
|
|
15
14
|
* Babel AST 引擎。
|
|
16
15
|
*/
|
|
@@ -18,8 +17,6 @@ export declare const babelAstEngine: {
|
|
|
18
17
|
name: "babel";
|
|
19
18
|
parseJsLike(code: string): import("@babel/types").File;
|
|
20
19
|
};
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/engines/oxc.d.ts
|
|
23
20
|
/**
|
|
24
21
|
* Oxc AST 引擎。
|
|
25
22
|
*/
|
|
@@ -27,8 +24,71 @@ export declare const oxcAstEngine: {
|
|
|
27
24
|
name: "oxc";
|
|
28
25
|
parseJsLike(code: string, filename?: string): import("oxc-parser").Program;
|
|
29
26
|
};
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
interface NativeNpmChunkAnalysisInput {
|
|
28
|
+
code: string;
|
|
29
|
+
filename?: string;
|
|
30
|
+
}
|
|
31
|
+
interface NativeNpmRequireFact {
|
|
32
|
+
start: number;
|
|
33
|
+
end: number;
|
|
34
|
+
importee: string;
|
|
35
|
+
}
|
|
36
|
+
interface NativeNpmPlatformApiFact {
|
|
37
|
+
start: number;
|
|
38
|
+
end: number;
|
|
39
|
+
}
|
|
40
|
+
interface NativeNpmLocalRootFact {
|
|
41
|
+
kind: 'alias' | 'require' | 'interop';
|
|
42
|
+
requireIndex?: number;
|
|
43
|
+
bindingName?: string;
|
|
44
|
+
referenceName?: string;
|
|
45
|
+
importee?: string;
|
|
46
|
+
secondArgumentStart?: number;
|
|
47
|
+
secondArgumentEnd?: number;
|
|
48
|
+
}
|
|
49
|
+
interface NativeNpmChunkAnalysis {
|
|
50
|
+
requires: NativeNpmRequireFact[];
|
|
51
|
+
platformApiRanges: NativeNpmPlatformApiFact[];
|
|
52
|
+
localRootFacts: NativeNpmLocalRootFact[];
|
|
53
|
+
}
|
|
54
|
+
interface NativeCompilerScriptInput {
|
|
55
|
+
code: string;
|
|
56
|
+
filename?: string;
|
|
57
|
+
}
|
|
58
|
+
interface NativeCompilerScriptImport {
|
|
59
|
+
local: string;
|
|
60
|
+
imported?: string;
|
|
61
|
+
source: string;
|
|
62
|
+
kind: 'default' | 'namespace' | 'named';
|
|
63
|
+
typeOnly: boolean;
|
|
64
|
+
}
|
|
65
|
+
interface NativeCompilerRegisteredComponent {
|
|
66
|
+
name: string;
|
|
67
|
+
local: string;
|
|
68
|
+
}
|
|
69
|
+
interface NativeCompilerScriptSpan {
|
|
70
|
+
start: number;
|
|
71
|
+
end: number;
|
|
72
|
+
}
|
|
73
|
+
interface NativeCompilerScriptAnalysis {
|
|
74
|
+
imports: NativeCompilerScriptImport[];
|
|
75
|
+
/** 旧 binding 缺失该事实时,由编译阶段执行原有默认导出检查。 */
|
|
76
|
+
hasDefaultExport?: boolean;
|
|
77
|
+
defineOptionsStatements: NativeCompilerScriptSpan[];
|
|
78
|
+
registeredComponents?: NativeCompilerRegisteredComponent[];
|
|
79
|
+
/** 缺失表示旧 binding 或需由 Babel 完成诊断;空对象表示已确认无警告。 */
|
|
80
|
+
reservedPropsDiagnostic?: {
|
|
81
|
+
warningOffset?: number;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 编译器前端批量摘要的显式 native 快速路径;失败时由调用方继续使用 Babel/Oxc。
|
|
86
|
+
*/
|
|
87
|
+
export declare function analyzeCompilerScriptsWithNative(inputs: NativeCompilerScriptInput[]): (NativeCompilerScriptAnalysis | null)[] | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* 批量读取最终 chunk 的重写事实;默认关闭,任何批次或单项校验失败都交回 JS。
|
|
90
|
+
*/
|
|
91
|
+
export declare function analyzeNpmChunksWithNative(inputs: NativeNpmChunkAnalysisInput[]): (NativeNpmChunkAnalysis | null)[] | undefined;
|
|
32
92
|
interface ScriptAnalysisOptions<TFeature extends string = string> {
|
|
33
93
|
engine?: AstEngineName;
|
|
34
94
|
parserLike?: AstParserLike;
|
|
@@ -45,15 +105,13 @@ interface ScriptAnalysisBatchInput<TFeature extends string = string> {
|
|
|
45
105
|
featureFlags?: FeatureFlagOptions<TFeature>;
|
|
46
106
|
}
|
|
47
107
|
/**
|
|
48
|
-
*
|
|
108
|
+
* 同一份脚本只尝试一次 native;失败后显式选择完整的 JS fallback 服务。
|
|
49
109
|
*/
|
|
50
110
|
export declare function analyzeScript<TFeature extends string = string>(code: string, options?: ScriptAnalysisOptions<TFeature>): ScriptAnalysisResult<TFeature>;
|
|
51
111
|
/**
|
|
52
|
-
*
|
|
112
|
+
* 批次只跨 native 边界一次,失败项各自执行一次完整 JS fallback。
|
|
53
113
|
*/
|
|
54
114
|
export declare function analyzeScripts<TFeature extends string = string>(inputs: ScriptAnalysisBatchInput<TFeature>[], options?: ScriptAnalysisOptions<TFeature>): Array<ScriptAnalysisResult<TFeature>>;
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/operations/scriptLiterals.d.ts
|
|
57
115
|
/**
|
|
58
116
|
* 收集脚本中的字符串字面量源码片段,供上层语义按需筛选。
|
|
59
117
|
*/
|
|
@@ -66,5 +124,4 @@ export declare function collectScriptCallStringLiterals(code: string): string[];
|
|
|
66
124
|
* 快速判断脚本是否包含调用或模块语法,避免上层无条件扩大候选集。
|
|
67
125
|
*/
|
|
68
126
|
export declare function mayContainScriptCallOrModuleSyntax(code: string): boolean;
|
|
69
|
-
|
|
70
|
-
export { type AstEngineName, type AstParserLike, BABEL_TS_MODULE_PARSER_OPTIONS, BABEL_TS_MODULE_PLUGINS, type ComponentPropMap, type DynamicImportToken, type FeatureFlagOptions, type JsxAutoComponentAnalysisOptions, type JsxAutoComponentContext, type JsxBabelModuleAnalysisOptions, type JsxImportedComponent, type RequireCallbackToken, type RequireToken, type ScriptAnalysisBatchInput, type ScriptAnalysisOptions, type ScriptAnalysisResult, type ScriptSetupImport, type WeappAstConfig, collectComponentPropsFromCode, collectComponentPropsWithBabel, collectComponentPropsWithOxc, collectFeatureFlagsFromCode, collectFeatureFlagsWithBabel, collectFeatureFlagsWithNative, collectFeatureFlagsWithNativeBatch, collectFeatureFlagsWithOxc, collectIdentifiersFromExpression, collectIdentifiersFromExpressionWithOxc, collectJsxAutoComponentsFromCode, collectJsxAutoComponentsWithBabel, collectJsxAutoComponentsWithOxc, collectJsxImportedComponentsAndDefaultExportFromBabelAst, collectJsxTemplateTagsFromBabelExpression, collectJsxTemplateTagsFromOxc, collectLoopScopeAliases, collectOnPageScrollPerformanceWarnings, collectOnPageScrollWarningsWithBabel, collectOnPageScrollWarningsWithNative, collectOnPageScrollWarningsWithOxc, collectPageScrollInspection, collectPageScrollInspectionWithOxc, collectPatternBindingNames, collectRequireTokens, collectScriptSetupImportsFromCode, collectScriptSetupImportsWithBabel, collectScriptSetupImportsWithOxc, collectSetDataPickKeysFromTemplateCode, collectSetDataPickKeysWithBabel, collectSetDataPickKeysWithOxc, consumeNamedFeatureFlag, consumeNamespaceFeatureFlag, createJsxImportedComponent, createLineStartOffsets, createScriptSetupImport, createWarningPrefix, defaultIsDefineComponentSource, defaultResolveBabelComponentExpression, defaultResolveBabelRenderExpression, extractComponentProperties, extractPropertiesObject, extractTemplateExpressions, generate, getCallExpressionCalleeName, getDynamicImportLiteralToken, getJsxImportLocalName, getJsxImportedName, getJsxOxcStaticPropertyName, getLocationFromOffset, getMemberExpressionPropertyName, getObjectPropertyByKey, getOnPageScrollCallbackArgument, getOxcCallExpressionCalleeName, getOxcMemberExpressionPropertyName, getOxcStaticPropertyName, getRenderPropertyFromComponentOptions, getRequireAsyncLiteralToken, getRequireCallbackLiteralToken, getScriptSetupImportedName, getStaticPropertyName, getStaticRequireLiteralValue, getVisitorKeys, hasBindingInScopes, hasPlatformApiMemberExpression, hasStaticRequireCall, isJsxDefineComponentImportSpecifier, isOnPageScrollCallee, isOxcFunctionLike, isOxcOnPageScrollCallee, isPlatformApiIdentifier, isPlatformApiMemberExpression, isStaticPropertyName, isStaticRequireCall, mapConstructorName, mayContainComponentPropsShape, mayContainFeatureFlagHints, mayContainJsxAutoComponentEntry, mayContainPlatformApiAccess, mayContainPlatformApiIdentifierByText, mayContainRelevantScriptSetupImports, mayContainRequireCallByText, mayContainStaticRequireLiteral, mergeComponentPropTypes, parse, parseJsLike, parseJsLikeWithEngine, platformApiIdentifierList, platformApiIdentifiers, registerNamedFeatureFlagLocal, registerNamespaceFeatureFlagLocal, resolveOptionsObjectExpression, resolveOptionsObjectExpressionWithBabel, resolveOxcComponentExpression, resolveOxcRenderExpression, resolveRenderExpressionFromComponentOptions, resolveRenderableExpression, resolveTypeFromNode, toStaticObjectKey, traverse, unwrapOxcExpression, unwrapTypeScriptExpression };
|
|
127
|
+
export { type AstEngineName, type AstParserLike, BABEL_TS_MODULE_PARSER_OPTIONS, BABEL_TS_MODULE_PLUGINS, type ComponentPropMap, type DynamicImportToken, type FeatureFlagOptions, type JsxAutoComponentAnalysisOptions, type JsxAutoComponentContext, type JsxBabelModuleAnalysisOptions, type JsxImportedComponent, type NativeCompilerRegisteredComponent, type NativeCompilerScriptAnalysis, type NativeCompilerScriptImport, type NativeCompilerScriptInput, type NativeCompilerScriptSpan, type NativeNpmChunkAnalysis, type NativeNpmChunkAnalysisInput, type NativeNpmLocalRootFact, type NativeNpmPlatformApiFact, type NativeNpmRequireFact, type RequireCallbackToken, type RequireToken, type ScriptAnalysisBatchInput, type ScriptAnalysisOptions, type ScriptAnalysisResult, type ScriptSetupImport, type WeappAstConfig, collectComponentPropsFromCode, collectComponentPropsWithBabel, collectComponentPropsWithOxc, collectFeatureFlagsFromCode, collectFeatureFlagsWithBabel, collectFeatureFlagsWithNative, collectFeatureFlagsWithNativeBatch, collectFeatureFlagsWithOxc, collectIdentifiersFromExpression, collectIdentifiersFromExpressionWithOxc, collectJsxAutoComponentsFromCode, collectJsxAutoComponentsWithBabel, collectJsxAutoComponentsWithOxc, collectJsxImportedComponentsAndDefaultExportFromBabelAst, collectJsxTemplateTagsFromBabelExpression, collectJsxTemplateTagsFromOxc, collectLoopScopeAliases, collectOnPageScrollPerformanceWarnings, collectOnPageScrollWarningsWithBabel, collectOnPageScrollWarningsWithNative, collectOnPageScrollWarningsWithOxc, collectPageScrollInspection, collectPageScrollInspectionWithOxc, collectPatternBindingNames, collectRequireTokens, collectScriptSetupImportsFromCode, collectScriptSetupImportsWithBabel, collectScriptSetupImportsWithOxc, collectSetDataPickKeysFromTemplateCode, collectSetDataPickKeysWithBabel, collectSetDataPickKeysWithOxc, consumeNamedFeatureFlag, consumeNamespaceFeatureFlag, createJsxImportedComponent, createLineStartOffsets, createScriptSetupImport, createWarningPrefix, defaultIsDefineComponentSource, defaultResolveBabelComponentExpression, defaultResolveBabelRenderExpression, extractComponentProperties, extractPropertiesObject, extractTemplateExpressions, generate, getCallExpressionCalleeName, getDynamicImportLiteralToken, getJsxImportLocalName, getJsxImportedName, getJsxOxcStaticPropertyName, getLocationFromOffset, getMemberExpressionPropertyName, getObjectPropertyByKey, getOnPageScrollCallbackArgument, getOxcCallExpressionCalleeName, getOxcMemberExpressionPropertyName, getOxcStaticPropertyName, getRenderPropertyFromComponentOptions, getRequireAsyncLiteralToken, getRequireCallbackLiteralToken, getScriptSetupImportedName, getStaticPropertyName, getStaticRequireLiteralValue, getVisitorKeys, hasBindingInScopes, hasPlatformApiMemberExpression, hasStaticRequireCall, isJsxDefineComponentImportSpecifier, isOnPageScrollCallee, isOxcFunctionLike, isOxcOnPageScrollCallee, isPlatformApiIdentifier, isPlatformApiMemberExpression, isStaticPropertyName, isStaticRequireCall, mapConstructorName, mayContainComponentPropsShape, mayContainFeatureFlagHints, mayContainJsxAutoComponentEntry, mayContainPlatformApiAccess, mayContainPlatformApiIdentifierByText, mayContainRelevantScriptSetupImports, mayContainRequireCallByText, mayContainStaticRequireLiteral, mergeComponentPropTypes, parse, parseJsLike, parseJsLikeWithEngine, platformApiIdentifierList, platformApiIdentifiers, registerNamedFeatureFlagLocal, registerNamespaceFeatureFlagLocal, resolveOptionsObjectExpression, resolveOptionsObjectExpressionWithBabel, resolveOxcComponentExpression, resolveOxcRenderExpression, resolveRenderExpressionFromComponentOptions, resolveRenderableExpression, resolveTypeFromNode, toStaticObjectKey, traverse, unwrapOxcExpression, unwrapTypeScriptExpression };
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,51 @@
|
|
|
1
1
|
import { BABEL_TS_MODULE_PARSER_OPTIONS, BABEL_TS_MODULE_PLUGINS, generate, getVisitorKeys, parse, parseJsLike, traverse } from "./babel.mjs";
|
|
2
2
|
import { getObjectPropertyByKey, getRenderPropertyFromComponentOptions, resolveRenderExpressionFromComponentOptions, resolveRenderableExpression, toStaticObjectKey, unwrapTypeScriptExpression } from "./babelNodes.mjs";
|
|
3
|
-
import { n as oxcAstEngine, r as babelAstEngine, t as parseJsLikeWithEngine } from "./engine-
|
|
3
|
+
import { n as oxcAstEngine, r as babelAstEngine, t as parseJsLikeWithEngine } from "./engine-DNS4Kzzw.mjs";
|
|
4
|
+
import { i as analyzeScriptsWithNative, n as analyzeNpmChunksWithNative, o as shouldUseNativeAst, r as analyzeScriptWithNative, t as analyzeCompilerScriptsWithNative } from "./native-D8RHiEuF.mjs";
|
|
4
5
|
import { collectComponentPropsFromCode, collectComponentPropsWithBabel, collectComponentPropsWithOxc, extractComponentProperties, extractPropertiesObject, getStaticPropertyName, mapConstructorName, mayContainComponentPropsShape, mergeComponentPropTypes, resolveOptionsObjectExpression, resolveOptionsObjectExpressionWithBabel, resolveTypeFromNode } from "./operations/componentProps.mjs";
|
|
5
|
-
import { i as shouldUseNativeAst, n as analyzeScriptsWithNative, t as analyzeScriptWithNative } from "./native-C-xcrMBn.mjs";
|
|
6
6
|
import { collectFeatureFlagsFromCode, collectFeatureFlagsWithBabel, collectFeatureFlagsWithNative, collectFeatureFlagsWithNativeBatch, collectFeatureFlagsWithOxc, consumeNamedFeatureFlag, consumeNamespaceFeatureFlag, mayContainFeatureFlagHints, registerNamedFeatureFlagLocal, registerNamespaceFeatureFlagLocal } from "./operations/featureFlags.mjs";
|
|
7
7
|
import { collectJsxAutoComponentsFromCode, collectJsxAutoComponentsWithBabel, collectJsxAutoComponentsWithOxc, collectJsxImportedComponentsAndDefaultExportFromBabelAst, collectJsxTemplateTagsFromBabelExpression, collectJsxTemplateTagsFromOxc, createJsxImportedComponent, defaultIsDefineComponentSource, defaultResolveBabelComponentExpression, defaultResolveBabelRenderExpression, getJsxImportLocalName, getJsxImportedName, getJsxOxcStaticPropertyName, isJsxDefineComponentImportSpecifier, mayContainJsxAutoComponentEntry, resolveOxcComponentExpression, resolveOxcRenderExpression, unwrapOxcExpression } from "./operations/jsxAutoComponents.mjs";
|
|
8
|
-
import { _ as isOxcFunctionLike, a as collectOnPageScrollWarningsWithBabel, c as createWarningPrefix, d as getMemberExpressionPropertyName, f as getOnPageScrollCallbackArgument, g as isOnPageScrollCallee, h as getOxcStaticPropertyName, i as collectPageScrollInspectionWithOxc, l as getCallExpressionCalleeName, m as getOxcMemberExpressionPropertyName, n as collectOnPageScrollWarningsWithNative, o as collectPageScrollInspection, p as getOxcCallExpressionCalleeName, r as collectOnPageScrollWarningsWithOxc, s as createLineStartOffsets, t as collectOnPageScrollPerformanceWarnings, u as getLocationFromOffset, v as isOxcOnPageScrollCallee, y as isStaticPropertyName } from "./onPageScroll-
|
|
8
|
+
import { _ as isOxcFunctionLike, a as collectOnPageScrollWarningsWithBabel, c as createWarningPrefix, d as getMemberExpressionPropertyName, f as getOnPageScrollCallbackArgument, g as isOnPageScrollCallee, h as getOxcStaticPropertyName, i as collectPageScrollInspectionWithOxc, l as getCallExpressionCalleeName, m as getOxcMemberExpressionPropertyName, n as collectOnPageScrollWarningsWithNative, o as collectPageScrollInspection, p as getOxcCallExpressionCalleeName, r as collectOnPageScrollWarningsWithOxc, s as createLineStartOffsets, t as collectOnPageScrollPerformanceWarnings, u as getLocationFromOffset, v as isOxcOnPageScrollCallee, y as isStaticPropertyName } from "./onPageScroll-CN_ocv9l.mjs";
|
|
9
9
|
import { hasPlatformApiMemberExpression, isPlatformApiIdentifier, isPlatformApiMemberExpression, mayContainPlatformApiAccess, mayContainPlatformApiIdentifierByText, platformApiIdentifierList, platformApiIdentifiers } from "./operations/platformApi.mjs";
|
|
10
10
|
import { collectRequireTokens, getDynamicImportLiteralToken, getRequireAsyncLiteralToken, getRequireCallbackLiteralToken, getStaticRequireLiteralValue, hasStaticRequireCall, isStaticRequireCall, mayContainRequireCallByText, mayContainStaticRequireLiteral } from "./operations/require.mjs";
|
|
11
11
|
import { collectScriptSetupImportsFromCode, collectScriptSetupImportsWithBabel, collectScriptSetupImportsWithOxc, createScriptSetupImport, getScriptSetupImportedName, mayContainRelevantScriptSetupImports } from "./operations/scriptSetupImports.mjs";
|
|
12
12
|
import { collectIdentifiersFromExpression, collectIdentifiersFromExpressionWithOxc, collectLoopScopeAliases, collectPatternBindingNames, collectSetDataPickKeysFromTemplateCode, collectSetDataPickKeysWithBabel, collectSetDataPickKeysWithOxc, extractTemplateExpressions, hasBindingInScopes } from "./operations/setDataPick.mjs";
|
|
13
|
-
|
|
13
|
+
// src/operations/internal/scriptAnalysis.ts
|
|
14
|
+
/** 复用既有 JS collector 的预筛选和失败语义,不尝试 native。 */
|
|
15
|
+
function collectFeatureFlagsWithJs(code, options) {
|
|
16
|
+
if (!mayContainFeatureFlagHints(code, options.moduleId, options.hookToFeature)) return /* @__PURE__ */ new Set();
|
|
17
|
+
try {
|
|
18
|
+
return options.astEngine === "oxc" ? collectFeatureFlagsWithOxc(code, options.moduleId, options.hookToFeature) : collectFeatureFlagsWithBabel(code, options.moduleId, options.hookToFeature);
|
|
19
|
+
} catch {
|
|
20
|
+
return /* @__PURE__ */ new Set();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** 复用既有文本与 AST predicate,保留默认保守结果和 parserLike。 */
|
|
24
|
+
function mayContainScriptFactWithJs(code, options, mayContainByText, inspectAst) {
|
|
25
|
+
const engine = options?.engine ?? "babel";
|
|
26
|
+
if (engine !== "oxc") return true;
|
|
27
|
+
if (!mayContainByText(code)) return false;
|
|
28
|
+
try {
|
|
29
|
+
return inspectAst(parseJsLikeWithEngine(code, {
|
|
30
|
+
engine,
|
|
31
|
+
filename: "inline.ts",
|
|
32
|
+
parserLike: options?.parserLike
|
|
33
|
+
}));
|
|
34
|
+
} catch {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** 完整 fallback 的内部服务;该模块不属于 package entry。 */
|
|
39
|
+
const jsScriptAnalysisService = {
|
|
40
|
+
collectFeatureFlags: collectFeatureFlagsWithJs,
|
|
41
|
+
mayContainPlatformApiAccess(code, options) {
|
|
42
|
+
return mayContainScriptFactWithJs(code, options, mayContainPlatformApiIdentifierByText, hasPlatformApiMemberExpression);
|
|
43
|
+
},
|
|
44
|
+
mayContainStaticRequireLiteral(code, options) {
|
|
45
|
+
return mayContainScriptFactWithJs(code, options, mayContainRequireCallByText, hasStaticRequireCall);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
// src/operations/scriptAnalysis.ts
|
|
14
49
|
function normalizeNativeAnalysis(nativeAnalysis, featureFlags) {
|
|
15
50
|
const validFeatures = new Set(Object.values(featureFlags?.hookToFeature ?? {}));
|
|
16
51
|
const enabled = /* @__PURE__ */ new Set();
|
|
@@ -21,8 +56,21 @@ function normalizeNativeAnalysis(nativeAnalysis, featureFlags) {
|
|
|
21
56
|
hasStaticRequireLiteral: nativeAnalysis.hasStaticRequireLiteral
|
|
22
57
|
};
|
|
23
58
|
}
|
|
59
|
+
function analyzeScriptWithJs(code, options) {
|
|
60
|
+
return {
|
|
61
|
+
featureFlags: options?.featureFlags ? jsScriptAnalysisService.collectFeatureFlags(code, options.featureFlags) : /* @__PURE__ */ new Set(),
|
|
62
|
+
hasPlatformApiAccess: jsScriptAnalysisService.mayContainPlatformApiAccess(code, {
|
|
63
|
+
engine: options?.engine,
|
|
64
|
+
parserLike: options?.parserLike
|
|
65
|
+
}),
|
|
66
|
+
hasStaticRequireLiteral: jsScriptAnalysisService.mayContainStaticRequireLiteral(code, {
|
|
67
|
+
engine: options?.engine,
|
|
68
|
+
parserLike: options?.parserLike
|
|
69
|
+
})
|
|
70
|
+
};
|
|
71
|
+
}
|
|
24
72
|
/**
|
|
25
|
-
*
|
|
73
|
+
* 同一份脚本只尝试一次 native;失败后显式选择完整的 JS fallback 服务。
|
|
26
74
|
*/
|
|
27
75
|
function analyzeScript(code, options) {
|
|
28
76
|
if (shouldUseNativeAst()) try {
|
|
@@ -32,40 +80,34 @@ function analyzeScript(code, options) {
|
|
|
32
80
|
});
|
|
33
81
|
if (nativeAnalysis) return normalizeNativeAnalysis(nativeAnalysis, options?.featureFlags);
|
|
34
82
|
} catch {}
|
|
35
|
-
return
|
|
36
|
-
featureFlags: options?.featureFlags ? collectFeatureFlagsFromCode(code, options.featureFlags) : /* @__PURE__ */ new Set(),
|
|
37
|
-
hasPlatformApiAccess: mayContainPlatformApiAccess(code, {
|
|
38
|
-
engine: options?.engine,
|
|
39
|
-
parserLike: options?.parserLike
|
|
40
|
-
}),
|
|
41
|
-
hasStaticRequireLiteral: mayContainStaticRequireLiteral(code, {
|
|
42
|
-
engine: options?.engine,
|
|
43
|
-
parserLike: options?.parserLike
|
|
44
|
-
})
|
|
45
|
-
};
|
|
83
|
+
return analyzeScriptWithJs(code, options);
|
|
46
84
|
}
|
|
47
85
|
/**
|
|
48
|
-
*
|
|
86
|
+
* 批次只跨 native 边界一次,失败项各自执行一次完整 JS fallback。
|
|
49
87
|
*/
|
|
50
88
|
function analyzeScripts(inputs, options) {
|
|
89
|
+
let nativeResults;
|
|
51
90
|
if (shouldUseNativeAst() && inputs.length > 0) try {
|
|
52
|
-
|
|
91
|
+
nativeResults = analyzeScriptsWithNative(inputs.map((input) => ({
|
|
53
92
|
code: input.code,
|
|
54
93
|
filename: input.filename,
|
|
55
94
|
hookToFeature: input.featureFlags?.hookToFeature ?? options?.featureFlags?.hookToFeature,
|
|
56
95
|
moduleId: input.featureFlags?.moduleId ?? options?.featureFlags?.moduleId
|
|
57
96
|
})));
|
|
58
|
-
if (nativeResults?.length === inputs.length) return nativeResults.map((nativeAnalysis, index) => {
|
|
59
|
-
return normalizeNativeAnalysis(nativeAnalysis, inputs[index]?.featureFlags ?? options?.featureFlags);
|
|
60
|
-
});
|
|
61
97
|
} catch {}
|
|
62
|
-
return inputs.map((input) =>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
98
|
+
return inputs.map((input, index) => {
|
|
99
|
+
const featureFlags = input.featureFlags ?? options?.featureFlags;
|
|
100
|
+
const nativeAnalysis = nativeResults?.[index];
|
|
101
|
+
if (nativeAnalysis) try {
|
|
102
|
+
return normalizeNativeAnalysis(nativeAnalysis, featureFlags);
|
|
103
|
+
} catch {}
|
|
104
|
+
return analyzeScriptWithJs(input.code, {
|
|
105
|
+
...options,
|
|
106
|
+
featureFlags
|
|
107
|
+
});
|
|
108
|
+
});
|
|
66
109
|
}
|
|
67
|
-
|
|
68
|
-
//#region src/operations/scriptLiterals.ts
|
|
110
|
+
// src/operations/scriptLiterals.ts
|
|
69
111
|
const JS_STRING_LITERALS_RE = /"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^`\\])*`/g;
|
|
70
112
|
const SCRIPT_CALL_EXPRESSION_RE = /\b[$a-z_][\w$]*\s*\((?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^`\\])*`|[^()"'`])*\)/gi;
|
|
71
113
|
const SCRIPT_CALL_OR_MODULE_RE = /\b(?:import|export)\b|\b[$a-z_][\w$]*\s*\(/i;
|
|
@@ -91,5 +133,4 @@ function collectScriptCallStringLiterals(code) {
|
|
|
91
133
|
function mayContainScriptCallOrModuleSyntax(code) {
|
|
92
134
|
return SCRIPT_CALL_OR_MODULE_RE.test(code);
|
|
93
135
|
}
|
|
94
|
-
|
|
95
|
-
export { BABEL_TS_MODULE_PARSER_OPTIONS, BABEL_TS_MODULE_PLUGINS, analyzeScript, analyzeScripts, babelAstEngine, collectComponentPropsFromCode, collectComponentPropsWithBabel, collectComponentPropsWithOxc, collectFeatureFlagsFromCode, collectFeatureFlagsWithBabel, collectFeatureFlagsWithNative, collectFeatureFlagsWithNativeBatch, collectFeatureFlagsWithOxc, collectIdentifiersFromExpression, collectIdentifiersFromExpressionWithOxc, collectJsxAutoComponentsFromCode, collectJsxAutoComponentsWithBabel, collectJsxAutoComponentsWithOxc, collectJsxImportedComponentsAndDefaultExportFromBabelAst, collectJsxTemplateTagsFromBabelExpression, collectJsxTemplateTagsFromOxc, collectLoopScopeAliases, collectOnPageScrollPerformanceWarnings, collectOnPageScrollWarningsWithBabel, collectOnPageScrollWarningsWithNative, collectOnPageScrollWarningsWithOxc, collectPageScrollInspection, collectPageScrollInspectionWithOxc, collectPatternBindingNames, collectRequireTokens, collectScriptCallStringLiterals, collectScriptSetupImportsFromCode, collectScriptSetupImportsWithBabel, collectScriptSetupImportsWithOxc, collectScriptStringLiterals, collectSetDataPickKeysFromTemplateCode, collectSetDataPickKeysWithBabel, collectSetDataPickKeysWithOxc, consumeNamedFeatureFlag, consumeNamespaceFeatureFlag, createJsxImportedComponent, createLineStartOffsets, createScriptSetupImport, createWarningPrefix, defaultIsDefineComponentSource, defaultResolveBabelComponentExpression, defaultResolveBabelRenderExpression, extractComponentProperties, extractPropertiesObject, extractTemplateExpressions, generate, getCallExpressionCalleeName, getDynamicImportLiteralToken, getJsxImportLocalName, getJsxImportedName, getJsxOxcStaticPropertyName, getLocationFromOffset, getMemberExpressionPropertyName, getObjectPropertyByKey, getOnPageScrollCallbackArgument, getOxcCallExpressionCalleeName, getOxcMemberExpressionPropertyName, getOxcStaticPropertyName, getRenderPropertyFromComponentOptions, getRequireAsyncLiteralToken, getRequireCallbackLiteralToken, getScriptSetupImportedName, getStaticPropertyName, getStaticRequireLiteralValue, getVisitorKeys, hasBindingInScopes, hasPlatformApiMemberExpression, hasStaticRequireCall, isJsxDefineComponentImportSpecifier, isOnPageScrollCallee, isOxcFunctionLike, isOxcOnPageScrollCallee, isPlatformApiIdentifier, isPlatformApiMemberExpression, isStaticPropertyName, isStaticRequireCall, mapConstructorName, mayContainComponentPropsShape, mayContainFeatureFlagHints, mayContainJsxAutoComponentEntry, mayContainPlatformApiAccess, mayContainPlatformApiIdentifierByText, mayContainRelevantScriptSetupImports, mayContainRequireCallByText, mayContainScriptCallOrModuleSyntax, mayContainStaticRequireLiteral, mergeComponentPropTypes, oxcAstEngine, parse, parseJsLike, parseJsLikeWithEngine, platformApiIdentifierList, platformApiIdentifiers, registerNamedFeatureFlagLocal, registerNamespaceFeatureFlagLocal, resolveOptionsObjectExpression, resolveOptionsObjectExpressionWithBabel, resolveOxcComponentExpression, resolveOxcRenderExpression, resolveRenderExpressionFromComponentOptions, resolveRenderableExpression, resolveTypeFromNode, toStaticObjectKey, traverse, unwrapOxcExpression, unwrapTypeScriptExpression };
|
|
136
|
+
export { BABEL_TS_MODULE_PARSER_OPTIONS, BABEL_TS_MODULE_PLUGINS, analyzeCompilerScriptsWithNative, analyzeNpmChunksWithNative, analyzeScript, analyzeScripts, babelAstEngine, collectComponentPropsFromCode, collectComponentPropsWithBabel, collectComponentPropsWithOxc, collectFeatureFlagsFromCode, collectFeatureFlagsWithBabel, collectFeatureFlagsWithNative, collectFeatureFlagsWithNativeBatch, collectFeatureFlagsWithOxc, collectIdentifiersFromExpression, collectIdentifiersFromExpressionWithOxc, collectJsxAutoComponentsFromCode, collectJsxAutoComponentsWithBabel, collectJsxAutoComponentsWithOxc, collectJsxImportedComponentsAndDefaultExportFromBabelAst, collectJsxTemplateTagsFromBabelExpression, collectJsxTemplateTagsFromOxc, collectLoopScopeAliases, collectOnPageScrollPerformanceWarnings, collectOnPageScrollWarningsWithBabel, collectOnPageScrollWarningsWithNative, collectOnPageScrollWarningsWithOxc, collectPageScrollInspection, collectPageScrollInspectionWithOxc, collectPatternBindingNames, collectRequireTokens, collectScriptCallStringLiterals, collectScriptSetupImportsFromCode, collectScriptSetupImportsWithBabel, collectScriptSetupImportsWithOxc, collectScriptStringLiterals, collectSetDataPickKeysFromTemplateCode, collectSetDataPickKeysWithBabel, collectSetDataPickKeysWithOxc, consumeNamedFeatureFlag, consumeNamespaceFeatureFlag, createJsxImportedComponent, createLineStartOffsets, createScriptSetupImport, createWarningPrefix, defaultIsDefineComponentSource, defaultResolveBabelComponentExpression, defaultResolveBabelRenderExpression, extractComponentProperties, extractPropertiesObject, extractTemplateExpressions, generate, getCallExpressionCalleeName, getDynamicImportLiteralToken, getJsxImportLocalName, getJsxImportedName, getJsxOxcStaticPropertyName, getLocationFromOffset, getMemberExpressionPropertyName, getObjectPropertyByKey, getOnPageScrollCallbackArgument, getOxcCallExpressionCalleeName, getOxcMemberExpressionPropertyName, getOxcStaticPropertyName, getRenderPropertyFromComponentOptions, getRequireAsyncLiteralToken, getRequireCallbackLiteralToken, getScriptSetupImportedName, getStaticPropertyName, getStaticRequireLiteralValue, getVisitorKeys, hasBindingInScopes, hasPlatformApiMemberExpression, hasStaticRequireCall, isJsxDefineComponentImportSpecifier, isOnPageScrollCallee, isOxcFunctionLike, isOxcOnPageScrollCallee, isPlatformApiIdentifier, isPlatformApiMemberExpression, isStaticPropertyName, isStaticRequireCall, mapConstructorName, mayContainComponentPropsShape, mayContainFeatureFlagHints, mayContainJsxAutoComponentEntry, mayContainPlatformApiAccess, mayContainPlatformApiIdentifierByText, mayContainRelevantScriptSetupImports, mayContainRequireCallByText, mayContainScriptCallOrModuleSyntax, mayContainStaticRequireLiteral, mergeComponentPropTypes, oxcAstEngine, parse, parseJsLike, parseJsLikeWithEngine, platformApiIdentifierList, platformApiIdentifiers, registerNamedFeatureFlagLocal, registerNamespaceFeatureFlagLocal, resolveOptionsObjectExpression, resolveOptionsObjectExpressionWithBabel, resolveOxcComponentExpression, resolveOxcRenderExpression, resolveRenderExpressionFromComponentOptions, resolveRenderableExpression, resolveTypeFromNode, toStaticObjectKey, traverse, unwrapOxcExpression, unwrapTypeScriptExpression };
|