@code-inspector/core 1.4.5 → 1.4.6
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.js +4 -4
- package/dist/index.mjs +20414 -20417
- package/package.json +1 -1
- package/types/server/transform/transform-vue-pug.d.ts +15 -0
- package/types/server/transform/transform-vue.d.ts +3 -0
- package/types/shared/utils.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import MagicString from 'magic-string';
|
|
2
2
|
import { EscapeTags } from '../../shared';
|
|
3
3
|
import type { ElementNode } from '@vue/compiler-dom';
|
|
4
|
+
import * as pug from 'volar-service-pug/lib/languageService';
|
|
5
|
+
interface AstLocation {
|
|
6
|
+
column: number;
|
|
7
|
+
line: number;
|
|
8
|
+
}
|
|
4
9
|
export interface PugFileInfo {
|
|
5
10
|
content: string;
|
|
6
11
|
offsets: number[];
|
|
7
12
|
}
|
|
8
13
|
export declare const pugMap: Map<string, PugFileInfo>;
|
|
14
|
+
export declare function belongTemplate(target: AstLocation, start: AstLocation, end: AstLocation): boolean;
|
|
15
|
+
interface TransformPugParams {
|
|
16
|
+
node: pug.Node | null | undefined;
|
|
17
|
+
templateNode: ElementNode;
|
|
18
|
+
s: MagicString;
|
|
19
|
+
escapeTags: EscapeTags;
|
|
20
|
+
filePath: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function transformPugAst(params: TransformPugParams): void;
|
|
9
23
|
/**
|
|
10
24
|
* Check if a template node uses Pug syntax
|
|
11
25
|
* @param templateNode - The template element node to check
|
|
@@ -27,3 +41,4 @@ export declare function calculateLineOffsets(content: string): number[];
|
|
|
27
41
|
* @param s - MagicString instance for code transformation
|
|
28
42
|
*/
|
|
29
43
|
export declare function transformPugTemplate(content: string, filePath: string, templateNode: ElementNode, escapeTags: EscapeTags, s: MagicString): void;
|
|
44
|
+
export {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import { EscapeTags } from '../../shared';
|
|
2
|
+
type VueCompilerDom = Pick<typeof import('@vue/compiler-dom'), 'parse' | 'transform'>;
|
|
3
|
+
export declare function resolveVueCompilerDom(mod: any): VueCompilerDom;
|
|
2
4
|
export declare function transformVue(content: string, filePath: string, escapeTags: EscapeTags): Promise<string>;
|
|
5
|
+
export {};
|
package/types/shared/utils.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CodeOptions, Condition, EscapeTags } from './type';
|
|
2
2
|
export declare function getIP(ip: boolean | string): string;
|
|
3
|
-
export declare function fileURLToPath(fileURL: string): string;
|
|
4
3
|
export declare function isJsTypeFile(file: string): boolean;
|
|
5
4
|
export declare function getFilePathWithoutExt(filePath: string): string;
|
|
6
5
|
export declare function normalizePath(filepath: string): string;
|