prettier-plugin-astro 1.0.0-beta.0 → 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -318,7 +318,7 @@ function sidesFor(boundary) {
318
318
  sides.push(boundary.next);
319
319
  return sides.length > 0 ? sides : null;
320
320
  }
321
- function blankContentIsFree(container, run, isRoot, settings) {
321
+ function blankContentIsFree(container, isRoot, settings) {
322
322
  const tag = container.type === 'JSXElement' ? tagNameOf(container) : null;
323
323
  if (tag === 'slot')
324
324
  return false;
@@ -502,7 +502,7 @@ function parse(source, options) {
502
502
  const failure = diagnostics.find((diagnostic) => diagnostic.severity === 'error');
503
503
  if (failure)
504
504
  throw syntaxError(failure);
505
- stripParenthesizedExpressions(ast);
505
+ stripParentheses(ast);
506
506
  repairSpans(ast);
507
507
  markAttributes(ast, source);
508
508
  applyPrettierIgnore(ast);
@@ -532,7 +532,7 @@ function syntaxError(diagnostic) {
532
532
  error.loc = { start: { line, column } };
533
533
  return error;
534
534
  }
535
- function stripParenthesizedExpressions(root) {
535
+ function stripParentheses(root) {
536
536
  walk(root, (node) => {
537
537
  for (const key of Object.keys(node)) {
538
538
  const value = node[key];
@@ -549,8 +549,13 @@ function stripParenthesizedExpressions(root) {
549
549
  }
550
550
  function unwrapParens(node) {
551
551
  let current = node;
552
- while (isNode(current) && current.type === 'ParenthesizedExpression') {
553
- current = current.expression;
552
+ while (isNode(current)) {
553
+ if (current.type === 'ParenthesizedExpression')
554
+ current = current.expression;
555
+ else if (current.type === 'TSParenthesizedType')
556
+ current = current.typeAnnotation;
557
+ else
558
+ break;
554
559
  }
555
560
  return current;
556
561
  }
@@ -673,8 +678,7 @@ function resolveBlankContainers(template, settings) {
673
678
  const blank = children.every((child) => child.type === 'JSXText' && String(child.raw ?? '').trim() === '');
674
679
  if (!blank)
675
680
  return;
676
- const run = children.map((child) => String(child.raw ?? '')).join('');
677
- const free = blankContentIsFree(node, run, node.astroRoot === true, settings);
681
+ const free = blankContentIsFree(node, node.astroRoot === true, settings);
678
682
  children.length = 0;
679
683
  if (!free) {
680
684
  children.push({ type: 'JSXText', start: node.start, end: node.start, raw: ' ', value: ' ' });
@@ -846,6 +850,12 @@ function inferParserByTypeAttribute(type) {
846
850
  return 'babel-ts';
847
851
  }
848
852
  }
853
+ function inferScriptParser(node) {
854
+ const processed = attributesOf(node).every((attribute) => attribute.type === 'JSXAttribute' && attribute.name.name === 'src');
855
+ if (processed)
856
+ return 'babel-ts';
857
+ return inferParserByTypeAttribute(attributeStringValue(node, 'type'));
858
+ }
849
859
  function contentOf(node, options) {
850
860
  const start = node.openingElement.end;
851
861
  const end = node.closingElement?.start ?? node.end;
@@ -854,7 +864,7 @@ function contentOf(node, options) {
854
864
  function wrapContent(print, content, isEmpty) {
855
865
  return [
856
866
  print('openingElement'),
857
- indent([isEmpty ? '' : hardline$1, content]),
867
+ indent([hardline$1, content]),
858
868
  isEmpty ? '' : hardline$1,
859
869
  print('closingElement'),
860
870
  ];
@@ -897,7 +907,7 @@ function embed(path, options) {
897
907
  if (tag === 'script') {
898
908
  if (isEmpty)
899
909
  return estree.embed(path, options);
900
- const parser = inferParserByTypeAttribute(attributeStringValue(node, 'type'));
910
+ const parser = inferScriptParser(node);
901
911
  return async (textToDoc, print) => wrapContent(print, await surfacingErrors(textToDoc, source, { ...options, parser }), false);
902
912
  }
903
913
  if (tag === 'style') {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/options.ts","../src/ast.ts","../src/elements.ts","../src/printer/utils.ts","../src/whitespace.ts","../src/parser.ts","../src/estree.ts","../src/printer/children.ts","../src/printer/embed.ts","../src/printer/index.ts","../src/index.ts"],"sourcesContent":["import type { SupportOption } from 'prettier';\n\nexport type CompressHTML = 'jsx' | 'html' | 'none';\n\ninterface PluginOptions {\n\tastroAllowShorthand: boolean;\n\tastroSkipFrontmatter: boolean;\n\tastroCompressHTML: CompressHTML;\n}\n\ndeclare module 'prettier' {\n\t// eslint-disable-next-line @typescript-eslint/no-empty-object-type\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\tastroSkipFrontmatter: {\n\t\tcategory: 'Astro',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription: 'Skips the formatting of the frontmatter.',\n\t},\n\tastroCompressHTML: {\n\t\tcategory: 'Astro',\n\t\ttype: 'choice',\n\t\tdefault: 'jsx',\n\t\tdescription:\n\t\t\t\"Mirror of Astro's compressHTML config. Tells the formatter which whitespace the compiler will collapse.\",\n\t\tchoices: [\n\t\t\t{\n\t\t\t\tvalue: 'jsx',\n\t\t\t\tdescription:\n\t\t\t\t\t\"Astro's default since 7.0.0. Whitespace runs containing a newline are dropped; same-line spaces are content.\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: 'html',\n\t\t\t\tdescription: 'Browser HTML whitespace rules. Equivalent to compressHTML: true.',\n\t\t\t},\n\t\t\t{ value: 'none', description: 'No collapsing. Equivalent to compressHTML: false.' },\n\t\t\t// Prettier's SupportOption types omit `redirect`, which its own option normaliser honours.\n\t\t\t{ value: true, redirect: 'html' } as unknown as { value: boolean; description: string },\n\t\t\t{ value: false, redirect: 'none' } as unknown as { value: boolean; description: string },\n\t\t],\n\t},\n};\n","export const synthetic: unique symbol = Symbol.for('prettier-plugin-astro.synthetic');\nexport const ownChildren: unique symbol = Symbol.for('prettier-plugin-astro.ownChildren');\n\nexport interface AstroNode {\n\ttype: string;\n\tstart: number;\n\tend: number;\n\t[synthetic]?: boolean;\n\t[ownChildren]?: boolean;\n\t[key: string]: unknown;\n}\n\nexport interface JsComment {\n\ttype: 'Line' | 'Block';\n\tvalue: string;\n\tstart: number;\n\tend: number;\n}\n\nexport const astroVisitorKeys: Record<string, string[]> = {\n\tAstroRoot: ['frontmatter', 'template'],\n\tAstroFrontmatter: ['program'],\n\tAstroScript: ['program'],\n\tAstroDoctype: [],\n\tAstroComment: [],\n};\n\nexport const isNode = (value: unknown): value is AstroNode =>\n\ttypeof value === 'object' && value !== null && typeof (value as AstroNode).type === 'string';\n\nexport function tagNameOf(node: AstroNode): string | null {\n\tif (node.type !== 'JSXElement') return null;\n\tconst name = (node.openingElement as AstroNode | undefined)?.name as AstroNode | undefined;\n\treturn name?.type === 'JSXIdentifier' ? (name.name as string) : null;\n}\n\nexport const isComponentName = (name: string | null): boolean =>\n\tname === null || /^[A-Z]/.test(name) || name.includes('.');\n\nexport function attributesOf(node: AstroNode): AstroNode[] {\n\tconst opening = node.openingElement as AstroNode | undefined;\n\treturn (opening?.attributes as AstroNode[] | undefined) ?? [];\n}\n\nexport function attributeNamed(node: AstroNode, name: string): AstroNode | undefined {\n\treturn attributesOf(node).find(\n\t\t(attribute) => attribute.type === 'JSXAttribute' && (attribute.name as AstroNode).name === name,\n\t);\n}\n\nexport function attributeStringValue(node: AstroNode, name: string): string | null {\n\tconst value = attributeNamed(node, name)?.value as AstroNode | undefined;\n\treturn value?.type === 'Literal' && typeof value.value === 'string' ? value.value : null;\n}\n\nexport const hasAttribute = (node: AstroNode, name: string): boolean =>\n\tattributeNamed(node, name) !== undefined;\n\nexport const hasSetDirective = (node: AstroNode): boolean =>\n\thasAttribute(node, 'set:html') || hasAttribute(node, 'set:text');\n\nexport function childrenOf(node: AstroNode): AstroNode[] | null {\n\tif (node.type === 'JSXElement' || node.type === 'JSXFragment') {\n\t\treturn (node.astroChildren as AstroNode[] | undefined) ?? (node.children as AstroNode[]);\n\t}\n\treturn null;\n}\n\n/** Prettier's JSX printer prints a lone template-literal child verbatim: the only seam for our own children doc. */\nexport function takeOverChildren(node: AstroNode): void {\n\tconst children = node.children as AstroNode[];\n\tif (children.length === 0) return;\n\tnode.astroChildren = children;\n\tnode.children = [\n\t\t{\n\t\t\ttype: 'JSXExpressionContainer',\n\t\t\tstart: node.start,\n\t\t\tend: node.end,\n\t\t\t[ownChildren]: true,\n\t\t\texpression: {\n\t\t\t\ttype: 'TemplateLiteral',\n\t\t\t\tstart: node.start,\n\t\t\t\tend: node.end,\n\t\t\t\tquasis: [],\n\t\t\t\texpressions: [],\n\t\t\t},\n\t\t},\n\t];\n}\n\nexport function walk(node: unknown, visit: (node: AstroNode) => void): void {\n\tif (Array.isArray(node)) {\n\t\tfor (const item of node) walk(item, visit);\n\t\treturn;\n\t}\n\tif (!isNode(node)) return;\n\tvisit(node);\n\tfor (const key of Object.keys(node)) {\n\t\tif (key !== 'type') walk(node[key], visit);\n\t}\n}\n","/** Mirrors `astro_codegen/src/printer/whitespace.rs` — the compiler never collapses these. */\nexport const rawTextElements = new Set([\n\t'pre',\n\t'listing',\n\t'iframe',\n\t'noembed',\n\t'noframes',\n\t'math',\n\t'plaintext',\n\t'script',\n\t'style',\n\t'textarea',\n\t'title',\n\t'xmp',\n]);\n\n// https://github.com/prettier/prettier/blob/main/vendors/html-void-elements.json\nexport const voidElements = new Set([\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'source',\n\t'track',\n\t'wbr',\n]);\n\n/** Extracted verbatim from `prettier/plugins/html.js` so the two printers cannot drift apart. */\nconst cssDisplay: Record<string, string> = {\n\tarea: 'none',\n\tbase: 'none',\n\tbasefont: 'none',\n\tdatalist: 'none',\n\thead: 'none',\n\tlink: 'none',\n\tmeta: 'none',\n\tnoembed: 'none',\n\tnoframes: 'none',\n\tparam: 'block',\n\trp: 'none',\n\tscript: 'block',\n\tstyle: 'none',\n\ttemplate: 'inline',\n\ttitle: 'none',\n\thtml: 'block',\n\tbody: 'block',\n\taddress: 'block',\n\tblockquote: 'block',\n\tcenter: 'block',\n\tdialog: 'block',\n\tdiv: 'block',\n\tfigure: 'block',\n\tfigcaption: 'block',\n\tfooter: 'block',\n\tform: 'block',\n\theader: 'block',\n\thr: 'block',\n\tlegend: 'block',\n\tlisting: 'block',\n\tmain: 'block',\n\tp: 'block',\n\tplaintext: 'block',\n\tpre: 'block',\n\tsearch: 'block',\n\txmp: 'block',\n\tslot: 'contents',\n\truby: 'ruby',\n\trt: 'ruby-text',\n\tarticle: 'block',\n\taside: 'block',\n\th1: 'block',\n\th2: 'block',\n\th3: 'block',\n\th4: 'block',\n\th5: 'block',\n\th6: 'block',\n\thgroup: 'block',\n\tnav: 'block',\n\tsection: 'block',\n\tdir: 'block',\n\tdd: 'block',\n\tdl: 'block',\n\tdt: 'block',\n\tmenu: 'block',\n\tol: 'block',\n\tul: 'block',\n\tli: 'list-item',\n\ttable: 'table',\n\tcaption: 'table-caption',\n\tcolgroup: 'table-column-group',\n\tcol: 'table-column',\n\tthead: 'table-header-group',\n\ttbody: 'table-row-group',\n\ttfoot: 'table-footer-group',\n\ttr: 'table-row',\n\ttd: 'table-cell',\n\tth: 'table-cell',\n\tinput: 'inline-block',\n\tbutton: 'inline-block',\n\tfieldset: 'block',\n\tdetails: 'block',\n\tsummary: 'block',\n\tmarquee: 'inline-block',\n\tsource: 'block',\n\ttrack: 'block',\n\tmeter: 'inline-block',\n\tprogress: 'inline-block',\n\tobject: 'inline-block',\n\tvideo: 'inline-block',\n\taudio: 'inline-block',\n\tselect: 'inline-block',\n\toption: 'block',\n\toptgroup: 'block',\n};\n\nconst inlineLevel = new Set(['inline', 'inline-block', 'ruby', 'ruby-text', 'contents']);\n\nexport function displayOfTag(tag: string): string {\n\treturn cssDisplay[tag] ?? 'inline';\n}\n\nexport function isInlineDisplay(display: string): boolean {\n\treturn inlineLevel.has(display);\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 = /^(\\s+)\\S+/.exec(line); // \\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\nexport function printClassNames(value: string): string {\n\tconst lines = value.trim().split(/[\\r\\n]+/);\n\tconst formattedLines = lines.map((line) => {\n\t\tconst spaces = /^\\s+/.exec(line);\n\t\treturn (spaces ? spaces[0] : '') + line.trim().split(/\\s+/).join(' ');\n\t});\n\treturn formattedLines.join('\\n');\n}\n","import {\n\ttype AstroNode,\n\tchildrenOf,\n\thasAttribute,\n\thasSetDirective,\n\tisComponentName,\n\ttagNameOf,\n} from './ast';\nimport { displayOfTag, isInlineDisplay, rawTextElements } from './elements';\nimport type { CompressHTML } from './options';\n\ntype Sensitivity = 'css' | 'strict' | 'ignore';\n\nexport interface Settings {\n\tmode: CompressHTML;\n\tsensitivity: Sensitivity;\n}\n\ninterface Context extends Settings {\n\tisRoot: boolean;\n\tinRaw: boolean;\n}\n\ntype Decision = 'keep' | 'drop' | 'space';\n\nconst leadingWhitespace = /^[\\t\\n\\f\\r ]+/;\nconst trailingWhitespace = /[\\t\\n\\f\\r ]+$/;\nconst hasNewline = (run: string) => /[\\n\\r]/.test(run);\n\nconst isText = (node: AstroNode | null) => node?.type === 'JSXText';\nconst rawTextOf = (node: AstroNode) => (node.raw as string | undefined) ?? '';\nconst isWhitespaceOnly = (node: AstroNode) => isText(node) && rawTextOf(node).trim().length === 0;\n\nexport function opensRawSubtree(node: AstroNode): boolean {\n\tif (node.type !== 'JSXElement') return false;\n\tif (hasAttribute(node, 'is:raw')) return true;\n\tconst tag = tagNameOf(node);\n\treturn tag !== null && !isComponentName(tag) && rawTextElements.has(tag);\n}\n\n/** A `<style>` the compiler lifts out of the template, taking the whitespace beside it. */\nconst isExtractedStyle = (node: AstroNode | null) =>\n\tnode !== null && tagNameOf(node) === 'style' && !hasAttribute(node, 'is:inline');\n\nfunction displayOf(node: AstroNode): string {\n\tif (node.type !== 'JSXElement') return 'inline';\n\tconst tag = tagNameOf(node);\n\tif (tag === null || isComponentName(tag) || tag.includes('-')) return 'inline';\n\treturn displayOfTag(tag);\n}\n\nexport type Separator = 'none' | 'soft' | 'space' | 'break' | 'blank';\n\nexport interface PrinterBoundary {\n\tcontainer: AstroNode;\n\tprev: AstroNode | null;\n\tnext: AstroNode | null;\n\tisRoot: boolean;\n\tloneChild: boolean;\n\tedge: boolean;\n}\n\nconst isBlankRun = (run: string) => /[\\n\\r][^\\S\\n\\r]*[\\n\\r]/.test(run);\n\n/** A text neighbour never decides significance; at a container edge only the container does. */\nfunction sidesFor(boundary: PrinterBoundary): (AstroNode | null)[] | null {\n\tif (boundary.edge) return [null];\n\tconst sides: (AstroNode | null)[] = [];\n\tif (boundary.prev === null) sides.push(null);\n\telse if (boundary.prev.type !== 'JSXText') sides.push(boundary.prev);\n\tif (boundary.next === null) sides.push(null);\n\telse if (boundary.next.type !== 'JSXText') sides.push(boundary.next);\n\treturn sides.length > 0 ? sides : null;\n}\n\n/** `<slot>` and custom elements get a slot iff they have content, so their blank content is content. */\nexport function blankContentIsFree(\n\tcontainer: AstroNode,\n\trun: string,\n\tisRoot: boolean,\n\tsettings: Settings,\n): boolean {\n\tconst tag = container.type === 'JSXElement' ? tagNameOf(container) : null;\n\tif (tag === 'slot') return false;\n\tif (tag !== null && !isComponentName(tag) && tag.includes('-')) return false;\n\n\tconst boundary: Boundary = {\n\t\tcontainer,\n\t\tcontext: { ...settings, isRoot, inRaw: false },\n\t\tprev: null,\n\t\tnext: null,\n\t\tsides: [null],\n\t\tatStart: true,\n\t\tatEnd: true,\n\t\tloneChild: true,\n\t};\n\treturn isFree(boundary) || mayAlterRenderedWhitespace(boundary);\n}\n\nexport function separatorFor(\n\trun: string,\n\tboundary: PrinterBoundary,\n\tsettings: Settings,\n): Separator {\n\tconst sides = sidesFor(boundary);\n\tconst internal: Boundary = {\n\t\tcontainer: boundary.container,\n\t\tcontext: { ...settings, isRoot: boundary.isRoot, inRaw: false },\n\t\tprev: boundary.prev,\n\t\tnext: boundary.next,\n\t\tsides: sides ?? [],\n\t\tatStart: boundary.prev === null,\n\t\tatEnd: boundary.next === null,\n\t\tloneChild: boundary.loneChild,\n\t};\n\n\tif (isSlotFallback(internal)) return run === '' ? 'none' : 'space';\n\tconst free = isFree(internal) || (sides !== null && mayAlterRenderedWhitespace(internal));\n\tif (boundary.edge) {\n\t\tif (free) return 'soft';\n\t\treturn run === '' ? 'none' : 'space';\n\t}\n\tif (isBlankRun(run)) return 'blank';\n\tif (hasNewline(run)) return 'break';\n\tif (free) return 'soft';\n\treturn run === '' ? 'none' : 'space';\n}\n\nexport function normalizeWhitespace(template: AstroNode, options: Settings): void {\n\tvisit(template, { ...options, isRoot: true, inRaw: false });\n}\n\nfunction visit(container: AstroNode, context: Context): void {\n\tconst children = childrenOf(container);\n\tif (children === null) return;\n\n\tif (!context.inRaw) collapseRuns(container, children, context);\n\n\tfor (const child of children) {\n\t\tvisit(child, {\n\t\t\t...context,\n\t\t\tisRoot: false,\n\t\t\tinRaw: context.inRaw || opensRawSubtree(child),\n\t\t});\n\t}\n}\n\nfunction collapseRuns(container: AstroNode, children: AstroNode[], context: Context): void {\n\tconst dropped = new Set<AstroNode>();\n\n\tfor (const [index, child] of children.entries()) {\n\t\tif (!isText(child)) continue;\n\t\tconst prev = children[index - 1] ?? null;\n\t\tconst next = children[index + 1] ?? null;\n\n\t\tif (isWhitespaceOnly(child)) {\n\t\t\tconst decision = decide(rawTextOf(child), {\n\t\t\t\tcontainer,\n\t\t\t\tcontext,\n\t\t\t\tprev,\n\t\t\t\tnext,\n\t\t\t\tsides: [prev, next],\n\t\t\t\tatStart: prev === null,\n\t\t\t\tatEnd: next === null,\n\t\t\t\tloneChild: children.length === 1,\n\t\t\t});\n\t\t\tconst text = resolve(rawTextOf(child), decision);\n\t\t\tif (text === '') dropped.add(child);\n\t\t\telse setText(child, text);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst raw = rawTextOf(child);\n\t\tconst lead = leadingWhitespace.exec(raw)?.[0] ?? '';\n\t\tconst trail = trailingWhitespace.exec(raw)?.[0] ?? '';\n\t\tconst body = raw.slice(lead.length, raw.length - trail.length);\n\n\t\tconst leadDecision = decide(lead, {\n\t\t\tcontainer,\n\t\t\tcontext,\n\t\t\tprev,\n\t\t\tnext: child,\n\t\t\tsides: [prev],\n\t\t\tatStart: prev === null,\n\t\t\tatEnd: false,\n\t\t\tloneChild: false,\n\t\t});\n\t\tconst trailDecision = decide(trail, {\n\t\t\tcontainer,\n\t\t\tcontext,\n\t\t\tprev: child,\n\t\t\tnext,\n\t\t\tsides: [next],\n\t\t\tatStart: false,\n\t\t\tatEnd: next === null,\n\t\t\tloneChild: false,\n\t\t});\n\n\t\tsetText(child, resolve(lead, leadDecision) + body + resolve(trail, trailDecision));\n\t}\n\n\tif (dropped.size > 0) {\n\t\tconst kept = children.filter((child) => !dropped.has(child));\n\t\tchildren.length = 0;\n\t\tchildren.push(...kept);\n\t}\n}\n\n// Dropping a newline run would also drop the blank lines prettier reproduces from it.\nfunction resolve(run: string, decision: Decision): string {\n\tif (decision === 'drop') return hasNewline(run) ? run : '';\n\tif (decision === 'space') return ' ';\n\treturn run;\n}\n\nfunction setText(node: AstroNode, text: string): void {\n\tnode.raw = text;\n\tnode.value = text;\n}\n\ninterface Boundary {\n\tcontainer: AstroNode;\n\tcontext: Context;\n\tprev: AstroNode | null;\n\tnext: AstroNode | null;\n\t/** The neighbours whose CSS display decides significance; `null` stands for the container. */\n\tsides: (AstroNode | null)[];\n\tatStart: boolean;\n\tatEnd: boolean;\n\tloneChild: boolean;\n}\n\nfunction decide(run: string, boundary: Boundary): Decision {\n\tif (run === '') return 'keep';\n\tconst { mode } = boundary.context;\n\n\tif (isSlotFallback(boundary)) return 'space';\n\tif (isFree(boundary)) return 'drop';\n\tif (mayAlterRenderedWhitespace(boundary)) return 'drop';\n\n\tif (mode === 'jsx') return hasNewline(run) ? 'keep' : 'space';\n\n\t// Prettier's JSX printer trims container-edge runs, which under `html`/`none` are rendered.\n\treturn boundary.atStart || boundary.atEnd ? 'space' : 'keep';\n}\n\nfunction isFree(boundary: Boundary): boolean {\n\tconst { container, context, atStart, atEnd, loneChild } = boundary;\n\tconst { mode } = context;\n\n\tif (context.isRoot && (atStart || atEnd)) return true;\n\tif (container.type === 'JSXElement' && hasSetDirective(container)) return true;\n\tif (isExtractedStyle(boundary.prev) || isExtractedStyle(boundary.next)) return true;\n\n\tconst tag = container.type === 'JSXElement' ? tagNameOf(container) : null;\n\tif (loneChild && tag !== null && isComponentName(tag)) return true;\n\n\tif (mode === 'html') {\n\t\tif (loneChild) return true;\n\t\tif (tag === 'head') return true;\n\t}\n\n\treturn false;\n}\n\n/** Whether the user authorised changing rendered whitespace here, not whether it is sound. */\nfunction mayAlterRenderedWhitespace(boundary: Boundary): boolean {\n\tconst { sensitivity } = boundary.context;\n\tif (sensitivity === 'ignore') return true;\n\tif (sensitivity === 'strict') return false;\n\treturn boundary.sides.every((side) => !isInlineDisplay(displayOf(side ?? boundary.container)));\n}\n\n/** Any content at all, whitespace included, gives a `<slot>` a fallback body; nothing gives none. */\nfunction isSlotFallback(boundary: Boundary): boolean {\n\treturn (\n\t\tboundary.container.type === 'JSXElement' &&\n\t\ttagNameOf(boundary.container) === 'slot' &&\n\t\tboundary.loneChild\n\t);\n}\n","import { parse as parseAstro } from '@astrojs/compiler-rs';\nimport type { ParserOptions } from 'prettier';\nimport {\n\ttype AstroNode,\n\ttype JsComment,\n\tchildrenOf,\n\thasSetDirective,\n\tisComponentName,\n\tisNode,\n\tsynthetic,\n\ttagNameOf,\n\ttakeOverChildren,\n\twalk,\n} from './ast';\nimport { rawTextElements, voidElements } from './elements';\nimport { printClassNames } from './printer/utils';\nimport {\n\ttype Settings,\n\tblankContentIsFree,\n\tnormalizeWhitespace,\n\topensRawSubtree,\n} from './whitespace';\n\ninterface Diagnostic {\n\tseverity: string;\n\ttext: string;\n\tlabels: { line: number; column: number }[];\n}\n\nexport function parse(source: string, options: ParserOptions): AstroNode {\n\tconst { ast, diagnostics } = parseAstro(source) as unknown as {\n\t\tast: AstroNode;\n\t\tdiagnostics: Diagnostic[];\n\t};\n\n\tconst failure = diagnostics.find((diagnostic) => diagnostic.severity === 'error');\n\tif (failure) throw syntaxError(failure);\n\n\tstripParenthesizedExpressions(ast);\n\trepairSpans(ast);\n\tmarkAttributes(ast, source);\n\tapplyPrettierIgnore(ast);\n\n\tconst body = ast.body as AstroNode[];\n\tconst template = templateFragment(ast, body);\n\tconst settings = {\n\t\tmode: options.astroCompressHTML,\n\t\tsensitivity: options.htmlWhitespaceSensitivity,\n\t};\n\t// Prettier always breaks between two adjacent non-text children, which only `jsx` can absorb.\n\tif (settings.mode === 'jsx') normalizeWhitespace(template.node as AstroNode, settings);\n\telse resolveBlankContainers(template.node as AstroNode, settings);\n\tnormalizeTagPairs(body, source);\n\tif (settings.mode !== 'jsx') claimChildren(template.node as AstroNode);\n\n\tast.template = template;\n\tdelete ast.body;\n\tast.comments = printableComments(ast);\n\treturn ast;\n}\n\nfunction syntaxError(diagnostic: Diagnostic): Error {\n\tconst label = diagnostic.labels[0];\n\tconst line = label?.line ?? 1;\n\tconst column = (label?.column ?? 0) + 1;\n\tconst error = new SyntaxError(`${diagnostic.text} (${line}:${column})`);\n\t(error as Error & { loc: unknown }).loc = { start: { line, column } };\n\treturn error;\n}\n\n// oxc emits explicit nodes; prettier re-derives parens itself and the two compound on every pass.\nfunction stripParenthesizedExpressions(root: AstroNode): void {\n\twalk(root, (node) => {\n\t\tfor (const key of Object.keys(node)) {\n\t\t\tconst value = node[key];\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const [index, item] of value.entries()) {\n\t\t\t\t\tvalue[index] = unwrapParens(item);\n\t\t\t\t}\n\t\t\t} else if (isNode(value)) {\n\t\t\t\tnode[key] = unwrapParens(value);\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction unwrapParens(node: unknown): unknown {\n\tlet current = node;\n\twhile (isNode(current) && current.type === 'ParenthesizedExpression') {\n\t\tcurrent = current.expression;\n\t}\n\treturn current;\n}\n\n// `AstroScript` spans the whole `<script>` element, overlapping the tags prettier sorts it against.\nfunction repairSpans(root: AstroNode): void {\n\twalk(root, (node) => {\n\t\tif (node.type !== 'JSXElement') return;\n\t\tconst script = (node.children as AstroNode[]).find((child) => child.type === 'AstroScript');\n\t\tif (!script) return;\n\t\tscript.start = (node.openingElement as AstroNode).end;\n\t\tscript.end = (node.closingElement as AstroNode | null)?.start ?? node.end;\n\t});\n}\n\nfunction markAttributes(root: AstroNode, source: string): void {\n\twalk(root, (node) => {\n\t\tif (node.type !== 'JSXAttribute') return;\n\t\tconst value = node.value as AstroNode | null;\n\t\tif (!value) return;\n\n\t\tif (value.type === 'Literal' && typeof value.value === 'string') {\n\t\t\tconst name = (node.name as AstroNode).name;\n\t\t\tconst text = name === 'class' ? printClassNames(value.value) : value.value;\n\t\t\tif (value.raw === null || text !== value.value) {\n\t\t\t\tvalue.value = text;\n\t\t\t\tvalue.raw = `\"${text.replaceAll('\"', '&quot;')}\"`;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (value.type !== 'JSXExpressionContainer') return;\n\n\t\tif (source[node.start] === '{') node.astroShorthand = true;\n\t\tif (source[value.start] === '`') node.astroBacktick = true;\n\t});\n}\n\nfunction applyPrettierIgnore(root: AstroNode): void {\n\twalk(root, (node) => {\n\t\tconst children = node.type === 'AstroRoot' ? (node.body as AstroNode[]) : childrenOf(node);\n\t\tif (children === null) return;\n\t\tfor (const [index, child] of children.entries()) {\n\t\t\tif (child.type !== 'AstroComment') continue;\n\t\t\tif (String(child.value).trim() !== 'prettier-ignore') continue;\n\t\t\tconst target = children.slice(index + 1).find((sibling) => sibling.type !== 'JSXText');\n\t\t\tif (target) target.astroIgnored = true;\n\t\t}\n\t});\n}\n\nfunction templateFragment(root: AstroNode, body: AstroNode[]): AstroNode {\n\tconst start = body[0]?.start ?? root.end;\n\tconst end = body.at(-1)?.end ?? root.end;\n\treturn {\n\t\ttype: 'JsExpressionRoot',\n\t\tstart,\n\t\tend,\n\t\tnode: {\n\t\t\ttype: 'JSXFragment',\n\t\t\tstart,\n\t\t\tend,\n\t\t\tastroRoot: true,\n\t\t\topeningFragment: { type: 'JSXOpeningFragment', start, end: start, [synthetic]: true },\n\t\t\tchildren: body,\n\t\t\tclosingFragment: { type: 'JSXClosingFragment', start: end, end, [synthetic]: true },\n\t\t},\n\t};\n}\n\nfunction pairUp(node: AstroNode, tag: string): void {\n\t(node.openingElement as AstroNode).selfClosing = false;\n\tnode.closingElement = {\n\t\ttype: 'JSXClosingElement',\n\t\tstart: node.end,\n\t\tend: node.end,\n\t\tname: { type: 'JSXIdentifier', name: tag, start: node.end, end: node.end },\n\t};\n}\n\n// Requiring the newline keeps the lone space `resolveBlankContainers` leaves behind, which is content.\nfunction printsNothing(child: AstroNode): boolean {\n\tconst raw = String(child.raw ?? '');\n\treturn child.type === 'JSXText' && raw.trim() === '' && /[\\n\\r]/.test(raw);\n}\n\nfunction normalizeTagPairs(body: AstroNode[], source: string): void {\n\twalk(body, (node) => {\n\t\tif (node.type !== 'JSXElement') return;\n\t\tconst tag = tagNameOf(node);\n\t\tif (tag === null) return;\n\t\tconst children = node.children as AstroNode[];\n\t\tconst closing = node.closingElement as AstroNode | null;\n\t\tconst component = isComponentName(tag);\n\n\t\tif (rawTextElements.has(tag) && !component) {\n\t\t\tif (!closing) pairUp(node, tag);\n\t\t\telse if (source.slice((node.openingElement as AstroNode).end, closing.start).trim() === '') {\n\t\t\t\tchildren.length = 0;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst selfClosable =\n\t\t\tcomponent || voidElements.has(tag) || tag === 'slot' || hasSetDirective(node);\n\n\t\tif (children.every(printsNothing) && selfClosable && closing) {\n\t\t\t(node.openingElement as AstroNode).selfClosing = true;\n\t\t\tnode.closingElement = null;\n\t\t}\n\t});\n}\n\n// Decided here rather than in the children printer so tag pairing sees the final child count.\nfunction resolveBlankContainers(template: AstroNode, settings: Settings): void {\n\twalk(template, (node) => {\n\t\tif (node.type !== 'JSXElement' && node.type !== 'JSXFragment') return;\n\t\tif (node.type === 'JSXElement' && opensRawSubtree(node)) return;\n\t\tconst children = node.children as AstroNode[];\n\t\tif (children.length === 0) return;\n\t\tconst blank = children.every(\n\t\t\t(child) => child.type === 'JSXText' && String(child.raw ?? '').trim() === '',\n\t\t);\n\t\tif (!blank) return;\n\n\t\tconst run = children.map((child) => String(child.raw ?? '')).join('');\n\t\tconst free = blankContentIsFree(node, run, node.astroRoot === true, settings);\n\t\tchildren.length = 0;\n\t\tif (!free) {\n\t\t\tchildren.push({ type: 'JSXText', start: node.start, end: node.start, raw: ' ', value: ' ' });\n\t\t}\n\t});\n}\n\nfunction claimChildren(template: AstroNode): void {\n\twalk(template, (node) => {\n\t\tif (node.type !== 'JSXElement' && node.type !== 'JSXFragment') return;\n\t\tif (node.type === 'JSXElement' && opensRawSubtree(node)) return;\n\t\ttakeOverChildren(node);\n\t});\n}\n\n// Prettier throws on any comment it never printed, so drop the ones inside reprinted-from-source regions.\nfunction printableComments(root: AstroNode): JsComment[] {\n\tconst comments = (root.comments as JsComment[] | undefined) ?? [];\n\tif (comments.length === 0) return comments;\n\n\tconst frontmatter = root.frontmatter as AstroNode;\n\tconst skipped: [number, number][] = [];\n\tif (frontmatter.end > 0) skipped.push([frontmatter.start, frontmatter.end]);\n\n\twalk(root, (node) => {\n\t\tif (node.astroIgnored) {\n\t\t\tskipped.push([node.start, node.end]);\n\t\t\treturn;\n\t\t}\n\t\tif (!opensRawSubtree(node)) return;\n\t\tconst closing = node.closingElement as AstroNode | null;\n\t\tskipped.push([(node.openingElement as AstroNode).end, closing?.start ?? node.end]);\n\t});\n\n\treturn comments.filter(\n\t\t(comment) => !skipped.some(([start, end]) => comment.start >= start && comment.end <= end),\n\t);\n}\n","import type { Printer } from 'prettier';\n// @ts-expect-error prettier does not ship types for its bundled printers\nimport { printers } from 'prettier/plugins/estree';\n\nexport const estree = (printers as Record<string, Printer>).estree as Printer & {\n\tprint: (path: unknown, options: unknown, print: unknown, args?: unknown) => unknown;\n\tembed: (path: unknown, options: unknown) => unknown;\n\tgetVisitorKeys: (node: unknown, nonTraversableKeys: Set<string>) => string[];\n};\n","import type { AstPath, Doc, ParserOptions } from 'prettier';\nimport { doc } from 'prettier';\nimport type { AstroNode } from '../ast';\nimport { type Separator, separatorFor } from '../whitespace';\n\nconst { fill, group, hardline, indent, line, softline } = doc.builders;\n\nconst leadingWhitespace = /^[\\t\\n\\f\\r ]+/;\nconst trailingWhitespace = /[\\t\\n\\f\\r ]+$/;\nconst whitespaceRun = /[\\t\\n\\f\\r ]+/;\n\ntype PrintFn = (selector?: string | number | (string | number)[]) => Doc;\ntype ChildIterator = (callback: (child: AstPath<AstroNode>) => void, key: string) => void;\n\ninterface Item {\n\tnode: AstroNode;\n\twords: string[] | null;\n\tdoc: Doc;\n}\n\nfunction docFor(separator: Separator): Doc | null {\n\tswitch (separator) {\n\t\tcase 'none':\n\t\t\treturn null;\n\t\tcase 'soft':\n\t\t\treturn softline;\n\t\tcase 'space':\n\t\t\treturn line;\n\t\tcase 'break':\n\t\t\treturn hardline;\n\t\tcase 'blank':\n\t\t\treturn [hardline, hardline];\n\t}\n}\n\n/** Runs alternate with items: `runs[i]` is the whitespace before `items[i]`, `runs[n]` the trailing. */\nfunction collect(children: AstroNode[], docs: Doc[]): { items: Item[]; runs: string[] } {\n\tconst items: Item[] = [];\n\tconst runs: string[] = [];\n\tlet pending = '';\n\n\tfor (const [index, child] of children.entries()) {\n\t\tif (child.type !== 'JSXText') {\n\t\t\truns.push(pending);\n\t\t\titems.push({ node: child, words: null, doc: docs[index] });\n\t\t\tpending = '';\n\t\t\tcontinue;\n\t\t}\n\t\tconst raw = String(child.raw ?? '');\n\t\tif (raw.trim() === '') {\n\t\t\tpending += raw;\n\t\t\tcontinue;\n\t\t}\n\t\tconst lead = leadingWhitespace.exec(raw)?.[0] ?? '';\n\t\tconst trail = trailingWhitespace.exec(raw)?.[0] ?? '';\n\t\truns.push(pending + lead);\n\t\titems.push({\n\t\t\tnode: child,\n\t\t\twords: raw.slice(lead.length, raw.length - trail.length).split(whitespaceRun),\n\t\t\tdoc: '',\n\t\t});\n\t\tpending = trail;\n\t}\n\n\truns.push(pending);\n\treturn { items, runs };\n}\n\nexport function printChildren(\n\tpath: AstPath<AstroNode>,\n\toptions: ParserOptions,\n\tprint: PrintFn,\n): Doc {\n\tconst container = path.node;\n\tconst docs: Doc[] = [];\n\t(path as AstPath<AstroNode> & { each: ChildIterator }).each((child) => {\n\t\tdocs.push(child.node.type === 'JSXText' ? '' : print());\n\t}, 'astroChildren');\n\n\tconst { items, runs } = collect(container.astroChildren as AstroNode[], docs);\n\t// `resolveBlankContainers` already decided whether whitespace-only content survives.\n\tif (items.length === 0) return runs[0] === '' ? '' : ' ';\n\n\tconst isRoot = container.astroRoot === true;\n\tconst settings = {\n\t\tmode: options.astroCompressHTML,\n\t\tsensitivity: options.htmlWhitespaceSensitivity,\n\t};\n\tconst separatorAt = (index: number, edge: boolean) =>\n\t\tdocFor(\n\t\t\tseparatorFor(\n\t\t\t\truns[index],\n\t\t\t\t{\n\t\t\t\t\tcontainer,\n\t\t\t\t\tprev: items[index - 1]?.node ?? null,\n\t\t\t\t\tnext: items[index]?.node ?? null,\n\t\t\t\t\tisRoot,\n\t\t\t\t\tloneChild: false,\n\t\t\t\t\tedge,\n\t\t\t\t},\n\t\t\t\tsettings,\n\t\t\t),\n\t\t);\n\n\tconst parts: Doc[] = [''];\n\tconst append = (content: Doc) => parts.push([parts.pop()!, content]);\n\tconst separate = (separator: Doc | null) => {\n\t\tif (separator !== null) parts.push(separator, '');\n\t};\n\n\tfor (const [position, item] of items.entries()) {\n\t\tif (position > 0) separate(separatorAt(position, false));\n\t\tif (item.words === null) {\n\t\t\tappend(item.doc);\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const [wordPosition, word] of item.words.entries()) {\n\t\t\tif (wordPosition > 0) separate(line);\n\t\t\tappend(word);\n\t\t}\n\t}\n\n\tconst body = fill(parts);\n\tif (isRoot) return body;\n\treturn group([indent([separatorAt(0, true) ?? '', body]), separatorAt(items.length, true) ?? '']);\n}\n","import type { AstPath, BuiltInParserName, Doc, Options, ParserOptions } from 'prettier';\nimport { doc } from 'prettier';\nimport { SassFormatter, type SassFormatterConfig } from 'sass-formatter';\nimport { type AstroNode, attributeStringValue, tagNameOf } from '../ast';\nimport { estree } from '../estree';\nimport { opensRawSubtree } from '../whitespace';\nimport { manualDedent } from './utils';\n\nconst { group, hardline, indent, join } = doc.builders;\nconst { replaceEndOfLine } = doc.utils;\n\ntype TextToDoc = (text: string, options: Options) => Promise<Doc>;\ntype PrintFn = (selector?: string | number | (string | number)[]) => Doc;\n\nconst styleParsers: Record<string, BuiltInParserName> = {\n\tcss: 'css',\n\tscss: 'scss',\n\tless: 'less',\n};\n\n// Prettier swallows every error thrown inside `embed` unless this is set, leaving a useless message.\nasync function surfacingErrors(textToDoc: TextToDoc, text: string, options: Options) {\n\ttry {\n\t\treturn await textToDoc(text, options);\n\t} catch (error) {\n\t\tprocess.env.PRETTIER_DEBUG = 'true';\n\t\tthrow error;\n\t}\n}\n\n// Adapted from: https://github.com/prettier/prettier/blob/main/src/language-html/utils/index.js\nfunction inferParserByTypeAttribute(type: string | null): BuiltInParserName {\n\tswitch (type) {\n\t\tcase null:\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\t\tcase 'application/x-typescript':\n\t\t\treturn 'babel-ts';\n\t\tcase 'text/markdown':\n\t\t\treturn 'markdown';\n\t\tcase 'text/html':\n\t\t\treturn 'html';\n\t\tcase 'text/x-handlebars-template':\n\t\t\treturn 'glimmer';\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\nfunction contentOf(node: AstroNode, options: ParserOptions): string {\n\tconst start = (node.openingElement as AstroNode).end;\n\tconst end = (node.closingElement as AstroNode | null)?.start ?? node.end;\n\treturn options.originalText.slice(start, end);\n}\n\nfunction wrapContent(print: PrintFn, content: Doc, isEmpty: boolean): Doc {\n\treturn [\n\t\tprint('openingElement'),\n\t\tindent([isEmpty ? '' : hardline, content]),\n\t\tisEmpty ? '' : hardline,\n\t\tprint('closingElement'),\n\t];\n}\n\nfunction embedSass(source: string, options: ParserOptions): Doc {\n\tconst sassOptions: Partial<SassFormatterConfig> = {\n\t\ttabSize: options.tabWidth,\n\t\tinsertSpaces: !options.useTabs,\n\t\tlineEnding: options.endOfLine.toUpperCase() === 'CRLF' ? 'CRLF' : 'LF',\n\t};\n\tconst { result } = manualDedent(source);\n\treturn join(hardline, SassFormatter.Format(result, sassOptions).trim().split('\\n'));\n}\n\nexport function embed(path: AstPath<AstroNode>, options: ParserOptions) {\n\tconst node = path.node;\n\tif (node.astroIgnored) return undefined;\n\n\tif (node.type === 'AstroFrontmatter') {\n\t\tif (node.end === 0 || options.astroSkipFrontmatter) return undefined;\n\t\t// `Program.start` skips leading comments and `node.start` includes preceding whitespace.\n\t\tconst fence = options.originalText.indexOf('---', node.start);\n\t\tconst source = options.originalText.slice(fence + 3, node.end - 3);\n\t\tif (!source.trim()) return undefined;\n\t\treturn async (textToDoc: TextToDoc) => [\n\t\t\t'---',\n\t\t\thardline,\n\t\t\tawait surfacingErrors(textToDoc, source, { ...options, parser: 'babel-ts' }),\n\t\t\thardline,\n\t\t\t'---',\n\t\t];\n\t}\n\n\tif (node.type !== 'JSXElement') return estree.embed(path, options);\n\tconst tag = tagNameOf(node);\n\tif (tag === null || !node.closingElement) return estree.embed(path, options);\n\n\tconst source = contentOf(node, options);\n\tconst isEmpty = source.trim() === '';\n\n\tif (tag === 'script') {\n\t\tif (isEmpty) return estree.embed(path, options);\n\t\tconst parser = inferParserByTypeAttribute(attributeStringValue(node, 'type'));\n\t\treturn async (textToDoc: TextToDoc, print: PrintFn) =>\n\t\t\twrapContent(print, await surfacingErrors(textToDoc, source, { ...options, parser }), false);\n\t}\n\n\tif (tag === 'style') {\n\t\tif (isEmpty) return estree.embed(path, options);\n\t\tconst lang = attributeStringValue(node, 'lang')?.toLowerCase() ?? 'css';\n\t\tif (lang === 'sass') {\n\t\t\treturn (_textToDoc: TextToDoc, print: PrintFn) =>\n\t\t\t\twrapContent(print, embedSass(source, options), false);\n\t\t}\n\t\tconst parser = styleParsers[lang];\n\t\tif (!parser) return printVerbatim(source);\n\t\treturn async (textToDoc: TextToDoc, print: PrintFn) =>\n\t\t\twrapContent(print, await surfacingErrors(textToDoc, source, { ...options, parser }), false);\n\t}\n\n\tif (opensRawSubtree(node)) {\n\t\treturn (_textToDoc: TextToDoc, print: PrintFn) => [\n\t\t\tprint('openingElement'),\n\t\t\treplaceEndOfLine(source),\n\t\t\tprint('closingElement'),\n\t\t];\n\t}\n\n\treturn estree.embed(path, options);\n}\n\nfunction printVerbatim(source: string) {\n\treturn (_textToDoc: TextToDoc, print: PrintFn) =>\n\t\tgroup([print('openingElement'), replaceEndOfLine(source), print('closingElement')]);\n}\n","import type { AstPath, Doc, ParserOptions } from 'prettier';\nimport { doc } from 'prettier';\nimport { type AstroNode, astroVisitorKeys, ownChildren, synthetic } from '../ast';\nimport { estree } from '../estree';\nimport { opensRawSubtree } from '../whitespace';\nimport { printChildren } from './children';\nimport { embed } from './embed';\n\nconst { hardline } = doc.builders;\nconst { replaceEndOfLine } = doc.utils;\n\ntype PrintFn = (selector?: string | number | (string | number)[]) => Doc;\n\nfunction printDoctype(value: string): string {\n\tconst trimmed = value.trim();\n\tconst space = trimmed.search(/\\s/);\n\tconst name = space === -1 ? trimmed : trimmed.slice(0, space);\n\tconst rest = space === -1 ? '' : trimmed.slice(space);\n\treturn `<!doctype ${name.toLowerCase()}${rest}>`;\n}\n\nfunction printAstroNode(path: AstPath<AstroNode>, options: ParserOptions, print: PrintFn): Doc {\n\tconst node = path.node;\n\tswitch (node.type) {\n\t\tcase 'AstroRoot': {\n\t\t\tconst template = node.template as AstroNode;\n\t\t\tconst hasTemplate = ((template.node as AstroNode).children as AstroNode[]).length > 0;\n\t\t\tconst parts: Doc[] = [];\n\t\t\tif ((node.frontmatter as AstroNode).end > 0) {\n\t\t\t\tparts.push(print('frontmatter'));\n\t\t\t\tif (hasTemplate) parts.push(hardline, hardline);\n\t\t\t}\n\t\t\tif (hasTemplate) parts.push(print('template'));\n\t\t\treturn [parts, hardline];\n\t\t}\n\t\tcase 'AstroFrontmatter': {\n\t\t\tconst body = (node.program as AstroNode).body as unknown[];\n\t\t\tif (options.astroSkipFrontmatter) {\n\t\t\t\tconst fence = options.originalText.indexOf('---', node.start);\n\t\t\t\treturn replaceEndOfLine(options.originalText.slice(fence, node.end));\n\t\t\t}\n\t\t\treturn body.length > 0\n\t\t\t\t? ['---', hardline, print('program'), '---']\n\t\t\t\t: ['---', hardline, '---'];\n\t\t}\n\t\tcase 'AstroScript':\n\t\t\treturn ((node.program as AstroNode).body as unknown[]).length > 0 ? print('program') : '';\n\t\tcase 'AstroDoctype':\n\t\t\treturn printDoctype(node.value as string);\n\t\tcase 'AstroComment':\n\t\t\treturn `<!--${node.value as string}-->`;\n\t\tdefault:\n\t\t\treturn '';\n\t}\n}\n\nfunction printAttribute(\n\tpath: AstPath<AstroNode>,\n\toptions: ParserOptions,\n\tprint: PrintFn,\n): Doc | null {\n\tconst node = path.node;\n\tconst name = (node.name as AstroNode).name as string;\n\tconst value = node.value as AstroNode | null;\n\n\tif (node.astroShorthand) return ['{', print(['value', 'expression']), '}'];\n\n\tif (node.astroBacktick) return [name, '=', print(['value', 'expression'])];\n\n\tconst expression =\n\t\tvalue?.type === 'JSXExpressionContainer' ? (value.expression as AstroNode) : null;\n\tif (\n\t\toptions.astroAllowShorthand &&\n\t\texpression?.type === 'Identifier' &&\n\t\texpression.name === name\n\t) {\n\t\treturn ['{', print(['value', 'expression']), '}'];\n\t}\n\n\treturn null;\n}\n\n// No doc builder can cancel an indent nested inside a doc, so the root fragment's must be cut out.\nfunction unwrapFragmentIndent(printed: Doc): Doc {\n\tconst group = printed as { type?: string; contents?: Doc; expandedStates?: Doc[] };\n\tif (group.type !== 'group') return printed;\n\tif (group.expandedStates) {\n\t\tconst states = group.expandedStates.map(unwrapFragmentIndent);\n\t\treturn { ...group, contents: states[0], expandedStates: states } as Doc;\n\t}\n\tconst parts = group.contents as Doc[];\n\tif (!Array.isArray(parts) || parts.length !== 4) return printed;\n\tconst indented = parts[1] as { type?: string; contents?: Doc[] };\n\tif (indented.type !== 'indent' || !indented.contents) return printed;\n\treturn indented.contents[1];\n}\n\nexport const printer = {\n\t...estree,\n\tembed,\n\tgetVisitorKeys(node: AstroNode, nonTraversableKeys: Set<string>): string[] {\n\t\tconst keys = astroVisitorKeys[node.type] ?? estree.getVisitorKeys(node, nonTraversableKeys);\n\t\treturn node.astroChildren\n\t\t\t? keys.map((key) => (key === 'children' ? 'astroChildren' : key))\n\t\t\t: keys;\n\t},\n\tprint(path: AstPath<AstroNode>, options: ParserOptions, print: PrintFn, args?: unknown): Doc {\n\t\tconst node = path.node;\n\t\tif (node[ownChildren]) return path.callParent(() => printChildren(path, options, print));\n\t\tif (node[synthetic]) return '';\n\t\tif (node.astroIgnored) {\n\t\t\treturn replaceEndOfLine(options.originalText.slice(node.start, node.end));\n\t\t}\n\t\tif (astroVisitorKeys[node.type]) return printAstroNode(path, options, print);\n\t\tif (node.type === 'JSXAttribute') {\n\t\t\tconst attribute = printAttribute(path, options, print);\n\t\t\tif (attribute) return attribute;\n\t\t}\n\t\t// Reached when `embeddedLanguageFormatting` is off; reflowing raw content would corrupt it.\n\t\tif (\n\t\t\tnode.type === 'JSXElement' &&\n\t\t\tnode.closingElement &&\n\t\t\t(node.children as AstroNode[]).length > 0 &&\n\t\t\topensRawSubtree(node)\n\t\t) {\n\t\t\tconst start = (node.openingElement as AstroNode).end;\n\t\t\tconst end = (node.closingElement as AstroNode).start;\n\t\t\treturn [\n\t\t\t\tprint('openingElement'),\n\t\t\t\treplaceEndOfLine(options.originalText.slice(start, end)),\n\t\t\t\tprint('closingElement'),\n\t\t\t];\n\t\t}\n\t\tconst printed = estree.print(path, options, print, args) as Doc;\n\t\tif ((node.openingFragment as AstroNode | undefined)?.[synthetic]) {\n\t\t\treturn unwrapFragmentIndent(printed);\n\t\t}\n\t\treturn printed;\n\t},\n};\n","import type { Parser, Printer, SupportLanguage } from 'prettier';\nimport type { AstroNode } from './ast';\nimport { options } from './options';\nimport { parse } from './parser';\nimport { printer } from './printer';\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,\n\t\tastFormat: 'astro',\n\t\tlocStart: (node: AstroNode) => node.start,\n\t\tlocEnd: (node: AstroNode) => node.end,\n\t},\n};\n\n// https://prettier.io/docs/en/plugins.html#printers\nexport const printers: Record<string, Printer> = {\n\t// Prettier types `print`'s callback as taking an `AstPath`, but it passes one taking a selector.\n\tastro: printer as unknown as Printer,\n};\n\nconst defaultOptions = {\n\ttabWidth: 2,\n};\n\nexport { defaultOptions, options };\n"],"names":["leadingWhitespace","trailingWhitespace","parseAstro","printers","group","hardline","indent","replaceEndOfLine"],"mappings":";;;;;AAgBa,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;AACD,IAAA,oBAAoB,EAAE;AACrB,QAAA,QAAQ,EAAE,OAAO;AACjB,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,WAAW,EAAE,0CAA0C;AACvD,KAAA;AACD,IAAA,iBAAiB,EAAE;AAClB,QAAA,QAAQ,EAAE,OAAO;AACjB,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,WAAW,EACV,yGAAyG;AAC1G,QAAA,OAAO,EAAE;AACR,YAAA;AACC,gBAAA,KAAK,EAAE,KAAK;AACZ,gBAAA,WAAW,EACV,8GAA8G;AAC/G,aAAA;AACD,YAAA;AACC,gBAAA,KAAK,EAAE,MAAM;AACb,gBAAA,WAAW,EAAE,kEAAkE;AAC/E,aAAA;AACD,YAAA,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,mDAAmD,EAAE;AAEnF,YAAA,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAwD;AACvF,YAAA,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAwD;AACxF,SAAA;AACD,KAAA;;;AClDK,M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,IAAI,CAAC,eAAyC,GAAG,SAAS,CAAC,EAAE;AACjE,YAAA,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC;SACrC;AACD,QAAA,OAAO,OAAO,CAAC;KACf;CACD;;ACpIY,MAAA,SAAS,GAA+B;AACpD,IAAA;AACC,QAAA,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,CAAC,OAAO,CAAC;QAClB,UAAU,EAAE,CAAC,QAAQ,CAAC;QACtB,iBAAiB,EAAE,CAAC,OAAO,CAAC;AAC5B,KAAA;EACA;AAGW,MAAA,OAAO,GAA2B;AAC9C,IAAA,KAAK,EAAE;QACN,KAAK;AACL,QAAA,SAAS,EAAE,OAAO;QAClB,QAAQ,EAAE,CAAC,IAAe,KAAK,IAAI,CAAC,KAAK;QACzC,MAAM,EAAE,CAAC,IAAe,KAAK,IAAI,CAAC,GAAG;AACrC,KAAA;EACA;AAGW,MAAA,QAAQ,GAA4B;AAEhD,IAAA,KAAK,EAAE,OAA6B;EACnC;AAEF,MAAM,cAAc,GAAG;AACtB,IAAA,QAAQ,EAAE,CAAC;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/options.ts","../src/ast.ts","../src/elements.ts","../src/printer/utils.ts","../src/whitespace.ts","../src/parser.ts","../src/estree.ts","../src/printer/children.ts","../src/printer/embed.ts","../src/printer/index.ts","../src/index.ts"],"sourcesContent":["import type { SupportOption } from 'prettier';\n\nexport type CompressHTML = 'jsx' | 'html' | 'none';\n\ninterface PluginOptions {\n\tastroAllowShorthand: boolean;\n\tastroSkipFrontmatter: boolean;\n\tastroCompressHTML: CompressHTML;\n}\n\ndeclare module 'prettier' {\n\t// eslint-disable-next-line @typescript-eslint/no-empty-object-type\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\tastroSkipFrontmatter: {\n\t\tcategory: 'Astro',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tdescription: 'Skips the formatting of the frontmatter.',\n\t},\n\tastroCompressHTML: {\n\t\tcategory: 'Astro',\n\t\ttype: 'choice',\n\t\tdefault: 'jsx',\n\t\tdescription:\n\t\t\t\"Mirror of Astro's compressHTML config. Tells the formatter which whitespace the compiler will collapse.\",\n\t\tchoices: [\n\t\t\t{\n\t\t\t\tvalue: 'jsx',\n\t\t\t\tdescription:\n\t\t\t\t\t\"Astro's default since 7.0.0. Whitespace runs containing a newline are dropped; same-line spaces are content.\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: 'html',\n\t\t\t\tdescription: 'Browser HTML whitespace rules. Equivalent to compressHTML: true.',\n\t\t\t},\n\t\t\t{ value: 'none', description: 'No collapsing. Equivalent to compressHTML: false.' },\n\t\t\t// Prettier's SupportOption types omit `redirect`, which its own option normaliser honours.\n\t\t\t{ value: true, redirect: 'html' } as unknown as { value: boolean; description: string },\n\t\t\t{ value: false, redirect: 'none' } as unknown as { value: boolean; description: string },\n\t\t],\n\t},\n};\n","export const synthetic: unique symbol = Symbol.for('prettier-plugin-astro.synthetic');\nexport const ownChildren: unique symbol = Symbol.for('prettier-plugin-astro.ownChildren');\n\nexport interface AstroNode {\n\ttype: string;\n\tstart: number;\n\tend: number;\n\t[synthetic]?: boolean;\n\t[ownChildren]?: boolean;\n\t[key: string]: unknown;\n}\n\nexport interface JsComment {\n\ttype: 'Line' | 'Block';\n\tvalue: string;\n\tstart: number;\n\tend: number;\n}\n\nexport const astroVisitorKeys: Record<string, string[]> = {\n\tAstroRoot: ['frontmatter', 'template'],\n\tAstroFrontmatter: ['program'],\n\tAstroScript: ['program'],\n\tAstroDoctype: [],\n\tAstroComment: [],\n};\n\nexport const isNode = (value: unknown): value is AstroNode =>\n\ttypeof value === 'object' && value !== null && typeof (value as AstroNode).type === 'string';\n\nexport function tagNameOf(node: AstroNode): string | null {\n\tif (node.type !== 'JSXElement') return null;\n\tconst name = (node.openingElement as AstroNode | undefined)?.name as AstroNode | undefined;\n\treturn name?.type === 'JSXIdentifier' ? (name.name as string) : null;\n}\n\nexport const isComponentName = (name: string | null): boolean =>\n\tname === null || /^[A-Z]/.test(name) || name.includes('.');\n\nexport function attributesOf(node: AstroNode): AstroNode[] {\n\tconst opening = node.openingElement as AstroNode | undefined;\n\treturn (opening?.attributes as AstroNode[] | undefined) ?? [];\n}\n\nexport function attributeNamed(node: AstroNode, name: string): AstroNode | undefined {\n\treturn attributesOf(node).find(\n\t\t(attribute) => attribute.type === 'JSXAttribute' && (attribute.name as AstroNode).name === name,\n\t);\n}\n\nexport function attributeStringValue(node: AstroNode, name: string): string | null {\n\tconst value = attributeNamed(node, name)?.value as AstroNode | undefined;\n\treturn value?.type === 'Literal' && typeof value.value === 'string' ? value.value : null;\n}\n\nexport const hasAttribute = (node: AstroNode, name: string): boolean =>\n\tattributeNamed(node, name) !== undefined;\n\nexport const hasSetDirective = (node: AstroNode): boolean =>\n\thasAttribute(node, 'set:html') || hasAttribute(node, 'set:text');\n\nexport function childrenOf(node: AstroNode): AstroNode[] | null {\n\tif (node.type === 'JSXElement' || node.type === 'JSXFragment') {\n\t\treturn (node.astroChildren as AstroNode[] | undefined) ?? (node.children as AstroNode[]);\n\t}\n\treturn null;\n}\n\n/** Prettier's JSX printer prints a lone template-literal child verbatim: the only seam for our own children doc. */\nexport function takeOverChildren(node: AstroNode): void {\n\tconst children = node.children as AstroNode[];\n\tif (children.length === 0) return;\n\tnode.astroChildren = children;\n\tnode.children = [\n\t\t{\n\t\t\ttype: 'JSXExpressionContainer',\n\t\t\tstart: node.start,\n\t\t\tend: node.end,\n\t\t\t[ownChildren]: true,\n\t\t\texpression: {\n\t\t\t\ttype: 'TemplateLiteral',\n\t\t\t\tstart: node.start,\n\t\t\t\tend: node.end,\n\t\t\t\tquasis: [],\n\t\t\t\texpressions: [],\n\t\t\t},\n\t\t},\n\t];\n}\n\nexport function walk(node: unknown, visit: (node: AstroNode) => void): void {\n\tif (Array.isArray(node)) {\n\t\tfor (const item of node) walk(item, visit);\n\t\treturn;\n\t}\n\tif (!isNode(node)) return;\n\tvisit(node);\n\tfor (const key of Object.keys(node)) {\n\t\tif (key !== 'type') walk(node[key], visit);\n\t}\n}\n","/** Mirrors `astro_codegen/src/printer/whitespace.rs` — the compiler never collapses these. */\nexport const rawTextElements = new Set([\n\t'pre',\n\t'listing',\n\t'iframe',\n\t'noembed',\n\t'noframes',\n\t'math',\n\t'plaintext',\n\t'script',\n\t'style',\n\t'textarea',\n\t'title',\n\t'xmp',\n]);\n\n// https://github.com/prettier/prettier/blob/main/vendors/html-void-elements.json\nexport const voidElements = new Set([\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'source',\n\t'track',\n\t'wbr',\n]);\n\n/** Extracted verbatim from `prettier/plugins/html.js` so the two printers cannot drift apart. */\nconst cssDisplay: Record<string, string> = {\n\tarea: 'none',\n\tbase: 'none',\n\tbasefont: 'none',\n\tdatalist: 'none',\n\thead: 'none',\n\tlink: 'none',\n\tmeta: 'none',\n\tnoembed: 'none',\n\tnoframes: 'none',\n\tparam: 'block',\n\trp: 'none',\n\tscript: 'block',\n\tstyle: 'none',\n\ttemplate: 'inline',\n\ttitle: 'none',\n\thtml: 'block',\n\tbody: 'block',\n\taddress: 'block',\n\tblockquote: 'block',\n\tcenter: 'block',\n\tdialog: 'block',\n\tdiv: 'block',\n\tfigure: 'block',\n\tfigcaption: 'block',\n\tfooter: 'block',\n\tform: 'block',\n\theader: 'block',\n\thr: 'block',\n\tlegend: 'block',\n\tlisting: 'block',\n\tmain: 'block',\n\tp: 'block',\n\tplaintext: 'block',\n\tpre: 'block',\n\tsearch: 'block',\n\txmp: 'block',\n\tslot: 'contents',\n\truby: 'ruby',\n\trt: 'ruby-text',\n\tarticle: 'block',\n\taside: 'block',\n\th1: 'block',\n\th2: 'block',\n\th3: 'block',\n\th4: 'block',\n\th5: 'block',\n\th6: 'block',\n\thgroup: 'block',\n\tnav: 'block',\n\tsection: 'block',\n\tdir: 'block',\n\tdd: 'block',\n\tdl: 'block',\n\tdt: 'block',\n\tmenu: 'block',\n\tol: 'block',\n\tul: 'block',\n\tli: 'list-item',\n\ttable: 'table',\n\tcaption: 'table-caption',\n\tcolgroup: 'table-column-group',\n\tcol: 'table-column',\n\tthead: 'table-header-group',\n\ttbody: 'table-row-group',\n\ttfoot: 'table-footer-group',\n\ttr: 'table-row',\n\ttd: 'table-cell',\n\tth: 'table-cell',\n\tinput: 'inline-block',\n\tbutton: 'inline-block',\n\tfieldset: 'block',\n\tdetails: 'block',\n\tsummary: 'block',\n\tmarquee: 'inline-block',\n\tsource: 'block',\n\ttrack: 'block',\n\tmeter: 'inline-block',\n\tprogress: 'inline-block',\n\tobject: 'inline-block',\n\tvideo: 'inline-block',\n\taudio: 'inline-block',\n\tselect: 'inline-block',\n\toption: 'block',\n\toptgroup: 'block',\n};\n\nconst inlineLevel = new Set(['inline', 'inline-block', 'ruby', 'ruby-text', 'contents']);\n\nexport function displayOfTag(tag: string): string {\n\treturn cssDisplay[tag] ?? 'inline';\n}\n\nexport function isInlineDisplay(display: string): boolean {\n\treturn inlineLevel.has(display);\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 = /^(\\s+)\\S+/.exec(line); // \\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\nexport function printClassNames(value: string): string {\n\tconst lines = value.trim().split(/[\\r\\n]+/);\n\tconst formattedLines = lines.map((line) => {\n\t\tconst spaces = /^\\s+/.exec(line);\n\t\treturn (spaces ? spaces[0] : '') + line.trim().split(/\\s+/).join(' ');\n\t});\n\treturn formattedLines.join('\\n');\n}\n","import {\n\ttype AstroNode,\n\tchildrenOf,\n\thasAttribute,\n\thasSetDirective,\n\tisComponentName,\n\ttagNameOf,\n} from './ast';\nimport { displayOfTag, isInlineDisplay, rawTextElements } from './elements';\nimport type { CompressHTML } from './options';\n\ntype Sensitivity = 'css' | 'strict' | 'ignore';\n\nexport interface Settings {\n\tmode: CompressHTML;\n\tsensitivity: Sensitivity;\n}\n\ninterface Context extends Settings {\n\tisRoot: boolean;\n\tinRaw: boolean;\n}\n\ntype Decision = 'keep' | 'drop' | 'space';\n\nconst leadingWhitespace = /^[\\t\\n\\f\\r ]+/;\nconst trailingWhitespace = /[\\t\\n\\f\\r ]+$/;\nconst hasNewline = (run: string) => /[\\n\\r]/.test(run);\n\nconst isText = (node: AstroNode | null) => node?.type === 'JSXText';\nconst rawTextOf = (node: AstroNode) => (node.raw as string | undefined) ?? '';\nconst isWhitespaceOnly = (node: AstroNode) => isText(node) && rawTextOf(node).trim().length === 0;\n\nexport function opensRawSubtree(node: AstroNode): boolean {\n\tif (node.type !== 'JSXElement') return false;\n\tif (hasAttribute(node, 'is:raw')) return true;\n\tconst tag = tagNameOf(node);\n\treturn tag !== null && !isComponentName(tag) && rawTextElements.has(tag);\n}\n\n/** A `<style>` the compiler lifts out of the template, taking the whitespace beside it. */\nconst isExtractedStyle = (node: AstroNode | null) =>\n\tnode !== null && tagNameOf(node) === 'style' && !hasAttribute(node, 'is:inline');\n\nfunction displayOf(node: AstroNode): string {\n\tif (node.type !== 'JSXElement') return 'inline';\n\tconst tag = tagNameOf(node);\n\tif (tag === null || isComponentName(tag) || tag.includes('-')) return 'inline';\n\treturn displayOfTag(tag);\n}\n\nexport type Separator = 'none' | 'soft' | 'space' | 'break' | 'blank';\n\nexport interface PrinterBoundary {\n\tcontainer: AstroNode;\n\tprev: AstroNode | null;\n\tnext: AstroNode | null;\n\tisRoot: boolean;\n\tloneChild: boolean;\n\tedge: boolean;\n}\n\nconst isBlankRun = (run: string) => /[\\n\\r][^\\S\\n\\r]*[\\n\\r]/.test(run);\n\n/** A text neighbour never decides significance; at a container edge only the container does. */\nfunction sidesFor(boundary: PrinterBoundary): (AstroNode | null)[] | null {\n\tif (boundary.edge) return [null];\n\tconst sides: (AstroNode | null)[] = [];\n\tif (boundary.prev === null) sides.push(null);\n\telse if (boundary.prev.type !== 'JSXText') sides.push(boundary.prev);\n\tif (boundary.next === null) sides.push(null);\n\telse if (boundary.next.type !== 'JSXText') sides.push(boundary.next);\n\treturn sides.length > 0 ? sides : null;\n}\n\n/** `<slot>` and custom elements get a slot iff they have content, so their blank content is content. */\nexport function blankContentIsFree(\n\tcontainer: AstroNode,\n\tisRoot: boolean,\n\tsettings: Settings,\n): boolean {\n\tconst tag = container.type === 'JSXElement' ? tagNameOf(container) : null;\n\tif (tag === 'slot') return false;\n\tif (tag !== null && !isComponentName(tag) && tag.includes('-')) return false;\n\n\tconst boundary: Boundary = {\n\t\tcontainer,\n\t\tcontext: { ...settings, isRoot, inRaw: false },\n\t\tprev: null,\n\t\tnext: null,\n\t\tsides: [null],\n\t\tatStart: true,\n\t\tatEnd: true,\n\t\tloneChild: true,\n\t};\n\treturn isFree(boundary) || mayAlterRenderedWhitespace(boundary);\n}\n\nexport function separatorFor(\n\trun: string,\n\tboundary: PrinterBoundary,\n\tsettings: Settings,\n): Separator {\n\tconst sides = sidesFor(boundary);\n\tconst internal: Boundary = {\n\t\tcontainer: boundary.container,\n\t\tcontext: { ...settings, isRoot: boundary.isRoot, inRaw: false },\n\t\tprev: boundary.prev,\n\t\tnext: boundary.next,\n\t\tsides: sides ?? [],\n\t\tatStart: boundary.prev === null,\n\t\tatEnd: boundary.next === null,\n\t\tloneChild: boundary.loneChild,\n\t};\n\n\tif (isSlotFallback(internal)) return run === '' ? 'none' : 'space';\n\tconst free = isFree(internal) || (sides !== null && mayAlterRenderedWhitespace(internal));\n\tif (boundary.edge) {\n\t\tif (free) return 'soft';\n\t\treturn run === '' ? 'none' : 'space';\n\t}\n\tif (isBlankRun(run)) return 'blank';\n\tif (hasNewline(run)) return 'break';\n\tif (free) return 'soft';\n\treturn run === '' ? 'none' : 'space';\n}\n\nexport function normalizeWhitespace(template: AstroNode, options: Settings): void {\n\tvisit(template, { ...options, isRoot: true, inRaw: false });\n}\n\nfunction visit(container: AstroNode, context: Context): void {\n\tconst children = childrenOf(container);\n\tif (children === null) return;\n\n\tif (!context.inRaw) collapseRuns(container, children, context);\n\n\tfor (const child of children) {\n\t\tvisit(child, {\n\t\t\t...context,\n\t\t\tisRoot: false,\n\t\t\tinRaw: context.inRaw || opensRawSubtree(child),\n\t\t});\n\t}\n}\n\nfunction collapseRuns(container: AstroNode, children: AstroNode[], context: Context): void {\n\tconst dropped = new Set<AstroNode>();\n\n\tfor (const [index, child] of children.entries()) {\n\t\tif (!isText(child)) continue;\n\t\tconst prev = children[index - 1] ?? null;\n\t\tconst next = children[index + 1] ?? null;\n\n\t\tif (isWhitespaceOnly(child)) {\n\t\t\tconst decision = decide(rawTextOf(child), {\n\t\t\t\tcontainer,\n\t\t\t\tcontext,\n\t\t\t\tprev,\n\t\t\t\tnext,\n\t\t\t\tsides: [prev, next],\n\t\t\t\tatStart: prev === null,\n\t\t\t\tatEnd: next === null,\n\t\t\t\tloneChild: children.length === 1,\n\t\t\t});\n\t\t\tconst text = resolve(rawTextOf(child), decision);\n\t\t\tif (text === '') dropped.add(child);\n\t\t\telse setText(child, text);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst raw = rawTextOf(child);\n\t\tconst lead = leadingWhitespace.exec(raw)?.[0] ?? '';\n\t\tconst trail = trailingWhitespace.exec(raw)?.[0] ?? '';\n\t\tconst body = raw.slice(lead.length, raw.length - trail.length);\n\n\t\tconst leadDecision = decide(lead, {\n\t\t\tcontainer,\n\t\t\tcontext,\n\t\t\tprev,\n\t\t\tnext: child,\n\t\t\tsides: [prev],\n\t\t\tatStart: prev === null,\n\t\t\tatEnd: false,\n\t\t\tloneChild: false,\n\t\t});\n\t\tconst trailDecision = decide(trail, {\n\t\t\tcontainer,\n\t\t\tcontext,\n\t\t\tprev: child,\n\t\t\tnext,\n\t\t\tsides: [next],\n\t\t\tatStart: false,\n\t\t\tatEnd: next === null,\n\t\t\tloneChild: false,\n\t\t});\n\n\t\tsetText(child, resolve(lead, leadDecision) + body + resolve(trail, trailDecision));\n\t}\n\n\tif (dropped.size > 0) {\n\t\tconst kept = children.filter((child) => !dropped.has(child));\n\t\tchildren.length = 0;\n\t\tchildren.push(...kept);\n\t}\n}\n\n// Dropping a newline run would also drop the blank lines prettier reproduces from it.\nfunction resolve(run: string, decision: Decision): string {\n\tif (decision === 'drop') return hasNewline(run) ? run : '';\n\tif (decision === 'space') return ' ';\n\treturn run;\n}\n\nfunction setText(node: AstroNode, text: string): void {\n\tnode.raw = text;\n\tnode.value = text;\n}\n\ninterface Boundary {\n\tcontainer: AstroNode;\n\tcontext: Context;\n\tprev: AstroNode | null;\n\tnext: AstroNode | null;\n\t/** The neighbours whose CSS display decides significance; `null` stands for the container. */\n\tsides: (AstroNode | null)[];\n\tatStart: boolean;\n\tatEnd: boolean;\n\tloneChild: boolean;\n}\n\nfunction decide(run: string, boundary: Boundary): Decision {\n\tif (run === '') return 'keep';\n\tconst { mode } = boundary.context;\n\n\tif (isSlotFallback(boundary)) return 'space';\n\tif (isFree(boundary)) return 'drop';\n\tif (mayAlterRenderedWhitespace(boundary)) return 'drop';\n\n\tif (mode === 'jsx') return hasNewline(run) ? 'keep' : 'space';\n\n\t// Prettier's JSX printer trims container-edge runs, which under `html`/`none` are rendered.\n\treturn boundary.atStart || boundary.atEnd ? 'space' : 'keep';\n}\n\nfunction isFree(boundary: Boundary): boolean {\n\tconst { container, context, atStart, atEnd, loneChild } = boundary;\n\tconst { mode } = context;\n\n\tif (context.isRoot && (atStart || atEnd)) return true;\n\tif (container.type === 'JSXElement' && hasSetDirective(container)) return true;\n\tif (isExtractedStyle(boundary.prev) || isExtractedStyle(boundary.next)) return true;\n\n\tconst tag = container.type === 'JSXElement' ? tagNameOf(container) : null;\n\tif (loneChild && tag !== null && isComponentName(tag)) return true;\n\n\tif (mode === 'html') {\n\t\tif (loneChild) return true;\n\t\tif (tag === 'head') return true;\n\t}\n\n\treturn false;\n}\n\n/** Whether the user authorised changing rendered whitespace here, not whether it is sound. */\nfunction mayAlterRenderedWhitespace(boundary: Boundary): boolean {\n\tconst { sensitivity } = boundary.context;\n\tif (sensitivity === 'ignore') return true;\n\tif (sensitivity === 'strict') return false;\n\treturn boundary.sides.every((side) => !isInlineDisplay(displayOf(side ?? boundary.container)));\n}\n\n/** Any content at all, whitespace included, gives a `<slot>` a fallback body; nothing gives none. */\nfunction isSlotFallback(boundary: Boundary): boolean {\n\treturn (\n\t\tboundary.container.type === 'JSXElement' &&\n\t\ttagNameOf(boundary.container) === 'slot' &&\n\t\tboundary.loneChild\n\t);\n}\n","import { parse as parseAstro } from '@astrojs/compiler-rs';\nimport type { ParserOptions } from 'prettier';\nimport {\n\ttype AstroNode,\n\tchildrenOf,\n\thasSetDirective,\n\tisComponentName,\n\tisNode,\n\ttype JsComment,\n\tsynthetic,\n\ttagNameOf,\n\ttakeOverChildren,\n\twalk,\n} from './ast';\nimport { rawTextElements, voidElements } from './elements';\nimport { printClassNames } from './printer/utils';\nimport {\n\tblankContentIsFree,\n\tnormalizeWhitespace,\n\topensRawSubtree,\n\ttype Settings,\n} from './whitespace';\n\ninterface Diagnostic {\n\tseverity: string;\n\ttext: string;\n\tlabels: { line: number; column: number }[];\n}\n\nexport function parse(source: string, options: ParserOptions): AstroNode {\n\tconst { ast, diagnostics } = parseAstro(source) as unknown as {\n\t\tast: AstroNode;\n\t\tdiagnostics: Diagnostic[];\n\t};\n\n\tconst failure = diagnostics.find((diagnostic) => diagnostic.severity === 'error');\n\tif (failure) throw syntaxError(failure);\n\n\tstripParentheses(ast);\n\trepairSpans(ast);\n\tmarkAttributes(ast, source);\n\tapplyPrettierIgnore(ast);\n\n\tconst body = ast.body as AstroNode[];\n\tconst template = templateFragment(ast, body);\n\tconst settings = {\n\t\tmode: options.astroCompressHTML,\n\t\tsensitivity: options.htmlWhitespaceSensitivity,\n\t};\n\t// Prettier always breaks between two adjacent non-text children, which only `jsx` can absorb.\n\tif (settings.mode === 'jsx') normalizeWhitespace(template.node as AstroNode, settings);\n\telse resolveBlankContainers(template.node as AstroNode, settings);\n\tnormalizeTagPairs(body, source);\n\tif (settings.mode !== 'jsx') claimChildren(template.node as AstroNode);\n\n\tast.template = template;\n\tdelete ast.body;\n\tast.comments = printableComments(ast);\n\treturn ast;\n}\n\nfunction syntaxError(diagnostic: Diagnostic): Error {\n\tconst label = diagnostic.labels[0];\n\tconst line = label?.line ?? 1;\n\tconst column = (label?.column ?? 0) + 1;\n\tconst error = new SyntaxError(`${diagnostic.text} (${line}:${column})`);\n\t(error as Error & { loc: unknown }).loc = { start: { line, column } };\n\treturn error;\n}\n\n// oxc emits explicit nodes; prettier re-derives parens itself and the two compound on every pass.\nfunction stripParentheses(root: AstroNode): void {\n\twalk(root, (node) => {\n\t\tfor (const key of Object.keys(node)) {\n\t\t\tconst value = node[key];\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const [index, item] of value.entries()) {\n\t\t\t\t\tvalue[index] = unwrapParens(item);\n\t\t\t\t}\n\t\t\t} else if (isNode(value)) {\n\t\t\t\tnode[key] = unwrapParens(value);\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction unwrapParens(node: unknown): unknown {\n\tlet current = node;\n\twhile (isNode(current)) {\n\t\tif (current.type === 'ParenthesizedExpression') current = current.expression;\n\t\telse if (current.type === 'TSParenthesizedType') current = current.typeAnnotation;\n\t\telse break;\n\t}\n\treturn current;\n}\n\n// `AstroScript` spans the whole `<script>` element, overlapping the tags prettier sorts it against.\nfunction repairSpans(root: AstroNode): void {\n\twalk(root, (node) => {\n\t\tif (node.type !== 'JSXElement') return;\n\t\tconst script = (node.children as AstroNode[]).find((child) => child.type === 'AstroScript');\n\t\tif (!script) return;\n\t\tscript.start = (node.openingElement as AstroNode).end;\n\t\tscript.end = (node.closingElement as AstroNode | null)?.start ?? node.end;\n\t});\n}\n\nfunction markAttributes(root: AstroNode, source: string): void {\n\twalk(root, (node) => {\n\t\tif (node.type !== 'JSXAttribute') return;\n\t\tconst value = node.value as AstroNode | null;\n\t\tif (!value) return;\n\n\t\tif (value.type === 'Literal' && typeof value.value === 'string') {\n\t\t\tconst name = (node.name as AstroNode).name;\n\t\t\tconst text = name === 'class' ? printClassNames(value.value) : value.value;\n\t\t\tif (value.raw === null || text !== value.value) {\n\t\t\t\tvalue.value = text;\n\t\t\t\tvalue.raw = `\"${text.replaceAll('\"', '&quot;')}\"`;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (value.type !== 'JSXExpressionContainer') return;\n\n\t\tif (source[node.start] === '{') node.astroShorthand = true;\n\t\tif (source[value.start] === '`') node.astroBacktick = true;\n\t});\n}\n\nfunction applyPrettierIgnore(root: AstroNode): void {\n\twalk(root, (node) => {\n\t\tconst children = node.type === 'AstroRoot' ? (node.body as AstroNode[]) : childrenOf(node);\n\t\tif (children === null) return;\n\t\tfor (const [index, child] of children.entries()) {\n\t\t\tif (child.type !== 'AstroComment') continue;\n\t\t\tif (String(child.value).trim() !== 'prettier-ignore') continue;\n\t\t\tconst target = children.slice(index + 1).find((sibling) => sibling.type !== 'JSXText');\n\t\t\tif (target) target.astroIgnored = true;\n\t\t}\n\t});\n}\n\nfunction templateFragment(root: AstroNode, body: AstroNode[]): AstroNode {\n\tconst start = body[0]?.start ?? root.end;\n\tconst end = body.at(-1)?.end ?? root.end;\n\treturn {\n\t\ttype: 'JsExpressionRoot',\n\t\tstart,\n\t\tend,\n\t\tnode: {\n\t\t\ttype: 'JSXFragment',\n\t\t\tstart,\n\t\t\tend,\n\t\t\tastroRoot: true,\n\t\t\topeningFragment: { type: 'JSXOpeningFragment', start, end: start, [synthetic]: true },\n\t\t\tchildren: body,\n\t\t\tclosingFragment: { type: 'JSXClosingFragment', start: end, end, [synthetic]: true },\n\t\t},\n\t};\n}\n\nfunction pairUp(node: AstroNode, tag: string): void {\n\t(node.openingElement as AstroNode).selfClosing = false;\n\tnode.closingElement = {\n\t\ttype: 'JSXClosingElement',\n\t\tstart: node.end,\n\t\tend: node.end,\n\t\tname: { type: 'JSXIdentifier', name: tag, start: node.end, end: node.end },\n\t};\n}\n\n// Requiring the newline keeps the lone space `resolveBlankContainers` leaves behind, which is content.\nfunction printsNothing(child: AstroNode): boolean {\n\tconst raw = String(child.raw ?? '');\n\treturn child.type === 'JSXText' && raw.trim() === '' && /[\\n\\r]/.test(raw);\n}\n\nfunction normalizeTagPairs(body: AstroNode[], source: string): void {\n\twalk(body, (node) => {\n\t\tif (node.type !== 'JSXElement') return;\n\t\tconst tag = tagNameOf(node);\n\t\tif (tag === null) return;\n\t\tconst children = node.children as AstroNode[];\n\t\tconst closing = node.closingElement as AstroNode | null;\n\t\tconst component = isComponentName(tag);\n\n\t\tif (rawTextElements.has(tag) && !component) {\n\t\t\tif (!closing) pairUp(node, tag);\n\t\t\telse if (source.slice((node.openingElement as AstroNode).end, closing.start).trim() === '') {\n\t\t\t\tchildren.length = 0;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst selfClosable =\n\t\t\tcomponent || voidElements.has(tag) || tag === 'slot' || hasSetDirective(node);\n\n\t\tif (children.every(printsNothing) && selfClosable && closing) {\n\t\t\t(node.openingElement as AstroNode).selfClosing = true;\n\t\t\tnode.closingElement = null;\n\t\t}\n\t});\n}\n\n// Decided here rather than in the children printer so tag pairing sees the final child count.\nfunction resolveBlankContainers(template: AstroNode, settings: Settings): void {\n\twalk(template, (node) => {\n\t\tif (node.type !== 'JSXElement' && node.type !== 'JSXFragment') return;\n\t\tif (node.type === 'JSXElement' && opensRawSubtree(node)) return;\n\t\tconst children = node.children as AstroNode[];\n\t\tif (children.length === 0) return;\n\t\tconst blank = children.every(\n\t\t\t(child) => child.type === 'JSXText' && String(child.raw ?? '').trim() === '',\n\t\t);\n\t\tif (!blank) return;\n\n\t\tconst free = blankContentIsFree(node, node.astroRoot === true, settings);\n\t\tchildren.length = 0;\n\t\tif (!free) {\n\t\t\tchildren.push({ type: 'JSXText', start: node.start, end: node.start, raw: ' ', value: ' ' });\n\t\t}\n\t});\n}\n\nfunction claimChildren(template: AstroNode): void {\n\twalk(template, (node) => {\n\t\tif (node.type !== 'JSXElement' && node.type !== 'JSXFragment') return;\n\t\tif (node.type === 'JSXElement' && opensRawSubtree(node)) return;\n\t\ttakeOverChildren(node);\n\t});\n}\n\n// Prettier throws on any comment it never printed, so drop the ones inside reprinted-from-source regions.\nfunction printableComments(root: AstroNode): JsComment[] {\n\tconst comments = (root.comments as JsComment[] | undefined) ?? [];\n\tif (comments.length === 0) return comments;\n\n\tconst frontmatter = root.frontmatter as AstroNode;\n\tconst skipped: [number, number][] = [];\n\tif (frontmatter.end > 0) skipped.push([frontmatter.start, frontmatter.end]);\n\n\twalk(root, (node) => {\n\t\tif (node.astroIgnored) {\n\t\t\tskipped.push([node.start, node.end]);\n\t\t\treturn;\n\t\t}\n\t\tif (!opensRawSubtree(node)) return;\n\t\tconst closing = node.closingElement as AstroNode | null;\n\t\tskipped.push([(node.openingElement as AstroNode).end, closing?.start ?? node.end]);\n\t});\n\n\treturn comments.filter(\n\t\t(comment) => !skipped.some(([start, end]) => comment.start >= start && comment.end <= end),\n\t);\n}\n","import type { Printer } from 'prettier';\nimport { printers } from 'prettier/plugins/estree';\n\nexport const estree = (printers as Record<string, Printer>).estree as Printer & {\n\tprint: (path: unknown, options: unknown, print: unknown, args?: unknown) => unknown;\n\tembed: (path: unknown, options: unknown) => unknown;\n\tgetVisitorKeys: (node: unknown, nonTraversableKeys: Set<string>) => string[];\n};\n","import type { AstPath, Doc, ParserOptions } from 'prettier';\nimport { doc } from 'prettier';\nimport type { AstroNode } from '../ast';\nimport { type Separator, separatorFor } from '../whitespace';\n\nconst { fill, group, hardline, indent, line, softline } = doc.builders;\n\nconst leadingWhitespace = /^[\\t\\n\\f\\r ]+/;\nconst trailingWhitespace = /[\\t\\n\\f\\r ]+$/;\nconst whitespaceRun = /[\\t\\n\\f\\r ]+/;\n\ntype PrintFn = (selector?: string | number | (string | number)[]) => Doc;\ntype ChildIterator = (callback: (child: AstPath<AstroNode>) => void, key: string) => void;\n\ninterface Item {\n\tnode: AstroNode;\n\twords: string[] | null;\n\tdoc: Doc;\n}\n\nfunction docFor(separator: Separator): Doc | null {\n\tswitch (separator) {\n\t\tcase 'none':\n\t\t\treturn null;\n\t\tcase 'soft':\n\t\t\treturn softline;\n\t\tcase 'space':\n\t\t\treturn line;\n\t\tcase 'break':\n\t\t\treturn hardline;\n\t\tcase 'blank':\n\t\t\treturn [hardline, hardline];\n\t}\n}\n\n/** Runs alternate with items: `runs[i]` is the whitespace before `items[i]`, `runs[n]` the trailing. */\nfunction collect(children: AstroNode[], docs: Doc[]): { items: Item[]; runs: string[] } {\n\tconst items: Item[] = [];\n\tconst runs: string[] = [];\n\tlet pending = '';\n\n\tfor (const [index, child] of children.entries()) {\n\t\tif (child.type !== 'JSXText') {\n\t\t\truns.push(pending);\n\t\t\titems.push({ node: child, words: null, doc: docs[index] });\n\t\t\tpending = '';\n\t\t\tcontinue;\n\t\t}\n\t\tconst raw = String(child.raw ?? '');\n\t\tif (raw.trim() === '') {\n\t\t\tpending += raw;\n\t\t\tcontinue;\n\t\t}\n\t\tconst lead = leadingWhitespace.exec(raw)?.[0] ?? '';\n\t\tconst trail = trailingWhitespace.exec(raw)?.[0] ?? '';\n\t\truns.push(pending + lead);\n\t\titems.push({\n\t\t\tnode: child,\n\t\t\twords: raw.slice(lead.length, raw.length - trail.length).split(whitespaceRun),\n\t\t\tdoc: '',\n\t\t});\n\t\tpending = trail;\n\t}\n\n\truns.push(pending);\n\treturn { items, runs };\n}\n\nexport function printChildren(\n\tpath: AstPath<AstroNode>,\n\toptions: ParserOptions,\n\tprint: PrintFn,\n): Doc {\n\tconst container = path.node;\n\tconst docs: Doc[] = [];\n\t(path as AstPath<AstroNode> & { each: ChildIterator }).each((child) => {\n\t\tdocs.push(child.node.type === 'JSXText' ? '' : print());\n\t}, 'astroChildren');\n\n\tconst { items, runs } = collect(container.astroChildren as AstroNode[], docs);\n\t// `resolveBlankContainers` already decided whether whitespace-only content survives.\n\tif (items.length === 0) return runs[0] === '' ? '' : ' ';\n\n\tconst isRoot = container.astroRoot === true;\n\tconst settings = {\n\t\tmode: options.astroCompressHTML,\n\t\tsensitivity: options.htmlWhitespaceSensitivity,\n\t};\n\tconst separatorAt = (index: number, edge: boolean) =>\n\t\tdocFor(\n\t\t\tseparatorFor(\n\t\t\t\truns[index],\n\t\t\t\t{\n\t\t\t\t\tcontainer,\n\t\t\t\t\tprev: items[index - 1]?.node ?? null,\n\t\t\t\t\tnext: items[index]?.node ?? null,\n\t\t\t\t\tisRoot,\n\t\t\t\t\tloneChild: false,\n\t\t\t\t\tedge,\n\t\t\t\t},\n\t\t\t\tsettings,\n\t\t\t),\n\t\t);\n\n\tconst parts: Doc[] = [''];\n\tconst append = (content: Doc) => parts.push([parts.pop()!, content]);\n\tconst separate = (separator: Doc | null) => {\n\t\tif (separator !== null) parts.push(separator, '');\n\t};\n\n\tfor (const [position, item] of items.entries()) {\n\t\tif (position > 0) separate(separatorAt(position, false));\n\t\tif (item.words === null) {\n\t\t\tappend(item.doc);\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const [wordPosition, word] of item.words.entries()) {\n\t\t\tif (wordPosition > 0) separate(line);\n\t\t\tappend(word);\n\t\t}\n\t}\n\n\tconst body = fill(parts);\n\tif (isRoot) return body;\n\treturn group([indent([separatorAt(0, true) ?? '', body]), separatorAt(items.length, true) ?? '']);\n}\n","import type { AstPath, BuiltInParserName, Doc, Options, ParserOptions } from 'prettier';\nimport { doc } from 'prettier';\nimport { SassFormatter, type SassFormatterConfig } from 'sass-formatter';\nimport { type AstroNode, attributeStringValue, attributesOf, tagNameOf } from '../ast';\nimport { estree } from '../estree';\nimport { opensRawSubtree } from '../whitespace';\nimport { manualDedent } from './utils';\n\nconst { group, hardline, indent, join } = doc.builders;\nconst { replaceEndOfLine } = doc.utils;\n\ntype TextToDoc = (text: string, options: Options) => Promise<Doc>;\ntype PrintFn = (selector?: string | number | (string | number)[]) => Doc;\n\nconst styleParsers: Record<string, BuiltInParserName> = {\n\tcss: 'css',\n\tscss: 'scss',\n\tless: 'less',\n};\n\n// Prettier swallows every error thrown inside `embed` unless this is set, leaving a useless message.\nasync function surfacingErrors(textToDoc: TextToDoc, text: string, options: Options) {\n\ttry {\n\t\treturn await textToDoc(text, options);\n\t} catch (error) {\n\t\tprocess.env.PRETTIER_DEBUG = 'true';\n\t\tthrow error;\n\t}\n}\n\n// Adapted from: https://github.com/prettier/prettier/blob/main/src/language-html/utils/index.js\nfunction inferParserByTypeAttribute(type: string | null): BuiltInParserName {\n\tswitch (type) {\n\t\tcase null:\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\t\tcase 'application/x-typescript':\n\t\t\treturn 'babel-ts';\n\t\tcase 'text/markdown':\n\t\t\treturn 'markdown';\n\t\tcase 'text/html':\n\t\t\treturn 'html';\n\t\tcase 'text/x-handlebars-template':\n\t\t\treturn 'glimmer';\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\nfunction inferScriptParser(node: AstroNode): BuiltInParserName {\n\t// Astro only processes scripts carrying no attribute other than `src`, and those are TypeScript.\n\tconst processed = attributesOf(node).every(\n\t\t(attribute) =>\n\t\t\tattribute.type === 'JSXAttribute' && (attribute.name as AstroNode).name === 'src',\n\t);\n\tif (processed) return 'babel-ts';\n\treturn inferParserByTypeAttribute(attributeStringValue(node, 'type'));\n}\n\nfunction contentOf(node: AstroNode, options: ParserOptions): string {\n\tconst start = (node.openingElement as AstroNode).end;\n\tconst end = (node.closingElement as AstroNode | null)?.start ?? node.end;\n\treturn options.originalText.slice(start, end);\n}\n\nfunction wrapContent(print: PrintFn, content: Doc, isEmpty: boolean): Doc {\n\treturn [\n\t\tprint('openingElement'),\n\t\tindent([isEmpty ? '' : hardline, content]),\n\t\tisEmpty ? '' : hardline,\n\t\tprint('closingElement'),\n\t];\n}\n\nfunction embedSass(source: string, options: ParserOptions): Doc {\n\tconst sassOptions: Partial<SassFormatterConfig> = {\n\t\ttabSize: options.tabWidth,\n\t\tinsertSpaces: !options.useTabs,\n\t\tlineEnding: options.endOfLine.toUpperCase() === 'CRLF' ? 'CRLF' : 'LF',\n\t};\n\tconst { result } = manualDedent(source);\n\treturn join(hardline, SassFormatter.Format(result, sassOptions).trim().split('\\n'));\n}\n\nexport function embed(path: AstPath<AstroNode>, options: ParserOptions) {\n\tconst node = path.node;\n\tif (node.astroIgnored) return undefined;\n\n\tif (node.type === 'AstroFrontmatter') {\n\t\tif (node.end === 0 || options.astroSkipFrontmatter) return undefined;\n\t\t// `Program.start` skips leading comments and `node.start` includes preceding whitespace.\n\t\tconst fence = options.originalText.indexOf('---', node.start);\n\t\tconst source = options.originalText.slice(fence + 3, node.end - 3);\n\t\tif (!source.trim()) return undefined;\n\t\treturn async (textToDoc: TextToDoc) => [\n\t\t\t'---',\n\t\t\thardline,\n\t\t\tawait surfacingErrors(textToDoc, source, { ...options, parser: 'babel-ts' }),\n\t\t\thardline,\n\t\t\t'---',\n\t\t];\n\t}\n\n\tif (node.type !== 'JSXElement') return estree.embed(path, options);\n\tconst tag = tagNameOf(node);\n\tif (tag === null || !node.closingElement) return estree.embed(path, options);\n\n\tconst source = contentOf(node, options);\n\tconst isEmpty = source.trim() === '';\n\n\tif (tag === 'script') {\n\t\tif (isEmpty) return estree.embed(path, options);\n\t\tconst parser = inferScriptParser(node);\n\t\treturn async (textToDoc: TextToDoc, print: PrintFn) =>\n\t\t\twrapContent(print, await surfacingErrors(textToDoc, source, { ...options, parser }), false);\n\t}\n\n\tif (tag === 'style') {\n\t\tif (isEmpty) return estree.embed(path, options);\n\t\tconst lang = attributeStringValue(node, 'lang')?.toLowerCase() ?? 'css';\n\t\tif (lang === 'sass') {\n\t\t\treturn (_textToDoc: TextToDoc, print: PrintFn) =>\n\t\t\t\twrapContent(print, embedSass(source, options), false);\n\t\t}\n\t\tconst parser = styleParsers[lang];\n\t\tif (!parser) return printVerbatim(source);\n\t\treturn async (textToDoc: TextToDoc, print: PrintFn) =>\n\t\t\twrapContent(print, await surfacingErrors(textToDoc, source, { ...options, parser }), false);\n\t}\n\n\tif (opensRawSubtree(node)) {\n\t\treturn (_textToDoc: TextToDoc, print: PrintFn) => [\n\t\t\tprint('openingElement'),\n\t\t\treplaceEndOfLine(source),\n\t\t\tprint('closingElement'),\n\t\t];\n\t}\n\n\treturn estree.embed(path, options);\n}\n\nfunction printVerbatim(source: string) {\n\treturn (_textToDoc: TextToDoc, print: PrintFn) =>\n\t\tgroup([print('openingElement'), replaceEndOfLine(source), print('closingElement')]);\n}\n","import type { AstPath, Doc, ParserOptions } from 'prettier';\nimport { doc } from 'prettier';\nimport { type AstroNode, astroVisitorKeys, ownChildren, synthetic } from '../ast';\nimport { estree } from '../estree';\nimport { opensRawSubtree } from '../whitespace';\nimport { printChildren } from './children';\nimport { embed } from './embed';\n\nconst { hardline } = doc.builders;\nconst { replaceEndOfLine } = doc.utils;\n\ntype PrintFn = (selector?: string | number | (string | number)[]) => Doc;\n\nfunction printDoctype(value: string): string {\n\tconst trimmed = value.trim();\n\tconst space = trimmed.search(/\\s/);\n\tconst name = space === -1 ? trimmed : trimmed.slice(0, space);\n\tconst rest = space === -1 ? '' : trimmed.slice(space);\n\treturn `<!doctype ${name.toLowerCase()}${rest}>`;\n}\n\nfunction printAstroNode(path: AstPath<AstroNode>, options: ParserOptions, print: PrintFn): Doc {\n\tconst node = path.node;\n\tswitch (node.type) {\n\t\tcase 'AstroRoot': {\n\t\t\tconst template = node.template as AstroNode;\n\t\t\tconst hasTemplate = ((template.node as AstroNode).children as AstroNode[]).length > 0;\n\t\t\tconst parts: Doc[] = [];\n\t\t\tif ((node.frontmatter as AstroNode).end > 0) {\n\t\t\t\tparts.push(print('frontmatter'));\n\t\t\t\tif (hasTemplate) parts.push(hardline, hardline);\n\t\t\t}\n\t\t\tif (hasTemplate) parts.push(print('template'));\n\t\t\treturn [parts, hardline];\n\t\t}\n\t\tcase 'AstroFrontmatter': {\n\t\t\tconst body = (node.program as AstroNode).body as unknown[];\n\t\t\tif (options.astroSkipFrontmatter) {\n\t\t\t\tconst fence = options.originalText.indexOf('---', node.start);\n\t\t\t\treturn replaceEndOfLine(options.originalText.slice(fence, node.end));\n\t\t\t}\n\t\t\treturn body.length > 0\n\t\t\t\t? ['---', hardline, print('program'), '---']\n\t\t\t\t: ['---', hardline, '---'];\n\t\t}\n\t\tcase 'AstroScript':\n\t\t\treturn ((node.program as AstroNode).body as unknown[]).length > 0 ? print('program') : '';\n\t\tcase 'AstroDoctype':\n\t\t\treturn printDoctype(node.value as string);\n\t\tcase 'AstroComment':\n\t\t\treturn `<!--${node.value as string}-->`;\n\t\tdefault:\n\t\t\treturn '';\n\t}\n}\n\nfunction printAttribute(\n\tpath: AstPath<AstroNode>,\n\toptions: ParserOptions,\n\tprint: PrintFn,\n): Doc | null {\n\tconst node = path.node;\n\tconst name = (node.name as AstroNode).name as string;\n\tconst value = node.value as AstroNode | null;\n\n\tif (node.astroShorthand) return ['{', print(['value', 'expression']), '}'];\n\n\tif (node.astroBacktick) return [name, '=', print(['value', 'expression'])];\n\n\tconst expression =\n\t\tvalue?.type === 'JSXExpressionContainer' ? (value.expression as AstroNode) : null;\n\tif (\n\t\toptions.astroAllowShorthand &&\n\t\texpression?.type === 'Identifier' &&\n\t\texpression.name === name\n\t) {\n\t\treturn ['{', print(['value', 'expression']), '}'];\n\t}\n\n\treturn null;\n}\n\n// No doc builder can cancel an indent nested inside a doc, so the root fragment's must be cut out.\nfunction unwrapFragmentIndent(printed: Doc): Doc {\n\tconst group = printed as { type?: string; contents?: Doc; expandedStates?: Doc[] };\n\tif (group.type !== 'group') return printed;\n\tif (group.expandedStates) {\n\t\tconst states = group.expandedStates.map(unwrapFragmentIndent);\n\t\treturn { ...group, contents: states[0], expandedStates: states } as Doc;\n\t}\n\tconst parts = group.contents as Doc[];\n\tif (!Array.isArray(parts) || parts.length !== 4) return printed;\n\tconst indented = parts[1] as { type?: string; contents?: Doc[] };\n\tif (indented.type !== 'indent' || !indented.contents) return printed;\n\treturn indented.contents[1];\n}\n\nexport const printer = {\n\t...estree,\n\tembed,\n\tgetVisitorKeys(node: AstroNode, nonTraversableKeys: Set<string>): string[] {\n\t\tconst keys = astroVisitorKeys[node.type] ?? estree.getVisitorKeys(node, nonTraversableKeys);\n\t\treturn node.astroChildren\n\t\t\t? keys.map((key) => (key === 'children' ? 'astroChildren' : key))\n\t\t\t: keys;\n\t},\n\tprint(path: AstPath<AstroNode>, options: ParserOptions, print: PrintFn, args?: unknown): Doc {\n\t\tconst node = path.node;\n\t\tif (node[ownChildren]) return path.callParent(() => printChildren(path, options, print));\n\t\tif (node[synthetic]) return '';\n\t\tif (node.astroIgnored) {\n\t\t\treturn replaceEndOfLine(options.originalText.slice(node.start, node.end));\n\t\t}\n\t\tif (astroVisitorKeys[node.type]) return printAstroNode(path, options, print);\n\t\tif (node.type === 'JSXAttribute') {\n\t\t\tconst attribute = printAttribute(path, options, print);\n\t\t\tif (attribute) return attribute;\n\t\t}\n\t\t// Reached when `embeddedLanguageFormatting` is off; reflowing raw content would corrupt it.\n\t\tif (\n\t\t\tnode.type === 'JSXElement' &&\n\t\t\tnode.closingElement &&\n\t\t\t(node.children as AstroNode[]).length > 0 &&\n\t\t\topensRawSubtree(node)\n\t\t) {\n\t\t\tconst start = (node.openingElement as AstroNode).end;\n\t\t\tconst end = (node.closingElement as AstroNode).start;\n\t\t\treturn [\n\t\t\t\tprint('openingElement'),\n\t\t\t\treplaceEndOfLine(options.originalText.slice(start, end)),\n\t\t\t\tprint('closingElement'),\n\t\t\t];\n\t\t}\n\t\tconst printed = estree.print(path, options, print, args) as Doc;\n\t\tif ((node.openingFragment as AstroNode | undefined)?.[synthetic]) {\n\t\t\treturn unwrapFragmentIndent(printed);\n\t\t}\n\t\treturn printed;\n\t},\n};\n","import type { Parser, Printer, SupportLanguage } from 'prettier';\nimport type { AstroNode } from './ast';\nimport { options } from './options';\nimport { parse } from './parser';\nimport { printer } from './printer';\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,\n\t\tastFormat: 'astro',\n\t\tlocStart: (node: AstroNode) => node.start,\n\t\tlocEnd: (node: AstroNode) => node.end,\n\t},\n};\n\n// https://prettier.io/docs/en/plugins.html#printers\nexport const printers: Record<string, Printer> = {\n\t// Prettier types `print`'s callback as taking an `AstPath`, but it passes one taking a selector.\n\tastro: printer as unknown as Printer,\n};\n\nconst defaultOptions = {\n\ttabWidth: 2,\n};\n\nexport { defaultOptions, options };\n"],"names":["leadingWhitespace","trailingWhitespace","parseAstro","printers","group","hardline","indent","replaceEndOfLine"],"mappings":";;;;;AAgBO,MAAM,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;AACD,IAAA,oBAAoB,EAAE;AACrB,QAAA,QAAQ,EAAE,OAAO;AACjB,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,WAAW,EAAE,0CAA0C;AACvD,KAAA;AACD,IAAA,iBAAiB,EAAE;AAClB,QAAA,QAAQ,EAAE,OAAO;AACjB,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,OAAO,EAAE,KAAK;AACd,QAAA,WAAW,EACV,yGAAyG;AAC1G,QAAA,OAAO,EAAE;AACR,YAAA;AACC,gBAAA,KAAK,EAAE,KAAK;AACZ,gBAAA,WAAW,EACV,8GAA8G;AAC/G,aAAA;AACD,YAAA;AACC,gBAAA,KAAK,EAAE,MAAM;AACb,gBAAA,WAAW,EAAE,kEAAkE;AAC/E,aAAA;AACD,YAAA,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,mDAAmD,EAAE;AAEnF,YAAA,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAwD;AACvF,YAAA,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAwD;AACxF,SAAA;AACD,KAAA;;;AClDK,MAAM,SAAS,GAAkB,MAAM,CAAC,GAAG,CAAC,iCAAiC,CAAC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O,EAAE,KAAK,EAAE,IAAI,CAAQ;QAC/D,IAAK,IAAI,CAAC,eAAyC,GAAG,SAAS,CAAC,EAAE;AACjE,YAAA,OAAO,oBAAoB,CAAC,OAAO,CAAC;QACrC;AACA,QAAA,OAAO,OAAO;IACf,CAAC;CACD;;ACpIM,MAAM,SAAS,GAA+B;AACpD,IAAA;AACC,QAAA,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,CAAC,OAAO,CAAC;QAClB,UAAU,EAAE,CAAC,QAAQ,CAAC;QACtB,iBAAiB,EAAE,CAAC,OAAO,CAAC;AAC5B,KAAA;;AAIK,MAAM,OAAO,GAA2B;AAC9C,IAAA,KAAK,EAAE;QACN,KAAK;AACL,QAAA,SAAS,EAAE,OAAO;QAClB,QAAQ,EAAE,CAAC,IAAe,KAAK,IAAI,CAAC,KAAK;QACzC,MAAM,EAAE,CAAC,IAAe,KAAK,IAAI,CAAC,GAAG;AACrC,KAAA;;AAIK,MAAM,QAAQ,GAA4B;AAEhD,IAAA,KAAK,EAAE,OAA6B;;AAGrC,MAAM,cAAc,GAAG;AACtB,IAAA,QAAQ,EAAE,CAAC;;;;;"}
package/package.json CHANGED
@@ -1,66 +1,70 @@
1
1
  {
2
2
  "name": "prettier-plugin-astro",
3
- "version": "1.0.0-beta.0",
4
- "type": "module",
3
+ "version": "1.0.0-beta.1",
5
4
  "description": "A Prettier Plugin for formatting Astro files",
6
- "main": "dist/index.js",
7
- "files": [
8
- "dist/**",
9
- "workers/*"
10
- ],
11
- "engines": {
12
- "node": "^14.15.0 || >=16.0.0"
13
- },
14
- "packageManager": "pnpm@8.6.2",
15
- "homepage": "https://github.com/withastro/prettier-plugin-astro/",
16
- "issues": {
17
- "url": "https://github.com/withastro/prettier-plugin-astro/issues"
18
- },
19
- "license": "MIT",
20
5
  "keywords": [
21
6
  "prettier-plugin",
22
7
  "prettier",
23
8
  "astro",
24
9
  "formatter"
25
10
  ],
11
+ "homepage": "https://github.com/withastro/prettier-plugin-astro/",
12
+ "bugs": {
13
+ "url": "https://github.com/withastro/prettier-plugin-astro/issues"
14
+ },
26
15
  "repository": {
27
16
  "type": "git",
28
- "url": "https://github.com/withastro/prettier-plugin-astro.git"
17
+ "url": "git+https://github.com/withastro/prettier-plugin-astro.git"
29
18
  },
19
+ "license": "MIT",
20
+ "type": "module",
21
+ "main": "dist/index.js",
22
+ "files": [
23
+ "dist/**"
24
+ ],
30
25
  "dependencies": {
31
26
  "@astrojs/compiler-rs": "^0.4.0",
32
- "sass-formatter": "^0.7.6"
27
+ "sass-formatter": "^0.8.0"
28
+ },
29
+ "devDependencies": {
30
+ "@biomejs/biome": "2.5.8",
31
+ "@changesets/cli": "^3.0.0",
32
+ "@rollup/plugin-commonjs": "^29.0.3",
33
+ "@rollup/plugin-typescript": "^12.3.0",
34
+ "@types/node": "^26.2.0",
35
+ "@vitest/ui": "^4.1.10",
36
+ "eslint": "^10.8.1",
37
+ "eslint-plugin-regexp": "^3.2.0",
38
+ "prettier": "3.9.6",
39
+ "rollup": "^4.62.4",
40
+ "tslib": "^2.8.1",
41
+ "typescript": "~6.0.3",
42
+ "typescript-eslint": "^8.67.0",
43
+ "vite": "^8.2.1",
44
+ "vitest": "^4.1.10"
33
45
  },
34
46
  "peerDependencies": {
35
47
  "prettier": "^3.5.3"
36
48
  },
37
- "devDependencies": {
38
- "@biomejs/biome": "1.8.1",
39
- "prettier": "3.5.3",
40
- "@changesets/cli": "^2.26.1",
41
- "@rollup/plugin-commonjs": "^25.0.0",
42
- "@rollup/plugin-typescript": "^11.1.1",
43
- "@types/node": "^20.2.5",
44
- "@vitest/ui": "^0.31.3",
45
- "eslint": "^9.8.0",
46
- "eslint-plugin-prettier-doc": "^1.1.0",
47
- "eslint-plugin-regexp": "^2.6.0",
48
- "rollup": "^3.23.0",
49
- "tslib": "^2.5.2",
50
- "typescript": "^5.5.4",
51
- "typescript-eslint": "^8.0.1",
52
- "vite": "^4.4.3",
53
- "vitest": "^0.31.3"
49
+ "engines": {
50
+ "node": ">=22.12.0"
54
51
  },
55
52
  "scripts": {
56
53
  "build": "rollup -c",
57
54
  "dev": "rollup -c -w",
55
+ "format": "pnpm run format:code && pnpm run format:imports",
56
+ "format:ci": "pnpm run format:code:ci && pnpm run format:imports:ci",
57
+ "format:code": "biome format --write",
58
+ "format:code:ci": "biome format",
59
+ "format:imports": "biome check --formatter-enabled=false --write",
60
+ "format:imports:ci": "biome ci --formatter-enabled=false",
61
+ "lint": "biome lint && eslint --cache",
62
+ "lint:ci": "biome ci --formatter-enabled=false --enforce-assist=false --reporter=github && eslint --cache",
63
+ "lint:fix": "biome lint --write --unsafe && eslint --cache --fix",
64
+ "release": "pnpm build && changeset publish",
58
65
  "test": "vitest run",
59
- "test:watch": "vitest -w",
60
66
  "test:ui": "vitest --ui",
61
- "lint": "eslint .",
62
- "lint:fix": "pnpm lint --fix",
63
- "format": "biome format --write",
64
- "release": "pnpm build && changeset publish"
67
+ "test:watch": "vitest -w",
68
+ "typecheck": "tsc --noEmit"
65
69
  }
66
70
  }