prettier-plugin-astro 0.10.0 → 0.11.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 +1 -1
- package/dist/index.js +130 -123
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ npm i --save-dev prettier-plugin-astro prettier
|
|
|
10
10
|
|
|
11
11
|
### Recommended configuration
|
|
12
12
|
|
|
13
|
-
For optimal compatibility with the different package managers and Prettier plugins, we recommend manually specifying
|
|
13
|
+
For optimal compatibility with the different package managers and Prettier plugins, we recommend manually specifying the parser to use for Astro files in your Prettier config as shown in the example below:
|
|
14
14
|
|
|
15
15
|
```js
|
|
16
16
|
module.exports = {
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var sassFormatter = require('sass-formatter');
|
|
1
|
+
import { parse } from '@astrojs/compiler/sync';
|
|
2
|
+
import * as prettierPluginBabel from 'prettier/plugins/babel';
|
|
3
|
+
import 'prettier';
|
|
4
|
+
import { serialize } from '@astrojs/compiler/utils';
|
|
5
|
+
import _doc from 'prettier/doc';
|
|
6
|
+
import { Buffer } from 'node:buffer';
|
|
7
|
+
import { SassFormatter } from 'sass-formatter';
|
|
9
8
|
|
|
10
9
|
const options = {
|
|
11
10
|
astroAllowShorthand: {
|
|
12
|
-
since: '0.0.10',
|
|
13
11
|
category: 'Astro',
|
|
14
12
|
type: 'boolean',
|
|
15
13
|
default: false,
|
|
@@ -108,7 +106,7 @@ function printRaw(node, stripLeadingAndTrailingNewline = false) {
|
|
|
108
106
|
if (node.children.length === 0) {
|
|
109
107
|
return '';
|
|
110
108
|
}
|
|
111
|
-
let raw = node.children.reduce((prev, curr) => prev +
|
|
109
|
+
let raw = node.children.reduce((prev, curr) => prev + serialize(curr), '');
|
|
112
110
|
if (!stripLeadingAndTrailingNewline) {
|
|
113
111
|
return raw;
|
|
114
112
|
}
|
|
@@ -324,7 +322,7 @@ function inferParserByTypeAttribute(type) {
|
|
|
324
322
|
const { builders: { breakParent, dedent, fill, group: group$1, indent: indent$1, join: join$1, line: line$1, softline: softline$1, hardline: hardline$1, literalline, }, utils: { stripTrailingHardline: stripTrailingHardline$1 }, } = _doc;
|
|
325
323
|
let ignoreNext = false;
|
|
326
324
|
function print(path, opts, print) {
|
|
327
|
-
const node = path.
|
|
325
|
+
const node = path.node;
|
|
328
326
|
if (!node) {
|
|
329
327
|
return '';
|
|
330
328
|
}
|
|
@@ -539,7 +537,7 @@ function print(path, opts, print) {
|
|
|
539
537
|
function splitTextToDocs(node) {
|
|
540
538
|
const text = getUnencodedText(node);
|
|
541
539
|
const textLines = text.split(/[\t\n\f\r ]+/);
|
|
542
|
-
let docs = join$1(line$1, textLines)
|
|
540
|
+
let docs = join$1(line$1, textLines);
|
|
543
541
|
if (startsWithLinebreak(text)) {
|
|
544
542
|
docs[0] = hardline$1;
|
|
545
543
|
}
|
|
@@ -557,119 +555,114 @@ function splitTextToDocs(node) {
|
|
|
557
555
|
|
|
558
556
|
const { builders: { group, indent, join, line, softline, hardline, lineSuffixBoundary }, utils: { stripTrailingHardline, mapDoc }, } = _doc;
|
|
559
557
|
const supportedStyleLangValues = ['css', 'scss', 'sass', 'less'];
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
558
|
+
const embed = ((path, options) => {
|
|
559
|
+
const parserOption = options;
|
|
560
|
+
return async (textToDoc, print) => {
|
|
561
|
+
var _a;
|
|
562
|
+
const node = path.node;
|
|
563
|
+
if (!node)
|
|
564
|
+
return undefined;
|
|
565
|
+
if (node.type === 'expression') {
|
|
566
|
+
const jsxNode = makeNodeJSXCompatible(node);
|
|
567
|
+
const textContent = printRaw(jsxNode);
|
|
568
|
+
let content;
|
|
569
|
+
content = await wrapParserTryCatch(textToDoc, textContent, {
|
|
570
|
+
...options,
|
|
571
|
+
parser: 'astroExpressionParser',
|
|
572
|
+
});
|
|
573
|
+
content = stripTrailingHardline(content);
|
|
574
|
+
const strings = [];
|
|
575
|
+
mapDoc(content, (doc) => {
|
|
576
|
+
if (typeof doc === 'string') {
|
|
577
|
+
strings.push(doc);
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
if (strings.every((value) => value.startsWith('//'))) {
|
|
581
|
+
return group(['{', content, softline, lineSuffixBoundary, '}']);
|
|
578
582
|
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
583
|
+
const astroDoc = mapDoc(content, (doc) => {
|
|
584
|
+
if (typeof doc === 'string') {
|
|
585
|
+
doc = doc.replace(openingBracketReplace, '{');
|
|
586
|
+
doc = doc.replace(closingBracketReplace, '}');
|
|
587
|
+
doc = doc.replace(atSignReplace, '@');
|
|
588
|
+
doc = doc.replace(dotReplace, '.');
|
|
589
|
+
}
|
|
590
|
+
return doc;
|
|
591
|
+
});
|
|
592
|
+
return group(['{', indent([softline, astroDoc]), softline, lineSuffixBoundary, '}']);
|
|
582
593
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
594
|
+
if (node.type === 'attribute' && node.kind === 'expression') {
|
|
595
|
+
const value = node.value.trim();
|
|
596
|
+
const name = node.name.trim();
|
|
597
|
+
const attrNodeValue = await wrapParserTryCatch(textToDoc, value, {
|
|
598
|
+
...options,
|
|
599
|
+
parser: 'astroExpressionParser',
|
|
600
|
+
});
|
|
601
|
+
if (name === value && options.astroAllowShorthand) {
|
|
602
|
+
return [line, '{', attrNodeValue, '}'];
|
|
589
603
|
}
|
|
590
|
-
return
|
|
591
|
-
});
|
|
592
|
-
return group(['{', indent([softline, astroDoc]), softline, lineSuffixBoundary, '}']);
|
|
593
|
-
}
|
|
594
|
-
if (node.type === 'attribute' && node.kind === 'expression') {
|
|
595
|
-
const value = node.value.trim();
|
|
596
|
-
const name = node.name.trim();
|
|
597
|
-
const attrNodeValue = wrapParserTryCatch(textToDoc, value, {
|
|
598
|
-
...opts,
|
|
599
|
-
parser: expressionParser,
|
|
600
|
-
});
|
|
601
|
-
if (name === value && opts.astroAllowShorthand) {
|
|
602
|
-
return [line, '{', attrNodeValue, '}'];
|
|
604
|
+
return [line, name, '=', '{', attrNodeValue, '}'];
|
|
603
605
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
});
|
|
611
|
-
return [line, '{...', spreadContent, '}'];
|
|
612
|
-
}
|
|
613
|
-
if (node.type === 'frontmatter') {
|
|
614
|
-
const frontmatterContent = wrapParserTryCatch(textToDoc, node.value, {
|
|
615
|
-
...opts,
|
|
616
|
-
parser: 'babel-ts',
|
|
617
|
-
});
|
|
618
|
-
return [group(['---', hardline, frontmatterContent, '---', hardline]), hardline];
|
|
619
|
-
}
|
|
620
|
-
if (node.type === 'element' && node.name === 'script' && node.children.length) {
|
|
621
|
-
const typeAttribute = (_a = node.attributes.find((attr) => attr.name === 'type')) === null || _a === void 0 ? void 0 : _a.value;
|
|
622
|
-
let parser = 'babel-ts';
|
|
623
|
-
if (typeAttribute) {
|
|
624
|
-
parser = inferParserByTypeAttribute(typeAttribute);
|
|
606
|
+
if (node.type === 'attribute' && node.kind === 'spread') {
|
|
607
|
+
const spreadContent = await wrapParserTryCatch(textToDoc, node.name, {
|
|
608
|
+
...options,
|
|
609
|
+
parser: 'astroExpressionParser',
|
|
610
|
+
});
|
|
611
|
+
return [line, '{...', spreadContent, '}'];
|
|
625
612
|
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
613
|
+
if (node.type === 'frontmatter') {
|
|
614
|
+
const frontmatterContent = await wrapParserTryCatch(textToDoc, node.value, {
|
|
615
|
+
...options,
|
|
616
|
+
parser: 'babel-ts',
|
|
617
|
+
});
|
|
618
|
+
return [group(['---', hardline, frontmatterContent, hardline, '---', hardline]), hardline];
|
|
619
|
+
}
|
|
620
|
+
if (node.type === 'element' && node.name === 'script' && node.children.length) {
|
|
621
|
+
const typeAttribute = (_a = node.attributes.find((attr) => attr.name === 'type')) === null || _a === void 0 ? void 0 : _a.value;
|
|
622
|
+
let parser = 'babel-ts';
|
|
623
|
+
if (typeAttribute) {
|
|
624
|
+
parser = inferParserByTypeAttribute(typeAttribute);
|
|
625
|
+
}
|
|
626
|
+
const scriptContent = printRaw(node);
|
|
627
|
+
let formattedScript = await wrapParserTryCatch(textToDoc, scriptContent, {
|
|
628
|
+
...options,
|
|
629
|
+
parser: parser,
|
|
630
|
+
});
|
|
631
|
+
formattedScript = stripTrailingHardline(formattedScript);
|
|
632
|
+
const isEmpty = /^\s*$/.test(scriptContent);
|
|
633
|
+
const attributes = path.map(print, 'attributes');
|
|
634
|
+
const openingTag = group(['<script', indent(group(attributes)), softline, '>']);
|
|
635
|
+
return [
|
|
636
|
+
openingTag,
|
|
637
|
+
indent([isEmpty ? '' : hardline, formattedScript]),
|
|
638
|
+
isEmpty ? '' : hardline,
|
|
639
|
+
'</script>',
|
|
640
|
+
];
|
|
641
|
+
}
|
|
642
|
+
if (node.type === 'element' && node.name === 'style') {
|
|
643
|
+
const content = printRaw(node);
|
|
644
|
+
let parserLang = 'css';
|
|
645
|
+
if (node.attributes) {
|
|
646
|
+
const langAttribute = node.attributes.filter((x) => x.name === 'lang');
|
|
647
|
+
if (langAttribute.length) {
|
|
648
|
+
const styleLang = langAttribute[0].value.toLowerCase();
|
|
649
|
+
parserLang = supportedStyleLangValues.includes(styleLang) ? styleLang : undefined;
|
|
650
|
+
}
|
|
650
651
|
}
|
|
652
|
+
return await embedStyle(parserLang, content, path, print, textToDoc, parserOption);
|
|
651
653
|
}
|
|
652
|
-
return
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
function wrapParserTryCatch(cb, text, options) {
|
|
654
|
+
return undefined;
|
|
655
|
+
};
|
|
656
|
+
});
|
|
657
|
+
async function wrapParserTryCatch(cb, text, options) {
|
|
657
658
|
try {
|
|
658
|
-
return cb(text, options);
|
|
659
|
+
return await cb(text, options);
|
|
659
660
|
}
|
|
660
661
|
catch (e) {
|
|
661
662
|
process.env.PRETTIER_DEBUG = 'true';
|
|
662
663
|
throw e;
|
|
663
664
|
}
|
|
664
665
|
}
|
|
665
|
-
function expressionParser(text, parsers, options) {
|
|
666
|
-
const expressionContent = `<>{${text}\n}</>`;
|
|
667
|
-
const ast = parsers['babel-ts'](expressionContent, parsers, options);
|
|
668
|
-
return {
|
|
669
|
-
...ast,
|
|
670
|
-
program: ast.program.body[0].expression.children[0].expression,
|
|
671
|
-
};
|
|
672
|
-
}
|
|
673
666
|
function makeNodeJSXCompatible(node) {
|
|
674
667
|
const newNode = { ...node };
|
|
675
668
|
const childBundle = [];
|
|
@@ -728,13 +721,17 @@ function makeNodeJSXCompatible(node) {
|
|
|
728
721
|
return attr;
|
|
729
722
|
}
|
|
730
723
|
}
|
|
731
|
-
function embedStyle(lang, content, path, print, textToDoc, options) {
|
|
724
|
+
async function embedStyle(lang, content, path, print, textToDoc, options) {
|
|
725
|
+
var _a;
|
|
732
726
|
const isEmpty = /^\s*$/.test(content);
|
|
733
727
|
switch (lang) {
|
|
734
728
|
case 'less':
|
|
735
729
|
case 'css':
|
|
736
730
|
case 'scss': {
|
|
737
|
-
let formattedStyles = wrapParserTryCatch(textToDoc, content, {
|
|
731
|
+
let formattedStyles = await wrapParserTryCatch(textToDoc, content, {
|
|
732
|
+
...options,
|
|
733
|
+
parser: lang,
|
|
734
|
+
});
|
|
738
735
|
formattedStyles = stripTrailingHardline(formattedStyles);
|
|
739
736
|
const attributes = path.map(print, 'attributes');
|
|
740
737
|
const openingTag = group(['<style', indent(group(attributes)), softline, '>']);
|
|
@@ -746,14 +743,14 @@ function embedStyle(lang, content, path, print, textToDoc, options) {
|
|
|
746
743
|
];
|
|
747
744
|
}
|
|
748
745
|
case 'sass': {
|
|
749
|
-
const lineEnding = options.endOfLine.toUpperCase() === 'CRLF' ? 'CRLF' : 'LF';
|
|
746
|
+
const lineEnding = ((_a = options === null || options === void 0 ? void 0 : options.endOfLine) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === 'CRLF' ? 'CRLF' : 'LF';
|
|
750
747
|
const sassOptions = {
|
|
751
748
|
tabSize: options.tabWidth,
|
|
752
749
|
insertSpaces: !options.useTabs,
|
|
753
750
|
lineEnding,
|
|
754
751
|
};
|
|
755
752
|
const { result: raw } = manualDedent(content);
|
|
756
|
-
const formattedSassIndented =
|
|
753
|
+
const formattedSassIndented = SassFormatter.Format(raw, sassOptions).trim();
|
|
757
754
|
const formattedSass = join(hardline, formattedSassIndented.split('\n'));
|
|
758
755
|
const attributes = path.map(print, 'attributes');
|
|
759
756
|
const openingTag = group(['<style', indent(group(attributes)), softline, '>']);
|
|
@@ -767,15 +764,16 @@ function embedStyle(lang, content, path, print, textToDoc, options) {
|
|
|
767
764
|
case undefined: {
|
|
768
765
|
const node = path.getNode();
|
|
769
766
|
if (node) {
|
|
770
|
-
return
|
|
767
|
+
return Buffer.from(options.originalText)
|
|
771
768
|
.subarray(options.locStart(node), options.locEnd(node))
|
|
772
769
|
.toString();
|
|
773
770
|
}
|
|
774
|
-
return
|
|
771
|
+
return undefined;
|
|
775
772
|
}
|
|
776
773
|
}
|
|
777
774
|
}
|
|
778
775
|
|
|
776
|
+
const babelParser = prettierPluginBabel.parsers['babel-ts'];
|
|
779
777
|
const languages = [
|
|
780
778
|
{
|
|
781
779
|
name: 'astro',
|
|
@@ -786,11 +784,24 @@ const languages = [
|
|
|
786
784
|
];
|
|
787
785
|
const parsers = {
|
|
788
786
|
astro: {
|
|
789
|
-
parse: (source) =>
|
|
787
|
+
parse: (source) => parse(source, { position: true }).ast,
|
|
790
788
|
astFormat: 'astro',
|
|
791
789
|
locStart: (node) => node.position.start.offset,
|
|
792
790
|
locEnd: (node) => node.position.end.offset,
|
|
793
791
|
},
|
|
792
|
+
astroExpressionParser: {
|
|
793
|
+
...babelParser,
|
|
794
|
+
preprocess(text) {
|
|
795
|
+
return `<>{${text}\n}</>`;
|
|
796
|
+
},
|
|
797
|
+
parse(text, opts) {
|
|
798
|
+
const ast = babelParser.parse(text, opts);
|
|
799
|
+
return {
|
|
800
|
+
...ast,
|
|
801
|
+
program: ast.program.body[0].expression.children[0].expression,
|
|
802
|
+
};
|
|
803
|
+
},
|
|
804
|
+
},
|
|
794
805
|
};
|
|
795
806
|
const printers = {
|
|
796
807
|
astro: {
|
|
@@ -802,9 +813,5 @@ const defaultOptions = {
|
|
|
802
813
|
tabWidth: 2,
|
|
803
814
|
};
|
|
804
815
|
|
|
805
|
-
|
|
806
|
-
exports.languages = languages;
|
|
807
|
-
exports.options = options;
|
|
808
|
-
exports.parsers = parsers;
|
|
809
|
-
exports.printers = printers;
|
|
816
|
+
export { defaultOptions, languages, options, parsers, printers };
|
|
810
817
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/options.ts","../src/printer/elements.ts","../src/printer/utils.ts","../src/printer/index.ts","../src/printer/embed.ts","../src/index.ts"],"sourcesContent":["import type { SupportOption } from 'prettier';\n\ninterface PluginOptions {\n\tastroAllowShorthand: boolean;\n}\n\ndeclare module 'prettier' {\n\t// eslint-disable-next-line @typescript-eslint/no-empty-interface\n\tinterface RequiredOptions extends PluginOptions {}\n}\n\n// https://prettier.io/docs/en/plugins.html#options\nexport const options: Record<keyof PluginOptions, SupportOption> = {\n\tastroAllowShorthand: {\n\t\tsince: '0.0.10',\n\t\tcategory: 'Astro',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription: 'Enable/disable attribute shorthand if attribute name and expression are the same',\n\t},\n};\n","export type TagName = keyof HTMLElementTagNameMap | 'svg';\n\n// https://github.com/prettier/prettier/blob/main/vendors/html-void-elements.json\nexport const selfClosingTags = [\n\t'area',\n\t'base',\n\t'basefont',\n\t'bgsound',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'frame',\n\t'hr',\n\t'image',\n\t'img',\n\t'input',\n\t'isindex',\n\t'keygen',\n\t'link',\n\t'menuitem',\n\t'meta',\n\t'nextid',\n\t'param',\n\t'slot',\n\t'source',\n\t'track',\n\t'wbr',\n];\n\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements#Elements\nexport const blockElements: TagName[] = [\n\t'address',\n\t'article',\n\t'aside',\n\t'blockquote',\n\t'details',\n\t'dialog',\n\t'dd',\n\t'div',\n\t'dl',\n\t'dt',\n\t'fieldset',\n\t'figcaption',\n\t'figure',\n\t'footer',\n\t'form',\n\t'h1',\n\t'h2',\n\t'h3',\n\t'h4',\n\t'h5',\n\t'h6',\n\t'header',\n\t'hgroup',\n\t'hr',\n\t'li',\n\t'main',\n\t'nav',\n\t'ol',\n\t'p',\n\t'pre',\n\t'section',\n\t'table',\n\t'ul',\n\t// TODO: WIP\n\t'title',\n\t'html',\n];\n\n/**\n * HTML attributes that we may safely reformat (trim whitespace, add or remove newlines)\n */\nexport const formattableAttributes: string[] = [\n\t// None at the moment\n\t// Prettier HTML does not format attributes at all\n\t// and to be consistent we leave this array empty for now\n];\n","import { serialize } from '@astrojs/compiler/utils';\nimport {\n\ttype AstPath as AstP,\n\ttype BuiltInParserName,\n\ttype Doc,\n\ttype ParserOptions as ParserOpts,\n} from 'prettier';\nimport { blockElements, formattableAttributes, type TagName } from './elements';\nimport type {\n\tCommentNode,\n\tExpressionNode,\n\tNode,\n\tParentLikeNode,\n\tTagLikeNode,\n\tTextNode,\n\tanyNode,\n} from './nodes';\n\nexport type printFn = (path: AstPath) => Doc;\nexport type ParserOptions = ParserOpts<anyNode>;\nexport type AstPath = AstP<anyNode>;\n\nexport const openingBracketReplace = '_Pé';\nexport const closingBracketReplace = 'èP_';\nexport const atSignReplace = 'ΩP_';\nexport const dotReplace = 'ωP_';\n\nexport function isInlineElement(path: AstPath, opts: ParserOptions, node: anyNode): boolean {\n\treturn node && node.type === 'element' && !isBlockElement(node, opts) && !isPreTagContent(path);\n}\n\nexport function isBlockElement(node: anyNode, opts: ParserOptions): boolean {\n\treturn (\n\t\t(node &&\n\t\t\tnode.type === 'element' &&\n\t\t\topts.htmlWhitespaceSensitivity !== 'strict' &&\n\t\t\t(opts.htmlWhitespaceSensitivity === 'ignore' ||\n\t\t\t\tblockElements.includes(node.name as TagName))) ||\n\t\tnode.type === 'component' ||\n\t\tnode.type === 'fragment'\n\t);\n}\n\nexport function isIgnoreDirective(node: Node): boolean {\n\treturn node.type === 'comment' && node.value.trim() === 'prettier-ignore';\n}\n\n/**\n * Returns the content of the node\n */\nexport function printRaw(node: anyNode, stripLeadingAndTrailingNewline = false): string {\n\tif (!isNodeWithChildren(node)) {\n\t\treturn '';\n\t}\n\n\tif (node.children.length === 0) {\n\t\treturn '';\n\t}\n\n\tlet raw = node.children.reduce((prev: string, curr: Node) => prev + serialize(curr), '');\n\n\tif (!stripLeadingAndTrailingNewline) {\n\t\treturn raw;\n\t}\n\n\tif (startsWithLinebreak(raw)) {\n\t\traw = raw.substring(raw.indexOf('\\n') + 1);\n\t}\n\tif (endsWithLinebreak(raw)) {\n\t\traw = raw.substring(0, raw.lastIndexOf('\\n'));\n\t\tif (raw.charAt(raw.length - 1) === '\\r') {\n\t\t\traw = raw.substring(0, raw.length - 1);\n\t\t}\n\t}\n\n\treturn raw;\n}\n\nexport function isNodeWithChildren(node: anyNode): node is anyNode & ParentLikeNode {\n\treturn node && 'children' in node && Array.isArray(node.children);\n}\n\nexport const isEmptyTextNode = (node: anyNode): boolean => {\n\treturn !!node && node.type === 'text' && getUnencodedText(node).trim() === '';\n};\n\nexport function getUnencodedText(node: TextNode | CommentNode): string {\n\treturn node.value;\n}\n\nexport function isTextNodeStartingWithLinebreak(node: TextNode, nrLines = 1): node is TextNode {\n\treturn startsWithLinebreak(getUnencodedText(node), nrLines);\n}\n\nexport function startsWithLinebreak(text: string, nrLines = 1): boolean {\n\treturn new RegExp(`^([\\\\t\\\\f\\\\r ]*\\\\n){${nrLines}}`).test(text);\n}\n\nexport function endsWithLinebreak(text: string, nrLines = 1): boolean {\n\treturn new RegExp(`(\\\\n[\\\\t\\\\f\\\\r ]*){${nrLines}}$`).test(text);\n}\n\nexport function isTextNodeStartingWithWhitespace(node: Node): node is TextNode {\n\treturn isTextNode(node) && /^\\s/.test(getUnencodedText(node));\n}\n\nfunction endsWithWhitespace(text: string) {\n\treturn /\\s$/.test(text);\n}\n\nexport function isTextNodeEndingWithWhitespace(node: Node): node is TextNode {\n\treturn isTextNode(node) && endsWithWhitespace(getUnencodedText(node));\n}\n\nexport function hasSetDirectives(node: TagLikeNode) {\n\tconst attributes = Array.from(node.attributes, (attr) => attr.name);\n\treturn attributes.some((attr) => ['set:html', 'set:text'].includes(attr));\n}\n\n/**\n * Check if given node's start tag should hug its first child. This is the case for inline elements when there's\n * no whitespace between the `>` and the first child.\n */\nexport function shouldHugStart(node: anyNode, opts: ParserOptions): boolean {\n\tif (isBlockElement(node, opts)) {\n\t\treturn false;\n\t}\n\n\tif (node.type === 'fragment') {\n\t\treturn false;\n\t}\n\n\tif (!isNodeWithChildren(node)) {\n\t\treturn false;\n\t}\n\n\tconst children = node.children;\n\tif (children.length === 0) {\n\t\treturn true;\n\t}\n\n\tconst firstChild = children[0];\n\treturn !isTextNodeStartingWithWhitespace(firstChild);\n}\n\n/**\n * Check if given node's end tag should hug its last child. This is the case for inline elements when there's\n * no whitespace between the last child and the `</`.\n */\nexport function shouldHugEnd(node: anyNode, opts: ParserOptions): boolean {\n\tif (isBlockElement(node, opts)) {\n\t\treturn false;\n\t}\n\n\tif (!isNodeWithChildren(node)) {\n\t\treturn false;\n\t}\n\n\tconst children = node.children;\n\tif (children.length === 0) {\n\t\treturn true;\n\t}\n\n\tconst lastChild = children[children.length - 1];\n\tif (isExpressionNode(lastChild)) return true;\n\tif (isTagLikeNode(lastChild)) return true;\n\treturn !isTextNodeEndingWithWhitespace(lastChild);\n}\n\n/**\n * Returns true if the softline between `</tagName` and `>` can be omitted.\n */\nexport function canOmitSoftlineBeforeClosingTag(path: AstPath, opts: ParserOptions): boolean {\n\treturn isLastChildWithinParentBlockElement(path, opts);\n}\n\nfunction getChildren(node: anyNode): Node[] {\n\treturn isNodeWithChildren(node) ? node.children : [];\n}\n\nfunction isLastChildWithinParentBlockElement(path: AstPath, opts: ParserOptions): boolean {\n\tconst parent = path.getParentNode();\n\tif (!parent || !isBlockElement(parent, opts)) {\n\t\treturn false;\n\t}\n\n\tconst children = getChildren(parent);\n\tconst lastChild = children[children.length - 1];\n\treturn lastChild === path.getNode();\n}\n\nexport function trimTextNodeLeft(node: TextNode): void {\n\tnode.value = node.value && node.value.trimStart();\n}\n\nexport function trimTextNodeRight(node: TextNode): void {\n\tnode.value = node.value && node.value.trimEnd();\n}\n\nexport function printClassNames(value: string) {\n\treturn value.trim().split(/\\s+/).join(' ');\n}\n\n/** dedent string & return tabSize (the last part is what we need) */\nexport function manualDedent(input: string): {\n\ttabSize: number;\n\tchar: string;\n\tresult: string;\n} {\n\tlet minTabSize = Infinity;\n\tlet result = input;\n\t// 1. normalize\n\tresult = result.replace(/\\r\\n/g, '\\n');\n\n\t// 2. count tabSize\n\tlet char = '';\n\tfor (const line of result.split('\\n')) {\n\t\tif (!line) continue;\n\t\t// if any line begins with a non-whitespace char, minTabSize is 0\n\t\tif (line[0] && /^[^\\s]/.test(line[0])) {\n\t\t\tminTabSize = 0;\n\t\t\tbreak;\n\t\t}\n\t\tconst match = line.match(/^(\\s+)\\S+/); // \\S ensures we don’t count lines of pure whitespace\n\t\tif (match) {\n\t\t\tif (match[1] && !char) char = match[1][0];\n\t\t\tif (match[1].length < minTabSize) minTabSize = match[1].length;\n\t\t}\n\t}\n\n\t// 3. reformat string\n\tif (minTabSize > 0 && Number.isFinite(minTabSize)) {\n\t\tresult = result.replace(new RegExp(`^${new Array(minTabSize + 1).join(char)}`, 'gm'), '');\n\t}\n\n\treturn {\n\t\ttabSize: minTabSize === Infinity ? 0 : minTabSize,\n\t\tchar,\n\t\tresult,\n\t};\n}\n\n/** True if the node is of type text */\nexport function isTextNode(node: anyNode): node is TextNode {\n\treturn node.type === 'text';\n}\n\nexport function isExpressionNode(node: anyNode): node is ExpressionNode {\n\treturn node.type === 'expression';\n}\n\n/** True if the node is TagLikeNode:\n *\n * ElementNode | ComponentNode | CustomElementNode | FragmentNode */\nexport function isTagLikeNode(node: anyNode): node is TagLikeNode {\n\treturn (\n\t\tnode.type === 'element' ||\n\t\tnode.type === 'component' ||\n\t\tnode.type === 'custom-element' ||\n\t\tnode.type === 'fragment'\n\t);\n}\n\n/**\n * Returns siblings, that is, the children of the parent.\n */\nexport function getSiblings(path: AstPath): anyNode[] {\n\tconst parent = path.getParentNode();\n\tif (!parent) return [];\n\n\treturn getChildren(parent);\n}\n\nexport function getNextNode(path: AstPath): anyNode | null {\n\tconst node = path.getNode();\n\tif (node) {\n\t\tconst siblings = getSiblings(path);\n\t\tif (node.position?.start === siblings[siblings.length - 1].position?.start) return null;\n\t\tfor (let i = 0; i < siblings.length; i++) {\n\t\t\tconst sibling = siblings[i];\n\t\t\tif (sibling.position?.start === node.position?.start && i !== siblings.length - 1) {\n\t\t\t\treturn siblings[i + 1];\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n}\n\nexport const isPreTagContent = (path: AstPath): boolean => {\n\tif (!path || !path.stack || !Array.isArray(path.stack)) return false;\n\treturn path.stack.some(\n\t\t(node: anyNode) =>\n\t\t\t(node.type === 'element' && node.name.toLowerCase() === 'pre') ||\n\t\t\t(node.type === 'attribute' && !formattableAttributes.includes(node.name))\n\t);\n};\n\ninterface QuoteResult {\n\tquote: '\"' | \"'\";\n\tregex: RegExp;\n\tescaped: string;\n}\n\n// Adapted from Prettier's source code as it's unfortunately not exported\n// https://github.com/prettier/prettier/blob/237e681936fc533c27d7ce8577d3fc98838a3314/src/common/util.js#L238\nexport function getPreferredQuote(rawContent: string, preferredQuote: string): QuoteResult {\n\tconst double: QuoteResult = { quote: '\"', regex: /\"/g, escaped: '"' };\n\tconst single: QuoteResult = { quote: \"'\", regex: /'/g, escaped: ''' };\n\n\tconst preferred = preferredQuote === \"'\" ? single : double;\n\tconst alternate = preferred === single ? double : single;\n\n\tlet result = preferred;\n\n\t// If `rawContent` contains at least one of the quote preferred for enclosing\n\t// the string, we might want to enclose with the alternate quote instead, to\n\t// minimize the number of escaped quotes.\n\tif (rawContent.includes(preferred.quote) || rawContent.includes(alternate.quote)) {\n\t\tconst numPreferredQuotes = (rawContent.match(preferred.regex) || []).length;\n\t\tconst numAlternateQuotes = (rawContent.match(alternate.regex) || []).length;\n\n\t\tresult = numPreferredQuotes > numAlternateQuotes ? alternate : preferred;\n\t}\n\n\treturn result;\n}\n\n// Adapted from: https://github.com/prettier/prettier/blob/20ab6d6f1c5bd774621230b493a3b71d39383a2c/src/language-html/utils/index.js#LL336C1-L369C2\nexport function inferParserByTypeAttribute(type: string): BuiltInParserName {\n\tif (!type) {\n\t\treturn 'babel-ts';\n\t}\n\n\tswitch (type) {\n\t\tcase 'module':\n\t\tcase 'text/javascript':\n\t\tcase 'text/babel':\n\t\tcase 'application/javascript':\n\t\t\treturn 'babel';\n\n\t\tcase 'application/x-typescript':\n\t\t\treturn 'babel-ts';\n\n\t\tcase 'text/markdown':\n\t\t\treturn 'markdown';\n\n\t\tcase 'text/html':\n\t\t\treturn 'html';\n\n\t\tcase 'text/x-handlebars-template':\n\t\t\treturn 'glimmer';\n\n\t\tdefault:\n\t\t\tif (type.endsWith('json') || type.endsWith('importmap') || type === 'speculationrules') {\n\t\t\t\treturn 'json';\n\t\t\t}\n\t\t\treturn 'babel-ts';\n\t}\n}\n","import { type Doc } from 'prettier';\nimport { selfClosingTags } from './elements';\nimport { type TextNode } from './nodes';\nimport {\n\tcanOmitSoftlineBeforeClosingTag,\n\tendsWithLinebreak,\n\tgetNextNode,\n\tgetPreferredQuote,\n\tgetUnencodedText,\n\thasSetDirectives,\n\tisEmptyTextNode,\n\tisIgnoreDirective,\n\tisInlineElement,\n\tisPreTagContent,\n\tisTagLikeNode,\n\tisTextNode,\n\tisTextNodeEndingWithWhitespace,\n\tisTextNodeStartingWithLinebreak,\n\tisTextNodeStartingWithWhitespace,\n\tprintClassNames,\n\tprintRaw,\n\tshouldHugEnd,\n\tshouldHugStart,\n\tstartsWithLinebreak,\n\ttrimTextNodeLeft,\n\ttrimTextNodeRight,\n\ttype AstPath,\n\ttype ParserOptions,\n\ttype printFn,\n} from './utils';\n\nimport _doc from 'prettier/doc';\nconst {\n\tbuilders: {\n\t\tbreakParent,\n\t\tdedent,\n\t\tfill,\n\t\tgroup,\n\t\tindent,\n\t\tjoin,\n\t\tline,\n\t\tsoftline,\n\t\thardline,\n\t\tliteralline,\n\t},\n\tutils: { stripTrailingHardline },\n} = _doc;\n\nlet ignoreNext = false;\n\n// https://prettier.io/docs/en/plugins.html#print\n// eslint-disable-next-line @typescript-eslint/no-shadow\nexport function print(path: AstPath, opts: ParserOptions, print: printFn): Doc {\n\tconst node = path.getValue();\n\n\t// 1. handle special node types\n\tif (!node) {\n\t\treturn '';\n\t}\n\n\tif (ignoreNext && !isEmptyTextNode(node)) {\n\t\tignoreNext = false;\n\t\treturn [\n\t\t\topts.originalText\n\t\t\t\t.slice(opts.locStart(node), opts.locEnd(node))\n\t\t\t\t.split('\\n')\n\t\t\t\t.map((lineContent, i) => (i == 0 ? [lineContent] : [literalline, lineContent]))\n\t\t\t\t.flat(),\n\t\t];\n\t}\n\n\tif (typeof node === 'string') {\n\t\treturn node;\n\t}\n\n\t// 2. handle printing\n\tswitch (node.type) {\n\t\tcase 'root': {\n\t\t\treturn [stripTrailingHardline(path.map(print, 'children')), hardline];\n\t\t}\n\n\t\tcase 'text': {\n\t\t\tconst rawText = getUnencodedText(node);\n\n\t\t\t// TODO: TEST PRE TAGS\n\t\t\t// if (isPreTagContent(path)) {\n\t\t\t// if (path.getParentNode()?.type === 'Attribute') {\n\t\t\t// // Direct child of attribute value -> add literallines at end of lines\n\t\t\t// // so that other things don't break in unexpected places\n\t\t\t// return replaceEndOfLineWith(rawText, literalline);\n\t\t\t// }\n\t\t\t// return rawText;\n\t\t\t// }\n\n\t\t\tif (isEmptyTextNode(node)) {\n\t\t\t\tconst hasWhiteSpace = rawText.trim().length < getUnencodedText(node).length;\n\t\t\t\tconst hasOneOrMoreNewlines = /\\n/.test(getUnencodedText(node));\n\t\t\t\tconst hasTwoOrMoreNewlines = /\\n\\r?\\s*\\n\\r?/.test(getUnencodedText(node));\n\t\t\t\tif (hasTwoOrMoreNewlines) {\n\t\t\t\t\treturn [hardline, hardline];\n\t\t\t\t}\n\t\t\t\tif (hasOneOrMoreNewlines) {\n\t\t\t\t\treturn hardline;\n\t\t\t\t}\n\t\t\t\tif (hasWhiteSpace) {\n\t\t\t\t\treturn line;\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * For non-empty text nodes each sequence of non-whitespace characters (effectively,\n\t\t\t * each \"word\") is joined by a single `line`, which will be rendered as a single space\n\t\t\t * until this node's current line is out of room, at which `fill` will break at the\n\t\t\t * most convenient instance of `line`.\n\t\t\t */\n\t\t\treturn fill(splitTextToDocs(node));\n\t\t}\n\n\t\tcase 'component':\n\t\tcase 'fragment':\n\t\tcase 'custom-element':\n\t\tcase 'element': {\n\t\t\tlet isEmpty: boolean;\n\t\t\tif (!node.children) {\n\t\t\t\tisEmpty = true;\n\t\t\t} else {\n\t\t\t\tisEmpty = node.children.every((child) => isEmptyTextNode(child));\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * An element is allowed to self close only if:\n\t\t\t * It is empty AND\n\t\t\t * It's a component OR\n\t\t\t * It's in the HTML spec as a void element OR\n\t\t\t * It has a `set:*` directive\n\t\t\t */\n\t\t\tconst isSelfClosingTag =\n\t\t\t\tisEmpty &&\n\t\t\t\t(node.type === 'component' ||\n\t\t\t\t\tselfClosingTags.includes(node.name) ||\n\t\t\t\t\thasSetDirectives(node));\n\n\t\t\tconst isSingleLinePerAttribute = opts.singleAttributePerLine && node.attributes.length > 1;\n\t\t\tconst attributeLine = isSingleLinePerAttribute ? breakParent : '';\n\t\t\tconst attributes = join(attributeLine, path.map(print, 'attributes'));\n\n\t\t\tif (isSelfClosingTag) {\n\t\t\t\treturn group(['<', node.name, indent(attributes), line, `/>`]);\n\t\t\t}\n\n\t\t\tif (node.children) {\n\t\t\t\tconst children = node.children;\n\t\t\t\tconst firstChild = children[0];\n\t\t\t\tconst lastChild = children[children.length - 1];\n\n\t\t\t\t// No hugging of content means it's either a block element and/or there's whitespace at the start/end\n\t\t\t\tlet noHugSeparatorStart:\n\t\t\t\t\t| _doc.builders.Concat\n\t\t\t\t\t| _doc.builders.Line\n\t\t\t\t\t| _doc.builders.Softline\n\t\t\t\t\t| string = softline;\n\t\t\t\tlet noHugSeparatorEnd:\n\t\t\t\t\t| _doc.builders.Concat\n\t\t\t\t\t| _doc.builders.Line\n\t\t\t\t\t| _doc.builders.Softline\n\t\t\t\t\t| string = softline;\n\t\t\t\tconst hugStart = shouldHugStart(node, opts);\n\t\t\t\tconst hugEnd = shouldHugEnd(node, opts);\n\n\t\t\t\tlet body;\n\n\t\t\t\tif (isEmpty) {\n\t\t\t\t\tbody =\n\t\t\t\t\t\tisInlineElement(path, opts, node) &&\n\t\t\t\t\t\tnode.children.length &&\n\t\t\t\t\t\tisTextNodeStartingWithWhitespace(node.children[0]) &&\n\t\t\t\t\t\t!isPreTagContent(path)\n\t\t\t\t\t\t\t? () => line\n\t\t\t\t\t\t\t: () => softline;\n\t\t\t\t} else if (isPreTagContent(path)) {\n\t\t\t\t\tbody = () => printRaw(node);\n\t\t\t\t} else if (isInlineElement(path, opts, node) && !isPreTagContent(path)) {\n\t\t\t\t\tbody = () => path.map(print, 'children');\n\t\t\t\t} else {\n\t\t\t\t\tbody = () => path.map(print, 'children');\n\t\t\t\t}\n\n\t\t\t\tconst openingTag = [\n\t\t\t\t\t'<',\n\t\t\t\t\tnode.name,\n\t\t\t\t\tindent(\n\t\t\t\t\t\tgroup([\n\t\t\t\t\t\t\tattributes,\n\t\t\t\t\t\t\thugStart\n\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t: !isPreTagContent(path) && !opts.bracketSameLine\n\t\t\t\t\t\t\t\t? dedent(softline)\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\t])\n\t\t\t\t\t),\n\t\t\t\t];\n\n\t\t\t\tif (hugStart && hugEnd) {\n\t\t\t\t\tconst huggedContent = [\n\t\t\t\t\t\tisSingleLinePerAttribute ? hardline : softline,\n\t\t\t\t\t\tgroup(['>', body(), `</${node.name}`]),\n\t\t\t\t\t];\n\n\t\t\t\t\tconst omitSoftlineBeforeClosingTag =\n\t\t\t\t\t\tisEmpty || canOmitSoftlineBeforeClosingTag(path, opts);\n\t\t\t\t\treturn group([\n\t\t\t\t\t\t...openingTag,\n\t\t\t\t\t\tisEmpty ? group(huggedContent) : group(indent(huggedContent)),\n\t\t\t\t\t\tomitSoftlineBeforeClosingTag ? '' : softline,\n\t\t\t\t\t\t'>',\n\t\t\t\t\t]);\n\t\t\t\t}\n\n\t\t\t\tif (isPreTagContent(path)) {\n\t\t\t\t\tnoHugSeparatorStart = '';\n\t\t\t\t\tnoHugSeparatorEnd = '';\n\t\t\t\t} else {\n\t\t\t\t\tlet didSetEndSeparator = false;\n\n\t\t\t\t\tif (!hugStart && firstChild && isTextNode(firstChild)) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tisTextNodeStartingWithLinebreak(firstChild) &&\n\t\t\t\t\t\t\tfirstChild !== lastChild &&\n\t\t\t\t\t\t\t(!isInlineElement(path, opts, node) || isTextNodeEndingWithWhitespace(lastChild))\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tnoHugSeparatorStart = hardline;\n\t\t\t\t\t\t\tnoHugSeparatorEnd = hardline;\n\t\t\t\t\t\t\tdidSetEndSeparator = true;\n\t\t\t\t\t\t} else if (isInlineElement(path, opts, node)) {\n\t\t\t\t\t\t\tnoHugSeparatorStart = line;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttrimTextNodeLeft(firstChild);\n\t\t\t\t\t}\n\t\t\t\t\tif (!hugEnd && lastChild && isTextNode(lastChild)) {\n\t\t\t\t\t\tif (isInlineElement(path, opts, node) && !didSetEndSeparator) {\n\t\t\t\t\t\t\tnoHugSeparatorEnd = softline;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttrimTextNodeRight(lastChild);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (hugStart) {\n\t\t\t\t\treturn group([\n\t\t\t\t\t\t...openingTag,\n\t\t\t\t\t\tindent([softline, group(['>', body()])]),\n\t\t\t\t\t\tnoHugSeparatorEnd,\n\t\t\t\t\t\t`</${node.name}>`,\n\t\t\t\t\t]);\n\t\t\t\t}\n\n\t\t\t\tif (hugEnd) {\n\t\t\t\t\treturn group([\n\t\t\t\t\t\t...openingTag,\n\t\t\t\t\t\t'>',\n\t\t\t\t\t\tindent([noHugSeparatorStart, group([body(), `</${node.name}`])]),\n\t\t\t\t\t\tcanOmitSoftlineBeforeClosingTag(path, opts) ? '' : softline,\n\t\t\t\t\t\t'>',\n\t\t\t\t\t]);\n\t\t\t\t}\n\n\t\t\t\tif (isEmpty) {\n\t\t\t\t\treturn group([...openingTag, '>', body(), `</${node.name}>`]);\n\t\t\t\t}\n\n\t\t\t\treturn group([\n\t\t\t\t\t...openingTag,\n\t\t\t\t\t'>',\n\t\t\t\t\tindent([noHugSeparatorStart, body()]),\n\t\t\t\t\tnoHugSeparatorEnd,\n\t\t\t\t\t`</${node.name}>`,\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\t// TODO: WIP\n\t\t\treturn '';\n\t\t}\n\n\t\tcase 'attribute': {\n\t\t\tconst name = node.name.trim();\n\t\t\tswitch (node.kind) {\n\t\t\t\tcase 'empty':\n\t\t\t\t\treturn [line, name];\n\t\t\t\tcase 'expression':\n\t\t\t\t\t// Handled in the `embed` function\n\t\t\t\t\t// See embed.ts\n\t\t\t\t\treturn '';\n\t\t\t\tcase 'quoted':\n\t\t\t\t\tlet value = node.value;\n\n\t\t\t\t\tif (node.name === 'class') {\n\t\t\t\t\t\tvalue = printClassNames(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst unescapedValue = value.replace(/'/g, \"'\").replace(/"/g, '\"');\n\t\t\t\t\tconst { escaped, quote, regex } = getPreferredQuote(\n\t\t\t\t\t\tunescapedValue,\n\t\t\t\t\t\topts.jsxSingleQuote ? \"'\" : '\"'\n\t\t\t\t\t);\n\n\t\t\t\t\tconst result = unescapedValue.replace(regex, escaped);\n\t\t\t\t\treturn [line, name, '=', quote, result, quote];\n\t\t\t\tcase 'shorthand':\n\t\t\t\t\treturn [line, '{', name, '}'];\n\t\t\t\tcase 'spread':\n\t\t\t\t\treturn [line, '{...', name, '}'];\n\t\t\t\tcase 'template-literal':\n\t\t\t\t\treturn [line, name, '=', '`', node.value, '`'];\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\tcase 'doctype': {\n\t\t\t// https://www.w3.org/wiki/Doctypes_and_markup_styles\n\t\t\treturn ['<!DOCTYPE html>', hardline];\n\t\t}\n\n\t\tcase 'comment':\n\t\t\tif (isIgnoreDirective(node)) {\n\t\t\t\tignoreNext = true;\n\t\t\t}\n\n\t\t\tconst nextNode = getNextNode(path);\n\t\t\tlet trailingLine: _doc.builders.Concat | string = '';\n\t\t\tif (nextNode && isTagLikeNode(nextNode)) {\n\t\t\t\ttrailingLine = hardline;\n\t\t\t}\n\t\t\treturn ['<!--', getUnencodedText(node), '-->', trailingLine];\n\n\t\tdefault: {\n\t\t\tthrow new Error(`Unhandled node type \"${node.type}\"!`);\n\t\t}\n\t}\n}\n\n/**\n * Split the text into words separated by whitespace. Replace the whitespaces by lines,\n * collapsing multiple whitespaces into a single line.\n *\n * If the text starts or ends with multiple newlines, two of those should be kept.\n */\nfunction splitTextToDocs(node: TextNode): Doc[] {\n\tconst text = getUnencodedText(node);\n\n\tconst textLines = text.split(/[\\t\\n\\f\\r ]+/);\n\n\tlet docs = join(line, textLines).parts.filter((s) => s !== '');\n\n\tif (startsWithLinebreak(text)) {\n\t\tdocs[0] = hardline;\n\t}\n\tif (startsWithLinebreak(text, 2)) {\n\t\tdocs = [hardline, ...docs];\n\t}\n\n\tif (endsWithLinebreak(text)) {\n\t\tdocs[docs.length - 1] = hardline;\n\t}\n\tif (endsWithLinebreak(text, 2)) {\n\t\tdocs = [...docs, hardline];\n\t}\n\n\treturn docs;\n}\n","import { Buffer } from 'node:buffer';\nimport type { BuiltInParserName, BuiltInParsers, Doc, ParserOptions } from 'prettier';\nimport _doc from 'prettier/doc';\nimport { SassFormatter, type SassFormatterConfig } from 'sass-formatter';\nimport type { AttributeNode, ExpressionNode, FragmentNode, Node } from './nodes';\nimport {\n\tatSignReplace,\n\tclosingBracketReplace,\n\tdotReplace,\n\tinferParserByTypeAttribute,\n\tisNodeWithChildren,\n\tisTagLikeNode,\n\tisTextNode,\n\tmanualDedent,\n\topeningBracketReplace,\n\tprintRaw,\n\ttype AstPath,\n\ttype printFn,\n} from './utils';\n\nconst {\n\tbuilders: { group, indent, join, line, softline, hardline, lineSuffixBoundary },\n\tutils: { stripTrailingHardline, mapDoc },\n} = _doc;\n\nconst supportedStyleLangValues = ['css', 'scss', 'sass', 'less'] as const;\ntype supportedStyleLang = (typeof supportedStyleLangValues)[number];\n\n// https://prettier.io/docs/en/plugins.html#optional-embed\nexport function embed(\n\tpath: AstPath,\n\tprint: printFn,\n\ttextToDoc: (text: string, options: object) => Doc,\n\topts: ParserOptions\n) {\n\tconst node = path.getValue();\n\n\tif (!node) return null;\n\n\tif (node.type === 'expression') {\n\t\tconst jsxNode = makeNodeJSXCompatible<ExpressionNode>(node);\n\t\tconst textContent = printRaw(jsxNode);\n\n\t\tlet content: Doc;\n\n\t\tcontent = wrapParserTryCatch(textToDoc, textContent, {\n\t\t\t...opts,\n\t\t\tparser: expressionParser,\n\t\t});\n\n\t\tcontent = stripTrailingHardline(content);\n\n\t\t// HACK: Bit of a weird hack to get if a document is exclusively comments\n\t\t// Using `mapDoc` directly to build the array for some reason caused it to always be undefined? Not sure why\n\t\tconst strings: string[] = [];\n\t\tmapDoc(content, (doc) => {\n\t\t\tif (typeof doc === 'string') {\n\t\t\t\tstrings.push(doc);\n\t\t\t}\n\t\t});\n\n\t\tif (strings.every((value) => value.startsWith('//'))) {\n\t\t\treturn group(['{', content, softline, lineSuffixBoundary, '}']);\n\t\t}\n\n\t\t// Create a Doc without the things we had to add to make the expression compatible with Babel\n\t\tconst astroDoc = mapDoc(content, (doc) => {\n\t\t\tif (typeof doc === 'string') {\n\t\t\t\tdoc = doc.replace(openingBracketReplace, '{');\n\t\t\t\tdoc = doc.replace(closingBracketReplace, '}');\n\t\t\t\tdoc = doc.replace(atSignReplace, '@');\n\t\t\t\tdoc = doc.replace(dotReplace, '.');\n\t\t\t}\n\n\t\t\treturn doc;\n\t\t});\n\n\t\treturn group(['{', indent([softline, astroDoc]), softline, lineSuffixBoundary, '}']);\n\t}\n\n\t// Attribute using an expression as value\n\tif (node.type === 'attribute' && node.kind === 'expression') {\n\t\tconst value = node.value.trim();\n\t\tconst name = node.name.trim();\n\n\t\tconst attrNodeValue = wrapParserTryCatch(textToDoc, value, {\n\t\t\t...opts,\n\t\t\tparser: expressionParser,\n\t\t});\n\n\t\tif (name === value && opts.astroAllowShorthand) {\n\t\t\treturn [line, '{', attrNodeValue, '}'];\n\t\t}\n\n\t\treturn [line, name, '=', '{', attrNodeValue, '}'];\n\t}\n\n\tif (node.type === 'attribute' && node.kind === 'spread') {\n\t\tconst spreadContent = wrapParserTryCatch(textToDoc, node.name, {\n\t\t\t...opts,\n\t\t\tparser: expressionParser,\n\t\t});\n\n\t\treturn [line, '{...', spreadContent, '}'];\n\t}\n\n\t// Frontmatter\n\tif (node.type === 'frontmatter') {\n\t\tconst frontmatterContent = wrapParserTryCatch(textToDoc, node.value, {\n\t\t\t...opts,\n\t\t\tparser: 'babel-ts',\n\t\t});\n\n\t\treturn [group(['---', hardline, frontmatterContent, '---', hardline]), hardline];\n\t}\n\n\t// Script tags\n\tif (node.type === 'element' && node.name === 'script' && node.children.length) {\n\t\tconst typeAttribute = node.attributes.find((attr) => attr.name === 'type')?.value;\n\n\t\tlet parser: BuiltInParserName = 'babel-ts';\n\t\tif (typeAttribute) {\n\t\t\tparser = inferParserByTypeAttribute(typeAttribute);\n\t\t}\n\n\t\tconst scriptContent = printRaw(node);\n\t\tlet formattedScript = wrapParserTryCatch(textToDoc, scriptContent, {\n\t\t\t...opts,\n\t\t\tparser: parser,\n\t\t});\n\n\t\tformattedScript = stripTrailingHardline(formattedScript);\n\t\tconst isEmpty = /^\\s*$/.test(scriptContent);\n\n\t\t// print\n\t\tconst attributes = path.map(print, 'attributes');\n\t\tconst openingTag = group(['<script', indent(group(attributes)), softline, '>']);\n\t\treturn [\n\t\t\topeningTag,\n\t\t\tindent([isEmpty ? '' : hardline, formattedScript]),\n\t\t\tisEmpty ? '' : hardline,\n\t\t\t'</script>',\n\t\t];\n\t}\n\n\t// Style tags\n\tif (node.type === 'element' && node.name === 'style') {\n\t\tconst content = printRaw(node);\n\t\tlet parserLang: supportedStyleLang | undefined = 'css';\n\n\t\tif (node.attributes) {\n\t\t\tconst langAttribute = node.attributes.filter((x) => x.name === 'lang');\n\t\t\tif (langAttribute.length) {\n\t\t\t\tconst styleLang = langAttribute[0].value.toLowerCase() as supportedStyleLang;\n\t\t\t\tparserLang = supportedStyleLangValues.includes(styleLang) ? styleLang : undefined;\n\t\t\t}\n\t\t}\n\n\t\treturn embedStyle(parserLang, content, path, print, textToDoc, opts);\n\t}\n\n\treturn null;\n}\n\nfunction wrapParserTryCatch(\n\tcb: (text: string, options: object) => Doc,\n\ttext: string,\n\toptions: ParserOptions\n) {\n\ttry {\n\t\treturn cb(text, options);\n\t} catch (e) {\n\t\t// If we couldn't parse the expression (ex: syntax error) and we throw here, Prettier fallback to `print` and we'll\n\t\t// get a totally useless error message (ex: unhandled node type). An undocumented way to work around this is to set\n\t\t// `PRETTIER_DEBUG=1`, but nobody know that exists / want to do that just to get useful error messages. So we force it on\n\t\tprocess.env.PRETTIER_DEBUG = 'true';\n\t\tthrow e;\n\t}\n}\n\nfunction expressionParser(text: string, parsers: BuiltInParsers, options: ParserOptions) {\n\t// note the trailing newline: if the statement ends in a // comment,\n\t// we can't add the closing bracket right afterwards\n\tconst expressionContent = `<>{${text}\\n}</>`;\n\n\t// @ts-ignore\n\t// The type `RequiredOptions['parser]` is wrong. It uses `BuiltInParsers` as the type for the 2nd argument.\n\t// However, the parsers produced by `getParsers()` include ALL registered parsers, not just the built-in ones.\n\t// And the type of the built-in parsers and custom parsers all take (text[, parsers[, options]]) as arguments.\n\tconst ast = parsers['babel-ts'](expressionContent, parsers, options);\n\n\treturn {\n\t\t...ast,\n\t\tprogram: ast.program.body[0].expression.children[0].expression,\n\t};\n}\n\n/**\n * Due to the differences between Astro and JSX, Prettier's TypeScript parsers (be it `typescript` or `babel-ts`) are not\n * able to parse all expressions. So we need to first make the expression compatible before passing it to the parser\n *\n * A list of the difference that matters here:\n * - Astro allows a shorthand syntax for props. ex: `<Component {props} />`\n * - Astro allows multiple root elements. ex: `<div></div><div></div>`\n * - Astro allows attributes to include at signs (@) and dots (.)\n */\nfunction makeNodeJSXCompatible<T>(node: any): T {\n\tconst newNode = { ...node };\n\tconst childBundle: Node[][] = [];\n\tlet childBundleIndex = 0;\n\n\tif (isNodeWithChildren(newNode)) {\n\t\tnewNode.children = newNode.children.reduce((result: Node[], child, index) => {\n\t\t\tconst previousChildren = newNode.children[index - 1];\n\t\t\tconst nextChildren = newNode.children[index + 1];\n\t\t\tif (isTagLikeNode(child)) {\n\t\t\t\tchild.attributes = child.attributes.map(makeAttributeJSXCompatible);\n\n\t\t\t\tif (!childBundle[childBundleIndex]) {\n\t\t\t\t\tchildBundle[childBundleIndex] = [];\n\t\t\t\t}\n\n\t\t\t\tif (isNodeWithChildren(child)) {\n\t\t\t\t\tchild = makeNodeJSXCompatible<typeof child>(child);\n\t\t\t\t}\n\n\t\t\t\t// If we don't have a previous children, or it's not an element AND\n\t\t\t\t// we have a next children, and it's an element. Add the current children to the bundle\n\t\t\t\tif (\n\t\t\t\t\t(!previousChildren || isTextNode(previousChildren)) &&\n\t\t\t\t\tnextChildren &&\n\t\t\t\t\tisTagLikeNode(nextChildren)\n\t\t\t\t) {\n\t\t\t\t\tchildBundle[childBundleIndex].push(child);\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\t// If we have elements in our bundle, and there's no next children, or it's a text node\n\t\t\t\t// Create a fake parent, and add all the previous encountered elements as children of it\n\t\t\t\tif (\n\t\t\t\t\t(!nextChildren || isTextNode(nextChildren)) &&\n\t\t\t\t\tchildBundle[childBundleIndex].length > 0\n\t\t\t\t) {\n\t\t\t\t\tchildBundle[childBundleIndex].push(child);\n\n\t\t\t\t\tconst parentNode: FragmentNode = {\n\t\t\t\t\t\ttype: 'fragment',\n\t\t\t\t\t\tname: '',\n\t\t\t\t\t\tattributes: [],\n\t\t\t\t\t\tchildren: childBundle[childBundleIndex],\n\t\t\t\t\t};\n\n\t\t\t\t\tchildBundleIndex += 1;\n\t\t\t\t\tresult.push(parentNode);\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tchildBundleIndex += 1;\n\t\t\t}\n\n\t\t\tresult.push(child);\n\t\t\treturn result;\n\t\t}, []);\n\t}\n\n\treturn newNode;\n\n\tfunction makeAttributeJSXCompatible(attr: AttributeNode): AttributeNode {\n\t\t// Transform shorthand attributes into an empty attribute, ex: `{shorthand}` becomes `shorthand` and wrap it\n\t\t// so we can transform it back into {}\n\t\tif (attr.kind === 'shorthand') {\n\t\t\tattr.kind = 'empty';\n\t\t\tattr.name = openingBracketReplace + attr.name + closingBracketReplace;\n\t\t}\n\n\t\tif (attr.name.includes('@')) {\n\t\t\tattr.name = attr.name.replace('@', atSignReplace);\n\t\t}\n\n\t\tif (attr.name.includes('.')) {\n\t\t\tattr.name = attr.name.replace('.', dotReplace);\n\t\t}\n\n\t\treturn attr;\n\t}\n}\n\n/**\n * Format the content of a style tag and print the entire element\n */\nfunction embedStyle(\n\tlang: supportedStyleLang | undefined,\n\tcontent: string,\n\tpath: AstPath,\n\tprint: printFn,\n\ttextToDoc: (text: string, options: object) => Doc,\n\toptions: ParserOptions\n): Doc | null {\n\tconst isEmpty = /^\\s*$/.test(content);\n\n\tswitch (lang) {\n\t\tcase 'less':\n\t\tcase 'css':\n\t\tcase 'scss': {\n\t\t\tlet formattedStyles = wrapParserTryCatch(textToDoc, content, { ...options, parser: lang });\n\n\t\t\t// The css parser appends an extra indented hardline, which we want outside of the `indent()`,\n\t\t\t// so we remove the last element of the array\n\t\t\tformattedStyles = stripTrailingHardline(formattedStyles);\n\n\t\t\t// print\n\t\t\tconst attributes = path.map(print, 'attributes');\n\t\t\tconst openingTag = group(['<style', indent(group(attributes)), softline, '>']);\n\t\t\treturn [\n\t\t\t\topeningTag,\n\t\t\t\tindent([isEmpty ? '' : hardline, formattedStyles]),\n\t\t\t\tisEmpty ? '' : hardline,\n\t\t\t\t'</style>',\n\t\t\t];\n\t\t}\n\t\tcase 'sass': {\n\t\t\tconst lineEnding = options.endOfLine.toUpperCase() === 'CRLF' ? 'CRLF' : 'LF';\n\t\t\tconst sassOptions: Partial<SassFormatterConfig> = {\n\t\t\t\ttabSize: options.tabWidth,\n\t\t\t\tinsertSpaces: !options.useTabs,\n\t\t\t\tlineEnding,\n\t\t\t};\n\n\t\t\t// dedent the .sass, otherwise SassFormatter gets indentation wrong\n\t\t\tconst { result: raw } = manualDedent(content);\n\n\t\t\t// format\n\t\t\tconst formattedSassIndented = SassFormatter.Format(raw, sassOptions).trim();\n\n\t\t\t// print\n\t\t\tconst formattedSass = join(hardline, formattedSassIndented.split('\\n'));\n\t\t\tconst attributes = path.map(print, 'attributes');\n\t\t\tconst openingTag = group(['<style', indent(group(attributes)), softline, '>']);\n\t\t\treturn [\n\t\t\t\topeningTag,\n\t\t\t\tindent([isEmpty ? '' : hardline, formattedSass]),\n\t\t\t\tisEmpty ? '' : hardline,\n\t\t\t\t'</style>',\n\t\t\t];\n\t\t}\n\t\tcase undefined: {\n\t\t\tconst node = path.getNode();\n\n\t\t\tif (node) {\n\t\t\t\treturn Buffer.from(options.originalText)\n\t\t\t\t\t.subarray(options.locStart(node), options.locEnd(node))\n\t\t\t\t\t.toString();\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\t}\n}\n","import { parse } from '@astrojs/compiler/sync';\nimport type { Parser, Printer, SupportLanguage } from 'prettier';\nimport { options } from './options';\nimport { print } from './printer';\nimport { embed } from './printer/embed';\n\n// https://prettier.io/docs/en/plugins.html#languages\nexport const languages: Partial<SupportLanguage>[] = [\n\t{\n\t\tname: 'astro',\n\t\tparsers: ['astro'],\n\t\textensions: ['.astro'],\n\t\tvscodeLanguageIds: ['astro'],\n\t},\n];\n\n// https://prettier.io/docs/en/plugins.html#parsers\nexport const parsers: Record<string, Parser> = {\n\tastro: {\n\t\tparse: (source) => parse(source, { position: true }).ast,\n\t\tastFormat: 'astro',\n\t\tlocStart: (node) => node.position.start.offset,\n\t\tlocEnd: (node) => node.position.end.offset,\n\t},\n};\n\n// https://prettier.io/docs/en/plugins.html#printers\nexport const printers: Record<string, Printer> = {\n\tastro: {\n\t\tprint,\n\t\tembed,\n\t},\n};\n\nconst defaultOptions = {\n\ttabWidth: 2,\n};\n\nexport { options, defaultOptions };\n"],"names":["serialize","group","indent","join","line","softline","hardline","stripTrailingHardline","SassFormatter","Buffer","parse"],"mappings":";;;;;;;;;AAYa,MAAA,OAAO,GAA+C;AAClE,IAAA,mBAAmB,EAAE;AACpB,QAAA,KAAK,EAAE,QAAQ;AACf,QAAA,QAAQ,EAAE,OAAO;AACjB,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,WAAW,EAAE,kFAAkF;AAC/F,KAAA;;;AChBK,MAAM,eAAe,GAAG;IAC9B,MAAM;IACN,MAAM;IACN,UAAU;IACV,SAAS;IACT,IAAI;IACJ,KAAK;IACL,SAAS;IACT,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,KAAK;IACL,OAAO;IACP,SAAS;IACT,QAAQ;IACR,MAAM;IACN,UAAU;IACV,MAAM;IACN,QAAQ;IACR,OAAO;IACP,MAAM;IACN,QAAQ;IACR,OAAO;IACP,KAAK;CACL,CAAC;AAGK,MAAM,aAAa,GAAc;IACvC,SAAS;IACT,SAAS;IACT,OAAO;IACP,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,KAAK;IACL,IAAI;IACJ,GAAG;IACH,KAAK;IACL,SAAS;IACT,OAAO;IACP,IAAI;IAEJ,OAAO;IACP,MAAM;CACN,CAAC;AAKK,MAAM,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AAC;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/options.ts","../src/printer/elements.ts","../src/printer/utils.ts","../src/printer/index.ts","../src/printer/embed.ts","../src/index.ts"],"sourcesContent":["import type { SupportOption } from 'prettier';\n\ninterface PluginOptions {\n\tastroAllowShorthand: boolean;\n}\n\ndeclare module 'prettier' {\n\t// eslint-disable-next-line @typescript-eslint/no-empty-interface\n\tinterface RequiredOptions extends PluginOptions {}\n}\n\n// https://prettier.io/docs/en/plugins.html#options\nexport const options: Record<keyof PluginOptions, SupportOption> = {\n\tastroAllowShorthand: {\n\t\tcategory: 'Astro',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription: 'Enable/disable attribute shorthand if attribute name and expression are the same',\n\t},\n};\n","export type TagName = keyof HTMLElementTagNameMap | 'svg';\n\n// https://github.com/prettier/prettier/blob/main/vendors/html-void-elements.json\nexport const selfClosingTags = [\n\t'area',\n\t'base',\n\t'basefont',\n\t'bgsound',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'frame',\n\t'hr',\n\t'image',\n\t'img',\n\t'input',\n\t'isindex',\n\t'keygen',\n\t'link',\n\t'menuitem',\n\t'meta',\n\t'nextid',\n\t'param',\n\t'slot',\n\t'source',\n\t'track',\n\t'wbr',\n];\n\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements#Elements\nexport const blockElements: TagName[] = [\n\t'address',\n\t'article',\n\t'aside',\n\t'blockquote',\n\t'details',\n\t'dialog',\n\t'dd',\n\t'div',\n\t'dl',\n\t'dt',\n\t'fieldset',\n\t'figcaption',\n\t'figure',\n\t'footer',\n\t'form',\n\t'h1',\n\t'h2',\n\t'h3',\n\t'h4',\n\t'h5',\n\t'h6',\n\t'header',\n\t'hgroup',\n\t'hr',\n\t'li',\n\t'main',\n\t'nav',\n\t'ol',\n\t'p',\n\t'pre',\n\t'section',\n\t'table',\n\t'ul',\n\t// TODO: WIP\n\t'title',\n\t'html',\n];\n\n/**\n * HTML attributes that we may safely reformat (trim whitespace, add or remove newlines)\n */\nexport const formattableAttributes: string[] = [\n\t// None at the moment\n\t// Prettier HTML does not format attributes at all\n\t// and to be consistent we leave this array empty for now\n];\n","import { serialize } from '@astrojs/compiler/utils';\nimport {\n\ttype AstPath as AstP,\n\ttype BuiltInParserName,\n\ttype Doc,\n\ttype ParserOptions as ParserOpts,\n} from 'prettier';\nimport { blockElements, formattableAttributes, type TagName } from './elements';\nimport type {\n\tCommentNode,\n\tExpressionNode,\n\tNode,\n\tParentLikeNode,\n\tTagLikeNode,\n\tTextNode,\n\tanyNode,\n} from './nodes';\n\nexport type printFn = (path: AstPath) => Doc;\nexport type ParserOptions = ParserOpts<anyNode>;\nexport type AstPath = AstP<anyNode>;\n\nexport const openingBracketReplace = '_Pé';\nexport const closingBracketReplace = 'èP_';\nexport const atSignReplace = 'ΩP_';\nexport const dotReplace = 'ωP_';\n\nexport function isInlineElement(path: AstPath, opts: ParserOptions, node: anyNode): boolean {\n\treturn node && node.type === 'element' && !isBlockElement(node, opts) && !isPreTagContent(path);\n}\n\nexport function isBlockElement(node: anyNode, opts: ParserOptions): boolean {\n\treturn (\n\t\t(node &&\n\t\t\tnode.type === 'element' &&\n\t\t\topts.htmlWhitespaceSensitivity !== 'strict' &&\n\t\t\t(opts.htmlWhitespaceSensitivity === 'ignore' ||\n\t\t\t\tblockElements.includes(node.name as TagName))) ||\n\t\tnode.type === 'component' ||\n\t\tnode.type === 'fragment'\n\t);\n}\n\nexport function isIgnoreDirective(node: Node): boolean {\n\treturn node.type === 'comment' && node.value.trim() === 'prettier-ignore';\n}\n\n/**\n * Returns the content of the node\n */\nexport function printRaw(node: anyNode, stripLeadingAndTrailingNewline = false): string {\n\tif (!isNodeWithChildren(node)) {\n\t\treturn '';\n\t}\n\n\tif (node.children.length === 0) {\n\t\treturn '';\n\t}\n\n\tlet raw = node.children.reduce((prev: string, curr: Node) => prev + serialize(curr), '');\n\n\tif (!stripLeadingAndTrailingNewline) {\n\t\treturn raw;\n\t}\n\n\tif (startsWithLinebreak(raw)) {\n\t\traw = raw.substring(raw.indexOf('\\n') + 1);\n\t}\n\tif (endsWithLinebreak(raw)) {\n\t\traw = raw.substring(0, raw.lastIndexOf('\\n'));\n\t\tif (raw.charAt(raw.length - 1) === '\\r') {\n\t\t\traw = raw.substring(0, raw.length - 1);\n\t\t}\n\t}\n\n\treturn raw;\n}\n\nexport function isNodeWithChildren(node: anyNode): node is anyNode & ParentLikeNode {\n\treturn node && 'children' in node && Array.isArray(node.children);\n}\n\nexport const isEmptyTextNode = (node: anyNode): boolean => {\n\treturn !!node && node.type === 'text' && getUnencodedText(node).trim() === '';\n};\n\nexport function getUnencodedText(node: TextNode | CommentNode): string {\n\treturn node.value;\n}\n\nexport function isTextNodeStartingWithLinebreak(node: TextNode, nrLines = 1): node is TextNode {\n\treturn startsWithLinebreak(getUnencodedText(node), nrLines);\n}\n\nexport function startsWithLinebreak(text: string, nrLines = 1): boolean {\n\treturn new RegExp(`^([\\\\t\\\\f\\\\r ]*\\\\n){${nrLines}}`).test(text);\n}\n\nexport function endsWithLinebreak(text: string, nrLines = 1): boolean {\n\treturn new RegExp(`(\\\\n[\\\\t\\\\f\\\\r ]*){${nrLines}}$`).test(text);\n}\n\nexport function isTextNodeStartingWithWhitespace(node: Node): node is TextNode {\n\treturn isTextNode(node) && /^\\s/.test(getUnencodedText(node));\n}\n\nfunction endsWithWhitespace(text: string) {\n\treturn /\\s$/.test(text);\n}\n\nexport function isTextNodeEndingWithWhitespace(node: Node): node is TextNode {\n\treturn isTextNode(node) && endsWithWhitespace(getUnencodedText(node));\n}\n\nexport function hasSetDirectives(node: TagLikeNode) {\n\tconst attributes = Array.from(node.attributes, (attr) => attr.name);\n\treturn attributes.some((attr) => ['set:html', 'set:text'].includes(attr));\n}\n\n/**\n * Check if given node's start tag should hug its first child. This is the case for inline elements when there's\n * no whitespace between the `>` and the first child.\n */\nexport function shouldHugStart(node: anyNode, opts: ParserOptions): boolean {\n\tif (isBlockElement(node, opts)) {\n\t\treturn false;\n\t}\n\n\tif (node.type === 'fragment') {\n\t\treturn false;\n\t}\n\n\tif (!isNodeWithChildren(node)) {\n\t\treturn false;\n\t}\n\n\tconst children = node.children;\n\tif (children.length === 0) {\n\t\treturn true;\n\t}\n\n\tconst firstChild = children[0];\n\treturn !isTextNodeStartingWithWhitespace(firstChild);\n}\n\n/**\n * Check if given node's end tag should hug its last child. This is the case for inline elements when there's\n * no whitespace between the last child and the `</`.\n */\nexport function shouldHugEnd(node: anyNode, opts: ParserOptions): boolean {\n\tif (isBlockElement(node, opts)) {\n\t\treturn false;\n\t}\n\n\tif (!isNodeWithChildren(node)) {\n\t\treturn false;\n\t}\n\n\tconst children = node.children;\n\tif (children.length === 0) {\n\t\treturn true;\n\t}\n\n\tconst lastChild = children[children.length - 1];\n\tif (isExpressionNode(lastChild)) return true;\n\tif (isTagLikeNode(lastChild)) return true;\n\treturn !isTextNodeEndingWithWhitespace(lastChild);\n}\n\n/**\n * Returns true if the softline between `</tagName` and `>` can be omitted.\n */\nexport function canOmitSoftlineBeforeClosingTag(path: AstPath, opts: ParserOptions): boolean {\n\treturn isLastChildWithinParentBlockElement(path, opts);\n}\n\nfunction getChildren(node: anyNode): Node[] {\n\treturn isNodeWithChildren(node) ? node.children : [];\n}\n\nfunction isLastChildWithinParentBlockElement(path: AstPath, opts: ParserOptions): boolean {\n\tconst parent = path.getParentNode();\n\tif (!parent || !isBlockElement(parent, opts)) {\n\t\treturn false;\n\t}\n\n\tconst children = getChildren(parent);\n\tconst lastChild = children[children.length - 1];\n\treturn lastChild === path.getNode();\n}\n\nexport function trimTextNodeLeft(node: TextNode): void {\n\tnode.value = node.value && node.value.trimStart();\n}\n\nexport function trimTextNodeRight(node: TextNode): void {\n\tnode.value = node.value && node.value.trimEnd();\n}\n\nexport function printClassNames(value: string) {\n\treturn value.trim().split(/\\s+/).join(' ');\n}\n\n/** dedent string & return tabSize (the last part is what we need) */\nexport function manualDedent(input: string): {\n\ttabSize: number;\n\tchar: string;\n\tresult: string;\n} {\n\tlet minTabSize = Infinity;\n\tlet result = input;\n\t// 1. normalize\n\tresult = result.replace(/\\r\\n/g, '\\n');\n\n\t// 2. count tabSize\n\tlet char = '';\n\tfor (const line of result.split('\\n')) {\n\t\tif (!line) continue;\n\t\t// if any line begins with a non-whitespace char, minTabSize is 0\n\t\tif (line[0] && /^[^\\s]/.test(line[0])) {\n\t\t\tminTabSize = 0;\n\t\t\tbreak;\n\t\t}\n\t\tconst match = line.match(/^(\\s+)\\S+/); // \\S ensures we don’t count lines of pure whitespace\n\t\tif (match) {\n\t\t\tif (match[1] && !char) char = match[1][0];\n\t\t\tif (match[1].length < minTabSize) minTabSize = match[1].length;\n\t\t}\n\t}\n\n\t// 3. reformat string\n\tif (minTabSize > 0 && Number.isFinite(minTabSize)) {\n\t\tresult = result.replace(new RegExp(`^${new Array(minTabSize + 1).join(char)}`, 'gm'), '');\n\t}\n\n\treturn {\n\t\ttabSize: minTabSize === Infinity ? 0 : minTabSize,\n\t\tchar,\n\t\tresult,\n\t};\n}\n\n/** True if the node is of type text */\nexport function isTextNode(node: anyNode): node is TextNode {\n\treturn node.type === 'text';\n}\n\nexport function isExpressionNode(node: anyNode): node is ExpressionNode {\n\treturn node.type === 'expression';\n}\n\n/** True if the node is TagLikeNode:\n *\n * ElementNode | ComponentNode | CustomElementNode | FragmentNode */\nexport function isTagLikeNode(node: anyNode): node is TagLikeNode {\n\treturn (\n\t\tnode.type === 'element' ||\n\t\tnode.type === 'component' ||\n\t\tnode.type === 'custom-element' ||\n\t\tnode.type === 'fragment'\n\t);\n}\n\n/**\n * Returns siblings, that is, the children of the parent.\n */\nexport function getSiblings(path: AstPath): anyNode[] {\n\tconst parent = path.getParentNode();\n\tif (!parent) return [];\n\n\treturn getChildren(parent);\n}\n\nexport function getNextNode(path: AstPath): anyNode | null {\n\tconst node = path.getNode();\n\tif (node) {\n\t\tconst siblings = getSiblings(path);\n\t\tif (node.position?.start === siblings[siblings.length - 1].position?.start) return null;\n\t\tfor (let i = 0; i < siblings.length; i++) {\n\t\t\tconst sibling = siblings[i];\n\t\t\tif (sibling.position?.start === node.position?.start && i !== siblings.length - 1) {\n\t\t\t\treturn siblings[i + 1];\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n}\n\nexport const isPreTagContent = (path: AstPath): boolean => {\n\tif (!path || !path.stack || !Array.isArray(path.stack)) return false;\n\treturn path.stack.some(\n\t\t(node: anyNode) =>\n\t\t\t(node.type === 'element' && node.name.toLowerCase() === 'pre') ||\n\t\t\t(node.type === 'attribute' && !formattableAttributes.includes(node.name))\n\t);\n};\n\ninterface QuoteResult {\n\tquote: '\"' | \"'\";\n\tregex: RegExp;\n\tescaped: string;\n}\n\n// Adapted from Prettier's source code as it's unfortunately not exported\n// https://github.com/prettier/prettier/blob/237e681936fc533c27d7ce8577d3fc98838a3314/src/common/util.js#L238\nexport function getPreferredQuote(rawContent: string, preferredQuote: string): QuoteResult {\n\tconst double: QuoteResult = { quote: '\"', regex: /\"/g, escaped: '"' };\n\tconst single: QuoteResult = { quote: \"'\", regex: /'/g, escaped: ''' };\n\n\tconst preferred = preferredQuote === \"'\" ? single : double;\n\tconst alternate = preferred === single ? double : single;\n\n\tlet result = preferred;\n\n\t// If `rawContent` contains at least one of the quote preferred for enclosing\n\t// the string, we might want to enclose with the alternate quote instead, to\n\t// minimize the number of escaped quotes.\n\tif (rawContent.includes(preferred.quote) || rawContent.includes(alternate.quote)) {\n\t\tconst numPreferredQuotes = (rawContent.match(preferred.regex) || []).length;\n\t\tconst numAlternateQuotes = (rawContent.match(alternate.regex) || []).length;\n\n\t\tresult = numPreferredQuotes > numAlternateQuotes ? alternate : preferred;\n\t}\n\n\treturn result;\n}\n\n// Adapted from: https://github.com/prettier/prettier/blob/20ab6d6f1c5bd774621230b493a3b71d39383a2c/src/language-html/utils/index.js#LL336C1-L369C2\nexport function inferParserByTypeAttribute(type: string): BuiltInParserName {\n\tif (!type) {\n\t\treturn 'babel-ts';\n\t}\n\n\tswitch (type) {\n\t\tcase 'module':\n\t\tcase 'text/javascript':\n\t\tcase 'text/babel':\n\t\tcase 'application/javascript':\n\t\t\treturn 'babel';\n\n\t\tcase 'application/x-typescript':\n\t\t\treturn 'babel-ts';\n\n\t\tcase 'text/markdown':\n\t\t\treturn 'markdown';\n\n\t\tcase 'text/html':\n\t\t\treturn 'html';\n\n\t\tcase 'text/x-handlebars-template':\n\t\t\treturn 'glimmer';\n\n\t\tdefault:\n\t\t\tif (type.endsWith('json') || type.endsWith('importmap') || type === 'speculationrules') {\n\t\t\t\treturn 'json';\n\t\t\t}\n\t\t\treturn 'babel-ts';\n\t}\n}\n","import { type Doc } from 'prettier';\nimport { selfClosingTags } from './elements';\nimport { type TextNode } from './nodes';\nimport {\n\tcanOmitSoftlineBeforeClosingTag,\n\tendsWithLinebreak,\n\tgetNextNode,\n\tgetPreferredQuote,\n\tgetUnencodedText,\n\thasSetDirectives,\n\tisEmptyTextNode,\n\tisIgnoreDirective,\n\tisInlineElement,\n\tisPreTagContent,\n\tisTagLikeNode,\n\tisTextNode,\n\tisTextNodeEndingWithWhitespace,\n\tisTextNodeStartingWithLinebreak,\n\tisTextNodeStartingWithWhitespace,\n\tprintClassNames,\n\tprintRaw,\n\tshouldHugEnd,\n\tshouldHugStart,\n\tstartsWithLinebreak,\n\ttrimTextNodeLeft,\n\ttrimTextNodeRight,\n\ttype AstPath,\n\ttype ParserOptions,\n\ttype printFn,\n} from './utils';\n\nimport _doc from 'prettier/doc';\nconst {\n\tbuilders: {\n\t\tbreakParent,\n\t\tdedent,\n\t\tfill,\n\t\tgroup,\n\t\tindent,\n\t\tjoin,\n\t\tline,\n\t\tsoftline,\n\t\thardline,\n\t\tliteralline,\n\t},\n\tutils: { stripTrailingHardline },\n} = _doc;\n\nlet ignoreNext = false;\n\n// https://prettier.io/docs/en/plugins.html#print\n// eslint-disable-next-line @typescript-eslint/no-shadow\nexport function print(path: AstPath, opts: ParserOptions, print: printFn): Doc {\n\tconst node = path.node;\n\n\t// 1. handle special node types\n\tif (!node) {\n\t\treturn '';\n\t}\n\n\tif (ignoreNext && !isEmptyTextNode(node)) {\n\t\tignoreNext = false;\n\t\treturn [\n\t\t\topts.originalText\n\t\t\t\t.slice(opts.locStart(node), opts.locEnd(node))\n\t\t\t\t.split('\\n')\n\t\t\t\t.map((lineContent, i) => (i == 0 ? [lineContent] : [literalline, lineContent]))\n\t\t\t\t.flat(),\n\t\t];\n\t}\n\n\tif (typeof node === 'string') {\n\t\treturn node;\n\t}\n\n\t// 2. handle printing\n\tswitch (node.type) {\n\t\tcase 'root': {\n\t\t\treturn [stripTrailingHardline(path.map(print, 'children')), hardline];\n\t\t}\n\n\t\tcase 'text': {\n\t\t\tconst rawText = getUnencodedText(node);\n\n\t\t\t// TODO: TEST PRE TAGS\n\t\t\t// if (isPreTagContent(path)) {\n\t\t\t// if (path.getParentNode()?.type === 'Attribute') {\n\t\t\t// // Direct child of attribute value -> add literallines at end of lines\n\t\t\t// // so that other things don't break in unexpected places\n\t\t\t// return replaceEndOfLineWith(rawText, literalline);\n\t\t\t// }\n\t\t\t// return rawText;\n\t\t\t// }\n\n\t\t\tif (isEmptyTextNode(node)) {\n\t\t\t\tconst hasWhiteSpace = rawText.trim().length < getUnencodedText(node).length;\n\t\t\t\tconst hasOneOrMoreNewlines = /\\n/.test(getUnencodedText(node));\n\t\t\t\tconst hasTwoOrMoreNewlines = /\\n\\r?\\s*\\n\\r?/.test(getUnencodedText(node));\n\t\t\t\tif (hasTwoOrMoreNewlines) {\n\t\t\t\t\treturn [hardline, hardline];\n\t\t\t\t}\n\t\t\t\tif (hasOneOrMoreNewlines) {\n\t\t\t\t\treturn hardline;\n\t\t\t\t}\n\t\t\t\tif (hasWhiteSpace) {\n\t\t\t\t\treturn line;\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * For non-empty text nodes each sequence of non-whitespace characters (effectively,\n\t\t\t * each \"word\") is joined by a single `line`, which will be rendered as a single space\n\t\t\t * until this node's current line is out of room, at which `fill` will break at the\n\t\t\t * most convenient instance of `line`.\n\t\t\t */\n\t\t\treturn fill(splitTextToDocs(node));\n\t\t}\n\n\t\tcase 'component':\n\t\tcase 'fragment':\n\t\tcase 'custom-element':\n\t\tcase 'element': {\n\t\t\tlet isEmpty: boolean;\n\t\t\tif (!node.children) {\n\t\t\t\tisEmpty = true;\n\t\t\t} else {\n\t\t\t\tisEmpty = node.children.every((child) => isEmptyTextNode(child));\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * An element is allowed to self close only if:\n\t\t\t * It is empty AND\n\t\t\t * It's a component OR\n\t\t\t * It's in the HTML spec as a void element OR\n\t\t\t * It has a `set:*` directive\n\t\t\t */\n\t\t\tconst isSelfClosingTag =\n\t\t\t\tisEmpty &&\n\t\t\t\t(node.type === 'component' ||\n\t\t\t\t\tselfClosingTags.includes(node.name) ||\n\t\t\t\t\thasSetDirectives(node));\n\n\t\t\tconst isSingleLinePerAttribute = opts.singleAttributePerLine && node.attributes.length > 1;\n\t\t\tconst attributeLine = isSingleLinePerAttribute ? breakParent : '';\n\t\t\tconst attributes = join(attributeLine, path.map(print, 'attributes'));\n\n\t\t\tif (isSelfClosingTag) {\n\t\t\t\treturn group(['<', node.name, indent(attributes), line, `/>`]);\n\t\t\t}\n\n\t\t\tif (node.children) {\n\t\t\t\tconst children = node.children;\n\t\t\t\tconst firstChild = children[0];\n\t\t\t\tconst lastChild = children[children.length - 1];\n\n\t\t\t\t// No hugging of content means it's either a block element and/or there's whitespace at the start/end\n\t\t\t\tlet noHugSeparatorStart:\n\t\t\t\t\t| _doc.builders.Line\n\t\t\t\t\t| _doc.builders.Softline\n\t\t\t\t\t| _doc.builders.Hardline\n\t\t\t\t\t| string = softline;\n\t\t\t\tlet noHugSeparatorEnd:\n\t\t\t\t\t| _doc.builders.Line\n\t\t\t\t\t| _doc.builders.Softline\n\t\t\t\t\t| _doc.builders.Hardline\n\t\t\t\t\t| string = softline;\n\t\t\t\tconst hugStart = shouldHugStart(node, opts);\n\t\t\t\tconst hugEnd = shouldHugEnd(node, opts);\n\n\t\t\t\tlet body;\n\n\t\t\t\tif (isEmpty) {\n\t\t\t\t\tbody =\n\t\t\t\t\t\tisInlineElement(path, opts, node) &&\n\t\t\t\t\t\tnode.children.length &&\n\t\t\t\t\t\tisTextNodeStartingWithWhitespace(node.children[0]) &&\n\t\t\t\t\t\t!isPreTagContent(path)\n\t\t\t\t\t\t\t? () => line\n\t\t\t\t\t\t\t: () => softline;\n\t\t\t\t} else if (isPreTagContent(path)) {\n\t\t\t\t\tbody = () => printRaw(node);\n\t\t\t\t} else if (isInlineElement(path, opts, node) && !isPreTagContent(path)) {\n\t\t\t\t\tbody = () => path.map(print, 'children');\n\t\t\t\t} else {\n\t\t\t\t\tbody = () => path.map(print, 'children');\n\t\t\t\t}\n\n\t\t\t\tconst openingTag = [\n\t\t\t\t\t'<',\n\t\t\t\t\tnode.name,\n\t\t\t\t\tindent(\n\t\t\t\t\t\tgroup([\n\t\t\t\t\t\t\tattributes,\n\t\t\t\t\t\t\thugStart\n\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t: !isPreTagContent(path) && !opts.bracketSameLine\n\t\t\t\t\t\t\t\t? dedent(softline)\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\t])\n\t\t\t\t\t),\n\t\t\t\t];\n\n\t\t\t\tif (hugStart && hugEnd) {\n\t\t\t\t\tconst huggedContent = [\n\t\t\t\t\t\tisSingleLinePerAttribute ? hardline : softline,\n\t\t\t\t\t\tgroup(['>', body(), `</${node.name}`]),\n\t\t\t\t\t];\n\n\t\t\t\t\tconst omitSoftlineBeforeClosingTag =\n\t\t\t\t\t\tisEmpty || canOmitSoftlineBeforeClosingTag(path, opts);\n\t\t\t\t\treturn group([\n\t\t\t\t\t\t...openingTag,\n\t\t\t\t\t\tisEmpty ? group(huggedContent) : group(indent(huggedContent)),\n\t\t\t\t\t\tomitSoftlineBeforeClosingTag ? '' : softline,\n\t\t\t\t\t\t'>',\n\t\t\t\t\t]);\n\t\t\t\t}\n\n\t\t\t\tif (isPreTagContent(path)) {\n\t\t\t\t\tnoHugSeparatorStart = '';\n\t\t\t\t\tnoHugSeparatorEnd = '';\n\t\t\t\t} else {\n\t\t\t\t\tlet didSetEndSeparator = false;\n\n\t\t\t\t\tif (!hugStart && firstChild && isTextNode(firstChild)) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tisTextNodeStartingWithLinebreak(firstChild) &&\n\t\t\t\t\t\t\tfirstChild !== lastChild &&\n\t\t\t\t\t\t\t(!isInlineElement(path, opts, node) || isTextNodeEndingWithWhitespace(lastChild))\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tnoHugSeparatorStart = hardline;\n\t\t\t\t\t\t\tnoHugSeparatorEnd = hardline;\n\t\t\t\t\t\t\tdidSetEndSeparator = true;\n\t\t\t\t\t\t} else if (isInlineElement(path, opts, node)) {\n\t\t\t\t\t\t\tnoHugSeparatorStart = line;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttrimTextNodeLeft(firstChild);\n\t\t\t\t\t}\n\t\t\t\t\tif (!hugEnd && lastChild && isTextNode(lastChild)) {\n\t\t\t\t\t\tif (isInlineElement(path, opts, node) && !didSetEndSeparator) {\n\t\t\t\t\t\t\tnoHugSeparatorEnd = softline;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttrimTextNodeRight(lastChild);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (hugStart) {\n\t\t\t\t\treturn group([\n\t\t\t\t\t\t...openingTag,\n\t\t\t\t\t\tindent([softline, group(['>', body()])]),\n\t\t\t\t\t\tnoHugSeparatorEnd,\n\t\t\t\t\t\t`</${node.name}>`,\n\t\t\t\t\t]);\n\t\t\t\t}\n\n\t\t\t\tif (hugEnd) {\n\t\t\t\t\treturn group([\n\t\t\t\t\t\t...openingTag,\n\t\t\t\t\t\t'>',\n\t\t\t\t\t\tindent([noHugSeparatorStart, group([body(), `</${node.name}`])]),\n\t\t\t\t\t\tcanOmitSoftlineBeforeClosingTag(path, opts) ? '' : softline,\n\t\t\t\t\t\t'>',\n\t\t\t\t\t]);\n\t\t\t\t}\n\n\t\t\t\tif (isEmpty) {\n\t\t\t\t\treturn group([...openingTag, '>', body(), `</${node.name}>`]);\n\t\t\t\t}\n\n\t\t\t\treturn group([\n\t\t\t\t\t...openingTag,\n\t\t\t\t\t'>',\n\t\t\t\t\tindent([noHugSeparatorStart, body()]),\n\t\t\t\t\tnoHugSeparatorEnd,\n\t\t\t\t\t`</${node.name}>`,\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\t// TODO: WIP\n\t\t\treturn '';\n\t\t}\n\n\t\tcase 'attribute': {\n\t\t\tconst name = node.name.trim();\n\t\t\tswitch (node.kind) {\n\t\t\t\tcase 'empty':\n\t\t\t\t\treturn [line, name];\n\t\t\t\tcase 'expression':\n\t\t\t\t\t// Handled in the `embed` function\n\t\t\t\t\t// See embed.ts\n\t\t\t\t\treturn '';\n\t\t\t\tcase 'quoted':\n\t\t\t\t\tlet value = node.value;\n\n\t\t\t\t\tif (node.name === 'class') {\n\t\t\t\t\t\tvalue = printClassNames(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst unescapedValue = value.replace(/'/g, \"'\").replace(/"/g, '\"');\n\t\t\t\t\tconst { escaped, quote, regex } = getPreferredQuote(\n\t\t\t\t\t\tunescapedValue,\n\t\t\t\t\t\topts.jsxSingleQuote ? \"'\" : '\"'\n\t\t\t\t\t);\n\n\t\t\t\t\tconst result = unescapedValue.replace(regex, escaped);\n\t\t\t\t\treturn [line, name, '=', quote, result, quote];\n\t\t\t\tcase 'shorthand':\n\t\t\t\t\treturn [line, '{', name, '}'];\n\t\t\t\tcase 'spread':\n\t\t\t\t\treturn [line, '{...', name, '}'];\n\t\t\t\tcase 'template-literal':\n\t\t\t\t\treturn [line, name, '=', '`', node.value, '`'];\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\tcase 'doctype': {\n\t\t\t// https://www.w3.org/wiki/Doctypes_and_markup_styles\n\t\t\treturn ['<!DOCTYPE html>', hardline];\n\t\t}\n\n\t\tcase 'comment':\n\t\t\tif (isIgnoreDirective(node)) {\n\t\t\t\tignoreNext = true;\n\t\t\t}\n\n\t\t\tconst nextNode = getNextNode(path);\n\t\t\tlet trailingLine: string | _doc.builders.Hardline = '';\n\t\t\tif (nextNode && isTagLikeNode(nextNode)) {\n\t\t\t\ttrailingLine = hardline;\n\t\t\t}\n\t\t\treturn ['<!--', getUnencodedText(node), '-->', trailingLine];\n\n\t\tdefault: {\n\t\t\tthrow new Error(`Unhandled node type \"${node.type}\"!`);\n\t\t}\n\t}\n}\n\n/**\n * Split the text into words separated by whitespace. Replace the whitespaces by lines,\n * collapsing multiple whitespaces into a single line.\n *\n * If the text starts or ends with multiple newlines, two of those should be kept.\n */\nfunction splitTextToDocs(node: TextNode): Doc[] {\n\tconst text = getUnencodedText(node);\n\n\tconst textLines = text.split(/[\\t\\n\\f\\r ]+/);\n\n\tlet docs = join(line, textLines);\n\n\tif (startsWithLinebreak(text)) {\n\t\tdocs[0] = hardline;\n\t}\n\tif (startsWithLinebreak(text, 2)) {\n\t\tdocs = [hardline, ...docs];\n\t}\n\n\tif (endsWithLinebreak(text)) {\n\t\tdocs[docs.length - 1] = hardline;\n\t}\n\tif (endsWithLinebreak(text, 2)) {\n\t\tdocs = [...docs, hardline];\n\t}\n\n\treturn docs;\n}\n","import { Buffer } from 'node:buffer';\nimport type { BuiltInParserName, Doc, Options } from 'prettier';\nimport _doc from 'prettier/doc';\nimport { SassFormatter, type SassFormatterConfig } from 'sass-formatter';\nimport type { AttributeNode, ExpressionNode, FragmentNode, Node } from './nodes';\nimport {\n\tatSignReplace,\n\tclosingBracketReplace,\n\tdotReplace,\n\tinferParserByTypeAttribute,\n\tisNodeWithChildren,\n\tisTagLikeNode,\n\tisTextNode,\n\tmanualDedent,\n\topeningBracketReplace,\n\tprintRaw,\n\ttype AstPath,\n\ttype ParserOptions,\n\ttype printFn,\n} from './utils';\n\nconst {\n\tbuilders: { group, indent, join, line, softline, hardline, lineSuffixBoundary },\n\tutils: { stripTrailingHardline, mapDoc },\n} = _doc;\n\nconst supportedStyleLangValues = ['css', 'scss', 'sass', 'less'] as const;\ntype supportedStyleLang = (typeof supportedStyleLangValues)[number];\n\n// https://prettier.io/docs/en/plugins.html#optional-embed\ntype TextToDoc = (text: string, options: Options) => Promise<Doc>;\n\ntype Embed =\n\t| ((\n\t\t\tpath: AstPath,\n\t\t\toptions: Options\n\t ) =>\n\t\t\t| ((\n\t\t\t\t\ttextToDoc: TextToDoc,\n\t\t\t\t\tprint: (selector?: string | number | Array<string | number> | AstPath) => Doc,\n\t\t\t\t\tpath: AstPath,\n\t\t\t\t\toptions: Options\n\t\t\t ) => Promise<Doc | undefined> | Doc | undefined)\n\t\t\t| Doc\n\t\t\t| null)\n\t| undefined;\n\nexport const embed = ((path: AstPath, options: Options) => {\n\tconst parserOption = options as ParserOptions;\n\treturn async (textToDoc, print) => {\n\t\tconst node = path.node;\n\n\t\tif (!node) return undefined;\n\n\t\tif (node.type === 'expression') {\n\t\t\tconst jsxNode = makeNodeJSXCompatible<ExpressionNode>(node);\n\t\t\tconst textContent = printRaw(jsxNode);\n\n\t\t\tlet content: Doc;\n\n\t\t\tcontent = await wrapParserTryCatch(textToDoc, textContent, {\n\t\t\t\t...options,\n\t\t\t\tparser: 'astroExpressionParser',\n\t\t\t});\n\n\t\t\tcontent = stripTrailingHardline(content);\n\n\t\t\t// HACK: Bit of a weird hack to get if a document is exclusively comments\n\t\t\t// Using `mapDoc` directly to build the array for some reason caused it to always be undefined? Not sure why\n\t\t\tconst strings: string[] = [];\n\t\t\tmapDoc(content, (doc) => {\n\t\t\t\tif (typeof doc === 'string') {\n\t\t\t\t\tstrings.push(doc);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (strings.every((value) => value.startsWith('//'))) {\n\t\t\t\treturn group(['{', content, softline, lineSuffixBoundary, '}']);\n\t\t\t}\n\n\t\t\t// Create a Doc without the things we had to add to make the expression compatible with Babel\n\t\t\tconst astroDoc = mapDoc(content, (doc) => {\n\t\t\t\tif (typeof doc === 'string') {\n\t\t\t\t\tdoc = doc.replace(openingBracketReplace, '{');\n\t\t\t\t\tdoc = doc.replace(closingBracketReplace, '}');\n\t\t\t\t\tdoc = doc.replace(atSignReplace, '@');\n\t\t\t\t\tdoc = doc.replace(dotReplace, '.');\n\t\t\t\t}\n\n\t\t\t\treturn doc;\n\t\t\t});\n\n\t\t\treturn group(['{', indent([softline, astroDoc]), softline, lineSuffixBoundary, '}']);\n\t\t}\n\n\t\t// Attribute using an expression as value\n\t\tif (node.type === 'attribute' && node.kind === 'expression') {\n\t\t\tconst value = node.value.trim();\n\t\t\tconst name = node.name.trim();\n\n\t\t\tconst attrNodeValue = await wrapParserTryCatch(textToDoc, value, {\n\t\t\t\t...options,\n\t\t\t\tparser: 'astroExpressionParser',\n\t\t\t});\n\n\t\t\tif (name === value && options.astroAllowShorthand) {\n\t\t\t\treturn [line, '{', attrNodeValue, '}'];\n\t\t\t}\n\n\t\t\treturn [line, name, '=', '{', attrNodeValue, '}'];\n\t\t}\n\n\t\tif (node.type === 'attribute' && node.kind === 'spread') {\n\t\t\tconst spreadContent = await wrapParserTryCatch(textToDoc, node.name, {\n\t\t\t\t...options,\n\t\t\t\tparser: 'astroExpressionParser',\n\t\t\t});\n\n\t\t\treturn [line, '{...', spreadContent, '}'];\n\t\t}\n\n\t\t// Frontmatter\n\t\tif (node.type === 'frontmatter') {\n\t\t\tconst frontmatterContent = await wrapParserTryCatch(textToDoc, node.value, {\n\t\t\t\t...options,\n\t\t\t\tparser: 'babel-ts',\n\t\t\t});\n\n\t\t\treturn [group(['---', hardline, frontmatterContent, hardline, '---', hardline]), hardline];\n\t\t}\n\n\t\t// Script tags\n\t\tif (node.type === 'element' && node.name === 'script' && node.children.length) {\n\t\t\tconst typeAttribute = node.attributes.find((attr) => attr.name === 'type')?.value;\n\n\t\t\tlet parser: BuiltInParserName = 'babel-ts';\n\t\t\tif (typeAttribute) {\n\t\t\t\tparser = inferParserByTypeAttribute(typeAttribute);\n\t\t\t}\n\n\t\t\tconst scriptContent = printRaw(node);\n\t\t\tlet formattedScript = await wrapParserTryCatch(textToDoc, scriptContent, {\n\t\t\t\t...options,\n\t\t\t\tparser: parser,\n\t\t\t});\n\n\t\t\tformattedScript = stripTrailingHardline(formattedScript);\n\t\t\tconst isEmpty = /^\\s*$/.test(scriptContent);\n\n\t\t\t// print\n\t\t\tconst attributes = path.map(print, 'attributes');\n\t\t\tconst openingTag = group(['<script', indent(group(attributes)), softline, '>']);\n\t\t\treturn [\n\t\t\t\topeningTag,\n\t\t\t\tindent([isEmpty ? '' : hardline, formattedScript]),\n\t\t\t\tisEmpty ? '' : hardline,\n\t\t\t\t'</script>',\n\t\t\t];\n\t\t}\n\n\t\t// Style tags\n\t\tif (node.type === 'element' && node.name === 'style') {\n\t\t\tconst content = printRaw(node);\n\t\t\tlet parserLang: supportedStyleLang | undefined = 'css';\n\n\t\t\tif (node.attributes) {\n\t\t\t\tconst langAttribute = node.attributes.filter((x) => x.name === 'lang');\n\t\t\t\tif (langAttribute.length) {\n\t\t\t\t\tconst styleLang = langAttribute[0].value.toLowerCase() as supportedStyleLang;\n\t\t\t\t\tparserLang = supportedStyleLangValues.includes(styleLang) ? styleLang : undefined;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn await embedStyle(parserLang, content, path, print, textToDoc, parserOption);\n\t\t}\n\n\t\treturn undefined;\n\t};\n}) satisfies Embed;\n\nasync function wrapParserTryCatch(cb: TextToDoc, text: string, options: Options) {\n\ttry {\n\t\treturn await cb(text, options);\n\t} catch (e) {\n\t\t// If we couldn't parse the expression (ex: syntax error) and we throw here, Prettier fallback to `print` and we'll\n\t\t// get a totally useless error message (ex: unhandled node type). An undocumented way to work around this is to set\n\t\t// `PRETTIER_DEBUG=1`, but nobody know that exists / want to do that just to get useful error messages. So we force it on\n\t\tprocess.env.PRETTIER_DEBUG = 'true';\n\t\tthrow e;\n\t}\n}\n\n/**\n * Due to the differences between Astro and JSX, Prettier's TypeScript parsers (be it `typescript` or `babel-ts`) are not\n * able to parse all expressions. So we need to first make the expression compatible before passing it to the parser\n *\n * A list of the difference that matters here:\n * - Astro allows a shorthand syntax for props. ex: `<Component {props} />`\n * - Astro allows multiple root elements. ex: `<div></div><div></div>`\n * - Astro allows attributes to include at signs (@) and dots (.)\n */\nfunction makeNodeJSXCompatible<T>(node: any): T {\n\tconst newNode = { ...node };\n\tconst childBundle: Node[][] = [];\n\tlet childBundleIndex = 0;\n\n\tif (isNodeWithChildren(newNode)) {\n\t\tnewNode.children = newNode.children.reduce((result: Node[], child, index) => {\n\t\t\tconst previousChildren = newNode.children[index - 1];\n\t\t\tconst nextChildren = newNode.children[index + 1];\n\t\t\tif (isTagLikeNode(child)) {\n\t\t\t\tchild.attributes = child.attributes.map(makeAttributeJSXCompatible);\n\n\t\t\t\tif (!childBundle[childBundleIndex]) {\n\t\t\t\t\tchildBundle[childBundleIndex] = [];\n\t\t\t\t}\n\n\t\t\t\tif (isNodeWithChildren(child)) {\n\t\t\t\t\tchild = makeNodeJSXCompatible<typeof child>(child);\n\t\t\t\t}\n\n\t\t\t\t// If we don't have a previous children, or it's not an element AND\n\t\t\t\t// we have a next children, and it's an element. Add the current children to the bundle\n\t\t\t\tif (\n\t\t\t\t\t(!previousChildren || isTextNode(previousChildren)) &&\n\t\t\t\t\tnextChildren &&\n\t\t\t\t\tisTagLikeNode(nextChildren)\n\t\t\t\t) {\n\t\t\t\t\tchildBundle[childBundleIndex].push(child);\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\t// If we have elements in our bundle, and there's no next children, or it's a text node\n\t\t\t\t// Create a fake parent, and add all the previous encountered elements as children of it\n\t\t\t\tif (\n\t\t\t\t\t(!nextChildren || isTextNode(nextChildren)) &&\n\t\t\t\t\tchildBundle[childBundleIndex].length > 0\n\t\t\t\t) {\n\t\t\t\t\tchildBundle[childBundleIndex].push(child);\n\n\t\t\t\t\tconst parentNode: FragmentNode = {\n\t\t\t\t\t\ttype: 'fragment',\n\t\t\t\t\t\tname: '',\n\t\t\t\t\t\tattributes: [],\n\t\t\t\t\t\tchildren: childBundle[childBundleIndex],\n\t\t\t\t\t};\n\n\t\t\t\t\tchildBundleIndex += 1;\n\t\t\t\t\tresult.push(parentNode);\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tchildBundleIndex += 1;\n\t\t\t}\n\n\t\t\tresult.push(child);\n\t\t\treturn result;\n\t\t}, []);\n\t}\n\n\treturn newNode;\n\n\tfunction makeAttributeJSXCompatible(attr: AttributeNode): AttributeNode {\n\t\t// Transform shorthand attributes into an empty attribute, ex: `{shorthand}` becomes `shorthand` and wrap it\n\t\t// so we can transform it back into {}\n\t\tif (attr.kind === 'shorthand') {\n\t\t\tattr.kind = 'empty';\n\t\t\tattr.name = openingBracketReplace + attr.name + closingBracketReplace;\n\t\t}\n\n\t\tif (attr.name.includes('@')) {\n\t\t\tattr.name = attr.name.replace('@', atSignReplace);\n\t\t}\n\n\t\tif (attr.name.includes('.')) {\n\t\t\tattr.name = attr.name.replace('.', dotReplace);\n\t\t}\n\n\t\treturn attr;\n\t}\n}\n\n/**\n * Format the content of a style tag and print the entire element\n */\nasync function embedStyle(\n\tlang: supportedStyleLang | undefined,\n\tcontent: string,\n\tpath: AstPath,\n\tprint: printFn,\n\ttextToDoc: TextToDoc,\n\toptions: ParserOptions\n): Promise<_doc.builders.Doc | undefined> {\n\tconst isEmpty = /^\\s*$/.test(content);\n\n\tswitch (lang) {\n\t\tcase 'less':\n\t\tcase 'css':\n\t\tcase 'scss': {\n\t\t\tlet formattedStyles = await wrapParserTryCatch(textToDoc, content, {\n\t\t\t\t...options,\n\t\t\t\tparser: lang,\n\t\t\t});\n\n\t\t\t// The css parser appends an extra indented hardline, which we want outside of the `indent()`,\n\t\t\t// so we remove the last element of the array\n\t\t\tformattedStyles = stripTrailingHardline(formattedStyles);\n\n\t\t\t// print\n\t\t\tconst attributes = path.map(print, 'attributes');\n\t\t\tconst openingTag = group(['<style', indent(group(attributes)), softline, '>']);\n\t\t\treturn [\n\t\t\t\topeningTag,\n\t\t\t\tindent([isEmpty ? '' : hardline, formattedStyles]),\n\t\t\t\tisEmpty ? '' : hardline,\n\t\t\t\t'</style>',\n\t\t\t];\n\t\t}\n\t\tcase 'sass': {\n\t\t\tconst lineEnding = options?.endOfLine?.toUpperCase() === 'CRLF' ? 'CRLF' : 'LF';\n\t\t\tconst sassOptions: Partial<SassFormatterConfig> = {\n\t\t\t\ttabSize: options.tabWidth,\n\t\t\t\tinsertSpaces: !options.useTabs,\n\t\t\t\tlineEnding,\n\t\t\t};\n\n\t\t\t// dedent the .sass, otherwise SassFormatter gets indentation wrong\n\t\t\tconst { result: raw } = manualDedent(content);\n\n\t\t\t// format\n\t\t\tconst formattedSassIndented = SassFormatter.Format(raw, sassOptions).trim();\n\n\t\t\t// print\n\t\t\tconst formattedSass = join(hardline, formattedSassIndented.split('\\n'));\n\t\t\tconst attributes = path.map(print, 'attributes');\n\t\t\tconst openingTag = group(['<style', indent(group(attributes)), softline, '>']);\n\t\t\treturn [\n\t\t\t\topeningTag,\n\t\t\t\tindent([isEmpty ? '' : hardline, formattedSass]),\n\t\t\t\tisEmpty ? '' : hardline,\n\t\t\t\t'</style>',\n\t\t\t];\n\t\t}\n\t\tcase undefined: {\n\t\t\tconst node = path.getNode();\n\n\t\t\tif (node) {\n\t\t\t\treturn Buffer.from(options.originalText)\n\t\t\t\t\t.subarray(options.locStart(node), options.locEnd(node))\n\t\t\t\t\t.toString();\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n","import { parse } from '@astrojs/compiler/sync';\nimport type { Parser, Printer, SupportLanguage } from 'prettier';\nimport * as prettierPluginBabel from 'prettier/plugins/babel';\nimport { options } from './options';\nimport { print } from './printer';\nimport { embed } from './printer/embed';\n\nconst babelParser = prettierPluginBabel.parsers['babel-ts'];\n\n// https://prettier.io/docs/en/plugins.html#languages\nexport const languages: Partial<SupportLanguage>[] = [\n\t{\n\t\tname: 'astro',\n\t\tparsers: ['astro'],\n\t\textensions: ['.astro'],\n\t\tvscodeLanguageIds: ['astro'],\n\t},\n];\n\n// https://prettier.io/docs/en/plugins.html#parsers\nexport const parsers: Record<string, Parser> = {\n\tastro: {\n\t\tparse: (source) => parse(source, { position: true }).ast,\n\t\tastFormat: 'astro',\n\t\tlocStart: (node) => node.position.start.offset,\n\t\tlocEnd: (node) => node.position.end.offset,\n\t},\n\tastroExpressionParser: {\n\t\t...babelParser,\n\t\tpreprocess(text) {\n\t\t\t// note the trailing newline: if the statement ends in a // comment,\n\t\t\t// we can't add the closing bracket right afterwards\n\t\t\treturn `<>{${text}\\n}</>`;\n\t\t},\n\t\tparse(text, opts) {\n\t\t\tconst ast = babelParser.parse(text, opts);\n\n\t\t\treturn {\n\t\t\t\t...ast,\n\t\t\t\tprogram: ast.program.body[0].expression.children[0].expression,\n\t\t\t};\n\t\t},\n\t},\n};\n\n// https://prettier.io/docs/en/plugins.html#printers\nexport const printers: Record<string, Printer> = {\n\tastro: {\n\t\tprint,\n\t\tembed,\n\t},\n};\n\nconst defaultOptions = {\n\ttabWidth: 2,\n};\n\nexport { defaultOptions, options };\n"],"names":["group","indent","join","line","softline","hardline","stripTrailingHardline"],"mappings":";;;;;;;;AAYa,MAAA,OAAO,GAA+C;AAClE,IAAA,mBAAmB,EAAE;AACpB,QAAA,QAAQ,EAAE,OAAO;AACjB,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,WAAW,EAAE,kFAAkF;AAC/F,KAAA;;;ACfK,MAAM,eAAe,GAAG;IAC9B,MAAM;IACN,MAAM;IACN,UAAU;IACV,SAAS;IACT,IAAI;I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prettier Plugin for formatting Astro files",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"files": [
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"node": "^14.15.0 || >=16.0.0",
|
|
13
13
|
"pnpm": ">=7.14.0"
|
|
14
14
|
},
|
|
15
|
-
"packageManager": "pnpm@
|
|
15
|
+
"packageManager": "pnpm@8.6.2",
|
|
16
16
|
"homepage": "https://github.com/withastro/prettier-plugin-astro/",
|
|
17
17
|
"issues": {
|
|
18
18
|
"url": "https://github.com/withastro/prettier-plugin-astro/issues"
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"url": "https://github.com/withastro/prettier-plugin-astro.git"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@astrojs/compiler": "^1.5.
|
|
33
|
-
"prettier": "^
|
|
32
|
+
"@astrojs/compiler": "^1.5.5",
|
|
33
|
+
"prettier": "^3.0.0",
|
|
34
34
|
"sass-formatter": "^0.7.6"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -38,18 +38,18 @@
|
|
|
38
38
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
39
39
|
"@rollup/plugin-typescript": "^11.1.1",
|
|
40
40
|
"@types/node": "^20.2.5",
|
|
41
|
-
"@
|
|
42
|
-
"@typescript-eslint/
|
|
43
|
-
"@typescript-eslint/parser": "^5.59.8",
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "^5.61.0",
|
|
42
|
+
"@typescript-eslint/parser": "^5.61.0",
|
|
44
43
|
"@vitest/ui": "^0.31.3",
|
|
45
|
-
"eslint": "^8.
|
|
44
|
+
"eslint": "^8.44.0",
|
|
46
45
|
"eslint-config-prettier": "^8.8.0",
|
|
47
|
-
"eslint-plugin-prettier": "
|
|
46
|
+
"eslint-plugin-prettier": "5.0.0-alpha.2",
|
|
48
47
|
"eslint-plugin-prettier-doc": "^1.1.0",
|
|
49
48
|
"rollup": "^3.23.0",
|
|
50
49
|
"tslib": "^2.5.2",
|
|
51
50
|
"typescript": "^5.0.4",
|
|
52
|
-
"vitest": "^0.31.3"
|
|
51
|
+
"vitest": "^0.31.3",
|
|
52
|
+
"vite": "^4.4.3"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "rollup -c",
|