@react-pug/react-pug-core 0.1.0
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/README.md +60 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/language/diagnosticMapping.d.ts +25 -0
- package/dist/language/diagnosticMapping.d.ts.map +1 -0
- package/dist/language/diagnosticMapping.js +89 -0
- package/dist/language/diagnosticMapping.js.map +1 -0
- package/dist/language/extractRegions.d.ts +39 -0
- package/dist/language/extractRegions.d.ts.map +1 -0
- package/dist/language/extractRegions.js +419 -0
- package/dist/language/extractRegions.js.map +1 -0
- package/dist/language/mapping.d.ts +181 -0
- package/dist/language/mapping.d.ts.map +1 -0
- package/dist/language/mapping.js +32 -0
- package/dist/language/mapping.js.map +1 -0
- package/dist/language/positionMapping.d.ts +6 -0
- package/dist/language/positionMapping.d.ts.map +1 -0
- package/dist/language/positionMapping.js +138 -0
- package/dist/language/positionMapping.js.map +1 -0
- package/dist/language/pugToTsx.d.ts +39 -0
- package/dist/language/pugToTsx.d.ts.map +1 -0
- package/dist/language/pugToTsx.js +1484 -0
- package/dist/language/pugToTsx.js.map +1 -0
- package/dist/language/shadowDocument.d.ts +15 -0
- package/dist/language/shadowDocument.d.ts.map +1 -0
- package/dist/language/shadowDocument.js +480 -0
- package/dist/language/shadowDocument.js.map +1 -0
- package/dist/language/sourceTransform.d.ts +88 -0
- package/dist/language/sourceTransform.d.ts.map +1 -0
- package/dist/language/sourceTransform.js +80 -0
- package/dist/language/sourceTransform.js.map +1 -0
- package/package.json +22 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractPugRegions = extractPugRegions;
|
|
4
|
+
exports.extractPugAnalysis = extractPugAnalysis;
|
|
5
|
+
const parser_1 = require("@babel/parser");
|
|
6
|
+
/** Strip the common leading whitespace from all non-empty lines, returning the stripped text and indent amount */
|
|
7
|
+
function stripCommonIndent(text) {
|
|
8
|
+
const lines = text.split('\n');
|
|
9
|
+
let minIndent = Infinity;
|
|
10
|
+
for (const line of lines) {
|
|
11
|
+
if (line.trim().length === 0)
|
|
12
|
+
continue;
|
|
13
|
+
const indent = line.match(/^(\s*)/)?.[1].length ?? 0;
|
|
14
|
+
if (indent < minIndent)
|
|
15
|
+
minIndent = indent;
|
|
16
|
+
}
|
|
17
|
+
if (minIndent === Infinity || minIndent === 0)
|
|
18
|
+
return { stripped: text, indent: 0 };
|
|
19
|
+
const stripped = lines
|
|
20
|
+
.map(line => (line.trim().length === 0 ? '' : line.slice(minIndent)))
|
|
21
|
+
.join('\n');
|
|
22
|
+
return { stripped, indent: minIndent };
|
|
23
|
+
}
|
|
24
|
+
/** Determine babel parser plugins based on filename */
|
|
25
|
+
function getPluginsForFile(filename) {
|
|
26
|
+
const isTS = /\.tsx?$/i.test(filename);
|
|
27
|
+
const isJSX = /\.[jt]sx$/i.test(filename);
|
|
28
|
+
const plugins = ['decorators-legacy'];
|
|
29
|
+
if (isTS)
|
|
30
|
+
plugins.push('typescript');
|
|
31
|
+
if (isJSX || isTS)
|
|
32
|
+
plugins.push('jsx');
|
|
33
|
+
// For .js files, still try jsx since many React projects use JSX in .js
|
|
34
|
+
if (!isTS && !isJSX)
|
|
35
|
+
plugins.push('jsx');
|
|
36
|
+
return plugins;
|
|
37
|
+
}
|
|
38
|
+
function getNodeText(text, node) {
|
|
39
|
+
return text.slice(node.start ?? 0, node.end ?? 0);
|
|
40
|
+
}
|
|
41
|
+
function padToLength(text, targetLength) {
|
|
42
|
+
if (text.length >= targetLength)
|
|
43
|
+
return text;
|
|
44
|
+
return text + ' '.repeat(targetLength - text.length);
|
|
45
|
+
}
|
|
46
|
+
function buildImportCleanup(text, declaration, matchedSpecifiers) {
|
|
47
|
+
const originalStart = declaration.start ?? 0;
|
|
48
|
+
const originalEnd = declaration.end ?? originalStart;
|
|
49
|
+
const originalText = text.slice(originalStart, originalEnd);
|
|
50
|
+
const sourceText = getNodeText(text, declaration.source);
|
|
51
|
+
const remaining = declaration.specifiers.filter(spec => !matchedSpecifiers.includes(spec));
|
|
52
|
+
const hasSemicolon = originalText.trimEnd().endsWith(';');
|
|
53
|
+
let replacement = '';
|
|
54
|
+
if (remaining.length === 0) {
|
|
55
|
+
replacement = declaration.importKind === 'type'
|
|
56
|
+
? ''
|
|
57
|
+
: `import ${sourceText}${hasSemicolon ? ';' : ''}`;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const defaultSpecifier = remaining.find(spec => spec.type === 'ImportDefaultSpecifier');
|
|
61
|
+
const namespaceSpecifier = remaining.find(spec => spec.type === 'ImportNamespaceSpecifier');
|
|
62
|
+
const namedSpecifiers = remaining.filter(spec => spec.type === 'ImportSpecifier');
|
|
63
|
+
const parts = [];
|
|
64
|
+
if (defaultSpecifier)
|
|
65
|
+
parts.push(getNodeText(text, defaultSpecifier));
|
|
66
|
+
if (namespaceSpecifier)
|
|
67
|
+
parts.push(getNodeText(text, namespaceSpecifier));
|
|
68
|
+
if (namedSpecifiers.length > 0) {
|
|
69
|
+
parts.push(`{ ${namedSpecifiers.map(spec => getNodeText(text, spec)).join(', ')} }`);
|
|
70
|
+
}
|
|
71
|
+
const importPrefix = declaration.importKind === 'type' ? 'import type ' : 'import ';
|
|
72
|
+
replacement = `${importPrefix}${parts.join(', ')} from ${sourceText}${hasSemicolon ? ';' : ''}`;
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
originalStart,
|
|
76
|
+
originalEnd,
|
|
77
|
+
replacementText: padToLength(replacement, originalEnd - originalStart),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function getLineStartOffset(text, offset) {
|
|
81
|
+
const lineBreak = text.lastIndexOf('\n', Math.max(0, offset - 1));
|
|
82
|
+
return lineBreak < 0 ? 0 : lineBreak + 1;
|
|
83
|
+
}
|
|
84
|
+
function getLineIndent(text, offset) {
|
|
85
|
+
const lineStart = getLineStartOffset(text, offset);
|
|
86
|
+
const line = text.slice(lineStart, text.indexOf('\n', lineStart) >= 0 ? text.indexOf('\n', lineStart) : text.length);
|
|
87
|
+
return line.match(/^[ \t]*/) ? line.match(/^[ \t]*/)[0] : '';
|
|
88
|
+
}
|
|
89
|
+
function getOffsetAfterTrailingLineBreak(text, offset) {
|
|
90
|
+
if (text[offset] === '\r' && text[offset + 1] === '\n')
|
|
91
|
+
return offset + 2;
|
|
92
|
+
if (text[offset] === '\n' || text[offset] === '\r')
|
|
93
|
+
return offset + 1;
|
|
94
|
+
return offset;
|
|
95
|
+
}
|
|
96
|
+
function isDirectiveStatement(node) {
|
|
97
|
+
return node.type === 'ExpressionStatement' && typeof node.directive === 'string';
|
|
98
|
+
}
|
|
99
|
+
function findProgramInsertionOffset(text, program) {
|
|
100
|
+
const body = program.body;
|
|
101
|
+
let lastLeading = null;
|
|
102
|
+
for (const statement of body) {
|
|
103
|
+
if (statement.type === 'ImportDeclaration' || isDirectiveStatement(statement)) {
|
|
104
|
+
lastLeading = statement;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
return statement.start ?? 0;
|
|
108
|
+
}
|
|
109
|
+
return lastLeading ? getOffsetAfterTrailingLineBreak(text, lastLeading.end ?? 0) : 0;
|
|
110
|
+
}
|
|
111
|
+
function findBlockInsertionOffset(block) {
|
|
112
|
+
const firstNonDirective = block.body.find(statement => !isDirectiveStatement(statement));
|
|
113
|
+
if (firstNonDirective)
|
|
114
|
+
return firstNonDirective.start ?? ((block.start ?? 0) + 1);
|
|
115
|
+
return Math.max(0, (block.end ?? 0) - 1);
|
|
116
|
+
}
|
|
117
|
+
function buildArrowExpressionScopeTarget(text, node) {
|
|
118
|
+
if (node.body.type !== 'BlockStatement') {
|
|
119
|
+
const closingIndent = getLineIndent(text, node.start ?? node.body.start ?? 0);
|
|
120
|
+
return {
|
|
121
|
+
kind: 'arrow-expression',
|
|
122
|
+
insertionOffset: node.body.start ?? 0,
|
|
123
|
+
statementIndent: `${closingIndent} `,
|
|
124
|
+
closingIndent,
|
|
125
|
+
expressionEnd: node.body.end ?? 0,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
throw new Error('Arrow expression scope target requires a non-block arrow body');
|
|
129
|
+
}
|
|
130
|
+
function buildBlockScopeTarget(text, block) {
|
|
131
|
+
const blockIndent = getLineIndent(text, block.start ?? 0);
|
|
132
|
+
return {
|
|
133
|
+
kind: 'block',
|
|
134
|
+
insertionOffset: findBlockInsertionOffset(block),
|
|
135
|
+
statementIndent: `${blockIndent} `,
|
|
136
|
+
closingIndent: blockIndent,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function buildStatementBodyScopeTarget(text, statement, parent) {
|
|
140
|
+
const closingIndent = getLineIndent(text, parent.start ?? statement.start ?? 0);
|
|
141
|
+
return {
|
|
142
|
+
kind: 'statement-body',
|
|
143
|
+
insertionOffset: statement.start ?? 0,
|
|
144
|
+
statementIndent: `${closingIndent} `,
|
|
145
|
+
closingIndent,
|
|
146
|
+
statementEnd: statement.end ?? statement.start ?? 0,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function shouldWrapStatementBody(parent, key, child) {
|
|
150
|
+
if (child.type === 'BlockStatement')
|
|
151
|
+
return false;
|
|
152
|
+
if (parent.type === 'IfStatement' && (key === 'consequent' || key === 'alternate'))
|
|
153
|
+
return true;
|
|
154
|
+
if ((parent.type === 'WhileStatement'
|
|
155
|
+
|| parent.type === 'DoWhileStatement'
|
|
156
|
+
|| parent.type === 'ForStatement'
|
|
157
|
+
|| parent.type === 'ForInStatement'
|
|
158
|
+
|| parent.type === 'ForOfStatement'
|
|
159
|
+
|| parent.type === 'WithStatement'
|
|
160
|
+
|| parent.type === 'LabeledStatement')
|
|
161
|
+
&& key === 'body') {
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
function collectPugAnalysis(node, text, templates, imports, scopeStack, ancestors = [], tagName = 'pug') {
|
|
167
|
+
if (!node || typeof node !== 'object')
|
|
168
|
+
return;
|
|
169
|
+
if (node.type === 'TaggedTemplateExpression' &&
|
|
170
|
+
node.tag.type === 'Identifier' &&
|
|
171
|
+
node.tag.name === tagName) {
|
|
172
|
+
templates.push({
|
|
173
|
+
node,
|
|
174
|
+
styleScopeTarget: scopeStack[scopeStack.length - 1],
|
|
175
|
+
});
|
|
176
|
+
// Do not recurse into this tagged template. Nested pug tags (e.g. inside ${...})
|
|
177
|
+
// are handled by the parent pug region compiler to avoid overlapping regions.
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (node.type === 'ImportDeclaration') {
|
|
181
|
+
const declaration = node;
|
|
182
|
+
const matchedSpecifiers = declaration.specifiers.filter((specifier) => {
|
|
183
|
+
if (specifier.type === 'ImportSpecifier') {
|
|
184
|
+
return specifier.local.name === tagName && specifier.imported.type === 'Identifier' && specifier.imported.name === 'pug';
|
|
185
|
+
}
|
|
186
|
+
if (specifier.type === 'ImportDefaultSpecifier') {
|
|
187
|
+
return specifier.local.name === tagName;
|
|
188
|
+
}
|
|
189
|
+
return false;
|
|
190
|
+
});
|
|
191
|
+
const helperImports = new Set();
|
|
192
|
+
for (const specifier of declaration.specifiers) {
|
|
193
|
+
if (specifier.type !== 'ImportSpecifier' || specifier.imported.type !== 'Identifier')
|
|
194
|
+
continue;
|
|
195
|
+
if (specifier.local.name !== specifier.imported.name)
|
|
196
|
+
continue;
|
|
197
|
+
if (specifier.imported.name === 'css'
|
|
198
|
+
|| specifier.imported.name === 'styl'
|
|
199
|
+
|| specifier.imported.name === 'sass'
|
|
200
|
+
|| specifier.imported.name === 'scss') {
|
|
201
|
+
helperImports.add(specifier.imported.name);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
imports.push({
|
|
205
|
+
declaration,
|
|
206
|
+
source: String(declaration.source.value),
|
|
207
|
+
sourceText: getNodeText(text, declaration.source),
|
|
208
|
+
cleanup: matchedSpecifiers.length > 0 ? buildImportCleanup(text, declaration, matchedSpecifiers) : null,
|
|
209
|
+
hasMatchedTag: matchedSpecifiers.length > 0,
|
|
210
|
+
matchedSpecifiers,
|
|
211
|
+
helperImports,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
for (const key of Object.keys(node)) {
|
|
215
|
+
if (key === 'type' || key === 'loc' || key === 'start' || key === 'end')
|
|
216
|
+
continue;
|
|
217
|
+
const child = node[key];
|
|
218
|
+
if (Array.isArray(child)) {
|
|
219
|
+
for (const item of child) {
|
|
220
|
+
if (item && typeof item === 'object' && typeof item.type === 'string') {
|
|
221
|
+
const nextScopeStack = item.type === 'BlockStatement'
|
|
222
|
+
? [...scopeStack, buildBlockScopeTarget(text, item)]
|
|
223
|
+
: scopeStack;
|
|
224
|
+
collectPugAnalysis(item, text, templates, imports, nextScopeStack, [...ancestors, node], tagName);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
else if (child && typeof child === 'object' && typeof child.type === 'string') {
|
|
229
|
+
const nextScopeStack = (node.type === 'ArrowFunctionExpression'
|
|
230
|
+
&& key === 'body'
|
|
231
|
+
&& child.type !== 'BlockStatement')
|
|
232
|
+
? [...scopeStack, buildArrowExpressionScopeTarget(text, node)]
|
|
233
|
+
: shouldWrapStatementBody(node, key, child)
|
|
234
|
+
? [...scopeStack, buildStatementBodyScopeTarget(text, child, node)]
|
|
235
|
+
: (child.type === 'BlockStatement'
|
|
236
|
+
? [...scopeStack, buildBlockScopeTarget(text, child)]
|
|
237
|
+
: scopeStack);
|
|
238
|
+
collectPugAnalysis(child, text, templates, imports, nextScopeStack, [...ancestors, node], tagName);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/** Escape special regex characters in a string */
|
|
243
|
+
function escapeRegExp(s) {
|
|
244
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
245
|
+
}
|
|
246
|
+
/** Regex fallback for when @babel/parser fails */
|
|
247
|
+
function extractWithRegex(text, tagName = 'pug') {
|
|
248
|
+
const re = new RegExp(`\\b${escapeRegExp(tagName)}\\s*\`([\\s\\S]*?)\``, 'g');
|
|
249
|
+
const regions = [];
|
|
250
|
+
let match;
|
|
251
|
+
while ((match = re.exec(text)) !== null) {
|
|
252
|
+
const fullMatchStart = match.index;
|
|
253
|
+
const fullMatchEnd = fullMatchStart + match[0].length;
|
|
254
|
+
const rawContent = match[1];
|
|
255
|
+
// Offsets of the content inside backticks
|
|
256
|
+
const backtickStart = text.indexOf('`', fullMatchStart);
|
|
257
|
+
const pugTextStart = backtickStart + 1;
|
|
258
|
+
const pugTextEnd = pugTextStart + rawContent.length;
|
|
259
|
+
const { stripped, indent } = stripCommonIndent(rawContent);
|
|
260
|
+
regions.push({
|
|
261
|
+
originalStart: fullMatchStart,
|
|
262
|
+
originalEnd: fullMatchEnd,
|
|
263
|
+
pugTextStart,
|
|
264
|
+
pugTextEnd,
|
|
265
|
+
pugText: stripped,
|
|
266
|
+
commonIndent: indent,
|
|
267
|
+
// Shadow fields populated later by the generator
|
|
268
|
+
shadowStart: 0,
|
|
269
|
+
shadowEnd: 0,
|
|
270
|
+
tsxText: '',
|
|
271
|
+
mappings: [],
|
|
272
|
+
lexerTokens: [],
|
|
273
|
+
parseError: null,
|
|
274
|
+
transformError: null,
|
|
275
|
+
styleBlock: null,
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
return regions;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Extract all pug tagged template literal regions from a source file.
|
|
282
|
+
* Uses @babel/parser for accurate AST-based extraction, with regex fallback.
|
|
283
|
+
*/
|
|
284
|
+
function extractPugRegions(text, filename, tagName = 'pug') {
|
|
285
|
+
return extractPugAnalysis(text, filename, tagName).regions;
|
|
286
|
+
}
|
|
287
|
+
function extractPugAnalysis(text, filename, tagName = 'pug') {
|
|
288
|
+
// Fast path: skip parsing if no pug templates
|
|
289
|
+
if (!text.includes(tagName + '`') && !text.includes(tagName + ' `')) {
|
|
290
|
+
return {
|
|
291
|
+
regions: [],
|
|
292
|
+
importCleanups: [],
|
|
293
|
+
tagImportEntries: [],
|
|
294
|
+
usesTagFunction: false,
|
|
295
|
+
hasTagImport: false,
|
|
296
|
+
tagImportSource: null,
|
|
297
|
+
tagImportSourceText: null,
|
|
298
|
+
helperImportInsertionOffset: null,
|
|
299
|
+
existingStyleImports: new Set(),
|
|
300
|
+
styleScopeTargets: [],
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
let templates;
|
|
304
|
+
let imports;
|
|
305
|
+
let templateData;
|
|
306
|
+
try {
|
|
307
|
+
const ast = (0, parser_1.parse)(text, {
|
|
308
|
+
sourceType: 'module',
|
|
309
|
+
plugins: getPluginsForFile(filename),
|
|
310
|
+
errorRecovery: true,
|
|
311
|
+
ranges: true,
|
|
312
|
+
});
|
|
313
|
+
templates = [];
|
|
314
|
+
templateData = [];
|
|
315
|
+
imports = [];
|
|
316
|
+
const programTarget = {
|
|
317
|
+
kind: 'program',
|
|
318
|
+
insertionOffset: findProgramInsertionOffset(text, ast.program),
|
|
319
|
+
statementIndent: '',
|
|
320
|
+
closingIndent: '',
|
|
321
|
+
};
|
|
322
|
+
collectPugAnalysis(ast, text, templateData, imports, [programTarget], [], tagName);
|
|
323
|
+
templateData.sort((a, b) => (a.node.start ?? 0) - (b.node.start ?? 0));
|
|
324
|
+
templates = templateData.map(entry => entry.node);
|
|
325
|
+
}
|
|
326
|
+
catch {
|
|
327
|
+
// @babel/parser failed -- fall back to regex
|
|
328
|
+
const regions = extractWithRegex(text, tagName);
|
|
329
|
+
return {
|
|
330
|
+
regions,
|
|
331
|
+
importCleanups: [],
|
|
332
|
+
tagImportEntries: [],
|
|
333
|
+
usesTagFunction: regions.length > 0,
|
|
334
|
+
hasTagImport: false,
|
|
335
|
+
tagImportSource: null,
|
|
336
|
+
tagImportSourceText: null,
|
|
337
|
+
helperImportInsertionOffset: null,
|
|
338
|
+
existingStyleImports: new Set(),
|
|
339
|
+
styleScopeTargets: regions.map(() => ({
|
|
340
|
+
kind: 'program',
|
|
341
|
+
insertionOffset: 0,
|
|
342
|
+
statementIndent: '',
|
|
343
|
+
closingIndent: '',
|
|
344
|
+
})),
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
if (templates.length === 0) {
|
|
348
|
+
const tagImportEntries = imports.filter(entry => entry.hasMatchedTag);
|
|
349
|
+
return {
|
|
350
|
+
regions: [],
|
|
351
|
+
importCleanups: [],
|
|
352
|
+
tagImportEntries,
|
|
353
|
+
usesTagFunction: false,
|
|
354
|
+
hasTagImport: tagImportEntries.length > 0,
|
|
355
|
+
tagImportSource: null,
|
|
356
|
+
tagImportSourceText: null,
|
|
357
|
+
helperImportInsertionOffset: null,
|
|
358
|
+
existingStyleImports: new Set(),
|
|
359
|
+
styleScopeTargets: [],
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
const regions = [];
|
|
363
|
+
for (const node of templates) {
|
|
364
|
+
const originalStart = node.start ?? 0;
|
|
365
|
+
const originalEnd = node.end ?? 0;
|
|
366
|
+
const quasi = node.quasi;
|
|
367
|
+
const quasis = quasi.quasis;
|
|
368
|
+
// Offsets of the template content (inside backticks)
|
|
369
|
+
const pugTextStart = quasis[0].start ?? ((quasi.start ?? 0) + 1);
|
|
370
|
+
const pugTextEnd = quasis[quasis.length - 1].end ?? ((quasi.end ?? 0) - 1);
|
|
371
|
+
const rawContent = text.slice(pugTextStart, pugTextEnd);
|
|
372
|
+
const { stripped, indent } = stripCommonIndent(rawContent);
|
|
373
|
+
const region = {
|
|
374
|
+
originalStart,
|
|
375
|
+
originalEnd,
|
|
376
|
+
pugTextStart,
|
|
377
|
+
pugTextEnd,
|
|
378
|
+
pugText: stripped,
|
|
379
|
+
commonIndent: indent,
|
|
380
|
+
// Shadow fields populated later by the generator
|
|
381
|
+
shadowStart: 0,
|
|
382
|
+
shadowEnd: 0,
|
|
383
|
+
tsxText: '',
|
|
384
|
+
mappings: [],
|
|
385
|
+
lexerTokens: [],
|
|
386
|
+
parseError: null,
|
|
387
|
+
transformError: null,
|
|
388
|
+
styleBlock: null,
|
|
389
|
+
};
|
|
390
|
+
regions.push(region);
|
|
391
|
+
}
|
|
392
|
+
const tagImportEntries = imports.filter(entry => entry.hasMatchedTag);
|
|
393
|
+
const tagImportSource = tagImportEntries[0]?.source ?? null;
|
|
394
|
+
const tagImportSourceText = tagImportEntries[0]?.sourceText ?? null;
|
|
395
|
+
const sameSourceImports = tagImportSource == null
|
|
396
|
+
? []
|
|
397
|
+
: imports.filter(entry => entry.source === tagImportSource);
|
|
398
|
+
const existingStyleImports = new Set();
|
|
399
|
+
for (const entry of sameSourceImports) {
|
|
400
|
+
for (const helper of entry.helperImports)
|
|
401
|
+
existingStyleImports.add(helper);
|
|
402
|
+
}
|
|
403
|
+
const helperImportInsertionOffset = sameSourceImports.length > 0
|
|
404
|
+
? getOffsetAfterTrailingLineBreak(text, sameSourceImports[sameSourceImports.length - 1].declaration.end ?? 0)
|
|
405
|
+
: null;
|
|
406
|
+
return {
|
|
407
|
+
regions,
|
|
408
|
+
importCleanups: tagImportEntries.flatMap(entry => entry.cleanup ? [entry.cleanup] : []),
|
|
409
|
+
tagImportEntries,
|
|
410
|
+
usesTagFunction: regions.length > 0,
|
|
411
|
+
hasTagImport: tagImportEntries.length > 0,
|
|
412
|
+
tagImportSource,
|
|
413
|
+
tagImportSourceText,
|
|
414
|
+
helperImportInsertionOffset,
|
|
415
|
+
existingStyleImports,
|
|
416
|
+
styleScopeTargets: templateData.map(entry => entry.styleScopeTarget),
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
//# sourceMappingURL=extractRegions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractRegions.js","sourceRoot":"","sources":["../../src/language/extractRegions.ts"],"names":[],"mappings":";;AAoXA,8C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}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type { Mapping } from '@volar/source-map';
|
|
2
|
+
/** Controls which IntelliSense features are enabled for a mapped span */
|
|
3
|
+
export interface CodeInformation {
|
|
4
|
+
/** Enable auto-completion suggestions */
|
|
5
|
+
completion: boolean;
|
|
6
|
+
/** Enable go-to-definition, find-references, rename */
|
|
7
|
+
navigation: boolean;
|
|
8
|
+
/** Enable type-checking diagnostics */
|
|
9
|
+
verification: boolean;
|
|
10
|
+
/** Enable semantic highlighting and hover info */
|
|
11
|
+
semantic: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Expressions, tag names, attribute names/values -- full IntelliSense */
|
|
14
|
+
export declare const FULL_FEATURES: CodeInformation;
|
|
15
|
+
/** Class/ID shorthands -- CSS names, not TS identifiers */
|
|
16
|
+
export declare const CSS_CLASS: CodeInformation;
|
|
17
|
+
/** Structural syntax (JSX brackets, keywords) -- no features */
|
|
18
|
+
export declare const SYNTHETIC: CodeInformation;
|
|
19
|
+
/** Expressions that should show diagnostics but not completions */
|
|
20
|
+
export declare const VERIFY_ONLY: CodeInformation;
|
|
21
|
+
/** Volar-compatible source mapping with CodeInformation feature flags */
|
|
22
|
+
export type CodeMapping = Mapping<CodeInformation>;
|
|
23
|
+
export interface PugParseError {
|
|
24
|
+
/** Error message from pug-lexer or pug-parser */
|
|
25
|
+
message: string;
|
|
26
|
+
/** Line number (1-based) within the pug region text */
|
|
27
|
+
line: number;
|
|
28
|
+
/** Column number (1-based) within the pug region text */
|
|
29
|
+
column: number;
|
|
30
|
+
/** Byte offset within the pug region text */
|
|
31
|
+
offset: number;
|
|
32
|
+
}
|
|
33
|
+
export type StyleTagLang = 'css' | 'styl' | 'sass' | 'scss';
|
|
34
|
+
export type PugTransformErrorCode = 'style-tag-must-be-last' | 'unsupported-style-lang' | 'invalid-style-attrs' | 'missing-pug-import-for-style';
|
|
35
|
+
export interface PugTransformError {
|
|
36
|
+
/** Stable machine-readable error code */
|
|
37
|
+
code: PugTransformErrorCode;
|
|
38
|
+
/** Error message from react-pug transform validation */
|
|
39
|
+
message: string;
|
|
40
|
+
/** Line number (1-based) within the pug region text */
|
|
41
|
+
line: number;
|
|
42
|
+
/** Column number (1-based) within the pug region text */
|
|
43
|
+
column: number;
|
|
44
|
+
/** Byte offset within the pug region text */
|
|
45
|
+
offset: number;
|
|
46
|
+
}
|
|
47
|
+
export interface ExtractedStyleBlock {
|
|
48
|
+
/** Helper function to call at the destination scope */
|
|
49
|
+
lang: StyleTagLang;
|
|
50
|
+
/** Style content with common body indentation removed */
|
|
51
|
+
content: string;
|
|
52
|
+
/** Offset of the style tag line within the pug region text */
|
|
53
|
+
tagOffset: number;
|
|
54
|
+
/** Offset of the style body start within the pug region text */
|
|
55
|
+
contentStart: number;
|
|
56
|
+
/** Offset of the style body end within the pug region text */
|
|
57
|
+
contentEnd: number;
|
|
58
|
+
/** Number of characters stripped from each non-empty style body line */
|
|
59
|
+
commonIndent: number;
|
|
60
|
+
/** Line number (1-based) of the style tag within the pug region text */
|
|
61
|
+
line: number;
|
|
62
|
+
/** Column number (1-based) of the style tag within the pug region text */
|
|
63
|
+
column: number;
|
|
64
|
+
}
|
|
65
|
+
/** Minimal pug lexer token shape (retained for sub-expression position resolution) */
|
|
66
|
+
export interface PugToken {
|
|
67
|
+
type: string;
|
|
68
|
+
loc: {
|
|
69
|
+
start: {
|
|
70
|
+
line: number;
|
|
71
|
+
column: number;
|
|
72
|
+
};
|
|
73
|
+
end: {
|
|
74
|
+
line: number;
|
|
75
|
+
column: number;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
val?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface TagImportCleanup {
|
|
81
|
+
/** Offset of the full import declaration in the original file */
|
|
82
|
+
originalStart: number;
|
|
83
|
+
originalEnd: number;
|
|
84
|
+
/** Fixed-length replacement text for the shadow/transformed output */
|
|
85
|
+
replacementText: string;
|
|
86
|
+
}
|
|
87
|
+
export interface MissingTagImportDiagnostic {
|
|
88
|
+
/** Human-readable message for the missing import condition */
|
|
89
|
+
message: string;
|
|
90
|
+
/** Original-file offset where the missing import should be reported */
|
|
91
|
+
start: number;
|
|
92
|
+
/** Diagnostic length in original-file coordinates */
|
|
93
|
+
length: number;
|
|
94
|
+
}
|
|
95
|
+
export interface ShadowCopySegment {
|
|
96
|
+
/** Original-file slice copied through unchanged */
|
|
97
|
+
originalStart: number;
|
|
98
|
+
originalEnd: number;
|
|
99
|
+
/** Corresponding shadow-file slice */
|
|
100
|
+
shadowStart: number;
|
|
101
|
+
shadowEnd: number;
|
|
102
|
+
}
|
|
103
|
+
export interface ShadowMappedRegion {
|
|
104
|
+
/** Generated region kind */
|
|
105
|
+
kind: 'pug' | 'style';
|
|
106
|
+
/** Region index whose stripped pug text is used as the mapping source space */
|
|
107
|
+
regionIndex: number;
|
|
108
|
+
/** Source span in stripped pug-text coordinates */
|
|
109
|
+
sourceStart: number;
|
|
110
|
+
sourceEnd: number;
|
|
111
|
+
/** Corresponding shadow-file generated span */
|
|
112
|
+
shadowStart: number;
|
|
113
|
+
shadowEnd: number;
|
|
114
|
+
/** Volar-compatible source mappings for this generated span */
|
|
115
|
+
mappings: CodeMapping[];
|
|
116
|
+
}
|
|
117
|
+
export interface ShadowInsertion {
|
|
118
|
+
/** Inserted shadow text that has no direct original slice */
|
|
119
|
+
kind: 'style-import' | 'style-call' | 'arrow-body-prefix' | 'arrow-body-suffix' | 'statement-body-suffix';
|
|
120
|
+
/** Original-file offset where the insertion occurs */
|
|
121
|
+
originalOffset: number;
|
|
122
|
+
/** Generated shadow span occupied by the insertion */
|
|
123
|
+
shadowStart: number;
|
|
124
|
+
shadowEnd: number;
|
|
125
|
+
}
|
|
126
|
+
export interface PugRegion {
|
|
127
|
+
/** Offset of the entire tagged template expression (pug`...`) in the original file */
|
|
128
|
+
originalStart: number;
|
|
129
|
+
originalEnd: number;
|
|
130
|
+
/** Offset of just the template content (inside backticks) */
|
|
131
|
+
pugTextStart: number;
|
|
132
|
+
pugTextEnd: number;
|
|
133
|
+
/** Extracted pug source text (with common indent stripped for the pug parser) */
|
|
134
|
+
pugText: string;
|
|
135
|
+
/** Number of characters stripped from each line as common indent (0 if none) */
|
|
136
|
+
commonIndent: number;
|
|
137
|
+
/** Offset of the generated TSX expression in the shadow file */
|
|
138
|
+
shadowStart: number;
|
|
139
|
+
shadowEnd: number;
|
|
140
|
+
/** Generated TSX expression text */
|
|
141
|
+
tsxText: string;
|
|
142
|
+
/** Source mappings for this region (Volar-compatible format) */
|
|
143
|
+
mappings: CodeMapping[];
|
|
144
|
+
/** Retained lexer tokens for sub-expression position resolution */
|
|
145
|
+
lexerTokens: PugToken[];
|
|
146
|
+
/** Pug parse error, if any (null = parsed successfully) */
|
|
147
|
+
parseError: PugParseError | null;
|
|
148
|
+
/** Transform validation error, if any */
|
|
149
|
+
transformError: PugTransformError | null;
|
|
150
|
+
/** Extracted terminal style block, if present */
|
|
151
|
+
styleBlock: ExtractedStyleBlock | null;
|
|
152
|
+
}
|
|
153
|
+
export interface PugDocument {
|
|
154
|
+
/** Original file text as the user sees it */
|
|
155
|
+
originalText: string;
|
|
156
|
+
/** File URI / path */
|
|
157
|
+
uri: string;
|
|
158
|
+
/** Detected pug`` template literal regions */
|
|
159
|
+
regions: PugRegion[];
|
|
160
|
+
/** Fixed-length import cleanup edits applied outside pug regions */
|
|
161
|
+
importCleanups: TagImportCleanup[];
|
|
162
|
+
/** Original-text slices copied through unchanged */
|
|
163
|
+
copySegments: ShadowCopySegment[];
|
|
164
|
+
/** Generated shadow spans with custom source mappings */
|
|
165
|
+
mappedRegions: ShadowMappedRegion[];
|
|
166
|
+
/** Synthetic insertions applied outside copied source text */
|
|
167
|
+
insertions: ShadowInsertion[];
|
|
168
|
+
/** Shadow TSX text (original with pug regions replaced by generated TSX) */
|
|
169
|
+
shadowText: string;
|
|
170
|
+
/** Version counter, bumped on every edit */
|
|
171
|
+
version: number;
|
|
172
|
+
/** Cumulative offset deltas for mapping positions outside pug regions */
|
|
173
|
+
regionDeltas: number[];
|
|
174
|
+
/** Whether the configured tag function is used in this file */
|
|
175
|
+
usesTagFunction: boolean;
|
|
176
|
+
/** Whether the configured tag function is explicitly imported in this file */
|
|
177
|
+
hasTagImport: boolean;
|
|
178
|
+
/** Optional missing-import diagnostic metadata */
|
|
179
|
+
missingTagImport: MissingTagImportDiagnostic | null;
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=mapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../src/language/mapping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIjD,yEAAyE;AACzE,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,UAAU,EAAE,OAAO,CAAC;IACpB,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAC;IACpB,uCAAuC;IACvC,YAAY,EAAE,OAAO,CAAC;IACtB,kDAAkD;IAClD,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,0EAA0E;AAC1E,eAAO,MAAM,aAAa,EAAE,eAK3B,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,SAAS,EAAE,eAKvB,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,SAAS,EAAE,eAKvB,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,WAAW,EAAE,eAKzB,CAAC;AAIF,yEAAyE;AACzE,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAInD,MAAM,WAAW,aAAa;IAC5B,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAA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ATURES = void 0;
|
|
4
|
+
/** Expressions, tag names, attribute names/values -- full IntelliSense */
|
|
5
|
+
exports.FULL_FEATURES = {
|
|
6
|
+
completion: true,
|
|
7
|
+
navigation: true,
|
|
8
|
+
verification: true,
|
|
9
|
+
semantic: true,
|
|
10
|
+
};
|
|
11
|
+
/** Class/ID shorthands -- CSS names, not TS identifiers */
|
|
12
|
+
exports.CSS_CLASS = {
|
|
13
|
+
completion: false,
|
|
14
|
+
navigation: false,
|
|
15
|
+
verification: false,
|
|
16
|
+
semantic: false,
|
|
17
|
+
};
|
|
18
|
+
/** Structural syntax (JSX brackets, keywords) -- no features */
|
|
19
|
+
exports.SYNTHETIC = {
|
|
20
|
+
completion: false,
|
|
21
|
+
navigation: false,
|
|
22
|
+
verification: false,
|
|
23
|
+
semantic: false,
|
|
24
|
+
};
|
|
25
|
+
/** Expressions that should show diagnostics but not completions */
|
|
26
|
+
exports.VERIFY_ONLY = {
|
|
27
|
+
completion: false,
|
|
28
|
+
navigation: true,
|
|
29
|
+
verification: true,
|
|
30
|
+
semantic: true,
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=mapping.js.map
|