@weapp-vite/ast 6.16.14 → 6.16.15
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 +7 -10
- package/dist/index.d.mts +2 -4
- package/package.json +3 -3
package/dist/babel.d.mts
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as _$_babel_traverse0 from "@babel/traverse";
|
|
3
|
-
import * as _$_babel_generator0 from "@babel/generator";
|
|
4
|
-
import * as _$_babel_parser0 from "@babel/parser";
|
|
1
|
+
import * as t from "@babel/types";
|
|
5
2
|
import { ParserOptions, ParserPlugin } from "@babel/parser";
|
|
6
3
|
|
|
7
4
|
//#region src/babel.d.ts
|
|
8
5
|
declare const BABEL_TS_MODULE_PLUGINS: ParserPlugin[];
|
|
9
6
|
declare const BABEL_TS_MODULE_PARSER_OPTIONS: ParserOptions;
|
|
10
|
-
type BabelTraverse = typeof
|
|
11
|
-
type BabelGenerate = typeof
|
|
12
|
-
type BabelParse = typeof
|
|
7
|
+
type BabelTraverse = typeof import('@babel/traverse').default;
|
|
8
|
+
type BabelGenerate = typeof import('@babel/generator').default;
|
|
9
|
+
type BabelParse = typeof import('@babel/parser').parse;
|
|
13
10
|
type BabelGeneratorOptions = Parameters<BabelGenerate>[1];
|
|
14
11
|
type BabelGeneratorInputCode = Parameters<BabelGenerate>[2];
|
|
15
12
|
type BabelGeneratorResult = ReturnType<BabelGenerate>;
|
|
16
13
|
type TraverseFn = (...args: Parameters<BabelTraverse>) => ReturnType<BabelTraverse>;
|
|
17
|
-
type GenerateFn = (ast:
|
|
14
|
+
type GenerateFn = (ast: t.Node, opts?: BabelGeneratorOptions, code?: BabelGeneratorInputCode) => BabelGeneratorResult;
|
|
18
15
|
declare const traverse: TraverseFn;
|
|
19
16
|
declare const generate: GenerateFn;
|
|
20
17
|
declare const parse: BabelParse;
|
|
21
|
-
declare function getVisitorKeys(): typeof
|
|
22
|
-
declare function parseJsLike(source: string):
|
|
18
|
+
declare function getVisitorKeys(): typeof import('@babel/types').VISITOR_KEYS;
|
|
19
|
+
declare function parseJsLike(source: string): t.File;
|
|
23
20
|
//#endregion
|
|
24
21
|
export { BABEL_TS_MODULE_PARSER_OPTIONS, BABEL_TS_MODULE_PLUGINS, generate, getVisitorKeys, parse, parseJsLike, traverse };
|
package/dist/index.d.mts
CHANGED
|
@@ -10,8 +10,6 @@ import { hasPlatformApiMemberExpression, isPlatformApiIdentifier, isPlatformApiM
|
|
|
10
10
|
import { RequireToken, collectRequireTokens, getRequireAsyncLiteralToken, 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
|
-
import * as _$_babel_types0 from "@babel/types";
|
|
14
|
-
import * as _$oxc_parser0 from "oxc-parser";
|
|
15
13
|
|
|
16
14
|
//#region src/engines/babel.d.ts
|
|
17
15
|
/**
|
|
@@ -19,7 +17,7 @@ import * as _$oxc_parser0 from "oxc-parser";
|
|
|
19
17
|
*/
|
|
20
18
|
declare const babelAstEngine: {
|
|
21
19
|
name: "babel";
|
|
22
|
-
parseJsLike(code: string):
|
|
20
|
+
parseJsLike(code: string): import("@babel/types").File;
|
|
23
21
|
};
|
|
24
22
|
//#endregion
|
|
25
23
|
//#region src/engines/oxc.d.ts
|
|
@@ -28,7 +26,7 @@ declare const babelAstEngine: {
|
|
|
28
26
|
*/
|
|
29
27
|
declare const oxcAstEngine: {
|
|
30
28
|
name: "oxc";
|
|
31
|
-
parseJsLike(code: string, filename?: string):
|
|
29
|
+
parseJsLike(code: string, filename?: string): import("oxc-parser").Program;
|
|
32
30
|
};
|
|
33
31
|
//#endregion
|
|
34
32
|
export { type AstEngineName, type AstParserLike, BABEL_TS_MODULE_PARSER_OPTIONS, BABEL_TS_MODULE_PLUGINS, type ComponentPropMap, type FeatureFlagOptions, type JsxAutoComponentAnalysisOptions, type JsxAutoComponentContext, type JsxBabelModuleAnalysisOptions, type JsxImportedComponent, type RequireToken, type ScriptSetupImport, type WeappAstConfig, babelAstEngine, collectComponentPropsFromCode, collectComponentPropsWithBabel, collectComponentPropsWithOxc, collectFeatureFlagsFromCode, collectFeatureFlagsWithBabel, collectFeatureFlagsWithOxc, collectIdentifiersFromExpression, collectIdentifiersFromExpressionWithOxc, collectJsxAutoComponentsFromCode, collectJsxAutoComponentsWithBabel, collectJsxAutoComponentsWithOxc, collectJsxImportedComponentsAndDefaultExportFromBabelAst, collectJsxTemplateTagsFromBabelExpression, collectJsxTemplateTagsFromOxc, collectLoopScopeAliases, collectOnPageScrollPerformanceWarnings, collectOnPageScrollWarningsWithBabel, 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, getJsxImportLocalName, getJsxImportedName, getJsxOxcStaticPropertyName, getLocationFromOffset, getMemberExpressionPropertyName, getObjectPropertyByKey, getOnPageScrollCallbackArgument, getOxcCallExpressionCalleeName, getOxcMemberExpressionPropertyName, getOxcStaticPropertyName, getRenderPropertyFromComponentOptions, getRequireAsyncLiteralToken, 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, oxcAstEngine, parse, parseJsLike, parseJsLikeWithEngine, platformApiIdentifierList, platformApiIdentifiers, registerNamedFeatureFlagLocal, registerNamespaceFeatureFlagLocal, resolveOptionsObjectExpression, resolveOptionsObjectExpressionWithBabel, resolveOxcComponentExpression, resolveOxcRenderExpression, resolveRenderExpressionFromComponentOptions, resolveRenderableExpression, resolveTypeFromNode, toStaticObjectKey, traverse, unwrapOxcExpression, unwrapTypeScriptExpression };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-vite/ast",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.16.
|
|
4
|
+
"version": "6.16.15",
|
|
5
5
|
"description": "weapp-vite 共享 AST 分析工具包,统一 Babel/Oxc 解析与常用分析操作",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -106,8 +106,8 @@
|
|
|
106
106
|
"@babel/parser": "^7.29.3",
|
|
107
107
|
"@babel/traverse": "^7.29.0",
|
|
108
108
|
"@babel/types": "^7.29.0",
|
|
109
|
-
"@oxc-project/types": "^0.
|
|
110
|
-
"oxc-parser": "^0.
|
|
109
|
+
"@oxc-project/types": "^0.131.0",
|
|
110
|
+
"oxc-parser": "^0.131.0",
|
|
111
111
|
"oxc-walker": "^1.0.0",
|
|
112
112
|
"@weapp-core/shared": "3.0.4"
|
|
113
113
|
},
|