🔧 npm update

This commit is contained in:
2025-04-15 20:50:11 +02:00
parent ce5b9ac0c8
commit 94a90edabd
828 changed files with 256807 additions and 197099 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
import { PatchFlags } from '@vue/shared';
export { generateCodeFrame } from '@vue/shared';
import { Node as Node$1, Identifier, Function, BlockStatement as BlockStatement$1, Program, ObjectProperty } from '@babel/types';
import { ParserPlugin } from '@babel/parser';
import { RawSourceMap, SourceMapGenerator } from 'source-map-js';
export { generateCodeFrame } from '@vue/shared';
export declare const FRAGMENT: unique symbol;
export declare const TELEPORT: unique symbol;
@@ -35,7 +35,14 @@ export declare const CAMELIZE: unique symbol;
export declare const CAPITALIZE: unique symbol;
export declare const TO_HANDLER_KEY: unique symbol;
export declare const SET_BLOCK_TRACKING: unique symbol;
/**
* @deprecated no longer needed in 3.5+ because we no longer hoist element nodes
* but kept for backwards compat
*/
export declare const PUSH_SCOPE_ID: unique symbol;
/**
* @deprecated kept for backwards compat
*/
export declare const POP_SCOPE_ID: unique symbol;
export declare const WITH_CTX: unique symbol;
export declare const UNREF: unique symbol;
@@ -89,7 +96,7 @@ export interface TransformContext extends Required<Omit<TransformOptions, keyof
hoists: (JSChildNode | null)[];
imports: ImportItem[];
temps: number;
cached: number;
cached: (CacheExpression | null)[];
identifiers: {
[name: string]: number | undefined;
};
@@ -100,6 +107,7 @@ export interface TransformContext extends Required<Omit<TransformOptions, keyof
vOnce: number;
};
parent: ParentNode | null;
grandParent: ParentNode | null;
childIndex: number;
currentNode: RootNode | TemplateChildNode | null;
inVOnce: boolean;
@@ -112,7 +120,7 @@ export interface TransformContext extends Required<Omit<TransformOptions, keyof
addIdentifiers(exp: ExpressionNode | string): void;
removeIdentifiers(exp: ExpressionNode | string): void;
hoist(exp: string | JSChildNode | ArrayExpression): SimpleExpressionNode;
cache<T extends JSChildNode>(exp: T, isVNode?: boolean): CacheExpression | T;
cache(exp: JSChildNode, isVNode?: boolean, inVOnce?: boolean): CacheExpression;
constantCache: WeakMap<TemplateChildNode, ConstantTypes>;
filters?: Set<string>;
}
@@ -124,7 +132,7 @@ export declare function createStructuralDirectiveTransform(name: string | RegExp
export declare const transformElement: NodeTransform;
export declare function resolveComponentType(node: ComponentNode, context: TransformContext, ssr?: boolean): string | symbol | CallExpression;
export type PropsExpression = ObjectExpression | CallExpression | ExpressionNode;
export declare function buildProps(node: ElementNode, context: TransformContext, props: (DirectiveNode | AttributeNode)[] | undefined, isComponent: boolean, isDynamicComponent: boolean, ssr?: boolean): {
export declare function buildProps(node: ElementNode, context: TransformContext, props: ElementNode['props'] | undefined, isComponent: boolean, isDynamicComponent: boolean, ssr?: boolean): {
props: PropsExpression | undefined;
directives: DirectiveNode[];
patchFlag: number;
@@ -200,7 +208,7 @@ export interface RootNode extends Node {
directives: string[];
hoists: (JSChildNode | null)[];
imports: ImportItem[];
cached: number;
cached: (CacheExpression | null)[];
temps: number;
ssrHelpers?: symbol[];
codegenNode?: TemplateChildNode | JSChildNode | BlockStatement;
@@ -264,7 +272,7 @@ export interface DirectiveNode extends Node {
rawName?: string;
exp: ExpressionNode | undefined;
arg: ExpressionNode | undefined;
modifiers: string[];
modifiers: SimpleExpressionNode[];
/**
* optional property to cache the expression parse result for v-for
*/
@@ -278,7 +286,7 @@ export interface DirectiveNode extends Node {
export declare enum ConstantTypes {
NOT_CONSTANT = 0,
CAN_SKIP_PATCH = 1,
CAN_HOIST = 2,
CAN_CACHE = 2,
CAN_STRINGIFY = 3
}
export interface SimpleExpressionNode extends Node {
@@ -363,8 +371,8 @@ export interface VNodeCall extends Node {
type: NodeTypes.VNODE_CALL;
tag: string | symbol | CallExpression;
props: PropsExpression | undefined;
children: TemplateChildNode[] | TemplateTextChildNode | SlotsExpression | ForRenderListExpression | SimpleExpressionNode | undefined;
patchFlag: string | undefined;
children: TemplateChildNode[] | TemplateTextChildNode | SlotsExpression | ForRenderListExpression | SimpleExpressionNode | CacheExpression | undefined;
patchFlag: PatchFlags | undefined;
dynamicProps: string | SimpleExpressionNode | undefined;
directives: DirectiveArguments | undefined;
isBlock: boolean;
@@ -418,7 +426,9 @@ export interface CacheExpression extends Node {
type: NodeTypes.JS_CACHE_EXPRESSION;
index: number;
value: JSChildNode;
isVNode: boolean;
needPauseTracking: boolean;
inVOnce: boolean;
needArraySpread: boolean;
}
export interface MemoExpression extends CallExpression {
callee: typeof WITH_MEMO;
@@ -478,7 +488,7 @@ export interface SlotsObjectProperty extends Property {
value: SlotFunctionExpression;
}
export interface SlotFunctionExpression extends FunctionExpression {
returns: TemplateChildNode[];
returns: TemplateChildNode[] | CacheExpression;
}
export interface DynamicSlotsExpression extends CallExpression {
callee: typeof CREATE_SLOTS;
@@ -514,7 +524,7 @@ export interface ForCodegenNode extends VNodeCall {
tag: typeof FRAGMENT;
props: undefined;
children: ForRenderListExpression;
patchFlag: string;
patchFlag: PatchFlags;
disableTracking: boolean;
}
export interface ForRenderListExpression extends CallExpression {
@@ -522,7 +532,7 @@ export interface ForRenderListExpression extends CallExpression {
arguments: [ExpressionNode, ForIteratorExpression];
}
export interface ForIteratorExpression extends FunctionExpression {
returns: BlockCodegenNode;
returns?: BlockCodegenNode;
}
export declare const locStub: SourceLocation;
export declare function createRoot(children: TemplateChildNode[], source?: string): RootNode;
@@ -537,7 +547,7 @@ type InferCodegenNodeType<T> = T extends typeof RENDER_SLOT ? RenderSlotCall : C
export declare function createCallExpression<T extends CallExpression['callee']>(callee: T, args?: CallExpression['arguments'], loc?: SourceLocation): InferCodegenNodeType<T>;
export declare function createFunctionExpression(params: FunctionExpression['params'], returns?: FunctionExpression['returns'], newline?: boolean, isSlot?: boolean, loc?: SourceLocation): FunctionExpression;
export declare function createConditionalExpression(test: ConditionalExpression['test'], consequent: ConditionalExpression['consequent'], alternate: ConditionalExpression['alternate'], newline?: boolean): ConditionalExpression;
export declare function createCacheExpression(index: number, value: JSChildNode, isVNode?: boolean): CacheExpression;
export declare function createCacheExpression(index: number, value: JSChildNode, needPauseTracking?: boolean, inVOnce?: boolean): CacheExpression;
export declare function createBlockStatement(body: BlockStatement['body']): BlockStatement;
export declare function createTemplateLiteral(elements: TemplateLiteral['elements']): TemplateLiteral;
export declare function createIfStatement(test: IfStatement['test'], consequent: IfStatement['consequent'], alternate?: IfStatement['alternate']): IfStatement;
@@ -612,7 +622,8 @@ export declare enum ErrorCodes {
X_CACHE_HANDLER_NOT_SUPPORTED = 49,
X_SCOPE_ID_NOT_SUPPORTED = 50,
X_VNODE_HOOKS = 51,
__EXTEND_POINT__ = 52
X_V_BIND_INVALID_SAME_NAME_ARGUMENT = 52,
__EXTEND_POINT__ = 53
}
export declare const errorMessages: Record<ErrorCodes, string>;
@@ -651,6 +662,11 @@ export interface ParserOptions extends ErrorHandlingOptions, CompilerCompatOptio
* e.g. elements that should preserve whitespace inside, e.g. `<pre>`
*/
isPreTag?: (tag: string) => boolean;
/**
* Elements that should ignore the first newline token per parinsg spec
* e.g. `<textarea>` and `<pre>`
*/
isIgnoreNewlineTag?: (tag: string) => boolean;
/**
* Platform-specific built-in components e.g. `<Transition>`
*/
@@ -669,6 +685,7 @@ export interface ParserOptions extends ErrorHandlingOptions, CompilerCompatOptio
delimiters?: [string, string];
/**
* Whitespace handling strategy
* @default 'condense'
*/
whitespace?: 'preserve' | 'condense';
/**
@@ -832,7 +849,7 @@ export interface TransformOptions extends SharedTransformCodegenOptions, ErrorHa
*/
prefixIdentifiers?: boolean;
/**
* Hoist static VNodes and props objects to `_hoisted_x` constants
* Cache static VNodes and props objects to `_hoisted_x` constants
* @default false
*/
hoistStatic?: boolean;
@@ -923,6 +940,41 @@ export interface CodegenOptions extends SharedTransformCodegenOptions {
}
export type CompilerOptions = ParserOptions & TransformOptions & CodegenOptions;
/**
* The `SourceMapGenerator` type from `source-map-js` is a bit incomplete as it
* misses `toJSON()`. We also need to add types for internal properties which we
* need to access for better performance.
*
* Since TS 5.3, dts generation starts to strangely include broken triple slash
* references for source-map-js, so we are inlining all source map related types
* here to to workaround that.
*/
export interface CodegenSourceMapGenerator {
setSourceContent(sourceFile: string, sourceContent: string): void;
toJSON(): RawSourceMap;
_sources: Set<string>;
_names: Set<string>;
_mappings: {
add(mapping: MappingItem): void;
};
}
export interface RawSourceMap {
file?: string;
sourceRoot?: string;
version: string;
sources: string[];
names: string[];
sourcesContent?: string[];
mappings: string;
}
interface MappingItem {
source: string;
generatedLine: number;
generatedColumn: number;
originalLine: number;
originalColumn: number;
name: string | null;
}
type CodegenNode = TemplateChildNode | JSChildNode | SSRCodegenNode;
export interface CodegenResult {
code: string;
@@ -938,7 +990,7 @@ export interface CodegenContext extends Omit<Required<CodegenOptions>, 'bindingM
offset: number;
indentLevel: number;
pure: boolean;
map?: SourceMapGenerator;
map?: CodegenSourceMapGenerator;
helper(key: symbol): string;
push(code: string, newlineIndex?: number, node?: CodegenNode): void;
indent(): void;
@@ -965,9 +1017,12 @@ export declare const isSimpleIdentifier: (name: string) => boolean;
* inside square brackets), but it's ok since these are only used on template
* expressions and false positives are invalid expressions in the first place.
*/
export declare const isMemberExpressionBrowser: (path: string) => boolean;
export declare const isMemberExpressionNode: (path: string, context: TransformContext) => boolean;
export declare const isMemberExpression: (path: string, context: TransformContext) => boolean;
export declare const isMemberExpressionBrowser: (exp: ExpressionNode) => boolean;
export declare const isMemberExpressionNode: (exp: ExpressionNode, context: TransformContext) => boolean;
export declare const isMemberExpression: (exp: ExpressionNode, context: TransformContext) => boolean;
export declare const isFnExpressionBrowser: (exp: ExpressionNode) => boolean;
export declare const isFnExpressionNode: (exp: ExpressionNode, context: TransformContext) => boolean;
export declare const isFnExpression: (exp: ExpressionNode, context: TransformContext) => boolean;
export declare function advancePositionWithClone(pos: Position, source: string, numberOfCharacters?: number): Position;
export declare function advancePositionWithMutation(pos: Position, source: string, numberOfCharacters?: number): Position;
export declare function assert(condition: boolean, msg?: string): void;
@@ -981,11 +1036,14 @@ export declare function isTemplateNode(node: RootNode | TemplateChildNode): node
export declare function isSlotOutlet(node: RootNode | TemplateChildNode): node is SlotOutletNode;
export declare function injectProp(node: VNodeCall | RenderSlotCall, prop: Property, context: TransformContext): void;
export declare function toValidAssetId(name: string, type: 'component' | 'directive' | 'filter'): string;
export declare function hasScopeRef(node: TemplateChildNode | IfBranchNode | ExpressionNode | undefined, ids: TransformContext['identifiers']): boolean;
export declare function hasScopeRef(node: TemplateChildNode | IfBranchNode | ExpressionNode | CacheExpression | undefined, ids: TransformContext['identifiers']): boolean;
export declare function getMemoedVNodeCall(node: BlockCodegenNode | MemoExpression): VNodeCall | RenderSlotCall;
export declare const forAliasRE: RegExp;
export declare function walkIdentifiers(root: Node$1, onIdentifier: (node: Identifier, parent: Node$1, parentStack: Node$1[], isReference: boolean, isLocal: boolean) => void, includeAll?: boolean, parentStack?: Node$1[], knownIds?: Record<string, number>): void;
/**
* Return value indicates whether the AST walked can be a constant
*/
export declare function walkIdentifiers(root: Node$1, onIdentifier: (node: Identifier, parent: Node$1 | null, parentStack: Node$1[], isReference: boolean, isLocal: boolean) => void, includeAll?: boolean, parentStack?: Node$1[], knownIds?: Record<string, number>): void;
export declare function isReferencedIdentifier(id: Identifier, parent: Node$1 | null, parentStack: Node$1[]): boolean;
export declare function isInDestructureAssignment(parent: Node$1, parentStack: Node$1[]): boolean;
export declare function isInNewExpression(parentStack: Node$1[]): boolean;
@@ -1029,5 +1087,5 @@ interface SlotOutletProcessResult {
}
export declare function processSlotOutlet(node: SlotOutletNode, context: TransformContext): SlotOutletProcessResult;
export declare function getConstantType(node: TemplateChildNode | SimpleExpressionNode, context: TransformContext): ConstantTypes;
export declare function getConstantType(node: TemplateChildNode | SimpleExpressionNode | CacheExpression, context: TransformContext): ConstantTypes;

File diff suppressed because it is too large Load Diff