@weapp-vite/ast 6.16.47 → 6.17.1
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.mjs +1 -9
- package/dist/babelCore.d.mts +35 -2
- package/dist/babelCore.mjs +6 -2
- package/dist/babelNodes.d.mts +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{onPageScroll-BDuUZSSJ.mjs → onPageScroll-DYWM5bYW.mjs} +2 -2
- package/dist/{onPageScroll-C1BbvMzn.d.mts → onPageScroll-DpsTdS_S.d.mts} +1 -1
- 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 +8 -8
package/dist/babel.mjs
CHANGED
|
@@ -3,9 +3,6 @@ import { createRequire } from "node:module";
|
|
|
3
3
|
const BABEL_TS_MODULE_PLUGINS = [
|
|
4
4
|
"typescript",
|
|
5
5
|
"decorators-legacy",
|
|
6
|
-
"classProperties",
|
|
7
|
-
"classPrivateProperties",
|
|
8
|
-
"classPrivateMethods",
|
|
9
6
|
"jsx"
|
|
10
7
|
];
|
|
11
8
|
const BABEL_TS_MODULE_PARSER_OPTIONS = {
|
|
@@ -52,12 +49,7 @@ function getVisitorKeys() {
|
|
|
52
49
|
function parseJsLike(source) {
|
|
53
50
|
return parse(source, {
|
|
54
51
|
sourceType: "module",
|
|
55
|
-
plugins: [
|
|
56
|
-
...BABEL_TS_MODULE_PLUGINS,
|
|
57
|
-
"dynamicImport",
|
|
58
|
-
"optionalChaining",
|
|
59
|
-
"nullishCoalescingOperator"
|
|
60
|
-
]
|
|
52
|
+
plugins: [...BABEL_TS_MODULE_PLUGINS]
|
|
61
53
|
});
|
|
62
54
|
}
|
|
63
55
|
//#endregion
|
package/dist/babelCore.d.mts
CHANGED
|
@@ -1,2 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as BabelCore from "@babel/core";
|
|
2
|
+
import { InputOptions as TransformOptions, NodePath } from "@babel/core";
|
|
3
|
+
|
|
4
|
+
//#region src/babelCore.d.ts
|
|
5
|
+
declare const babelCore: typeof BabelCore;
|
|
6
|
+
declare const parse: {
|
|
7
|
+
(code: string, callback: {
|
|
8
|
+
(err: Error, ast: null): void;
|
|
9
|
+
(err: null, ast: import("@babel/parser").ParseResult | null): void;
|
|
10
|
+
}): void;
|
|
11
|
+
(code: string, opts: BabelCore.InputOptions | undefined | null, callback: {
|
|
12
|
+
(err: Error, ast: null): void;
|
|
13
|
+
(err: null, ast: import("@babel/parser").ParseResult | null): void;
|
|
14
|
+
}): void;
|
|
15
|
+
}, parseAsync: typeof BabelCore.parseAsync, parseSync: typeof BabelCore.parseSync, transform: {
|
|
16
|
+
(code: string, callback: {
|
|
17
|
+
(err: Error, file: null): void;
|
|
18
|
+
(err: null, file: BabelCore.FileResult | null): void;
|
|
19
|
+
}): void;
|
|
20
|
+
(code: string, opts: BabelCore.InputOptions | undefined | null, callback: {
|
|
21
|
+
(err: Error, file: null): void;
|
|
22
|
+
(err: null, file: BabelCore.FileResult | null): void;
|
|
23
|
+
}): void;
|
|
24
|
+
}, transformAsync: typeof BabelCore.transformAsync, transformFile: typeof BabelCore.transformFile, transformFileAsync: typeof BabelCore.transformFileAsync, transformFileSync: typeof BabelCore.transformFileSync, transformFromAst: {
|
|
25
|
+
(ast: BabelCore.types.File | BabelCore.types.Program, code: string, callback: {
|
|
26
|
+
(err: Error, file: null): void;
|
|
27
|
+
(err: null, file: BabelCore.FileResult | null): void;
|
|
28
|
+
}): void;
|
|
29
|
+
(ast: BabelCore.types.File | BabelCore.types.Program, code: string, opts: BabelCore.InputOptions | undefined | null, callback: {
|
|
30
|
+
(err: Error, file: null): void;
|
|
31
|
+
(err: null, file: BabelCore.FileResult | null): void;
|
|
32
|
+
}): void;
|
|
33
|
+
}, transformFromAstAsync: typeof BabelCore.transformFromAstAsync, transformFromAstSync: typeof BabelCore.transformFromAstSync, transformSync: typeof BabelCore.transformSync, types: typeof BabelCore.types, version: string;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { type NodePath, type TransformOptions, babelCore as default, parse, parseAsync, parseSync, transform, transformAsync, transformFile, transformFileAsync, transformFileSync, transformFromAst, transformFromAstAsync, transformFromAstSync, transformSync, types, version };
|
package/dist/babelCore.mjs
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
//#region src/babelCore.ts
|
|
3
|
+
const babelCore = createRequire(import.meta.url)("@babel/core");
|
|
4
|
+
const { parse, parseAsync, parseSync, transform, transformAsync, transformFile, transformFileAsync, transformFileSync, transformFromAst, transformFromAstAsync, transformFromAstSync, transformSync, types, version } = babelCore;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { babelCore as default, parse, parseAsync, parseSync, transform, transformAsync, transformFile, transformFileAsync, transformFileSync, transformFromAst, transformFromAstAsync, transformFromAstSync, transformSync, types, version };
|
package/dist/babelNodes.d.mts
CHANGED
|
@@ -4,8 +4,8 @@ import { Expression, ObjectExpression, ObjectMethod, ObjectProperty, PrivateName
|
|
|
4
4
|
//#region src/babelNodes.d.ts
|
|
5
5
|
declare function unwrapTypeScriptExpression(exp: Expression): Expression;
|
|
6
6
|
declare function toStaticObjectKey(key: Expression | PrivateName | t.Identifier): string | null;
|
|
7
|
-
declare function getObjectPropertyByKey(node: ObjectExpression, key: string): ObjectMethod |
|
|
8
|
-
declare function getRenderPropertyFromComponentOptions(componentExpr: Expression): ObjectMethod |
|
|
7
|
+
declare function getObjectPropertyByKey(node: ObjectExpression, key: string): ObjectMethod | t.ObjectPropertyNonComputed | null;
|
|
8
|
+
declare function getRenderPropertyFromComponentOptions(componentExpr: Expression): ObjectMethod | t.ObjectPropertyNonComputed | null;
|
|
9
9
|
declare function resolveRenderableExpression(node: ObjectMethod | ObjectProperty): Expression | null;
|
|
10
10
|
declare function resolveRenderExpressionFromComponentOptions(componentExpr: Expression): Expression | null;
|
|
11
11
|
//#endregion
|
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-DpsTdS_S.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";
|
|
@@ -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;
|
|
@@ -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.ArrowFunctionExpression | t.FunctionExpression | 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;
|
|
@@ -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-DpsTdS_S.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.
|
|
4
|
+
"version": "6.17.1",
|
|
5
5
|
"description": "weapp-vite 共享 AST 分析工具包,统一 Babel/Oxc 解析与常用分析操作",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -101,13 +101,13 @@
|
|
|
101
101
|
"node": ">=20"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@babel/core": "^
|
|
105
|
-
"@babel/generator": "^
|
|
106
|
-
"@babel/parser": "^
|
|
107
|
-
"@babel/traverse": "^
|
|
108
|
-
"@babel/types": "^
|
|
109
|
-
"@oxc-project/types": "^0.
|
|
110
|
-
"oxc-parser": "^0.
|
|
104
|
+
"@babel/core": "^8.0.1",
|
|
105
|
+
"@babel/generator": "^8.0.0",
|
|
106
|
+
"@babel/parser": "^8.0.0",
|
|
107
|
+
"@babel/traverse": "^8.0.0",
|
|
108
|
+
"@babel/types": "^8.0.0",
|
|
109
|
+
"@oxc-project/types": "^0.137.0",
|
|
110
|
+
"oxc-parser": "^0.137.0",
|
|
111
111
|
"oxc-walker": "^1.0.0",
|
|
112
112
|
"@weapp-core/shared": "3.0.4"
|
|
113
113
|
},
|