@weapp-vite/ast 6.17.0 → 6.17.2
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.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{onPageScroll-DpsTdS_S.d.mts → onPageScroll-C1BbvMzn.d.mts} +1 -1
- package/dist/{onPageScroll-BDuUZSSJ.mjs → onPageScroll-DYWM5bYW.mjs} +2 -2
- package/dist/operations/jsxAutoComponents.mjs +2 -2
- package/dist/operations/onPageScroll.d.mts +1 -1
- package/dist/operations/onPageScroll.mjs +1 -1
- package/dist/operations/setDataPick.mjs +2 -2
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ 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, 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 collectOnPageScrollWarningsWithBabel, a as getLocationFromOffset, c as getOxcCallExpressionCalleeName, d as isOnPageScrollCallee, f as isOxcFunctionLike, g as collectPageScrollInspectionWithOxc, h as collectOnPageScrollWarningsWithOxc, i as getCallExpressionCalleeName, l as getOxcMemberExpressionPropertyName, m as isStaticPropertyName, n as createLineStartOffsets, o as getMemberExpressionPropertyName, p as isOxcOnPageScrollCallee, r as createWarningPrefix, s as getOnPageScrollCallbackArgument, t as collectOnPageScrollPerformanceWarnings, u as getOxcStaticPropertyName, v as collectPageScrollInspection } from "./onPageScroll-
|
|
8
|
+
import { _ as collectOnPageScrollWarningsWithBabel, a as getLocationFromOffset, c as getOxcCallExpressionCalleeName, d as isOnPageScrollCallee, f as isOxcFunctionLike, g as collectPageScrollInspectionWithOxc, h as collectOnPageScrollWarningsWithOxc, i as getCallExpressionCalleeName, l as getOxcMemberExpressionPropertyName, m as isStaticPropertyName, n as createLineStartOffsets, o as getMemberExpressionPropertyName, p as isOxcOnPageScrollCallee, r as createWarningPrefix, s as getOnPageScrollCallbackArgument, t as collectOnPageScrollPerformanceWarnings, u as getOxcStaticPropertyName, v as collectPageScrollInspection } from "./onPageScroll-C1BbvMzn.mjs";
|
|
9
9
|
import { hasPlatformApiMemberExpression, isPlatformApiIdentifier, isPlatformApiMemberExpression, mayContainPlatformApiAccess, mayContainPlatformApiIdentifierByText, platformApiIdentifierList, platformApiIdentifiers } from "./operations/platformApi.mjs";
|
|
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";
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { n as oxcAstEngine, r as babelAstEngine, t as parseJsLikeWithEngine } fr
|
|
|
4
4
|
import { collectComponentPropsFromCode, collectComponentPropsWithBabel, collectComponentPropsWithOxc, extractComponentProperties, extractPropertiesObject, getStaticPropertyName, mapConstructorName, mayContainComponentPropsShape, mergeComponentPropTypes, resolveOptionsObjectExpression, resolveOptionsObjectExpressionWithBabel, resolveTypeFromNode } from "./operations/componentProps.mjs";
|
|
5
5
|
import { collectFeatureFlagsFromCode, collectFeatureFlagsWithBabel, collectFeatureFlagsWithOxc, consumeNamedFeatureFlag, consumeNamespaceFeatureFlag, mayContainFeatureFlagHints, registerNamedFeatureFlagLocal, registerNamespaceFeatureFlagLocal } from "./operations/featureFlags.mjs";
|
|
6
6
|
import { collectJsxAutoComponentsFromCode, collectJsxAutoComponentsWithBabel, collectJsxAutoComponentsWithOxc, collectJsxImportedComponentsAndDefaultExportFromBabelAst, collectJsxTemplateTagsFromBabelExpression, collectJsxTemplateTagsFromOxc, createJsxImportedComponent, defaultIsDefineComponentSource, defaultResolveBabelComponentExpression, defaultResolveBabelRenderExpression, getJsxImportLocalName, getJsxImportedName, getJsxOxcStaticPropertyName, isJsxDefineComponentImportSpecifier, mayContainJsxAutoComponentEntry, resolveOxcComponentExpression, resolveOxcRenderExpression, unwrapOxcExpression } from "./operations/jsxAutoComponents.mjs";
|
|
7
|
-
import { _ as isOxcOnPageScrollCallee, a as collectPageScrollInspection, c as getCallExpressionCalleeName, d as getOnPageScrollCallbackArgument, f as getOxcCallExpressionCalleeName, g as isOxcFunctionLike, h as isOnPageScrollCallee, i as collectOnPageScrollWarningsWithBabel, l as getLocationFromOffset, m as getOxcStaticPropertyName, n as collectOnPageScrollWarningsWithOxc, o as createLineStartOffsets, p as getOxcMemberExpressionPropertyName, r as collectPageScrollInspectionWithOxc, s as createWarningPrefix, t as collectOnPageScrollPerformanceWarnings, u as getMemberExpressionPropertyName, v as isStaticPropertyName } from "./onPageScroll-
|
|
7
|
+
import { _ as isOxcOnPageScrollCallee, a as collectPageScrollInspection, c as getCallExpressionCalleeName, d as getOnPageScrollCallbackArgument, f as getOxcCallExpressionCalleeName, g as isOxcFunctionLike, h as isOnPageScrollCallee, i as collectOnPageScrollWarningsWithBabel, l as getLocationFromOffset, m as getOxcStaticPropertyName, n as collectOnPageScrollWarningsWithOxc, o as createLineStartOffsets, p as getOxcMemberExpressionPropertyName, r as collectPageScrollInspectionWithOxc, s as createWarningPrefix, t as collectOnPageScrollPerformanceWarnings, u as getMemberExpressionPropertyName, v as isStaticPropertyName } from "./onPageScroll-DYWM5bYW.mjs";
|
|
8
8
|
import { hasPlatformApiMemberExpression, isPlatformApiIdentifier, isPlatformApiMemberExpression, mayContainPlatformApiAccess, mayContainPlatformApiIdentifierByText, platformApiIdentifierList, platformApiIdentifiers } from "./operations/platformApi.mjs";
|
|
9
9
|
import { collectRequireTokens, getRequireAsyncLiteralToken, getStaticRequireLiteralValue, hasStaticRequireCall, isStaticRequireCall, mayContainRequireCallByText, mayContainStaticRequireLiteral } from "./operations/require.mjs";
|
|
10
10
|
import { collectScriptSetupImportsFromCode, collectScriptSetupImportsWithBabel, collectScriptSetupImportsWithOxc, createScriptSetupImport, getScriptSetupImportedName, mayContainRelevantScriptSetupImports } from "./operations/scriptSetupImports.mjs";
|
|
@@ -27,7 +27,7 @@ declare function isOnPageScrollCallee(callee: t.Expression | t.V8IntrinsicIdenti
|
|
|
27
27
|
declare function getCallExpressionCalleeName(callee: t.Expression | t.V8IntrinsicIdentifier): string | undefined;
|
|
28
28
|
declare function getOnPageScrollCallbackArgument(node: {
|
|
29
29
|
arguments?: Array<t.Expression | t.SpreadElement | t.ArgumentPlaceholder | null>;
|
|
30
|
-
}): t.
|
|
30
|
+
}): t.FunctionExpression | t.ArrowFunctionExpression | undefined;
|
|
31
31
|
declare function createWarningPrefix(filename: string, line?: number, column?: number): string;
|
|
32
32
|
declare function getOxcStaticPropertyName(node: any): string | undefined;
|
|
33
33
|
declare function getOxcMemberExpressionPropertyName(node: any): string | undefined;
|
|
@@ -117,7 +117,7 @@ function collectPageScrollInspection(functionPath, node) {
|
|
|
117
117
|
}
|
|
118
118
|
function collectOnPageScrollWarningsWithBabel(code, filename) {
|
|
119
119
|
const ast = parseJsLike(code);
|
|
120
|
-
const onPageScrollHookNames = new Set(["onPageScroll"]);
|
|
120
|
+
const onPageScrollHookNames = /* @__PURE__ */ new Set(["onPageScroll"]);
|
|
121
121
|
const namespaceImports = /* @__PURE__ */ new Set();
|
|
122
122
|
for (const statement of ast.program.body) {
|
|
123
123
|
if (statement.type !== "ImportDeclaration" || statement.source.value !== "wevu") continue;
|
|
@@ -201,7 +201,7 @@ function collectOnPageScrollWarningsWithOxc(code, filename) {
|
|
|
201
201
|
engine: "oxc",
|
|
202
202
|
filename: "inline.ts"
|
|
203
203
|
});
|
|
204
|
-
const onPageScrollHookNames = new Set(["onPageScroll"]);
|
|
204
|
+
const onPageScrollHookNames = /* @__PURE__ */ new Set(["onPageScroll"]);
|
|
205
205
|
const namespaceImports = /* @__PURE__ */ new Set();
|
|
206
206
|
for (const statement of ast.body ?? []) {
|
|
207
207
|
if (statement?.type !== "ImportDeclaration" || statement.source?.value !== "wevu") continue;
|
|
@@ -53,7 +53,7 @@ function collectJsxImportedComponentsAndDefaultExportFromBabelAst(ast, options =
|
|
|
53
53
|
isDefineComponentSource: options.isDefineComponentSource ?? defaultIsDefineComponentSource,
|
|
54
54
|
resolveBabelComponentExpression: options.resolveBabelComponentExpression ?? defaultResolveBabelComponentExpression
|
|
55
55
|
};
|
|
56
|
-
const defineComponentAliases = new Set(["defineComponent", "_defineComponent"]);
|
|
56
|
+
const defineComponentAliases = /* @__PURE__ */ new Set(["defineComponent", "_defineComponent"]);
|
|
57
57
|
const defineComponentDecls = /* @__PURE__ */ new Map();
|
|
58
58
|
const imports = /* @__PURE__ */ new Map();
|
|
59
59
|
let exportDefaultExpression = null;
|
|
@@ -230,7 +230,7 @@ function collectJsxTemplateTagsFromOxc(renderExpression, isCollectableTag) {
|
|
|
230
230
|
}
|
|
231
231
|
function collectJsxAutoComponentsWithOxc(source, options) {
|
|
232
232
|
const ast = parseSync("inline.tsx", source).program;
|
|
233
|
-
const defineComponentAliases = new Set(["defineComponent", "_defineComponent"]);
|
|
233
|
+
const defineComponentAliases = /* @__PURE__ */ new Set(["defineComponent", "_defineComponent"]);
|
|
234
234
|
const defineComponentDecls = /* @__PURE__ */ new Map();
|
|
235
235
|
const imports = /* @__PURE__ */ new Map();
|
|
236
236
|
let exportDefaultExpression = null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as collectOnPageScrollWarningsWithBabel, a as getLocationFromOffset, c as getOxcCallExpressionCalleeName, d as isOnPageScrollCallee, f as isOxcFunctionLike, g as collectPageScrollInspectionWithOxc, h as collectOnPageScrollWarningsWithOxc, i as getCallExpressionCalleeName, l as getOxcMemberExpressionPropertyName, m as isStaticPropertyName, n as createLineStartOffsets, o as getMemberExpressionPropertyName, p as isOxcOnPageScrollCallee, r as createWarningPrefix, s as getOnPageScrollCallbackArgument, t as collectOnPageScrollPerformanceWarnings, u as getOxcStaticPropertyName, v as collectPageScrollInspection } from "../onPageScroll-
|
|
1
|
+
import { _ as collectOnPageScrollWarningsWithBabel, a as getLocationFromOffset, c as getOxcCallExpressionCalleeName, d as isOnPageScrollCallee, f as isOxcFunctionLike, g as collectPageScrollInspectionWithOxc, h as collectOnPageScrollWarningsWithOxc, i as getCallExpressionCalleeName, l as getOxcMemberExpressionPropertyName, m as isStaticPropertyName, n as createLineStartOffsets, o as getMemberExpressionPropertyName, p as isOxcOnPageScrollCallee, r as createWarningPrefix, s as getOnPageScrollCallbackArgument, t as collectOnPageScrollPerformanceWarnings, u as getOxcStaticPropertyName, v as collectPageScrollInspection } from "../onPageScroll-C1BbvMzn.mjs";
|
|
2
2
|
export { collectOnPageScrollPerformanceWarnings, collectOnPageScrollWarningsWithBabel, collectOnPageScrollWarningsWithOxc, collectPageScrollInspection, collectPageScrollInspectionWithOxc, createLineStartOffsets, createWarningPrefix, getCallExpressionCalleeName, getLocationFromOffset, getMemberExpressionPropertyName, getOnPageScrollCallbackArgument, getOxcCallExpressionCalleeName, getOxcMemberExpressionPropertyName, getOxcStaticPropertyName, isOnPageScrollCallee, isOxcFunctionLike, isOxcOnPageScrollCallee, isStaticPropertyName };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as isOxcOnPageScrollCallee, a as collectPageScrollInspection, c as getCallExpressionCalleeName, d as getOnPageScrollCallbackArgument, f as getOxcCallExpressionCalleeName, g as isOxcFunctionLike, h as isOnPageScrollCallee, i as collectOnPageScrollWarningsWithBabel, l as getLocationFromOffset, m as getOxcStaticPropertyName, n as collectOnPageScrollWarningsWithOxc, o as createLineStartOffsets, p as getOxcMemberExpressionPropertyName, r as collectPageScrollInspectionWithOxc, s as createWarningPrefix, t as collectOnPageScrollPerformanceWarnings, u as getMemberExpressionPropertyName, v as isStaticPropertyName } from "../onPageScroll-
|
|
1
|
+
import { _ as isOxcOnPageScrollCallee, a as collectPageScrollInspection, c as getCallExpressionCalleeName, d as getOnPageScrollCallbackArgument, f as getOxcCallExpressionCalleeName, g as isOxcFunctionLike, h as isOnPageScrollCallee, i as collectOnPageScrollWarningsWithBabel, l as getLocationFromOffset, m as getOxcStaticPropertyName, n as collectOnPageScrollWarningsWithOxc, o as createLineStartOffsets, p as getOxcMemberExpressionPropertyName, r as collectPageScrollInspectionWithOxc, s as createWarningPrefix, t as collectOnPageScrollPerformanceWarnings, u as getMemberExpressionPropertyName, v as isStaticPropertyName } from "../onPageScroll-DYWM5bYW.mjs";
|
|
2
2
|
export { collectOnPageScrollPerformanceWarnings, collectOnPageScrollWarningsWithBabel, collectOnPageScrollWarningsWithOxc, collectPageScrollInspection, collectPageScrollInspectionWithOxc, createLineStartOffsets, createWarningPrefix, getCallExpressionCalleeName, getLocationFromOffset, getMemberExpressionPropertyName, getOnPageScrollCallbackArgument, getOxcCallExpressionCalleeName, getOxcMemberExpressionPropertyName, getOxcStaticPropertyName, isOnPageScrollCallee, isOxcFunctionLike, isOxcOnPageScrollCallee, isStaticPropertyName };
|
|
@@ -3,12 +3,12 @@ import { t as parseJsLikeWithEngine } from "../engine-CBE2OpFp.mjs";
|
|
|
3
3
|
import { getMiniProgramDirectivePrefix, getSupportedMiniProgramPlatforms } from "@weapp-core/shared";
|
|
4
4
|
//#region src/operations/setDataPick.ts
|
|
5
5
|
const TEMPLATE_MUSTACHE_RE = /\{\{([\s\S]*?)\}\}/g;
|
|
6
|
-
const FOR_DIRECTIVE_PREFIX_PATTERN = Array.from(new Set(["s", ...getSupportedMiniProgramPlatforms().map((platform) => getMiniProgramDirectivePrefix(platform))])).sort((left, right) => right.length - left.length).map((prefix) => prefix.replace(/[|\\{}()[\]^$+*?.-]/g, "\\$&")).join("|");
|
|
6
|
+
const FOR_DIRECTIVE_PREFIX_PATTERN = Array.from(/* @__PURE__ */ new Set(["s", ...getSupportedMiniProgramPlatforms().map((platform) => getMiniProgramDirectivePrefix(platform))])).sort((left, right) => right.length - left.length).map((prefix) => prefix.replace(/[|\\{}()[\]^$+*?.-]/g, "\\$&")).join("|");
|
|
7
7
|
const FOR_DIRECTIVE_SEPARATOR_PATTERN = "[:-]";
|
|
8
8
|
const FOR_TAG_RE = new RegExp(`<[^>]*\\b(?:${FOR_DIRECTIVE_PREFIX_PATTERN})${FOR_DIRECTIVE_SEPARATOR_PATTERN}for\\s*=\\s*(?:\"[^\"]*\"|'[^']*')[^>]*>`, "g");
|
|
9
9
|
const FOR_ITEM_RE = new RegExp(`\\b(?:${FOR_DIRECTIVE_PREFIX_PATTERN})${FOR_DIRECTIVE_SEPARATOR_PATTERN}for-item\\s*=\\s*(?:\"([^\"]+)\"|'([^']+)')`);
|
|
10
10
|
const FOR_INDEX_RE = new RegExp(`\\b(?:${FOR_DIRECTIVE_PREFIX_PATTERN})${FOR_DIRECTIVE_SEPARATOR_PATTERN}for-index\\s*=\\s*(?:\"([^\"]+)\"|'([^']+)')`);
|
|
11
|
-
const JS_GLOBAL_IDENTIFIERS = new Set([
|
|
11
|
+
const JS_GLOBAL_IDENTIFIERS = /* @__PURE__ */ new Set([
|
|
12
12
|
"undefined",
|
|
13
13
|
"NaN",
|
|
14
14
|
"Infinity",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-vite/ast",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.17.
|
|
4
|
+
"version": "6.17.2",
|
|
5
5
|
"description": "weapp-vite 共享 AST 分析工具包,统一 Babel/Oxc 解析与常用分析操作",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -106,10 +106,10 @@
|
|
|
106
106
|
"@babel/parser": "^8.0.0",
|
|
107
107
|
"@babel/traverse": "^8.0.0",
|
|
108
108
|
"@babel/types": "^8.0.0",
|
|
109
|
-
"@oxc-project/types": "^0.
|
|
110
|
-
"oxc-parser": "^0.
|
|
109
|
+
"@oxc-project/types": "^0.137.0",
|
|
110
|
+
"oxc-parser": "^0.137.0",
|
|
111
111
|
"oxc-walker": "^1.0.0",
|
|
112
|
-
"@weapp-core/shared": "3.0.
|
|
112
|
+
"@weapp-core/shared": "3.0.5"
|
|
113
113
|
},
|
|
114
114
|
"publishConfig": {
|
|
115
115
|
"access": "public",
|