将 magic-string 从 0.x 升级到 1.x
根据 TypeScript 类型自动比较 magic-string 0.30.21 与 1.4.2 的公开 API。签名变化表示可能存在不兼容变更,并非确定结论。
概要
| 已删除的导入路径 | 0 |
|---|---|
| 已删除的导出 | 0 |
| 已修改的签名 | 0 |
| 已删除的类或接口成员 | 1 |
| 已修改的类或接口成员 | 15 |
| 新增弃用 | 0 |
| 要求变化(engines、peer 依赖) | 0 |
| 新增导出 | 5 |
已删除的导出
未发现。
已修改的签名
未发现。
已删除的类或接口成员
| member | import | 之前 |
|---|---|---|
default.indentExclusionRanges | magic-string | ExclusionRange | ExclusionRange[] |
已修改的类或接口成员
| member | 之前 | 之后 |
|---|---|---|
Bundle.addSource | (source: MagicString | { filename?: string | undefined; content: MagicString; ignoreList?: boolean | undefined; }): Bundle | (source: MagicString | BundleSourceDescription): Bundle |
Bundle.generateMap | (options?: SourceMapOptions | undefined): Omit<SourceMap, "sourcesContent"> & { sourcesContent: (string | null)[]; } | (options?: BundleSourceMapOptions | undefined): Omit<SourceMap, "sourcesContent"> & { sourcesContent: (string | null)[]; } |
Bundle.generateDecodedMap | (options?: SourceMapOptions | undefined): Omit<DecodedSourceMap, "sourcesContent"> & { sourcesContent: (string | null)[]; } | (options?: BundleSourceMapOptions | undefined): DecodedSourceMapOrMissingContent |
Bundle.indentExclusionRanges | ExclusionRange | ExclusionRange[] | ExclusionRange | ExclusionRange[] | undefined |
default.move | (start: number, end: number, index: number): MagicString | (start: number, end: number, index: number, affinity?: "left" | "right" | undefined): MagicString |
default.slice | (start: number, end: number): string | (start?: number | undefined, end?: number | undefined): string |
default.replace | (regex: string | RegExp, replacement: string | ((substring: string, ...args: any[]) => string)): MagicString | (searchValue: string | RegExp, replacement: string | ReplacementFunction): MagicString |
default.replaceAll | (regex: string | RegExp, replacement: string | ((substring: string, ...args: any[]) => string)): MagicString | (searchValue: string | RegExp, replacement: string | ReplacementFunction): MagicString |
default.constructor | (str: string, options?: MagicStringOptions | undefined): MagicString | (string: string, options?: MagicStringOptions | undefined): MagicString |
SourceMap.file | string | string | undefined |
SourceMap.constructor | (properties: DecodedSourceMap): SourceMap | (properties: DecodedSourceMap | (Omit<DecodedSourceMap, "mappings"> & { mappings: string; })): SourceMap |
SourceMap.sourcesContent | string[] | undefined | (string | null)[] | undefined |
DecodedSourceMap.file | string | string | undefined |
DecodedSourceMap.sourcesContent | string[] | undefined | (string | null)[] | undefined |
SourceMapOptions.hires | boolean | "boundary" | undefined | boolean | "boundary" | "experimental-range" | undefined |
新增弃用
未发现。
要求变化(engines、peer 依赖)
未发现。
新增导出 (5)
| import | export | kind |
|---|---|---|
magic-string | MagicString | class |
magic-string | MagicStringError | class |
magic-string | ReplacementFunction | type |
magic-string | BundleSourceMapOptions | interface |
magic-string | BundledSourceFileRecord | interface |
常见问题
将 magic-string 从 0 升级到 1 有哪些不兼容变更?
在 magic-string 0.30.21 与 1.4.2 之间,Vigia 发现 0 个已删除的导出、0 个已修改的签名,以及 16 个已删除或修改的类或接口成员。
magic-string 1 中弃用了哪些内容?
magic-string 1.4.2 中有 0 个导出或成员新被标记为弃用。
供智能体使用
GET https://vigia.coredls.cloud/v1/packages/npm/magic-string/upgrade?from=0.30.21&to=1.4.2