From a13dacbb17f44b3f5b7715628d7bf4c243ab1125 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Fri, 1 May 2026 20:54:45 +0200 Subject: [PATCH 01/50] feat: astro2tsx with biome --- crates/astro2tsx/Cargo.toml | 37 + crates/astro2tsx/build.rs | 3 + crates/astro2tsx/index.d.ts | 68 + crates/astro2tsx/index.js | 584 +++++++++ crates/astro2tsx/package.json | 43 + crates/astro2tsx/src/frontmatter.rs | 96 ++ crates/astro2tsx/src/lib.rs | 84 ++ crates/astro2tsx/src/napi.rs | 124 ++ crates/astro2tsx/src/printer.rs | 150 +++ crates/astro2tsx/src/props.rs | 368 ++++++ crates/astro2tsx/src/render.rs | 1401 +++++++++++++++++++++ crates/astro2tsx/src/sourcemap.rs | 66 + crates/astro2tsx/src/utils.rs | 280 ++++ crates/astro2tsx/test/astro2tsx.test.ts | 50 + crates/astro2tsx/tests/corpus/tsx.jsonl | 81 ++ crates/astro2tsx/tests/fixtures.rs | 148 +++ crates/astro2tsx/tests/upstream_corpus.rs | 174 +++ pnpm-lock.yaml | 9 + pnpm-workspace.yaml | 1 + 19 files changed, 3767 insertions(+) create mode 100644 crates/astro2tsx/Cargo.toml create mode 100644 crates/astro2tsx/build.rs create mode 100644 crates/astro2tsx/index.d.ts create mode 100644 crates/astro2tsx/index.js create mode 100644 crates/astro2tsx/package.json create mode 100644 crates/astro2tsx/src/frontmatter.rs create mode 100644 crates/astro2tsx/src/lib.rs create mode 100644 crates/astro2tsx/src/napi.rs create mode 100644 crates/astro2tsx/src/printer.rs create mode 100644 crates/astro2tsx/src/props.rs create mode 100644 crates/astro2tsx/src/render.rs create mode 100644 crates/astro2tsx/src/sourcemap.rs create mode 100644 crates/astro2tsx/src/utils.rs create mode 100644 crates/astro2tsx/test/astro2tsx.test.ts create mode 100644 crates/astro2tsx/tests/corpus/tsx.jsonl create mode 100644 crates/astro2tsx/tests/fixtures.rs create mode 100644 crates/astro2tsx/tests/upstream_corpus.rs diff --git a/crates/astro2tsx/Cargo.toml b/crates/astro2tsx/Cargo.toml new file mode 100644 index 00000000..d72b211d --- /dev/null +++ b/crates/astro2tsx/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "astro2tsx" +version = "0.1.0" +authors.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true +rust-version.workspace = true +publish = false +description = "Converts .astro files to .tsx for tsserver intellisense, using Biome's HTML CST" + +[lib] +crate-type = ["cdylib", "lib"] +test = true +doctest = false + +# Path deps into a sibling Biome checkout. Cargo follows the path into +# Biome's own workspace, so the `workspace = true` deps inside each +# Biome crate resolve from `../../../biome/Cargo.toml`. Switch to git +# deps once the Astro-specific lexer changes (template-literal attribute +# values) land in a published Biome version. +[dependencies] +biome_html_parser = { path = "../../../biome/crates/biome_html_parser" } +biome_html_syntax = { path = "../../../biome/crates/biome_html_syntax" } +biome_js_parser = { path = "../../../biome/crates/biome_js_parser" } +biome_js_syntax = { path = "../../../biome/crates/biome_js_syntax" } +biome_rowan = { path = "../../../biome/crates/biome_rowan" } + +napi = { workspace = true } +napi-derive = { workspace = true } + +[dev-dependencies] +serde = { version = "1", features = ["derive"] } +serde_json = "1" + +[build-dependencies] +napi-build = { workspace = true } diff --git a/crates/astro2tsx/build.rs b/crates/astro2tsx/build.rs new file mode 100644 index 00000000..0f1b0100 --- /dev/null +++ b/crates/astro2tsx/build.rs @@ -0,0 +1,3 @@ +fn main() { + napi_build::setup(); +} diff --git a/crates/astro2tsx/index.d.ts b/crates/astro2tsx/index.d.ts new file mode 100644 index 00000000..219d87f7 --- /dev/null +++ b/crates/astro2tsx/index.d.ts @@ -0,0 +1,68 @@ +/* auto-generated by NAPI-RS */ +/* eslint-disable */ +/** + * Convert an Astro source file to TSX for tsserver intellisense. + * + * The conversion is error-tolerant: malformed input produces a + * best-effort TSX output rather than throwing, and `hasParseErrors` is + * set to `true` when the parser surfaced one or more diagnostics. + */ +export declare function convertToTsx(source: string, options?: ConvertToTsxOptions | undefined | null): ConvertToTsxResult + +/** Options recognised by `convertToTsx`. */ +export interface ConvertToTsxOptions { + /** + * Filename used to derive the default-exported component identifier + * (e.g. `MyPage.astro` produces `MyPage__AstroComponent_`). Optional. + */ + filename?: string +} + +/** Result of converting an Astro source to TSX. */ +export interface ConvertToTsxResult { + code: string + mappings: Array + frontmatter: GeneratedRange + body: GeneratedRange + scripts: Array + styles: Array + hasParseErrors: boolean +} + +export interface ExtractedTag { + range: GeneratedRange + kind: ExtractedTagKind + content: string + lang?: string +} + +export declare const enum ExtractedTagKind { + Script = 'Script', + Style = 'Style', + StyleAttribute = 'StyleAttribute', + EventAttribute = 'EventAttribute' +} + +/** + * Byte range inside the generated TSX. Used to mark the frontmatter + * section, the body section, and each extracted script / style block. + */ +export interface GeneratedRange { + start: number + end: number +} + +/** + * Per-byte source-position mapping. JS consumers can iterate this list + * to build a VLQ-encoded sourcemap or to translate offsets between the + * emitted TSX and the original `.astro` source. + */ +export interface Mapping { + /** Byte offset into the generated TSX. */ + generated: number + /** + * Byte offset into the original `.astro` source. `None` for synthetic + * content (e.g. the `` wrapping or the prefix comment). + */ + original?: number +} diff --git a/crates/astro2tsx/index.js b/crates/astro2tsx/index.js new file mode 100644 index 00000000..148b96da --- /dev/null +++ b/crates/astro2tsx/index.js @@ -0,0 +1,584 @@ +// prettier-ignore +/* eslint-disable */ +// @ts-nocheck +/* auto-generated by NAPI-RS */ + +import { createRequire } from 'node:module' +const require = createRequire(import.meta.url) +const __dirname = new URL('.', import.meta.url).pathname + +const { readFileSync } = require('node:fs') +let nativeBinding = null +const loadErrors = [] + +const isMusl = () => { + let musl = false + if (process.platform === 'linux') { + musl = isMuslFromFilesystem() + if (musl === null) { + musl = isMuslFromReport() + } + if (musl === null) { + musl = isMuslFromChildProcess() + } + } + return musl +} + +const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-') + +const isMuslFromFilesystem = () => { + try { + return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl') + } catch { + return null + } +} + +const isMuslFromReport = () => { + let report = null + if (typeof process.report?.getReport === 'function') { + process.report.excludeNetwork = true + report = process.report.getReport() + } + if (!report) { + return null + } + if (report.header && report.header.glibcVersionRuntime) { + return false + } + if (Array.isArray(report.sharedObjects)) { + if (report.sharedObjects.some(isFileMusl)) { + return true + } + } + return false +} + +const isMuslFromChildProcess = () => { + try { + return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl') + } catch (e) { + // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false + return false + } +} + +function requireNative() { + if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) { + try { + return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH); + } catch (err) { + loadErrors.push(err) + } + } else if (process.platform === 'android') { + if (process.arch === 'arm64') { + try { + return require('./astro2tsx.android-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-android-arm64') + const bindingPackageVersion = require('@astrojs/astro2tsx-android-arm64/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm') { + try { + return require('./astro2tsx.android-arm-eabi.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-android-arm-eabi') + const bindingPackageVersion = require('@astrojs/astro2tsx-android-arm-eabi/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`)) + } + } else if (process.platform === 'win32') { + if (process.arch === 'x64') { + if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') { + try { + return require('./astro2tsx.win32-x64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-win32-x64-gnu') + const bindingPackageVersion = require('@astrojs/astro2tsx-win32-x64-gnu/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./astro2tsx.win32-x64-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-win32-x64-msvc') + const bindingPackageVersion = require('@astrojs/astro2tsx-win32-x64-msvc/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'ia32') { + try { + return require('./astro2tsx.win32-ia32-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-win32-ia32-msvc') + const bindingPackageVersion = require('@astrojs/astro2tsx-win32-ia32-msvc/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm64') { + try { + return require('./astro2tsx.win32-arm64-msvc.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-win32-arm64-msvc') + const bindingPackageVersion = require('@astrojs/astro2tsx-win32-arm64-msvc/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`)) + } + } else if (process.platform === 'darwin') { + try { + return require('./astro2tsx.darwin-universal.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-darwin-universal') + const bindingPackageVersion = require('@astrojs/astro2tsx-darwin-universal/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + if (process.arch === 'x64') { + try { + return require('./astro2tsx.darwin-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-darwin-x64') + const bindingPackageVersion = require('@astrojs/astro2tsx-darwin-x64/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm64') { + try { + return require('./astro2tsx.darwin-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-darwin-arm64') + const bindingPackageVersion = require('@astrojs/astro2tsx-darwin-arm64/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`)) + } + } else if (process.platform === 'freebsd') { + if (process.arch === 'x64') { + try { + return require('./astro2tsx.freebsd-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-freebsd-x64') + const bindingPackageVersion = require('@astrojs/astro2tsx-freebsd-x64/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm64') { + try { + return require('./astro2tsx.freebsd-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-freebsd-arm64') + const bindingPackageVersion = require('@astrojs/astro2tsx-freebsd-arm64/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`)) + } + } else if (process.platform === 'linux') { + if (process.arch === 'x64') { + if (isMusl()) { + try { + return require('./astro2tsx.linux-x64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-linux-x64-musl') + const bindingPackageVersion = require('@astrojs/astro2tsx-linux-x64-musl/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./astro2tsx.linux-x64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-linux-x64-gnu') + const bindingPackageVersion = require('@astrojs/astro2tsx-linux-x64-gnu/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'arm64') { + if (isMusl()) { + try { + return require('./astro2tsx.linux-arm64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-linux-arm64-musl') + const bindingPackageVersion = require('@astrojs/astro2tsx-linux-arm64-musl/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./astro2tsx.linux-arm64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-linux-arm64-gnu') + const bindingPackageVersion = require('@astrojs/astro2tsx-linux-arm64-gnu/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'arm') { + if (isMusl()) { + try { + return require('./astro2tsx.linux-arm-musleabihf.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-linux-arm-musleabihf') + const bindingPackageVersion = require('@astrojs/astro2tsx-linux-arm-musleabihf/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./astro2tsx.linux-arm-gnueabihf.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-linux-arm-gnueabihf') + const bindingPackageVersion = require('@astrojs/astro2tsx-linux-arm-gnueabihf/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'loong64') { + if (isMusl()) { + try { + return require('./astro2tsx.linux-loong64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-linux-loong64-musl') + const bindingPackageVersion = require('@astrojs/astro2tsx-linux-loong64-musl/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./astro2tsx.linux-loong64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-linux-loong64-gnu') + const bindingPackageVersion = require('@astrojs/astro2tsx-linux-loong64-gnu/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'riscv64') { + if (isMusl()) { + try { + return require('./astro2tsx.linux-riscv64-musl.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-linux-riscv64-musl') + const bindingPackageVersion = require('@astrojs/astro2tsx-linux-riscv64-musl/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + try { + return require('./astro2tsx.linux-riscv64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-linux-riscv64-gnu') + const bindingPackageVersion = require('@astrojs/astro2tsx-linux-riscv64-gnu/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } + } else if (process.arch === 'ppc64') { + try { + return require('./astro2tsx.linux-ppc64-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-linux-ppc64-gnu') + const bindingPackageVersion = require('@astrojs/astro2tsx-linux-ppc64-gnu/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 's390x') { + try { + return require('./astro2tsx.linux-s390x-gnu.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-linux-s390x-gnu') + const bindingPackageVersion = require('@astrojs/astro2tsx-linux-s390x-gnu/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`)) + } + } else if (process.platform === 'openharmony') { + if (process.arch === 'arm64') { + try { + return require('./astro2tsx.openharmony-arm64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-openharmony-arm64') + const bindingPackageVersion = require('@astrojs/astro2tsx-openharmony-arm64/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'x64') { + try { + return require('./astro2tsx.openharmony-x64.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-openharmony-x64') + const bindingPackageVersion = require('@astrojs/astro2tsx-openharmony-x64/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else if (process.arch === 'arm') { + try { + return require('./astro2tsx.openharmony-arm.node') + } catch (e) { + loadErrors.push(e) + } + try { + const binding = require('@astrojs/astro2tsx-openharmony-arm') + const bindingPackageVersion = require('@astrojs/astro2tsx-openharmony-arm/package.json').version + if (bindingPackageVersion !== '0.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { + throw new Error(`Native binding package version mismatch, expected 0.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) + } + return binding + } catch (e) { + loadErrors.push(e) + } + } else { + loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`)) + } + } else { + loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`)) + } +} + +nativeBinding = requireNative() + +if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { + let wasiBinding = null + let wasiBindingError = null + try { + wasiBinding = require('./astro2tsx.wasi.cjs') + nativeBinding = wasiBinding + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + wasiBindingError = err + } + } + if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { + try { + wasiBinding = require('@astrojs/astro2tsx-wasm32-wasi') + nativeBinding = wasiBinding + } catch (err) { + if (process.env.NAPI_RS_FORCE_WASI) { + if (!wasiBindingError) { + wasiBindingError = err + } else { + wasiBindingError.cause = err + } + loadErrors.push(err) + } + } + } + if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) { + const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error') + error.cause = wasiBindingError + throw error + } +} + +if (!nativeBinding) { + if (loadErrors.length > 0) { + throw new Error( + `Cannot find native binding. ` + + `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` + + 'Please try `npm i` again after removing both package-lock.json and node_modules directory.', + { + cause: loadErrors.reduce((err, cur) => { + cur.cause = err + return cur + }), + }, + ) + } + throw new Error(`Failed to load native binding`) +} + +const { convertToTsx, ExtractedTagKind } = nativeBinding +export { convertToTsx } +export { ExtractedTagKind } diff --git a/crates/astro2tsx/package.json b/crates/astro2tsx/package.json new file mode 100644 index 00000000..923d3d00 --- /dev/null +++ b/crates/astro2tsx/package.json @@ -0,0 +1,43 @@ +{ + "name": "@astrojs/astro2tsx", + "version": "0.1.0", + "description": "Convert .astro files to TSX for tsserver intellisense", + "keywords": ["astro", "tsx", "intellisense", "language-server"], + "license": "MIT", + "type": "module", + "main": "index.js", + "files": ["index.d.ts", "index.js"], + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, + "scripts": { + "artifacts": "napi artifacts", + "build-dev": "napi build --esm --platform", + "build": "napi build --esm --platform --release", + "prepublishOnly": "napi prepublish -t npm", + "test": "node --import tsx --test ./test/*.test.ts", + "version": "napi version" + }, + "devDependencies": { + "@napi-rs/cli": "^3", + "@types/node": "^22" + }, + "napi": { + "binaryName": "astro2tsx", + "packageName": "@astrojs/astro2tsx", + "targets": [ + "aarch64-apple-darwin", + "aarch64-pc-windows-msvc", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "x86_64-apple-darwin", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl" + ] + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } +} diff --git a/crates/astro2tsx/src/frontmatter.rs b/crates/astro2tsx/src/frontmatter.rs new file mode 100644 index 00000000..819f951d --- /dev/null +++ b/crates/astro2tsx/src/frontmatter.rs @@ -0,0 +1,96 @@ +//! Frontmatter post-processing: rewrites top-level `return` statements +//! into `throw ` so the generated TSX type-checks. Astro frontmatter runs +//! inside an implicit function at runtime, so top-level returns are valid +//! Astro syntax — but TS rejects them at the module level. +//! +//! The upstream Go printer keeps the byte count stable by emitting `throw ` +//! (with an extra trailing space) in place of `return` (six chars). We do +//! the same so source-mapping into the modified frontmatter remains +//! aligned with the original file. + +use biome_js_parser::{JsParserOptions, parse}; +use biome_js_syntax::{AnyJsRoot, JsFileSource, JsReturnStatement, JsSyntaxKind}; +use biome_rowan::{AstNode, WalkEvent}; + +/// Returns the byte offsets (relative to `source`) of every `return` +/// keyword that sits at module scope. Offsets address the start of the +/// keyword, ready for substitution. +pub(crate) fn find_top_level_returns(source: &str) -> Vec { + // Use the Astro embedding kind so top-level `return` keywords are + // accepted as valid syntax (Astro frontmatter runs inside a generated + // function at runtime). + let parse = parse(source, JsFileSource::astro(), JsParserOptions::default()); + let root: AnyJsRoot = parse.tree(); + let syntax = root.syntax().clone(); + + let mut offsets = Vec::new(); + let mut function_depth: u32 = 0; + + // Walk pre-order, incrementing on entering a function-like body and + // decrementing on leaving it. Top-level returns are nodes encountered + // at function_depth == 0. + for event in syntax.preorder() { + match event { + WalkEvent::Enter(node) => { + if is_function_like(node.kind()) { + function_depth += 1; + } else if function_depth == 0 && node.kind() == JsSyntaxKind::JS_RETURN_STATEMENT { + if let Some(stmt) = JsReturnStatement::cast(node) + && let Ok(token) = stmt.return_token() + { + offsets.push(u32::from(token.text_trimmed_range().start())); + } + } + } + WalkEvent::Leave(node) => { + if is_function_like(node.kind()) { + function_depth = function_depth.saturating_sub(1); + } + } + } + } + offsets +} + +fn is_function_like(kind: JsSyntaxKind) -> bool { + matches!( + kind, + JsSyntaxKind::JS_FUNCTION_DECLARATION + | JsSyntaxKind::JS_FUNCTION_EXPRESSION + | JsSyntaxKind::JS_ARROW_FUNCTION_EXPRESSION + | JsSyntaxKind::JS_METHOD_CLASS_MEMBER + | JsSyntaxKind::JS_METHOD_OBJECT_MEMBER + | JsSyntaxKind::JS_GETTER_CLASS_MEMBER + | JsSyntaxKind::JS_SETTER_CLASS_MEMBER + | JsSyntaxKind::JS_GETTER_OBJECT_MEMBER + | JsSyntaxKind::JS_SETTER_OBJECT_MEMBER + | JsSyntaxKind::JS_CONSTRUCTOR_CLASS_MEMBER + ) +} + +/// Rewrites the frontmatter source: at every offset returned by +/// `find_top_level_returns`, replaces the six-byte keyword `return` with +/// `throw ` (padded with a trailing space). Leaves the rest untouched. +pub(crate) fn rewrite_top_level_returns(source: &str) -> String { + let offsets = find_top_level_returns(source); + if offsets.is_empty() { + return source.to_string(); + } + let bytes = source.as_bytes(); + let mut out = Vec::with_capacity(bytes.len()); + let mut cursor = 0usize; + for offset in offsets { + let offset = offset as usize; + if offset < cursor || offset + b"return".len() > bytes.len() { + continue; + } + if &bytes[offset..offset + b"return".len()] != b"return" { + continue; + } + out.extend_from_slice(&bytes[cursor..offset]); + out.extend_from_slice(b"throw "); + cursor = offset + b"return".len(); + } + out.extend_from_slice(&bytes[cursor..]); + String::from_utf8(out).expect("ASCII substitution must remain valid UTF-8") +} diff --git a/crates/astro2tsx/src/lib.rs b/crates/astro2tsx/src/lib.rs new file mode 100644 index 00000000..4d801f58 --- /dev/null +++ b/crates/astro2tsx/src/lib.rs @@ -0,0 +1,84 @@ +//! Converts `.astro` source into TSX, mirroring the upstream Astro +//! compiler's `internal/printer/print-to-tsx.go`. +//! +//! The conversion is error-tolerant: it parses with Biome's HTML parser in +//! `Astro` mode and walks the resulting CST to emit TSX. Even malformed +//! input produces a best-effort TSX output, since the underlying parser +//! produces bogus nodes rather than failing outright. +//! +//! ```ignore +//! use astro2tsx::{convert_to_tsx, ConvertOptions}; +//! +//! let result = convert_to_tsx( +//! "---\nlet x = 1;\n---\n

{x}

", +//! ConvertOptions::default(), +//! ); +//! assert!(result.code.starts_with("/* @jsxImportSource astro */")); +//! ``` + +#![deny(clippy::use_self)] + +mod frontmatter; +mod napi; +mod printer; +mod props; +mod render; +pub mod sourcemap; +mod utils; + +use biome_html_parser::parse_html; +use biome_html_syntax::HtmlFileSource; + +pub use crate::sourcemap::{ExtractedKind, ExtractedTag, GeneratedRange, Mapping}; + +/// Options controlling TSX emission. Defaults reproduce the upstream +/// `convertToTSX` defaults. +#[derive(Clone, Debug, Default)] +pub struct ConvertOptions { + /// Display name used to derive the default-exported component + /// identifier. Mirrors the upstream `filename` option. + pub filename: Option, +} + +/// Result of a conversion. The `code` field is always populated; the rest +/// captures the metadata the upstream printer surfaces alongside the TSX. +#[derive(Debug, Default)] +pub struct ConvertResult { + /// The emitted TSX code. + pub code: String, + /// Source-position mappings, as `(generated_offset, original_offset)` + /// pairs. Consumers that need a JSON sourcemap can VLQ-encode this. + pub mappings: Vec, + /// Generated byte range covering the printed frontmatter section. + pub frontmatter: GeneratedRange, + /// Generated byte range covering the printed body section + /// (`...`). + pub body: GeneratedRange, + /// Extracted `
","options":{"sourcemap":"external"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\n
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"meta.ts","name":"extract styles","input":"
","options":{"sourcemap":"external"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\n
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"meta.ts","name":"extract scripts and styles with multibyte characters","input":"","options":{"sourcemap":"external"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"meta.ts","name":"extract scripts with multibyte characters II","input":"🀄✂🇸🇪👩🏻‍❤️‍👩🏽🀄✂🇸🇪👩🏻‍❤️‍👩🏽
","options":{"sourcemap":"external"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\n🀄✂🇸🇪👩🏻‍❤️‍👩🏽🀄✂🇸🇪👩🏻‍❤️‍👩🏽
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"nested-generics.ts","name":"handles plain aliases","input":"---\ninterface LocalImageProps {}\ntype Props = LocalImageProps;\n---","options":{"filename":"index.astro","sourcemap":"inline"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\ninterface LocalImageProps {}\ntype Props = LocalImageProps;\n\n\nexport default function Index__AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiaW5kZXguYXN0cm8iXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi0tLVxuaW50ZXJmYWNlIExvY2FsSW1hZ2VQcm9wcyB7fVxudHlwZSBQcm9wcyA9IExvY2FsSW1hZ2VQcm9wcztcbi0tLSJdLAogICJtYXBwaW5ncyI6ICI7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDNUIsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzdCLEFBQUcsQUFISDtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOyIsCiAgIm5hbWVzIjogW10KfQ=="} +{"file":"nested-generics.ts","name":"handles aliases with nested generics","input":"---\ninterface LocalImageProps {\n src: Promise<{ default: string }>;\n}\n\ntype Props = LocalImageProps;\n---","options":{"filename":"index.astro","sourcemap":"inline"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\ninterface LocalImageProps {\n src: Promise<{ default: string }>;\n}\n\ntype Props = LocalImageProps;\n\n\nexport default function Index__AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiaW5kZXguYXN0cm8iXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi0tLVxuaW50ZXJmYWNlIExvY2FsSW1hZ2VQcm9wcyB7XG4gIHNyYzogUHJvbWlzZVx1MDAzY3sgZGVmYXVsdDogc3RyaW5nIH1cdTAwM2U7XG59XG5cbnR5cGUgUHJvcHMgPSBMb2NhbEltYWdlUHJvcHM7XG4tLS0iXSwKICAibWFwcGluZ3MiOiAiOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUMzQixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNwQyxDQUFDO0FBQ0Q7QUFDQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDN0IsQUFBRyxBQU5IO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7IiwKICAibmFtZXMiOiBbXQp9"} +{"file":"nested-generics.ts","name":"gracefully handles Image props","input":"---\ninterface LocalImageProps\n\textends Omit,\n\t\tOmit,\n\t\tPick {\n\tsrc: ImageMetadata | Promise<{ default: ImageMetadata }>;\n\t/** Defines an alternative text description of the image. Set to an empty string (alt=\"\") if the image is not a key part of the content (it's decoration or a tracking pixel). */\n\talt: string;\n\tsizes: HTMLImageElement['sizes'];\n\twidths: number[];\n\tformats?: OutputFormat[];\n}\ninterface RemoteImageProps\n\textends Omit,\n\t\tTransformOptions,\n\t\tPick {\n\tsrc: string;\n\t/** Defines an alternative text description of the image. Set to an empty string (alt=\"\") if the image is not a key part of the content (it's decoration or a tracking pixel). */\n\talt: string;\n\tsizes: HTMLImageElement['sizes'];\n\twidths: number[];\n\taspectRatio: TransformOptions['aspectRatio'];\n\tformats?: OutputFormat[];\n\tbackground: TransformOptions['background'];\n}\nexport type Props = LocalImageProps | RemoteImageProps;\n---","options":{"filename":"index.astro","sourcemap":"inline"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\ninterface LocalImageProps\n\textends Omit,\n\t\tOmit,\n\t\tPick {\n\tsrc: ImageMetadata | Promise<{ default: ImageMetadata }>;\n\t/** Defines an alternative text description of the image. Set to an empty string (alt=\"\") if the image is not a key part of the content (it's decoration or a tracking pixel). */\n\talt: string;\n\tsizes: HTMLImageElement['sizes'];\n\twidths: number[];\n\tformats?: OutputFormat[];\n}\ninterface RemoteImageProps\n\textends Omit,\n\t\tTransformOptions,\n\t\tPick {\n\tsrc: string;\n\t/** Defines an alternative text description of the image. Set to an empty string (alt=\"\") if the image is not a key part of the content (it's decoration or a tracking pixel). */\n\talt: string;\n\tsizes: HTMLImageElement['sizes'];\n\twidths: number[];\n\taspectRatio: TransformOptions['aspectRatio'];\n\tformats?: OutputFormat[];\n\tbackground: TransformOptions['background'];\n}\nexport type Props = LocalImageProps | RemoteImageProps;\n\n\nexport default function Index__AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiaW5kZXguYXN0cm8iXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi0tLVxuaW50ZXJmYWNlIExvY2FsSW1hZ2VQcm9wc1xuXHRleHRlbmRzIE9taXRcdTAwM2NIVE1MQXR0cmlidXRlcywgJ3NyYycgfCAnd2lkdGgnIHwgJ2hlaWdodCdcdTAwM2UsXG5cdFx0T21pdFx1MDAzY1RyYW5zZm9ybU9wdGlvbnMsICdzcmMnXHUwMDNlLFxuXHRcdFBpY2tcdTAwM2Nhc3Ryb0hUTUwuSlNYLkltZ0hUTUxBdHRyaWJ1dGVzLCAnbG9hZGluZycgfCAnZGVjb2RpbmcnXHUwMDNlIHtcblx0c3JjOiBJbWFnZU1ldGFkYXRhIHwgUHJvbWlzZVx1MDAzY3sgZGVmYXVsdDogSW1hZ2VNZXRhZGF0YSB9XHUwMDNlO1xuXHQvKiogRGVmaW5lcyBhbiBhbHRlcm5hdGl2ZSB0ZXh0IGRlc2NyaXB0aW9uIG9mIHRoZSBpbWFnZS4gU2V0IHRvIGFuIGVtcHR5IHN0cmluZyAoYWx0PVwiXCIpIGlmIHRoZSBpbWFnZSBpcyBub3QgYSBrZXkgcGFydCBvZiB0aGUgY29udGVudCAoaXQncyBkZWNvcmF0aW9uIG9yIGEgdHJhY2tpbmcgcGl4ZWwpLiAqL1xuXHRhbHQ6IHN0cmluZztcblx0c2l6ZXM6IEhUTUxJbWFnZUVsZW1lbnRbJ3NpemVzJ107XG5cdHdpZHRoczogbnVtYmVyW107XG5cdGZvcm1hdHM/OiBPdXRwdXRGb3JtYXRbXTtcbn1cbmludGVyZmFjZSBSZW1vdGVJbWFnZVByb3BzXG5cdGV4dGVuZHMgT21pdFx1MDAzY0hUTUxBdHRyaWJ1dGVzLCAnc3JjJyB8ICd3aWR0aCcgfCAnaGVpZ2h0J1x1MDAzZSxcblx0XHRUcmFuc2Zvcm1PcHRpb25zLFxuXHRcdFBpY2tcdTAwM2NJbWdIVE1MQXR0cmlidXRlcywgJ2xvYWRpbmcnIHwgJ2RlY29kaW5nJ1x1MDAzZSB7XG5cdHNyYzogc3RyaW5nO1xuXHQvKiogRGVmaW5lcyBhbiBhbHRlcm5hdGl2ZSB0ZXh0IGRlc2NyaXB0aW9uIG9mIHRoZSBpbWFnZS4gU2V0IHRvIGFuIGVtcHR5IHN0cmluZyAoYWx0PVwiXCIpIGlmIHRoZSBpbWFnZSBpcyBub3QgYSBrZXkgcGFydCBvZiB0aGUgY29udGVudCAoaXQncyBkZWNvcmF0aW9uIG9yIGEgdHJhY2tpbmcgcGl4ZWwpLiAqL1xuXHRhbHQ6IHN0cmluZztcblx0c2l6ZXM6IEhUTUxJbWFnZUVsZW1lbnRbJ3NpemVzJ107XG5cdHdpZHRoczogbnVtYmVyW107XG5cdGFzcGVjdFJhdGlvOiBUcmFuc2Zvcm1PcHRpb25zWydhc3BlY3RSYXRpbyddO1xuXHRmb3JtYXRzPzogT3V0cHV0Rm9ybWF0W107XG5cdGJhY2tncm91bmQ6IFRyYW5zZm9ybU9wdGlvbnNbJ2JhY2tncm91bmQnXTtcbn1cbmV4cG9ydCB0eXBlIFByb3BzID0gTG9jYWxJbWFnZVByb3BzIHwgUmVtb3RlSW1hZ2VQcm9wcztcbi0tLSJdLAogICJtYXBwaW5ncyI6ICI7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDekIsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUMxRCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDaEMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ2pFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDMUQsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsTCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ2IsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsQixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDMUIsQ0FBQztBQUNELENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUMxQixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzFELENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbkIsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbkQsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNiLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbEwsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNiLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbEMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbEIsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUM5QyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDMUIsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzVDLENBQUM7QUFDRCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3ZELEFBQUcsQUExQkg7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTsiLAogICJuYW1lcyI6IFtdCn0="} +{"file":"props-and-getStaticPaths.ts","name":"explicit props definition","input":"---\ninterface Props {};\nexport function getStaticPaths() {\n return {};\n}\n---\n\n
","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props {};\nexport function getStaticPaths() {\n return {};\n}\n\n{};\n
\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props {};\nexport function getStaticPaths() {\n return {};\n}\n\n{};\n
\n
\nexport default function __AstroComponent_(_props: Props): any {}\ntype ASTRO__ArrayElement = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;\ntype ASTRO__Flattened = T extends Array ? ASTRO__Flattened : T;\ntype ASTRO__InferredGetStaticPath = ASTRO__Flattened>>>;\ntype ASTRO__MergeUnion = T extends unknown ? T & { [P in Exclude]?: never } extends infer O ? { [P in keyof O]: O[P] } : never : never;\ntype ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[K] : never;\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>>"} +{"file":"props-and-getStaticPaths.ts","name":"inferred props","input":"---\nexport function getStaticPaths() {\n return {};\n}\n---\n\n
","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nexport function getStaticPaths() {\n return {};\n}\n\n{};\n
\n
\nexport default function __AstroComponent_(_props: ASTRO__MergeUnion>): any {}\n__UNRESOLVED_CALL__\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\nexport function getStaticPaths() {\n return {};\n}\n\n{};\n
\n
\nexport default function __AstroComponent_(_props: ASTRO__MergeUnion>): any {}\ntype ASTRO__ArrayElement = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;\ntype ASTRO__Flattened = T extends Array ? ASTRO__Flattened : T;\ntype ASTRO__InferredGetStaticPath = ASTRO__Flattened>>>;\ntype ASTRO__MergeUnion = T extends unknown ? T & { [P in Exclude]?: never } extends infer O ? { [P in keyof O]: O[P] } : never : never;\ntype ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[K] : never;\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>, typeof __AstroComponent_, ASTRO__Get>>"} +{"file":"props.ts","name":"no props","input":"
","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"props.ts","name":"nested Props","input":"---\nfunction DoTheThing(Props) {}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nfunction DoTheThing(Props) {}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nfunction DoTheThing(Props) {}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"props.ts","name":"props interface","input":"\n---\ninterface Props {}\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"props.ts","name":"props import","input":"\n---\nimport { Props } from './somewhere';\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nimport { Props } from './somewhere';\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\nimport { Props } from './somewhere';\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"props.ts","name":"props alias","input":"\n---\nimport { MyComponent as Props } from './somewhere';\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nimport { MyComponent as Props } from './somewhere';\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\nimport { MyComponent as Props } from './somewhere';\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"props.ts","name":"props type import","input":"\n---\nimport type { Props } from './somewhere';\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nimport type { Props } from './somewhere';\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\nimport type { Props } from './somewhere';\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"props.ts","name":"props type","input":"\n---\ntype Props = {}\n---\n\n
\n","options":{"filename":"/Users/nmoo/test.astro","sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ntype Props = {}\n\n{};\n
\n\n
\nexport default function Test__AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ntype Props = {}\n\n{};\n
\n\n
\nexport default function Test__AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"props.ts","name":"props generic (simple)","input":"\n---\ninterface Props {}\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"props.ts","name":"props generic (complex)","input":"\n---\ninterface Props> {}\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props> {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_>(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props> {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_>(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"props.ts","name":"props generic (very complex)","input":"\n---\ninterface Props {}\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"props.ts","name":"props generic (very complex II)","input":"\n---\ninterface Props ? A : B, P extends string ? { [key: string]: any }: never> {}\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props ? A : B, P extends string ? { [key: string]: any }: never> {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_ ? A : B, P extends string ? { [key: string]: any }: never>(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props ? A : B, P extends string ? { [key: string]: any }: never> {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_ ? A : B, P extends string ? { [key: string]: any }: never>(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"props.ts","name":"polymorphic props","input":"\n---\ninterface Props extends HTMLAttributes {\n as?: Tag;\n}\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props extends HTMLAttributes {\n as?: Tag;\n}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props extends HTMLAttributes {\n as?: Tag;\n}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"props.ts","name":"unrelated prop import","input":"\n---\nimport SvelteOptionalProps from './SvelteOptionalProps.svelte';\n---\n\n\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nimport SvelteOptionalProps from './SvelteOptionalProps.svelte';\n\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nimport SvelteOptionalProps from './SvelteOptionalProps.svelte';\n\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"props.ts","name":"unrelated sibling prop","input":"---\nimport type { Props as ComponentBProps } from './ComponentB.astro'\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nimport type { Props as ComponentBProps } from './ComponentB.astro'\n\n{};\n
\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nimport type { Props as ComponentBProps } from './ComponentB.astro'\n\n{};\n
\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"props.ts","name":"props interface with as property","input":"---\ninterface Props {\n as?: string;\n href?: string;\n}\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props {\n as?: string;\n href?: string;\n}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props {\n as?: string;\n href?: string;\n}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"props.ts","name":"props with destructured as property","input":"---\ninterface Props {\n as?: string;\n className?: string;\n}\n\nconst { as, className } = Astro.props;\n---\n\n
{as}
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props {\n as?: string;\n className?: string;\n}\n\nconst { as, className } = Astro.props;\n\n\n
{as}
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props {\n as?: string;\n className?: string;\n}\n\nconst { as, className } = Astro.props;\n\n\n
{as}
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"props.ts","name":"props with renamed as property in destructuring","input":"---\ninterface Props {\n as?: string;\n}\n\nconst { as: element } = Astro.props;\n---\n\n
{element}
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props {\n as?: string;\n}\n\nconst { as: element } = Astro.props;\n\n\n
{element}
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props {\n as?: string;\n}\n\nconst { as: element } = Astro.props;\n\n\n
{element}
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"props.ts","name":"props interface with as and other properties","input":"---\ninterface Props extends HTMLAttributes<'div'> {\n as?: keyof HTMLElementTagNameMap;\n variant?: 'primary' | 'secondary';\n size?: 'sm' | 'md' | 'lg';\n}\n\nconst { as = 'div', variant = 'primary', size = 'md', ...rest } = Astro.props;\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props extends HTMLAttributes<'div'> {\n as?: keyof HTMLElementTagNameMap;\n variant?: 'primary' | 'secondary';\n size?: 'sm' | 'md' | 'lg';\n}\n\nconst { as = 'div', variant = 'primary', size = 'md', ...rest } = Astro.props;\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props extends HTMLAttributes<'div'> {\n as?: keyof HTMLElementTagNameMap;\n variant?: 'primary' | 'secondary';\n size?: 'sm' | 'md' | 'lg';\n}\n\nconst { as = 'div', variant = 'primary', size = 'md', ...rest } = Astro.props;\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"props.ts","name":"props type alias with as property","input":"---\ntype Props = {\n as?: string;\n children?: any;\n}\n\nconst props = Astro.props as Props;\n---\n\n
{props.children}
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ntype Props = {\n as?: string;\n children?: any;\n}\n\nconst props = Astro.props as Props;\n\n\n
{props.children}
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ntype Props = {\n as?: string;\n children?: any;\n}\n\nconst props = Astro.props as Props;\n\n\n
{props.children}
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} +{"file":"raw.ts","name":"style is raw","input":"","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"raw.ts","name":"is:raw is raw","input":"
A{B}C
","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n
{`A{B}C`}
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n
{`A{B}C`}
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"script.ts","name":"script function","input":"","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"script.ts","name":"partytown function","input":"","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"script.ts","name":"ld+json wrapping","input":"","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"script.ts","name":"escape unknown types","input":"","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"script.ts","name":"don't include scripts if disabled","input":"\n\n\n\n\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n\n\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n\n\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"top-level-returns.ts","name":"transforms top-level returns to throw statements","input":"---\nif (something) {\n\treturn Astro.redirect();\n}\n\nfunction thatDoesSomething() {\n\treturn \"Hey\";\n}\n\nclass Component {\n\trender() {\n\t\treturn \"wow\"!\n\t}\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nif (something) {\n\tthrow Astro.redirect();\n}\n\nfunction thatDoesSomething() {\n\treturn \"Hey\";\n}\n\nclass Component {\n\trender() {\n\t\treturn \"wow\"!\n\t}\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nif (something) {\n\tthrow Astro.redirect();\n}\n\nfunction thatDoesSomething() {\n\treturn \"Hey\";\n}\n\nclass Component {\n\trender() {\n\t\treturn \"wow\"!\n\t}\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"top-level-returns.ts","name":"preserves returns inside arrow functions","input":"---\nconst foo = () => {\n\treturn \"value\";\n}\n\nif (condition) {\n\treturn Astro.redirect(\"/login\");\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nconst foo = () => {\n\treturn \"value\";\n}\n\nif (condition) {\n\tthrow Astro.redirect(\"/login\");\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nconst foo = () => {\n\treturn \"value\";\n}\n\nif (condition) {\n\tthrow Astro.redirect(\"/login\");\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"top-level-returns.ts","name":"preserves returns inside object methods","input":"---\nconst something = {\n\tsomeFunction: () => {\n\t\treturn \"Hello World\";\n\t},\n\tsomeOtherFunction() {\n\t\treturn \"Hello World\";\n\t},\n};\n\nif (true) {\n\treturn Astro.redirect();\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nconst something = {\n\tsomeFunction: () => {\n\t\treturn \"Hello World\";\n\t},\n\tsomeOtherFunction() {\n\t\treturn \"Hello World\";\n\t},\n};\n\nif (true) {\n\tthrow Astro.redirect();\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nconst something = {\n\tsomeFunction: () => {\n\t\treturn \"Hello World\";\n\t},\n\tsomeOtherFunction() {\n\t\treturn \"Hello World\";\n\t},\n};\n\nif (true) {\n\tthrow Astro.redirect();\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"top-level-returns.ts","name":"handles multiple top-level returns","input":"---\nif (condition1) {\n\treturn Astro.redirect(\"/a\");\n}\n\nif (condition2) {\n\treturn Astro.redirect(\"/b\");\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nif (condition1) {\n\tthrow Astro.redirect(\"/a\");\n}\n\nif (condition2) {\n\tthrow Astro.redirect(\"/b\");\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nif (condition1) {\n\tthrow Astro.redirect(\"/a\");\n}\n\nif (condition2) {\n\tthrow Astro.redirect(\"/b\");\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"top-level-returns.ts","name":"no transformation when no top-level returns","input":"---\nfunction foo() {\n\treturn \"bar\";\n}\n\nconst arrow = () => {\n\treturn \"baz\";\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nfunction foo() {\n\treturn \"bar\";\n}\n\nconst arrow = () => {\n\treturn \"baz\";\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nfunction foo() {\n\treturn \"bar\";\n}\n\nconst arrow = () => {\n\treturn \"baz\";\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"top-level-returns.ts","name":"handles TypeScript syntax without losing returns","input":"---\ntype Response = { status: number };\nconst handler = (input: string): Response => {\n\treturn { status: 200 };\n};\n\nconst value = (foo as string);\n\nif (value) {\n\treturn Astro.redirect('/ok');\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ntype Response = { status: number };\nconst handler = (input: string): Response => {\n\treturn { status: 200 };\n};\n\nconst value = (foo as string);\n\nif (value) {\n\tthrow Astro.redirect('/ok');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\ntype Response = { status: number };\nconst handler = (input: string): Response => {\n\treturn { status: 200 };\n};\n\nconst value = (foo as string);\n\nif (value) {\n\tthrow Astro.redirect('/ok');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"top-level-returns.ts","name":"does not transform returns in nested class or object methods","input":"---\nclass Foo {\n\tmethod() {\n\t\treturn 'foo';\n\t}\n\tarrow = () => {\n\t\treturn 'bar';\n\t}\n}\n\nconst obj = {\n\tmethod() {\n\t\treturn 'baz';\n\t},\n};\n\nif (true) {\n\treturn Astro.redirect('/nested');\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nclass Foo {\n\tmethod() {\n\t\treturn 'foo';\n\t}\n\tarrow = () => {\n\t\treturn 'bar';\n\t}\n}\n\nconst obj = {\n\tmethod() {\n\t\treturn 'baz';\n\t},\n};\n\nif (true) {\n\tthrow Astro.redirect('/nested');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nclass Foo {\n\tmethod() {\n\t\treturn 'foo';\n\t}\n\tarrow = () => {\n\t\treturn 'bar';\n\t}\n}\n\nconst obj = {\n\tmethod() {\n\t\treturn 'baz';\n\t},\n};\n\nif (true) {\n\tthrow Astro.redirect('/nested');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"top-level-returns.ts","name":"handles computed methods and generic arrows","input":"---\nclass Foo {\n\t['get']() {\n\t\treturn 'ok';\n\t}\n\n\tstatic ['load']() {\n\t\treturn 'static';\n\t}\n}\n\nconst obj = {\n\t['get']() {\n\t\treturn 'obj';\n\t},\n};\n\nconst generic = (value: T) => {\n\treturn value;\n};\n\nif (true) {\n\treturn Astro.redirect('/computed');\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nclass Foo {\n\t['get']() {\n\t\treturn 'ok';\n\t}\n\n\tstatic ['load']() {\n\t\treturn 'static';\n\t}\n}\n\nconst obj = {\n\t['get']() {\n\t\treturn 'obj';\n\t},\n};\n\nconst generic = (value: T) => {\n\treturn value;\n};\n\nif (true) {\n\tthrow Astro.redirect('/computed');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nclass Foo {\n\t['get']() {\n\t\treturn 'ok';\n\t}\n\n\tstatic ['load']() {\n\t\treturn 'static';\n\t}\n}\n\nconst obj = {\n\t['get']() {\n\t\treturn 'obj';\n\t},\n};\n\nconst generic = (value: T) => {\n\treturn value;\n};\n\nif (true) {\n\tthrow Astro.redirect('/computed');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"top-level-returns.ts","name":"handles satisfies and as const in top-level conditionals","input":"---\nconst config = {\n\tflag: true,\n} as const;\n\nconst map = {\n\tname: 'astro',\n} satisfies Record;\n\nif (config.flag) {\n\treturn Astro.redirect('/satisfies');\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nconst config = {\n\tflag: true,\n} as const;\n\nconst map = {\n\tname: 'astro',\n} satisfies Record;\n\nif (config.flag) {\n\tthrow Astro.redirect('/satisfies');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nconst config = {\n\tflag: true,\n} as const;\n\nconst map = {\n\tname: 'astro',\n} satisfies Record;\n\nif (config.flag) {\n\tthrow Astro.redirect('/satisfies');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} +{"file":"top-level-returns.ts","name":"handles type-position arrows without missing top-level returns","input":"---\ntype Fn = () => void;\ntype Factory = (value: string) => { ok: boolean };\n\nif (true) {\n\treturn Astro.redirect('/types');\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ntype Fn = () => void;\ntype Factory = (value: string) => { ok: boolean };\n\nif (true) {\n\tthrow Astro.redirect('/types');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\ntype Fn = () => void;\ntype Factory = (value: string) => { ok: boolean };\n\nif (true) {\n\tthrow Astro.redirect('/types');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} diff --git a/crates/astro2tsx/tests/fixtures.rs b/crates/astro2tsx/tests/fixtures.rs new file mode 100644 index 00000000..3b20b6ec --- /dev/null +++ b/crates/astro2tsx/tests/fixtures.rs @@ -0,0 +1,148 @@ +//! Snapshot tests against the upstream Astro compiler's `convertToTSX` +//! reference output. Each fixture pairs a `.astro` source string with the +//! exact TSX bytes produced by the Go printer (copied from +//! `packages/compiler/test/tsx/*.ts`). When ports diverge, `cargo insta +//! review` is the preferred workflow — but inline `assert_eq!` is used here +//! so divergences are visible directly in test output. + +use astro2tsx::{ConvertOptions, convert_to_tsx}; + +const PREFIX: &str = "/* @jsxImportSource astro */\n\n"; + +fn convert(source: &str) -> String { + convert_to_tsx(source, ConvertOptions::default()).code +} + +fn convert_named(source: &str, filename: &str) -> String { + convert_to_tsx( + source, + ConvertOptions { + filename: Some(filename.to_string()), + }, + ) + .code +} + +#[test] +fn empty_no_props_default_export() { + let input = "
"; + let expected = format!( + "{PREFIX}\n
\n
\n\ + export default function __AstroComponent_(_props: Record): any {{}}\n" + ); + assert_eq!(convert(input), expected); +} + +#[test] +fn frontmatter_followed_by_body() { + let input = "\n---\nlet value = 'world';\n---\n\n

Hello {value}

\n"; + let actual = convert(input); + assert!(actual.contains("let value = 'world';")); + assert!(actual.contains("")); + // The text-content emitter preserves the original byte ranges, so the + // payload appears as "Hello " + "{value}" — JSX renders it the same + // way as the upstream printer's "Hello {value}". + assert!(actual.contains("Hello ")); + assert!(actual.contains("{value}")); + assert!(actual.contains("")); + assert!(actual.contains("export default function __AstroComponent_")); +} + +#[test] +fn frontmatter_only_no_body() { + let input = "---\nfunction DoTheThing(Props) {}\n---"; + let actual = convert(input); + assert!(actual.starts_with(PREFIX)); + assert!(actual.contains("function DoTheThing(Props) {}")); + // No body, so no wrapper. + assert!(!actual.contains("")); + assert!(actual.contains("export default function __AstroComponent_")); +} + +#[test] +fn template_literal_attribute_passes_through_braces() { + // `
` → the Go printer rewrites this to `class={\`x\`}`. + // Our parser exposes template literal attribute payloads as + // `HtmlString`; we currently emit a quoted form, so this test pins + // current behavior. + let input = "
"; + let actual = convert(input); + assert!(actual.contains("
")); +} + +#[test] +fn invalid_attribute_collected_in_spread_object() { + let input = "
{}} name=\"value\">
"; + let actual = convert(input); + // The exact ordering matches Go: valid attrs stay inline, invalids are + // siphoned into a `{...{...}}` spread. + assert!(actual.contains("name=\"value\"")); + assert!(actual.contains("{...{")); + assert!(actual.contains("\"@click\"")); +} + +#[test] +fn named_export_uses_filename_basename() { + let input = "
"; + let actual = convert_named(input, "/Users/nmoo/test.astro"); + assert!(actual.contains("export default function Test__AstroComponent_")); +} + +#[test] +fn comment_emits_jsx_comment_with_leading_space() { + let input = ""; + let actual = convert(input); + // The Go printer emits `{/** /
...*/}`. Our walker doesn't yet + // handle HTML comments inside the body, so this test pins absence of a + // panic and that the surrounding scaffold still emits cleanly. + assert!(actual.starts_with(PREFIX)); +} + +#[test] +fn unclosed_tag_passes_through() { + let input = "")); + assert!(actual.contains("")); +} + +#[test] +fn frontmatter_range_is_recorded() { + let result = convert_to_tsx( + "---\nlet x = 1;\n---\n
", + ConvertOptions::default(), + ); + assert!(result.frontmatter.end > result.frontmatter.start); + let frontmatter_slice = + &result.code[result.frontmatter.start as usize..result.frontmatter.end as usize]; + assert!(frontmatter_slice.contains("let x = 1;")); +} + +#[test] +fn body_range_is_recorded() { + let result = convert_to_tsx("

Hi

", ConvertOptions::default()); + assert!(result.body.end > result.body.start); + let body_slice = &result.code[result.body.start as usize..result.body.end as usize]; + assert!(body_slice.contains("

")); + assert!(body_slice.contains("

")); +} + +#[test] +fn parser_errors_surface_but_do_not_block_emission() { + // Unbalanced curly brace — bogus text expression recovery. + let result = convert_to_tsx( + "---\nconst items = [1];\n---\n{items.map(i =>
{i}
)", + ConvertOptions::default(), + ); + assert!(result.has_parse_errors); + assert!(result.code.starts_with(PREFIX)); +} + +#[test] +fn shorthand_attribute_expands_to_named_form() { + let input = ""; + let actual = convert(input); + // `` is what the Go printer emits. + assert!(actual.contains("bar={bar}")); +} diff --git a/crates/astro2tsx/tests/upstream_corpus.rs b/crates/astro2tsx/tests/upstream_corpus.rs new file mode 100644 index 00000000..c5e3a703 --- /dev/null +++ b/crates/astro2tsx/tests/upstream_corpus.rs @@ -0,0 +1,174 @@ +//! Runs every test case in `tests/corpus/tsx.jsonl` (extracted from the +//! upstream Astro compiler) through `convert_to_tsx` and reports parity +//! with the Go reference output. +//! +//! The corpus is regenerated from +//! `packages/compiler/test/extract-corpus.mjs` in the upstream repo. Each +//! entry is `{ file, name, input, options, expected, static_expected }`. + +use astro2tsx::{ConvertOptions, convert_to_tsx}; +use serde::Deserialize; +use std::collections::BTreeMap; + +/// Test cases where we deliberately diverge from the Go printer because +/// its recovery synthesises constructs that don't help intellisense: +/// +/// - `
\n` → upstream emits `
` +/// which fabricates phantom `<` and `div` attributes. We round-trip +/// the source instead. +/// - `` to balance JSX. tsserver parses unbalanced JSX just +/// fine, so we leave it unbalanced and avoid the synthetic span. +const INTENTIONAL_DIVERGENCES: &[&str] = &[ + "does not escape tag opening unnecessarily II", + "does not escape tag opening unnecessarily III", + "preserves spaces in tag", + "preserves line returns in tag by transforming to space", +]; + +#[derive(Debug, Deserialize)] +struct Record { + #[allow(dead_code)] + file: String, + name: String, + input: String, + #[serde(default)] + options: Options, + expected: String, +} + +#[derive(Debug, Default, Deserialize)] +struct Options { + #[serde(default)] + filename: Option, +} + +/// Drops the inline sourcemap comment that the upstream printer appends +/// when `sourcemap: 'inline'`. Our port doesn't yet emit sourcemaps, and +/// the assertion in the underlying test files (`assert.ok(code.includes( +/// ...))`) doesn't depend on the sourcemap. +fn strip_inline_sourcemap(code: &str) -> &str { + if let Some(idx) = code.rfind("\n//# sourceMappingURL=") { + &code[..idx] + } else { + code + } +} + +fn load_corpus() -> Vec { + let raw = include_str!("corpus/tsx.jsonl"); + raw.lines() + .filter(|l| !l.trim().is_empty()) + .map(|l| serde_json::from_str(l).expect("malformed corpus entry")) + .collect() +} + +#[test] +fn dump_named_diff() { + let only = std::env::var("ASTRO_DUMP_NAME").unwrap_or_default(); + if only.is_empty() { + return; + } + let corpus = load_corpus(); + for record in &corpus { + if !record.name.contains(&only) { + continue; + } + let actual = convert_to_tsx( + &record.input, + ConvertOptions { + filename: record.options.filename.clone(), + }, + ) + .code; + eprintln!("\n==== {} :: {} ====", record.file, record.name); + eprintln!("--- INPUT ---"); + eprintln!("{:?}", record.input); + eprintln!("--- EXPECTED ---"); + eprintln!("{:?}", strip_inline_sourcemap(&record.expected)); + eprintln!("--- ACTUAL ---"); + eprintln!("{:?}", strip_inline_sourcemap(&actual)); + } +} + +#[test] +fn dump_first_diff_per_file() { + let corpus = load_corpus(); + let mut seen_files: BTreeMap = BTreeMap::new(); + for record in &corpus { + let actual = convert_to_tsx( + &record.input, + ConvertOptions { + filename: record.options.filename.clone(), + }, + ) + .code; + if actual == record.expected { + continue; + } + if seen_files.contains_key(&record.file) { + continue; + } + seen_files.insert(record.file.clone(), ()); + eprintln!("\n==== {} :: {} ====", record.file, record.name); + eprintln!("--- INPUT ---"); + eprintln!("{:?}", record.input); + eprintln!("--- EXPECTED ---"); + eprintln!("{:?}", record.expected); + eprintln!("--- ACTUAL ---"); + eprintln!("{:?}", actual); + } +} + +#[test] +fn report_parity_with_upstream() { + let corpus = load_corpus(); + assert!(!corpus.is_empty(), "corpus is empty — regenerate it"); + + let mut by_file: BTreeMap, Vec)> = + BTreeMap::new(); + + for record in &corpus { + let actual = convert_to_tsx( + &record.input, + ConvertOptions { + filename: record.options.filename.clone(), + }, + ) + .code; + + let entry = by_file + .entry(record.file.clone()) + .or_insert((0, 0, Vec::new(), Vec::new())); + entry.1 += 1; + let expected_trimmed = strip_inline_sourcemap(&record.expected); + let actual_trimmed = strip_inline_sourcemap(&actual); + if actual_trimmed == expected_trimmed { + entry.0 += 1; + } else if INTENTIONAL_DIVERGENCES.contains(&record.name.as_str()) { + entry.3.push(record.name.clone()); + } else { + entry.2.push(record.name.clone()); + } + } + + let mut total_pass = 0; + let mut total_diverge = 0; + let mut total_count = 0; + eprintln!("\n== upstream tsx test parity =="); + for (file, (pass, total, failing, divergent)) in &by_file { + total_pass += pass; + total_diverge += divergent.len(); + total_count += total; + eprintln!(" {file}: {pass}/{total}"); + for name in failing { + eprintln!(" - FAIL: {name}"); + } + for name in divergent { + eprintln!(" - DIVERGE (intentional): {name}"); + } + } + eprintln!( + "---\n total: {total_pass}/{total_count} (+ {total_diverge} intentional divergences)\n" + ); +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 25824648..1622aff0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,6 +27,15 @@ importers: specifier: ~5.9.3 version: 5.9.3 + crates/astro2tsx: + devDependencies: + '@napi-rs/cli': + specifier: ^3 + version: 3.5.1(@emnapi/runtime@1.8.1)(@types/node@22.19.9)(node-addon-api@7.1.1) + '@types/node': + specifier: ^22 + version: 22.19.9 + crates/astro_napi: devDependencies: '@emnapi/runtime': diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 829a56fe..77b06c5a 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,4 @@ packages: - 'packages/*' - 'crates/astro_napi' + - 'crates/astro2tsx' From 8765acf9466aaf8041aefe205cf6b7a79c5ba8f2 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Tue, 11 Aug 2026 02:46:16 +0200 Subject: [PATCH 02/50] chore(astro2tsx): satisfy fmt, clippy, and biome checks --- biome.jsonc | 5 +++- crates/astro2tsx/package.json | 28 ++++++++++++++-------- crates/astro2tsx/src/frontmatter.rs | 12 +++++----- crates/astro2tsx/src/lib.rs | 1 + crates/astro2tsx/src/napi.rs | 6 ++++- crates/astro2tsx/src/printer.rs | 19 +++------------ crates/astro2tsx/src/props.rs | 26 +++++++++++--------- crates/astro2tsx/src/render.rs | 29 +++++++++++++---------- crates/astro2tsx/test/astro2tsx.test.ts | 11 +++------ crates/astro2tsx/tests/upstream_corpus.rs | 3 +-- 10 files changed, 73 insertions(+), 67 deletions(-) diff --git a/biome.jsonc b/biome.jsonc index 5b819f73..f16b0d56 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -11,7 +11,10 @@ "!crates/astro_napi/*.cjs", "!crates/astro_napi/*.mjs", "!crates/astro_napi/index.d.ts", - "!crates/astro_napi/npm" + "!crates/astro_napi/npm", + "!crates/astro2tsx/*.js", + "!crates/astro2tsx/index.d.ts", + "!crates/astro2tsx/npm" ] }, "vcs": { diff --git a/crates/astro2tsx/package.json b/crates/astro2tsx/package.json index 923d3d00..575511ee 100644 --- a/crates/astro2tsx/package.json +++ b/crates/astro2tsx/package.json @@ -2,19 +2,23 @@ "name": "@astrojs/astro2tsx", "version": "0.1.0", "description": "Convert .astro files to TSX for tsserver intellisense", - "keywords": ["astro", "tsx", "intellisense", "language-server"], + "keywords": [ + "astro", + "tsx", + "intellisense", + "language-server" + ], "license": "MIT", "type": "module", "main": "index.js", - "files": ["index.d.ts", "index.js"], - "publishConfig": { - "access": "public", - "registry": "https://registry.npmjs.org/" - }, + "files": [ + "index.d.ts", + "index.js" + ], "scripts": { "artifacts": "napi artifacts", - "build-dev": "napi build --esm --platform", "build": "napi build --esm --platform --release", + "build-dev": "napi build --esm --platform", "prepublishOnly": "napi prepublish -t npm", "test": "node --import tsx --test ./test/*.test.ts", "version": "napi version" @@ -23,6 +27,13 @@ "@napi-rs/cli": "^3", "@types/node": "^22" }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + }, "napi": { "binaryName": "astro2tsx", "packageName": "@astrojs/astro2tsx", @@ -36,8 +47,5 @@ "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl" ] - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" } } diff --git a/crates/astro2tsx/src/frontmatter.rs b/crates/astro2tsx/src/frontmatter.rs index 819f951d..bc6a76bd 100644 --- a/crates/astro2tsx/src/frontmatter.rs +++ b/crates/astro2tsx/src/frontmatter.rs @@ -34,12 +34,12 @@ pub(crate) fn find_top_level_returns(source: &str) -> Vec { WalkEvent::Enter(node) => { if is_function_like(node.kind()) { function_depth += 1; - } else if function_depth == 0 && node.kind() == JsSyntaxKind::JS_RETURN_STATEMENT { - if let Some(stmt) = JsReturnStatement::cast(node) - && let Ok(token) = stmt.return_token() - { - offsets.push(u32::from(token.text_trimmed_range().start())); - } + } else if function_depth == 0 + && node.kind() == JsSyntaxKind::JS_RETURN_STATEMENT + && let Some(stmt) = JsReturnStatement::cast(node) + && let Ok(token) = stmt.return_token() + { + offsets.push(u32::from(token.text_trimmed_range().start())); } } WalkEvent::Leave(node) => { diff --git a/crates/astro2tsx/src/lib.rs b/crates/astro2tsx/src/lib.rs index 4d801f58..4f585a13 100644 --- a/crates/astro2tsx/src/lib.rs +++ b/crates/astro2tsx/src/lib.rs @@ -19,6 +19,7 @@ #![deny(clippy::use_self)] mod frontmatter; +#[cfg(not(test))] mod napi; mod printer; mod props; diff --git a/crates/astro2tsx/src/napi.rs b/crates/astro2tsx/src/napi.rs index 009ad267..d424ed3a 100644 --- a/crates/astro2tsx/src/napi.rs +++ b/crates/astro2tsx/src/napi.rs @@ -101,7 +101,11 @@ pub fn convert_to_tsx(source: String, options: Option) -> C .into_iter() .map(extracted_tag_to_napi) .collect(), - styles: result.styles.into_iter().map(extracted_tag_to_napi).collect(), + styles: result + .styles + .into_iter() + .map(extracted_tag_to_napi) + .collect(), has_parse_errors: result.has_parse_errors, } } diff --git a/crates/astro2tsx/src/printer.rs b/crates/astro2tsx/src/printer.rs index 1ac7cb7a..169e670b 100644 --- a/crates/astro2tsx/src/printer.rs +++ b/crates/astro2tsx/src/printer.rs @@ -103,12 +103,7 @@ impl Printer { }); } - pub(crate) fn add_style_block( - &mut self, - range: GeneratedRange, - content: String, - lang: String, - ) { + pub(crate) fn add_style_block(&mut self, range: GeneratedRange, content: String, lang: String) { self.styles.push(ExtractedTag { range, kind: ExtractedKind::Style, @@ -117,11 +112,7 @@ impl Printer { }); } - pub(crate) fn add_event_attribute( - &mut self, - range: GeneratedRange, - content: String, - ) { + pub(crate) fn add_event_attribute(&mut self, range: GeneratedRange, content: String) { self.scripts.push(ExtractedTag { range, kind: ExtractedKind::EventAttribute, @@ -130,11 +121,7 @@ impl Printer { }); } - pub(crate) fn add_style_attribute( - &mut self, - range: GeneratedRange, - content: String, - ) { + pub(crate) fn add_style_attribute(&mut self, range: GeneratedRange, content: String) { self.styles.push(ExtractedTag { range, kind: ExtractedKind::StyleAttribute, diff --git a/crates/astro2tsx/src/props.rs b/crates/astro2tsx/src/props.rs index cf9b939b..97f24eb4 100644 --- a/crates/astro2tsx/src/props.rs +++ b/crates/astro2tsx/src/props.rs @@ -84,7 +84,8 @@ pub(crate) fn analyze(source: &str) -> PropsAnalysis { if !analysis.has_props { text_scan_props_binding(source, &mut analysis); } - if !analysis.has_get_static_paths && source.contains("getStaticPaths") + if !analysis.has_get_static_paths + && source.contains("getStaticPaths") && source.contains("export") { analysis.has_get_static_paths = true; @@ -173,10 +174,8 @@ fn collect_top_level_arg_names(inside: &str) -> String { _ => {} } } - let outermost = depth_angle == 0 - && depth_curly == 0 - && depth_paren == 0 - && depth_square == 0; + let outermost = + depth_angle == 0 && depth_curly == 0 && depth_paren == 0 && depth_square == 0; if b == b',' && outermost { let segment = &inside[start..i]; if let Some(name) = leading_identifier(segment) { @@ -199,7 +198,11 @@ fn leading_identifier(segment: &str) -> Option<&str> { while end < bytes.len() && is_ident_byte(bytes[end]) { end += 1; } - if end == 0 { None } else { Some(&trimmed[..end]) } + if end == 0 { + None + } else { + Some(&trimmed[..end]) + } } /// Last-resort text scan for `interface Props` / `type Props` when the JS @@ -229,8 +232,7 @@ fn text_scan_props_binding(source: &str, analysis: &mut PropsAnalysis) { } if i + "Props".len() <= bytes.len() && &bytes[i..i + "Props".len()] == b"Props" - && (i + "Props".len() == bytes.len() - || !is_ident_byte(bytes[i + "Props".len()])) + && (i + "Props".len() == bytes.len() || !is_ident_byte(bytes[i + "Props".len()])) { analysis.has_props = true; let mut j = i + "Props".len(); @@ -270,9 +272,11 @@ fn text_scan_props_binding(source: &str, analysis: &mut PropsAnalysis) { fn module_items(root: &AnyJsRoot) -> Vec { match root { AnyJsRoot::JsModule(module) => module.items().iter().map(|i| i.into_syntax()).collect(), - AnyJsRoot::JsScript(script) => { - script.statements().iter().map(|s| s.into_syntax()).collect() - } + AnyJsRoot::JsScript(script) => script + .statements() + .iter() + .map(|s| s.into_syntax()) + .collect(), AnyJsRoot::TsDeclarationModule(decl) => { decl.items().iter().map(|i| i.into_syntax()).collect() } diff --git a/crates/astro2tsx/src/render.rs b/crates/astro2tsx/src/render.rs index cd1f6e11..9b976de3 100644 --- a/crates/astro2tsx/src/render.rs +++ b/crates/astro2tsx/src/render.rs @@ -175,7 +175,9 @@ fn emit_default_export(printer: &mut Printer, component: &str, analysis: &PropsA printer.write( "type ASTRO__ArrayElement = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;\n", ); - printer.write("type ASTRO__Flattened = T extends Array ? ASTRO__Flattened : T;\n"); + printer.write( + "type ASTRO__Flattened = T extends Array ? ASTRO__Flattened : T;\n", + ); printer.write("type ASTRO__InferredGetStaticPath = ASTRO__Flattened>>>;\n"); printer.write("type ASTRO__MergeUnion = T extends unknown ? T & { [P in Exclude]?: never } extends infer O ? { [P in keyof O]: O[P] } : never : never;\n"); printer.write("type ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[K] : never;\n"); @@ -358,16 +360,10 @@ fn render_single_text_expression(printer: &mut Printer, node: HtmlSingleTextExpr printer.write_with_mapping(&raw[..jsx_start], original_start); printer.map_nil(); printer.write(""); - printer.write_with_mapping( - &raw[jsx_start..jsx_end], - original_start + jsx_start as u32, - ); + printer.write_with_mapping(&raw[jsx_start..jsx_end], original_start + jsx_start as u32); printer.map_nil(); printer.write(""); - printer.write_with_mapping( - &raw[jsx_end..], - original_start + jsx_end as u32, - ); + printer.write_with_mapping(&raw[jsx_end..], original_start + jsx_end as u32); } else { printer.write_with_mapping(raw, original_start); } @@ -662,7 +658,9 @@ fn attributes_to_iter(node: &HtmlElement) -> Vec { fn classify_script_label(attrs: &[AnyHtmlAttribute]) -> &'static str { let type_value = find_attr_value(attrs, "type"); - let is_raw = attrs.iter().any(|a| attribute_key(a).as_deref() == Some("is:raw")); + let is_raw = attrs + .iter() + .any(|a| attribute_key(a).as_deref() == Some("is:raw")); if is_raw { return "raw"; } @@ -877,7 +875,10 @@ fn render_fragment_shorthand(printer: &mut Printer, node: &HtmlElement) { /// Position immediately after the last attribute (or the tag name when /// there are no attributes). Used to detect whether there's whitespace /// between the attributes and the closing `>`/`/>` of the open tag. -fn open_tag_attrs_end(name: &AnyHtmlTagName, attributes: &biome_html_syntax::HtmlAttributeList) -> u32 { +fn open_tag_attrs_end( + name: &AnyHtmlTagName, + attributes: &biome_html_syntax::HtmlAttributeList, +) -> u32 { let attrs: Vec<_> = attributes.iter().collect(); if let Some(last) = attrs.last() { return u32::from(last.range().end()); @@ -1304,7 +1305,11 @@ fn inner_range(node: &HtmlElement) -> Option<(u32, u32)> { let closing = node.closing_element().ok()?; let start = u32::from(opening.r_angle_token().ok()?.text_trimmed_range().end()); let end = u32::from(closing.l_angle_token().ok()?.text_trimmed_range().start()); - if start <= end { Some((start, end)) } else { None } + if start <= end { + Some((start, end)) + } else { + None + } } /// Copies `source[from..to]` into the output, attaching per-byte source diff --git a/crates/astro2tsx/test/astro2tsx.test.ts b/crates/astro2tsx/test/astro2tsx.test.ts index f0ab1c7c..ff3d66db 100644 --- a/crates/astro2tsx/test/astro2tsx.test.ts +++ b/crates/astro2tsx/test/astro2tsx.test.ts @@ -9,9 +9,7 @@ test('emits the TSX prefix and a Fragment-wrapped body', () => { }); test('rewrites top-level returns to throws', () => { - const result = convertToTsx( - "---\nif (cond) {\n\treturn Astro.redirect('/x');\n}\n---\n", - ); + const result = convertToTsx("---\nif (cond) {\n\treturn Astro.redirect('/x');\n}\n---\n"); assert.match(result.code, /throw\s+Astro\.redirect/); assert.doesNotMatch(result.code, /return Astro\.redirect/); }); @@ -33,13 +31,10 @@ test('reports parse errors but still produces output', () => { }); test('records frontmatter and body byte ranges', () => { - const result = convertToTsx("---\nlet x = 1;\n---\n

"); + const result = convertToTsx('---\nlet x = 1;\n---\n

'); assert.ok(result.frontmatter.end > result.frontmatter.start); assert.ok(result.body.end > result.body.start); - const frontmatterSlice = result.code.slice( - result.frontmatter.start, - result.frontmatter.end, - ); + const frontmatterSlice = result.code.slice(result.frontmatter.start, result.frontmatter.end); assert.match(frontmatterSlice, /let x = 1;/); }); diff --git a/crates/astro2tsx/tests/upstream_corpus.rs b/crates/astro2tsx/tests/upstream_corpus.rs index c5e3a703..79b1bbe8 100644 --- a/crates/astro2tsx/tests/upstream_corpus.rs +++ b/crates/astro2tsx/tests/upstream_corpus.rs @@ -125,8 +125,7 @@ fn report_parity_with_upstream() { let corpus = load_corpus(); assert!(!corpus.is_empty(), "corpus is empty — regenerate it"); - let mut by_file: BTreeMap, Vec)> = - BTreeMap::new(); + let mut by_file: BTreeMap, Vec)> = BTreeMap::new(); for record in &corpus { let actual = convert_to_tsx( From e756b92f86465936ed981aadc6bb2914310ba2af Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Tue, 11 Aug 2026 02:57:59 +0200 Subject: [PATCH 03/50] test(astro2tsx): assert corpus parity instead of only reporting it --- crates/astro2tsx/tests/upstream_corpus.rs | 98 ++++++++++++++--------- 1 file changed, 61 insertions(+), 37 deletions(-) diff --git a/crates/astro2tsx/tests/upstream_corpus.rs b/crates/astro2tsx/tests/upstream_corpus.rs index 79b1bbe8..05e71260 100644 --- a/crates/astro2tsx/tests/upstream_corpus.rs +++ b/crates/astro2tsx/tests/upstream_corpus.rs @@ -19,16 +19,20 @@ use std::collections::BTreeMap; /// - `` to balance JSX. tsserver parses unbalanced JSX just /// fine, so we leave it unbalanced and avoid the synthetic span. +// Occurrence disambiguates basic.ts's two same-named "preserves spaces in tag" cases. const INTENTIONAL_DIVERGENCES: &[&str] = &[ - "does not escape tag opening unnecessarily II", - "does not escape tag opening unnecessarily III", - "preserves spaces in tag", - "preserves line returns in tag by transforming to space", + "escape.ts::does not escape tag opening unnecessarily II [1]", + "escape.ts::does not escape tag opening unnecessarily III [1]", + "basic.ts::preserves spaces in tag [2]", + "basic.ts::preserves line returns in tag by transforming to space [1]", ]; +fn record_key(record: &Record, occurrence: usize) -> String { + format!("{}::{} [{occurrence}]", record.file, record.name) +} + #[derive(Debug, Deserialize)] struct Record { - #[allow(dead_code)] file: String, name: String, input: String, @@ -121,13 +125,23 @@ fn dump_first_diff_per_file() { } #[test] -fn report_parity_with_upstream() { +fn corpus_parity() { let corpus = load_corpus(); assert!(!corpus.is_empty(), "corpus is empty — regenerate it"); - let mut by_file: BTreeMap, Vec)> = BTreeMap::new(); + let mut occurrences: BTreeMap<(String, String), usize> = BTreeMap::new(); + let mut keys: Vec = Vec::new(); + let mut regressions: Vec = Vec::new(); + let mut resolved: Vec = Vec::new(); for record in &corpus { + let occurrence = occurrences + .entry((record.file.clone(), record.name.clone())) + .or_insert(0); + *occurrence += 1; + let key = record_key(record, *occurrence); + keys.push(key.clone()); + let actual = convert_to_tsx( &record.input, ConvertOptions { @@ -136,38 +150,48 @@ fn report_parity_with_upstream() { ) .code; - let entry = by_file - .entry(record.file.clone()) - .or_insert((0, 0, Vec::new(), Vec::new())); - entry.1 += 1; - let expected_trimmed = strip_inline_sourcemap(&record.expected); - let actual_trimmed = strip_inline_sourcemap(&actual); - if actual_trimmed == expected_trimmed { - entry.0 += 1; - } else if INTENTIONAL_DIVERGENCES.contains(&record.name.as_str()) { - entry.3.push(record.name.clone()); - } else { - entry.2.push(record.name.clone()); + let matched = strip_inline_sourcemap(&actual) == strip_inline_sourcemap(&record.expected); + let allowed = INTENTIONAL_DIVERGENCES.contains(&key.as_str()); + + match (matched, allowed) { + (false, false) => regressions.push(format!( + " {key}\n input: {:?}\n expected: {:?}\n actual: {:?}", + record.input, + strip_inline_sourcemap(&record.expected), + strip_inline_sourcemap(&actual), + )), + (true, true) => resolved.push(key), + _ => {} } } - let mut total_pass = 0; - let mut total_diverge = 0; - let mut total_count = 0; - eprintln!("\n== upstream tsx test parity =="); - for (file, (pass, total, failing, divergent)) in &by_file { - total_pass += pass; - total_diverge += divergent.len(); - total_count += total; - eprintln!(" {file}: {pass}/{total}"); - for name in failing { - eprintln!(" - FAIL: {name}"); - } - for name in divergent { - eprintln!(" - DIVERGE (intentional): {name}"); - } + let unmatched: Vec<&str> = INTENTIONAL_DIVERGENCES + .iter() + .copied() + .filter(|listed| !keys.iter().any(|key| key == listed)) + .collect(); + + let mut failure = String::new(); + if !regressions.is_empty() { + failure.push_str(&format!( + "{} case(s) diverge but are not listed in INTENTIONAL_DIVERGENCES:\n{}\n", + regressions.len(), + regressions.join("\n"), + )); + } + if !resolved.is_empty() { + failure.push_str(&format!( + "{} listed divergence(s) now match and must be removed from the list:\n {}\n", + resolved.len(), + resolved.join("\n "), + )); + } + if !unmatched.is_empty() { + failure.push_str(&format!( + "{} listed divergence(s) match no corpus record:\n {}\n", + unmatched.len(), + unmatched.join("\n "), + )); } - eprintln!( - "---\n total: {total_pass}/{total_count} (+ {total_diverge} intentional divergences)\n" - ); + assert!(failure.is_empty(), "\n{failure}"); } From 02f6b172fe318311f8f3750908b175539dba30d2 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Tue, 11 Aug 2026 09:20:05 +0200 Subject: [PATCH 04/50] build(astro2tsx): build against the biome fork on rust 1.96.1 --- .gitignore | 1 - Cargo.lock | 2670 +++++++++++++++++++++++++++ crates/astro2tsx/Cargo.toml | 16 +- crates/astro2tsx/src/frontmatter.rs | 3 +- crates/astro2tsx/src/lib.rs | 2 +- crates/astro2tsx/src/props.rs | 4 +- crates/astro2tsx/src/render.rs | 32 +- rust-toolchain.toml | 2 +- 8 files changed, 2704 insertions(+), 26 deletions(-) create mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index 58ee8f35..e388f8a4 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ crates/astro_napi/npm # Rust /target -Cargo.lock .idea/ # insta pending snapshots diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..a6dd2af1 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2670 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.4", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "astro2tsx" +version = "0.1.0" +dependencies = [ + "biome_html_parser", + "biome_html_syntax", + "biome_js_parser", + "biome_js_syntax", + "biome_languages", + "biome_rowan", + "napi", + "napi-build", + "napi-derive", + "serde", + "serde_json", +] + +[[package]] +name = "astro_codegen" +version = "0.1.0" +dependencies = [ + "cow-utils", + "divan", + "insta", + "lightningcss", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_codegen", + "oxc_data_structures", + "oxc_diagnostics", + "oxc_parser", + "oxc_semantic", + "oxc_sourcemap", + "oxc_span", + "oxc_syntax", + "oxc_transformer", + "rustc-hash", + "serde_json", + "smallvec", +] + +[[package]] +name = "astro_napi" +version = "0.0.0" +dependencies = [ + "astro_codegen", + "mimalloc-safe", + "napi", + "napi-build", + "napi-derive", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_diagnostics", + "oxc_estree", + "oxc_parser", + "oxc_span", +] + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "backtrace" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-link", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64-simd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" +dependencies = [ + "outref", + "vsimd", +] + +[[package]] +name = "biome_aria" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_aria_metadata", + "biome_string_case", +] + +[[package]] +name = "biome_aria_metadata" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_deserialize", + "biome_deserialize_macros", + "biome_string_case", + "prettyplease", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn 2.0.119", +] + +[[package]] +name = "biome_console" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_markup", + "biome_text_size", + "serde", + "termcolor", + "unicode-segmentation", + "unicode-width 0.1.14", +] + +[[package]] +name = "biome_db" +version = "0.0.1" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_diagnostics", + "biome_parser", + "biome_rowan", + "camino", + "salsa", +] + +[[package]] +name = "biome_deserialize" +version = "0.6.0" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_console", + "biome_diagnostics", + "biome_json_parser", + "biome_json_syntax", + "biome_rowan", + "enumflags2", +] + +[[package]] +name = "biome_deserialize_macros" +version = "0.6.0" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_string_case", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "biome_diagnostics" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "backtrace", + "biome_console", + "biome_diagnostics_categories", + "biome_diagnostics_macros", + "biome_rowan", + "biome_text_edit", + "biome_text_size", + "enumflags2", + "serde", + "serde_json", + "termcolor", + "terminal_size", + "unicode-width 0.1.14", +] + +[[package]] +name = "biome_diagnostics_categories" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "quote", + "serde", +] + +[[package]] +name = "biome_diagnostics_macros" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "biome_html_factory" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_html_syntax", + "biome_rowan", +] + +[[package]] +name = "biome_html_parser" +version = "0.0.1" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_console", + "biome_diagnostics", + "biome_html_factory", + "biome_html_syntax", + "biome_languages", + "biome_parser", + "biome_rowan", + "biome_string_case", + "biome_unicode_table", + "tracing", +] + +[[package]] +name = "biome_html_syntax" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_aria", + "biome_parser", + "biome_rowan", + "biome_string_case", + "camino", + "serde", +] + +[[package]] +name = "biome_js_factory" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_js_syntax", + "biome_rowan", +] + +[[package]] +name = "biome_js_parser" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_console", + "biome_diagnostics", + "biome_js_factory", + "biome_js_syntax", + "biome_languages", + "biome_parser", + "biome_rowan", + "biome_unicode_table", + "drop_bomb", + "enumflags2", + "indexmap", + "rustc-hash", + "serde_json", + "smallvec", + "tracing", +] + +[[package]] +name = "biome_js_syntax" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_aria", + "biome_aria_metadata", + "biome_rowan", + "biome_string_case", + "camino", + "enumflags2", + "serde", +] + +[[package]] +name = "biome_json_factory" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_json_syntax", + "biome_rowan", +] + +[[package]] +name = "biome_json_parser" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_console", + "biome_diagnostics", + "biome_json_factory", + "biome_json_syntax", + "biome_languages", + "biome_parser", + "biome_rowan", + "biome_unicode_table", + "tracing", + "unicode-bom", +] + +[[package]] +name = "biome_json_syntax" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_rowan", + "serde", +] + +[[package]] +name = "biome_languages" +version = "0.1.0" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_console", + "biome_db", + "biome_rowan", + "biome_string_case", + "camino", + "directories", + "salsa", + "serde", + "tracing", +] + +[[package]] +name = "biome_markup" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "proc-macro-error2", + "proc-macro2", + "quote", +] + +[[package]] +name = "biome_parser" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_console", + "biome_diagnostics", + "biome_rowan", + "biome_unicode_table", + "drop_bomb", + "enumflags2", + "unicode-bom", +] + +[[package]] +name = "biome_rowan" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_text_edit", + "biome_text_size", + "hashbrown 0.15.5", + "rustc-hash", + "serde", +] + +[[package]] +name = "biome_string_case" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_rowan", + "caseless", +] + +[[package]] +name = "biome_text_edit" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "biome_text_size", + "serde", + "similar", +] + +[[package]] +name = "biome_text_size" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" +dependencies = [ + "serde", +] + +[[package]] +name = "biome_unicode_table" +version = "0.5.7" +source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" + +[[package]] +name = "bitflags" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" +dependencies = [ + "serde_core", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "boxcar" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f64beae40a84da1b4b26ff2761a5b895c12adc41dc25aaee1c4f2bbfe97a6e" + +[[package]] +name = "bstr" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f" +dependencies = [ + "memchr", + "regex-automata", + "serde_core", +] + +[[package]] +name = "camino" +version = "1.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb1307f12aa967b5a58416e87b3653360e0fd614a016b6e970db08fecbb1b80d" + +[[package]] +name = "caseless" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6fd507454086c8edfd769ca6ada439193cdb209c7681712ef6275cccbfe5d8" +dependencies = [ + "unicode-normalization", +] + +[[package]] +name = "castaway" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" +dependencies = [ + "rustversion", +] + +[[package]] +name = "cc" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d262e149917187838d5b42777c8253bcb64500067342904e7d429499a6f277e" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "clap" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "473c7e07f409a8d772161724aa8db6a765a2532a70f9667eeb7b49d3d02fbdca" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b48fea5a88e9ae728a2dcbedbfc0e730f7d60da42e1cb049a83c9fb8b789889" +dependencies = [ + "anstyle", + "clap_lex", + "terminal_size", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + +[[package]] +name = "cobs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" +dependencies = [ + "thiserror", +] + +[[package]] +name = "compact_str" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dfdd1c2274d9aa354115b09dc9a901d6c5576818cdf70d14cae2bdb47df00ab" +dependencies = [ + "castaway", + "cfg-if", + "itoa", + "rustversion", + "ryu", + "serde", + "static_assertions", +] + +[[package]] +name = "condtype" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf0a07a401f374238ab8e2f11a104d2851bf9ce711ec69804834de8af45c7af" + +[[package]] +name = "console" +version = "0.16.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fe5f465a4f6fee88fad41b85d990f84c835335e85b5d9e6e63e0d06d28cba7c" +dependencies = [ + "encode_unicode", + "libc", + "windows-sys", +] + +[[package]] +name = "const-str" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18f12cc9948ed9604230cdddc7c86e270f9401ccbe3c2e98a4378c5e7632212f" + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "convert_case" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "affbf0190ed2caf063e3def54ff444b449371d55c58e513a95ab98eca50adb49" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "cow-utils" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "417bef24afe1460300965a25ff4a24b8b45ad011948302ec221e8a0a81eb2c79" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803d13fb3b09d88be9f4dbc29062c66b19bf7170867ceb746d2a8689bf6c7a26" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "cssparser" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9cdaae01d5ed7882b04d795e7f752f46ff52d2fa3b50a20d28c464510bba98" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa", + "phf 0.13.1", + "smallvec", +] + +[[package]] +name = "cssparser-color" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa233e1dcd9c13a5d3e3a8a2c0f5a727bac380398345dbcb31db4597edc86b" +dependencies = [ + "cssparser", +] + +[[package]] +name = "cssparser-macros" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a2a99df6e410a8ff4245aa2006499ea662245f967cc7c0a38c83ef8eb44dbf" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "ctor" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d" + +[[package]] +name = "data-encoding" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06" + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "directories" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16f5094c54661b38d03bd7e50df373292118db60b585c08a411c6d840017fe7d" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys", +] + +[[package]] +name = "divan" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a405457ec78b8fe08b0e32b4a3570ab5dff6dd16eb9e76a5ee0a9d9cbd898933" +dependencies = [ + "cfg-if", + "clap", + "condtype", + "divan-macros", + "libc", + "regex-lite", +] + +[[package]] +name = "divan-macros" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9556bc800956545d6420a640173e5ba7dfa82f38d3ea5a167eb555bc69ac3323" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "dragonbox_ecma" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd8e701084c37e7ef62d3f9e453b618130cbc0ef3573847785952a3ac3f746bf" + +[[package]] +name = "drop_bomb" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bda8e21c04aca2ae33ffc2fd8c23134f3cac46db123ba97bd9d3f3b8a4a85e1" + +[[package]] +name = "dtoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" + +[[package]] +name = "dtoa-short" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" +dependencies = [ + "dtoa", +] + +[[package]] +name = "either" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" + +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "enumflags2" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "find-msvc-tools" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b73573e6edcd2af0cdf47bd6cb58f0b3839491263c314eaad1ccf24430e1de" + +[[package]] +name = "flate2" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "futures" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88cf1f829d945f548cf8fec32c61b1f202b6d93b45848602fc02af4b12ad218" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "262590f4fe6afeb0bc83be1daa64e52657fe185690a958af7f3ad0e92085c5ae" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7" + +[[package]] +name = "futures-executor" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6754879cc9f2c66f88c6e5c35344bb0bdb0708b0352b1201815667c7eabc7458" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4577ecaa3c4f96589d473f679a71b596316f6641bc350038b962a5daf0085d7a" + +[[package]] +name = "futures-macro" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d6d3cde68c518367be28956066ddfef33813991b77a55005a69dae04bf3b10b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "futures-sink" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e34418ac499d6305c2fb5ad0ed2f6ac998c5f8ca209b4510f7f94242c647e307" + +[[package]] +name = "futures-task" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109" + +[[package]] +name = "futures-util" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", +] + +[[package]] +name = "gimli" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" + +[[package]] +name = "globset" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07c34a9410465b45bd9787443bc7370f37735bad04b0f0cd57ff1a3186c98988" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashlink" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32069d97bb81e38fa67eab65e3393bf804bb85969f2bc06bf13f64aef5aba248" +dependencies = [ + "hashbrown 0.17.1", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", + "serde", + "serde_core", +] + +[[package]] +name = "insta" +version = "1.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f0f8fee8c926415c58d6ae43a08523a26faccb2323f5e6b644fe7dd4ef6b82" +dependencies = [ + "console", + "globset", + "once_cell", + "similar", + "tempfile", + "walkdir", +] + +[[package]] +name = "intrusive-collections" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4275b20e6057cd7733fd8df8a5a31701e4fe44497dad0f3fa0e1c4fb971506be" + +[[package]] +name = "inventory" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b" +dependencies = [ + "rustversion", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "json-escape-simd" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c22a2041e3874a055a4eb03ea2395aaccdefa84ce75b31d542d72a741c3c6ad3" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + +[[package]] +name = "libloading" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754ca22de805bb5744484a5b151a9e1a8e837d5dc232c2d7d8c2e3492edc8b60" +dependencies = [ + "cfg-if", + "windows-link", +] + +[[package]] +name = "libmimalloc-sys2" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "921641155d9dc4f434332abd912518e33c70e37c557434818b6cfd1fbbb6138d" +dependencies = [ + "cc", + "cmake", + "libc", +] + +[[package]] +name = "libredox" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2026a5056764a10b2bf5d56488cba40da507f5493a6a429340e2004d9ed085fa" +dependencies = [ + "libc", +] + +[[package]] +name = "lightningcss" +version = "1.0.0-alpha.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d31b760f96e8fdfe1d0c295e4bf76c503d6f15d2d470d53bd8cd1f7aa8c7d934" +dependencies = [ + "ahash", + "bitflags", + "const-str", + "cssparser", + "cssparser-color", + "data-encoding", + "getrandom 0.3.4", + "indexmap", + "itertools 0.10.5", + "lazy_static", + "lightningcss-derive", + "parcel_selectors", + "pastey", + "pathdiff", + "smallvec", + "static-self", +] + +[[package]] +name = "lightningcss-derive" +version = "1.0.0-alpha.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12744d1279367caed41739ef094c325d53fb0ffcd4f9b84a368796f870252" +dependencies = [ + "convert_case 0.6.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "mimalloc-safe" +version = "0.1.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afd082b59cfceeb3bf31dbff65e7b96e1f94fa9b918e131d02353e6867a12824" +dependencies = [ + "libmimalloc-sys2", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "napi" +version = "3.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "459197f1592f4c3dbbf9c1b13f5a4599a343e4ef66b96bc340e2a518b36a6662" +dependencies = [ + "bitflags", + "ctor", + "futures", + "libc", + "napi-build", + "napi-sys", + "nohash-hasher", + "rustc-hash", + "tokio", +] + +[[package]] +name = "napi-build" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60fdf9b392c50e7c4170fa633bd909490ed7835cea4c046776d1a4dd8d2ae0ab" + +[[package]] +name = "napi-derive" +version = "3.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa55ea69990c90b888e9e77044410e304ce7f35de599dc6d0b5c1923d2e59af" +dependencies = [ + "convert_case 0.11.0", + "ctor", + "napi-derive-backend", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "napi-derive-backend" +version = "6.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df4056ac7c18e4438ccf0edaed4340ca0d269278c8ec19284f7b23cb039fd0ae" +dependencies = [ + "convert_case 0.11.0", + "proc-macro2", + "quote", + "semver", + "syn 2.0.119", +] + +[[package]] +name = "napi-sys" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85fbf1fa9f1babfe396d74bbbf52b3643770243e8f5b0b46715d4caf7f0dfc9a" +dependencies = [ + "libloading", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nonmax" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "610a5acd306ec67f907abe5567859a3c693fb9886eb1f012ab8f2a47bef3db51" + +[[package]] +name = "num-bigint" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "outref" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" + +[[package]] +name = "owo-colors" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d211803b9b6b570f68772237e415a029d5a50c65d382910b879fb19d3271f94d" + +[[package]] +name = "oxc-browserslist" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb7a1163a5501f935f8722d839b576491b749c695e7a066aa0b8df988b806df" +dependencies = [ + "flate2", + "postcard", + "rustc-hash", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "oxc-miette" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4356a61f2ed4c9b3610245215fbf48970eb277126919f87db9d0efa93a74245c" +dependencies = [ + "cfg-if", + "owo-colors", + "oxc-miette-derive", + "textwrap", + "thiserror", + "unicode-segmentation", + "unicode-width 0.2.2", +] + +[[package]] +name = "oxc-miette-derive" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b237422b014f8f8fff75bb9379e697d13f8d57551a22c88bebb39f073c1bf696" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "oxc_allocator" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "allocator-api2", + "hashbrown 0.16.1", + "oxc_data_structures", + "oxc_estree", + "rustc-hash", + "serde", +] + +[[package]] +name = "oxc_ast" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "bitflags", + "oxc_allocator", + "oxc_ast_macros", + "oxc_data_structures", + "oxc_diagnostics", + "oxc_estree", + "oxc_regular_expression", + "oxc_span", + "oxc_syntax", +] + +[[package]] +name = "oxc_ast_macros" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "phf 0.13.1", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "oxc_ast_visit" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "oxc_allocator", + "oxc_ast", + "oxc_span", + "oxc_syntax", +] + +[[package]] +name = "oxc_codegen" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "bitflags", + "cow-utils", + "dragonbox_ecma", + "itoa", + "oxc_allocator", + "oxc_ast", + "oxc_data_structures", + "oxc_index", + "oxc_semantic", + "oxc_sourcemap", + "oxc_span", + "oxc_syntax", + "rustc-hash", +] + +[[package]] +name = "oxc_compat" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "cow-utils", + "oxc-browserslist", + "oxc_syntax", + "rustc-hash", + "serde", +] + +[[package]] +name = "oxc_data_structures" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "ropey", +] + +[[package]] +name = "oxc_diagnostics" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "cow-utils", + "oxc-miette", + "percent-encoding", +] + +[[package]] +name = "oxc_ecmascript" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "cow-utils", + "num-bigint", + "num-traits", + "oxc_allocator", + "oxc_ast", + "oxc_regular_expression", + "oxc_span", + "oxc_syntax", +] + +[[package]] +name = "oxc_estree" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "dragonbox_ecma", + "itoa", + "oxc_data_structures", +] + +[[package]] +name = "oxc_index" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3e6120999627ec9703025eab7c9f410ebb7e95557632a8902ca48210416c2b" +dependencies = [ + "nonmax", + "serde", +] + +[[package]] +name = "oxc_parser" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "bitflags", + "cow-utils", + "memchr", + "num-bigint", + "num-traits", + "oxc_allocator", + "oxc_ast", + "oxc_data_structures", + "oxc_diagnostics", + "oxc_ecmascript", + "oxc_regular_expression", + "oxc_span", + "oxc_syntax", + "rustc-hash", + "seq-macro", +] + +[[package]] +name = "oxc_regular_expression" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "bitflags", + "oxc_allocator", + "oxc_ast_macros", + "oxc_diagnostics", + "oxc_span", + "phf 0.13.1", + "rustc-hash", + "unicode-id-start", +] + +[[package]] +name = "oxc_semantic" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "itertools 0.14.0", + "memchr", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_data_structures", + "oxc_diagnostics", + "oxc_ecmascript", + "oxc_index", + "oxc_span", + "oxc_syntax", + "rustc-hash", + "self_cell", + "smallvec", +] + +[[package]] +name = "oxc_sourcemap" +version = "6.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d378eb8bad20e89d66276aebab51f6a5408571092cac94abdd3eabb773713d6" +dependencies = [ + "base64-simd", + "json-escape-simd", + "rustc-hash", + "serde", + "serde_json", +] + +[[package]] +name = "oxc_span" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "compact_str", + "oxc-miette", + "oxc_allocator", + "oxc_ast_macros", + "oxc_estree", + "oxc_str", + "serde", +] + +[[package]] +name = "oxc_str" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "compact_str", + "hashbrown 0.16.1", + "oxc_allocator", + "oxc_estree", + "serde", +] + +[[package]] +name = "oxc_syntax" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "bitflags", + "cow-utils", + "dragonbox_ecma", + "nonmax", + "oxc_allocator", + "oxc_ast_macros", + "oxc_estree", + "oxc_index", + "oxc_span", + "phf 0.13.1", + "serde", + "unicode-id-start", +] + +[[package]] +name = "oxc_transformer" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "base64", + "compact_str", + "indexmap", + "itoa", + "memchr", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_compat", + "oxc_data_structures", + "oxc_diagnostics", + "oxc_ecmascript", + "oxc_regular_expression", + "oxc_semantic", + "oxc_span", + "oxc_syntax", + "oxc_traverse", + "rustc-hash", + "serde", + "serde_json", + "sha1", +] + +[[package]] +name = "oxc_traverse" +version = "0.115.0" +source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" +dependencies = [ + "itoa", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_data_structures", + "oxc_ecmascript", + "oxc_semantic", + "oxc_span", + "oxc_str", + "oxc_syntax", + "rustc-hash", +] + +[[package]] +name = "parcel_selectors" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05f71e01edca03d245ab0a9f7ce13a974ceb79baaae8faf2ba0b11de6b90913" +dependencies = [ + "bitflags", + "cssparser", + "log", + "phf 0.11.3", + "phf_codegen", + "precomputed-hash", + "rustc-hash", + "smallvec", + "static-self", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "pastey" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" + +[[package]] +name = "pathdiff" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_shared 0.11.3", +] + +[[package]] +name = "phf" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +dependencies = [ + "phf_macros", + "phf_shared 0.13.1", + "serde", +] + +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared 0.11.3", + "rand", +] + +[[package]] +name = "phf_generator" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" +dependencies = [ + "fastrand", + "phf_shared 0.13.1", +] + +[[package]] +name = "phf_macros" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" +dependencies = [ + "phf_generator 0.13.1", + "phf_shared 0.13.1", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "portable-atomic" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" + +[[package]] +name = "postcard" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "serde", +] + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.119", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" +dependencies = [ + "getrandom 0.2.17", + "libredox", + "thiserror", +] + +[[package]] +name = "regex-automata" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-lite" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "ropey" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93411e420bcd1a75ddd1dc3caf18c23155eda2c090631a85af21ba19e97093b5" +dependencies = [ + "smallvec", + "str_indices", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb" + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "salsa" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbaab832e2ea754afda4a738f987dd1e8bd30c9e5d8c981ee6a3934386095e2" +dependencies = [ + "boxcar", + "crossbeam-queue", + "crossbeam-utils", + "hashbrown 0.17.1", + "hashlink", + "indexmap", + "intrusive-collections", + "inventory", + "parking_lot", + "portable-atomic", + "rayon", + "rustc-hash", + "salsa-macro-rules", + "salsa-macros", + "smallvec", + "thin-vec", + "tracing", + "typeid", +] + +[[package]] +name = "salsa-macro-rules" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de6872462ac73d39969a836273c24163e6a26a4e08f5114fcd80e25af30ea9c6" + +[[package]] +name = "salsa-macros" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc78ffaf65b1a9175818592c5130aa10b1bb245a905722fd4db87cea8a8457" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "self_cell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab42ca02749e120097e328d91d415325bdf43b1c72c4c8badf37375fe40a813" + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "seq-macro" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc" + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "serde_json" +version = "1.0.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "sha1" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "simd-adler32" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" + +[[package]] +name = "similar" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" +dependencies = [ + "bstr", + "unicode-segmentation", +] + +[[package]] +name = "siphasher" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" +dependencies = [ + "serde", +] + +[[package]] +name = "smawk" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8e2fb0f499abb4d162f2bedad68f5ef91a1682b5a03596ddb67efd37768d100" + +[[package]] +name = "static-self" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6635404b73efc136af3a7956e53c53d4f34b2f16c95a15c438929add0f69412" +dependencies = [ + "indexmap", + "smallvec", + "static-self-derive", +] + +[[package]] +name = "static-self-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5268c96d4b907c558a9a52d8492522d6c7b559651a5e1d8f2d551e461b9425d5" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "str_indices" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08889ec5408683408db66ad89e0e1f93dff55c73a4ccc71c427d5b277ee47e6" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.3", + "once_cell", + "rustix", + "windows-sys", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "terminal_size" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" +dependencies = [ + "rustix", + "windows-sys", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width 0.2.2", +] + +[[package]] +name = "thin-vec" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79def32ffcd477db1ff26f76dab9e3a91f0bd42a85ca96577089b24623056f9d" + +[[package]] +name = "thiserror" +version = "2.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "tinyvec" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" +dependencies = [ + "pin-project-lite", +] + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "unicode-bom" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" + +[[package]] +name = "unicode-id-start" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81b79ad29b5e19de4260020f8919b443b2ef0277d242ce532ec7b7a2cc8b6007" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + +[[package]] +name = "unicode-normalization" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.4+wasi-0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "zerocopy" +version = "0.8.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556764e583adb45a9f8d413c2a147fa7e8d821e48e12b14fd560b607998b75eb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ab42fc20575779bd240faa45f94a74256f755c0fa9e89f0ede20d91d0cdfc1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/crates/astro2tsx/Cargo.toml b/crates/astro2tsx/Cargo.toml index d72b211d..fc5b45f2 100644 --- a/crates/astro2tsx/Cargo.toml +++ b/crates/astro2tsx/Cargo.toml @@ -14,17 +14,13 @@ crate-type = ["cdylib", "lib"] test = true doctest = false -# Path deps into a sibling Biome checkout. Cargo follows the path into -# Biome's own workspace, so the `workspace = true` deps inside each -# Biome crate resolve from `../../../biome/Cargo.toml`. Switch to git -# deps once the Astro-specific lexer changes (template-literal attribute -# values) land in a published Biome version. [dependencies] -biome_html_parser = { path = "../../../biome/crates/biome_html_parser" } -biome_html_syntax = { path = "../../../biome/crates/biome_html_syntax" } -biome_js_parser = { path = "../../../biome/crates/biome_js_parser" } -biome_js_syntax = { path = "../../../biome/crates/biome_js_syntax" } -biome_rowan = { path = "../../../biome/crates/biome_rowan" } +biome_html_parser = { git = "https://github.com/Princesseuh/biome", branch = "fix/astro" } +biome_html_syntax = { git = "https://github.com/Princesseuh/biome", branch = "fix/astro" } +biome_js_parser = { git = "https://github.com/Princesseuh/biome", branch = "fix/astro" } +biome_js_syntax = { git = "https://github.com/Princesseuh/biome", branch = "fix/astro" } +biome_languages = { git = "https://github.com/Princesseuh/biome", branch = "fix/astro" } +biome_rowan = { git = "https://github.com/Princesseuh/biome", branch = "fix/astro" } napi = { workspace = true } napi-derive = { workspace = true } diff --git a/crates/astro2tsx/src/frontmatter.rs b/crates/astro2tsx/src/frontmatter.rs index bc6a76bd..ba40366a 100644 --- a/crates/astro2tsx/src/frontmatter.rs +++ b/crates/astro2tsx/src/frontmatter.rs @@ -9,7 +9,8 @@ //! aligned with the original file. use biome_js_parser::{JsParserOptions, parse}; -use biome_js_syntax::{AnyJsRoot, JsFileSource, JsReturnStatement, JsSyntaxKind}; +use biome_js_syntax::{AnyJsRoot, JsReturnStatement, JsSyntaxKind}; +use biome_languages::JsFileSource; use biome_rowan::{AstNode, WalkEvent}; /// Returns the byte offsets (relative to `source`) of every `return` diff --git a/crates/astro2tsx/src/lib.rs b/crates/astro2tsx/src/lib.rs index 4f585a13..b8fb2799 100644 --- a/crates/astro2tsx/src/lib.rs +++ b/crates/astro2tsx/src/lib.rs @@ -28,7 +28,7 @@ pub mod sourcemap; mod utils; use biome_html_parser::parse_html; -use biome_html_syntax::HtmlFileSource; +use biome_languages::HtmlFileSource; pub use crate::sourcemap::{ExtractedKind, ExtractedTag, GeneratedRange, Mapping}; diff --git a/crates/astro2tsx/src/props.rs b/crates/astro2tsx/src/props.rs index 97f24eb4..133df315 100644 --- a/crates/astro2tsx/src/props.rs +++ b/crates/astro2tsx/src/props.rs @@ -11,9 +11,9 @@ use biome_js_parser::{JsParserOptions, parse}; use biome_js_syntax::{ - AnyJsRoot, JsFileSource, JsLanguage, JsSyntaxKind, TsInterfaceDeclaration, - TsTypeAliasDeclaration, + AnyJsRoot, JsLanguage, JsSyntaxKind, TsInterfaceDeclaration, TsTypeAliasDeclaration, }; +use biome_languages::JsFileSource; use biome_rowan::{AstNode, AstNodeList, SyntaxNode}; type JsNode = SyntaxNode; diff --git a/crates/astro2tsx/src/render.rs b/crates/astro2tsx/src/render.rs index 9b976de3..1ce62554 100644 --- a/crates/astro2tsx/src/render.rs +++ b/crates/astro2tsx/src/render.rs @@ -257,11 +257,14 @@ fn render_element(printer: &mut Printer, element: AnyHtmlElement) { AnyHtmlElement::HtmlSelfClosingElement(node) => { render_self_closing_element(printer, node); } - AnyHtmlElement::HtmlCdataSection(_) | AnyHtmlElement::HtmlBogusElement(_) => { - // CDATA and bogus nodes are passed through verbatim. They occur - // rarely in `.astro` and produce JSX-illegal output regardless, - // so the safest action is to preserve the original text and let - // downstream tooling surface diagnostics. + AnyHtmlElement::HtmlCdataSection(_) + | AnyHtmlElement::HtmlProcessingInstruction(_) + | AnyHtmlElement::HtmlBogusElement(_) => { + // CDATA, processing instructions, and bogus nodes are passed + // through verbatim. They occur rarely in `.astro` and produce + // JSX-illegal output regardless, so the safest action is to + // preserve the original text and let downstream tooling surface + // diagnostics. let range = element.range(); let text = slice_source(&printer.source, range); printer.write_with_mapping(&text, range_start(range)); @@ -343,15 +346,20 @@ fn render_single_text_expression(printer: &mut Printer, node: HtmlSingleTextExpr printer.map_to_offset(range_start(l_curly_range)); printer.write("{"); - if let Ok(literal) = expression.html_literal_token() { + if expression.html_literal_token().is_ok() { // The Biome HTML parser doesn't recurse into `{...}` bodies — it // stores the entire content as a single `HTML_LITERAL` token. So // we manually scan for embedded JSX and, if present, splice in // `...` around it: TS needs a single // expression, and bare JSX inside a JS expression is interpreted // as a comparison without that wrapper. - let raw = literal.text_trimmed(); - let original_start = u32::from(literal.text_trimmed_range().start()); + // Whitespace touching `{` is trivia, which the literal token drops. + let original_start = u32::from(l_curly_range.end()); + let body = slice_source( + &printer.source, + TextRange::new(l_curly_range.end(), r_curly_range.start()), + ); + let raw = body.as_str(); if raw.is_empty() { printer.map_nil(); printer.write("(void 0)"); @@ -1043,7 +1051,10 @@ fn emit_attribute(printer: &mut Printer, attr: &AnyHtmlAttribute) { } } AnyHtmlAttribute::AnyAstroDirective(directive) => emit_astro_directive(printer, directive), - AnyHtmlAttribute::AnySvelteDirective(_) + AnyHtmlAttribute::AnyAngularBinding(_) + | AnyHtmlAttribute::AngularStructuralDirective(_) + | AnyHtmlAttribute::AngularTemplateRefVariable(_) + | AnyHtmlAttribute::AnySvelteDirective(_) | AnyHtmlAttribute::AnyVueDirective(_) | AnyHtmlAttribute::HtmlAttributeDoubleTextExpression(_) | AnyHtmlAttribute::HtmlBogusAttribute(_) @@ -1161,7 +1172,8 @@ fn emit_html_attribute(printer: &mut Printer, attr_node: &HtmlAttribute) { printer.map_nil(); printer.write("}"); } - AnyHtmlAttributeInitializer::VueVForValue(_) => { + AnyHtmlAttributeInitializer::SvelteTemplateAttributeValue(_) + | AnyHtmlAttributeInitializer::VueVForValue(_) => { // Not applicable in Astro mode. } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index c976725f..10001973 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.93.0" +channel = "1.96.1" profile = "default" From 9d20f56c7b03afd578492387b011709e59eb9479 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Tue, 11 Aug 2026 09:20:10 +0200 Subject: [PATCH 05/50] test(astro2tsx): port behavioral, error, and sourcemap coverage --- crates/astro2tsx/tests/ported_parity.rs | 328 ++++++++++++++++++++++ crates/astro2tsx/tests/upstream_corpus.rs | 15 +- 2 files changed, 331 insertions(+), 12 deletions(-) create mode 100644 crates/astro2tsx/tests/ported_parity.rs diff --git a/crates/astro2tsx/tests/ported_parity.rs b/crates/astro2tsx/tests/ported_parity.rs new file mode 100644 index 00000000..18d69a2e --- /dev/null +++ b/crates/astro2tsx/tests/ported_parity.rs @@ -0,0 +1,328 @@ +//! Behavioral, error-recovery, and sourcemap coverage for TSX conversion. + +use astro2tsx::{ConvertOptions, Mapping, convert_to_tsx}; + +fn convert(input: &str) -> astro2tsx::ConvertResult { + convert_to_tsx( + input, + ConvertOptions { + filename: Some("index.astro".to_string()), + }, + ) +} + +/// Line (1-based) and column (0-based, UTF-16 code units) of a byte offset. +fn line_col(source: &str, byte_offset: usize) -> (usize, usize) { + let mut line = 1usize; + let mut col = 0usize; + for (idx, ch) in source.char_indices() { + if idx >= byte_offset { + break; + } + if ch == '\n' { + line += 1; + col = 0; + } else { + col += ch.len_utf16(); + } + } + (line, col) +} + +fn snippet_offset(source: &str, snippet: &str) -> usize { + source + .find(snippet) + .unwrap_or_else(|| panic!("snippet {snippet:?} not found in input")) +} + +/// Greatest mapping whose `original` is at or before `byte`. +fn original_to_generated(mappings: &[Mapping], byte: u32) -> Option { + mappings + .iter() + .filter(|m| m.original.is_some_and(|o| o <= byte)) + .max_by_key(|m| m.original.unwrap()) + .map(|m| m.generated) +} + +enum Resolution { + /// Mapped offset lands exactly on the snippet in the generated output. + Exact, + /// Mapped offset lands elsewhere; carries the generated text found there. + Wrong(String), + Unmapped, +} + +/// Resolves a snippet's original offset to a generated offset and reports +/// whether the generated output actually carries the snippet there. +fn resolve(input: &str, snippet: &str) -> Resolution { + let result = convert(input); + let offset = snippet_offset(input, snippet) as u32; + let Some(generated) = original_to_generated(&result.mappings, offset) else { + return Resolution::Unmapped; + }; + let exact = result + .mappings + .iter() + .any(|m| m.original == Some(offset) && m.generated == generated); + let at = result.code.get(generated as usize..).unwrap_or(""); + if exact && at.starts_with(snippet) { + Resolution::Exact + } else { + let found: String = at.chars().take(snippet.chars().count().max(12)).collect(); + Resolution::Wrong(found) + } +} + +const SOURCEMAP_CASES: &[(&str, &str, &str)] = &[ + ("attributes/shorthand", "
", "name"), + ("attributes/empty-quoted", "
", "\""), + ( + "attributes/template-literal", + "---\n---\n", + "foo", + ), + ( + "attributes/multiline-quoted", + "", + "Z", + ), + ( + "deprecated/jsdoc", + "---\n /** @deprecated */\nconst deprecated = \"Astro\"\ndeprecated;\nconst hello = \"Astro\"\n---\n", + "deprecated;", + ), + ( + "error/svelte", + "---\nimport SvelteOptionalProps from \"./SvelteOptionalProps.svelte\"\n---\n\n", + "", + ), + ( + "error/vue", + "---\nimport SvelteError from \"./SvelteError.svelte\"\nimport VueError from \"./VueError.vue\"\n---\n\n\n", + "", + ), + ("frontmatter/bare", "---\nnonexistent\n---\n", "nonexistent"), + ( + "hover/plain", + "---\n const MyVariable = \"Astro\"\n\n /** Documentation */\n const MyDocumentedVariable = \"Astro\"\n\n /** @author Astro */\n const MyJSDocVariable = \"Astro\"\n---\n", + "MyVariable", + ), + ( + "hover/documented", + "---\n const MyVariable = \"Astro\"\n\n /** Documentation */\n const MyDocumentedVariable = \"Astro\"\n\n /** @author Astro */\n const MyJSDocVariable = \"Astro\"\n---\n", + "MyDocumentedVariable", + ), + ( + "hover/jsdoc", + "---\n const MyVariable = \"Astro\"\n\n /** Documentation */\n const MyDocumentedVariable = \"Astro\"\n\n /** @author Astro */\n const MyJSDocVariable = \"Astro\"\n---\n", + "MyJSDocVariable", + ), + ( + "module/invalid-import", + "---\n // valid\n import { foo } from './script.js';\n import ComponentAstro from './astro.astro';\n // invalid\n import { baz } from './script';\n foo;baz;ComponentAstro;\n---\n", + "'./script'", + ), + ("multibyte/content", "

", "ツ"), + ("multibyte/after", "

foobar

", "foobar"), + ("multibyte/many-n", "

こんにちは

", "ん"), + ("multibyte/many-ni", "

こんにちは

", "に"), + ("tags/close", "", ">"), + ("template/basic", "
{nonexistent}
", "nonexistent"), + ("template/dot", "
{console.log(hey)}
", "log"), + ("template/addition", "{\"hello\" + hey}", "hey"), + ( + "template/html-attribute", + "", + "color", + ), + ( + "template/complex-item", + "{[].map(ITEM => {\nv = \"what\";\nreturn
{ITEMS}
\n})}", + "ITEM", + ), + ( + "template/complex-items", + "{[].map(ITEM => {\nv = \"what\";\nreturn
{ITEMS}
\n})}", + "ITEMS", + ), + ( + "template/attributes", + "
", + "className", + ), + ( + "template/special-attributes", + "
", + "@on.click", + ), + ( + "windows/crlf-last-char", + "---\r\nimport { Meta } from '$lib/components/Meta.astro';\r\n---\r\n", + ";", + ), + ( + "windows/template-basic", + "
{\r\nnonexistent\r\n}
", + "nonexistent", + ), + ( + "windows/template-dot-lf", + "
{\nconsole.log(hey)\n}
", + "log", + ), + ( + "windows/template-dot-crlf", + "
{\r\nconsole.log(hey)\r\n}
", + "log", + ), + ("windows/addition-lf", "{\"hello\" + \nhey}", "hey"), + ("windows/addition-crlf", "{\"hello\" + \r\nhey}", "hey"), + ( + "windows/html-attribute-lf", + "", + "color", + ), + ( + "windows/html-attribute-crlf", + "", + "color", + ), + ( + "windows/complex-items", + "{[].map(ITEM => {\r\nv = \"what\";\r\nreturn
{ITEMS}
\r\n})}", + "ITEMS", + ), + ( + "windows/attributes", + "", + "className", + ), + ( + "windows/special-attributes", + "", + "@on.click", + ), + ( + "windows/whitespace", + "---\r\nimport A from \"a\";\r\n\timport B from \"b\";\r\n---\r\n", + "B", + ), +]; + +// Non-identifier attribute names map onto the opening quote of `"name":`, not the name. +const KNOWN_GAPS: &[&str] = &["template/special-attributes", "windows/special-attributes"]; + +#[test] +fn sourcemap_resolves_to_snippet() { + let mut failures = Vec::new(); + let mut fixed = Vec::new(); + for (label, input, snippet) in SOURCEMAP_CASES { + let (line, col) = line_col(input, snippet_offset(input, snippet)); + let known = KNOWN_GAPS.contains(label); + match resolve(input, snippet) { + Resolution::Exact if known => fixed.push(*label), + Resolution::Exact => {} + _ if known => {} + Resolution::Wrong(found) => failures.push(format!( + " {label}: {snippet:?} at {line}:{col} maps onto {found:?}" + )), + Resolution::Unmapped => failures.push(format!( + " {label}: {snippet:?} at {line}:{col} has no mapping" + )), + } + } + + let mut failure = String::new(); + if !failures.is_empty() { + failure.push_str(&format!( + "{}/{} sourcemap positions do not resolve to their snippet:\n{}\n", + failures.len(), + SOURCEMAP_CASES.len(), + failures.join("\n"), + )); + } + if !fixed.is_empty() { + failure.push_str(&format!( + "{} KNOWN_GAPS entr(y/ies) now resolve and must be removed:\n {}\n", + fixed.len(), + fixed.join("\n "), + )); + } + assert!(failure.is_empty(), "\n{failure}"); +} + +#[test] +#[ignore = "unterminated attribute values are emitted verbatim; recovery is not implemented"] +fn unfinished_constructs_recover() { + let cases = [ + ("
\n ", "class={``}"), + ("
", "id=\"gotcha\""), + ("
\n"); + let result = convert(&input); + assert!( + result.code.contains(frontmatter), + "non-latin frontmatter was not round-tripped verbatim:\n{}", + result.code + ); +} + +#[test] +fn handles_complex_generics() { + let input = "---\nimport type { GetStaticPaths, MDXInstance } from \"$data/shared\";\n\nexport const getStaticPaths: GetStaticPaths = async () => {\n const articles = await Astro.glob
(\"/content/articles/**/*.mdx\");\n return articles.map((article) => {\n return { params: { slug: getSlugFromFile(article.file) } };\n });\n};\n\nexport interface Props {\n article: MDXInstance
;\n}\n\nconst { article } = Astro.props;\n---\n\n"; + let result = convert(input); + assert!( + result.code.contains("MDXInstance
"), + "complex generics were not preserved:\n{}", + result.code + ); + assert!( + !result.has_parse_errors, + "complex generics should parse cleanly" + ); +} diff --git a/crates/astro2tsx/tests/upstream_corpus.rs b/crates/astro2tsx/tests/upstream_corpus.rs index 05e71260..377c59fb 100644 --- a/crates/astro2tsx/tests/upstream_corpus.rs +++ b/crates/astro2tsx/tests/upstream_corpus.rs @@ -1,6 +1,5 @@ -//! Runs every test case in `tests/corpus/tsx.jsonl` (extracted from the -//! upstream Astro compiler) through `convert_to_tsx` and reports parity -//! with the Go reference output. +//! Runs every test case in `tests/corpus/tsx.jsonl` through `convert_to_tsx` +//! and asserts the output matches, except for listed divergences. //! //! The corpus is regenerated from //! `packages/compiler/test/extract-corpus.mjs` in the upstream repo. Each @@ -10,15 +9,7 @@ use astro2tsx::{ConvertOptions, convert_to_tsx}; use serde::Deserialize; use std::collections::BTreeMap; -/// Test cases where we deliberately diverge from the Go printer because -/// its recovery synthesises constructs that don't help intellisense: -/// -/// - `
\n` → upstream emits `
` -/// which fabricates phantom `<` and `div` attributes. We round-trip -/// the source instead. -/// - `` to balance JSX. tsserver parses unbalanced JSX just -/// fine, so we leave it unbalanced and avoid the synthetic span. +// Recovery would invent phantom attributes and tags; TypeScript errors on the raw output but recovers. // Occurrence disambiguates basic.ts's two same-named "preserves spaces in tag" cases. const INTENTIONAL_DIVERGENCES: &[&str] = &[ "escape.ts::does not escape tag opening unnecessarily II [1]", From ef2bd0bb5a3af576a84b0f9cf3f701b4ad794364 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Tue, 11 Aug 2026 09:20:10 +0200 Subject: [PATCH 06/50] ci: run the astro2tsx test suites --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e2ddbf4..68642d1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,6 +107,13 @@ jobs: run: pnpm test working-directory: crates/astro_napi + - name: Build astro2tsx binding + run: pnpm --filter ./crates/astro2tsx run build-dev + + - name: Test astro2tsx binding + run: pnpm test + working-directory: crates/astro2tsx + - name: Build compiler package run: pnpm run build:compiler From 40384d5884029d062e748d21cef06e4683859891 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Tue, 11 Aug 2026 09:20:10 +0200 Subject: [PATCH 07/50] chore(astro2tsx): mark the package private --- crates/astro2tsx/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/astro2tsx/package.json b/crates/astro2tsx/package.json index 575511ee..5034a98e 100644 --- a/crates/astro2tsx/package.json +++ b/crates/astro2tsx/package.json @@ -1,6 +1,7 @@ { "name": "@astrojs/astro2tsx", "version": "0.1.0", + "private": true, "description": "Convert .astro files to TSX for tsserver intellisense", "keywords": [ "astro", From 1a0110731eb14727ef127de83d609bd811fb5c16 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Tue, 11 Aug 2026 09:25:10 +0200 Subject: [PATCH 08/50] build(astro2tsx): pin the biome fork to an exact rev --- .gitignore | 1 + Cargo.lock | 2670 ----------------------------------- crates/astro2tsx/Cargo.toml | 12 +- 3 files changed, 7 insertions(+), 2676 deletions(-) delete mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index e388f8a4..58ee8f35 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ crates/astro_napi/npm # Rust /target +Cargo.lock .idea/ # insta pending snapshots diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index a6dd2af1..00000000 --- a/Cargo.lock +++ /dev/null @@ -1,2670 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "addr2line" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - -[[package]] -name = "ahash" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" -dependencies = [ - "cfg-if", - "getrandom 0.3.4", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" -dependencies = [ - "memchr", -] - -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - -[[package]] -name = "anstyle" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" - -[[package]] -name = "astro2tsx" -version = "0.1.0" -dependencies = [ - "biome_html_parser", - "biome_html_syntax", - "biome_js_parser", - "biome_js_syntax", - "biome_languages", - "biome_rowan", - "napi", - "napi-build", - "napi-derive", - "serde", - "serde_json", -] - -[[package]] -name = "astro_codegen" -version = "0.1.0" -dependencies = [ - "cow-utils", - "divan", - "insta", - "lightningcss", - "oxc_allocator", - "oxc_ast", - "oxc_ast_visit", - "oxc_codegen", - "oxc_data_structures", - "oxc_diagnostics", - "oxc_parser", - "oxc_semantic", - "oxc_sourcemap", - "oxc_span", - "oxc_syntax", - "oxc_transformer", - "rustc-hash", - "serde_json", - "smallvec", -] - -[[package]] -name = "astro_napi" -version = "0.0.0" -dependencies = [ - "astro_codegen", - "mimalloc-safe", - "napi", - "napi-build", - "napi-derive", - "oxc_allocator", - "oxc_ast", - "oxc_ast_visit", - "oxc_diagnostics", - "oxc_estree", - "oxc_parser", - "oxc_span", -] - -[[package]] -name = "autocfg" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" - -[[package]] -name = "backtrace" -version = "0.3.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-link", -] - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "base64-simd" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" -dependencies = [ - "outref", - "vsimd", -] - -[[package]] -name = "biome_aria" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_aria_metadata", - "biome_string_case", -] - -[[package]] -name = "biome_aria_metadata" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_deserialize", - "biome_deserialize_macros", - "biome_string_case", - "prettyplease", - "proc-macro2", - "quote", - "serde", - "serde_json", - "syn 2.0.119", -] - -[[package]] -name = "biome_console" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_markup", - "biome_text_size", - "serde", - "termcolor", - "unicode-segmentation", - "unicode-width 0.1.14", -] - -[[package]] -name = "biome_db" -version = "0.0.1" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_diagnostics", - "biome_parser", - "biome_rowan", - "camino", - "salsa", -] - -[[package]] -name = "biome_deserialize" -version = "0.6.0" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_console", - "biome_diagnostics", - "biome_json_parser", - "biome_json_syntax", - "biome_rowan", - "enumflags2", -] - -[[package]] -name = "biome_deserialize_macros" -version = "0.6.0" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_string_case", - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "biome_diagnostics" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "backtrace", - "biome_console", - "biome_diagnostics_categories", - "biome_diagnostics_macros", - "biome_rowan", - "biome_text_edit", - "biome_text_size", - "enumflags2", - "serde", - "serde_json", - "termcolor", - "terminal_size", - "unicode-width 0.1.14", -] - -[[package]] -name = "biome_diagnostics_categories" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "quote", - "serde", -] - -[[package]] -name = "biome_diagnostics_macros" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "biome_html_factory" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_html_syntax", - "biome_rowan", -] - -[[package]] -name = "biome_html_parser" -version = "0.0.1" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_console", - "biome_diagnostics", - "biome_html_factory", - "biome_html_syntax", - "biome_languages", - "biome_parser", - "biome_rowan", - "biome_string_case", - "biome_unicode_table", - "tracing", -] - -[[package]] -name = "biome_html_syntax" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_aria", - "biome_parser", - "biome_rowan", - "biome_string_case", - "camino", - "serde", -] - -[[package]] -name = "biome_js_factory" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_js_syntax", - "biome_rowan", -] - -[[package]] -name = "biome_js_parser" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_console", - "biome_diagnostics", - "biome_js_factory", - "biome_js_syntax", - "biome_languages", - "biome_parser", - "biome_rowan", - "biome_unicode_table", - "drop_bomb", - "enumflags2", - "indexmap", - "rustc-hash", - "serde_json", - "smallvec", - "tracing", -] - -[[package]] -name = "biome_js_syntax" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_aria", - "biome_aria_metadata", - "biome_rowan", - "biome_string_case", - "camino", - "enumflags2", - "serde", -] - -[[package]] -name = "biome_json_factory" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_json_syntax", - "biome_rowan", -] - -[[package]] -name = "biome_json_parser" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_console", - "biome_diagnostics", - "biome_json_factory", - "biome_json_syntax", - "biome_languages", - "biome_parser", - "biome_rowan", - "biome_unicode_table", - "tracing", - "unicode-bom", -] - -[[package]] -name = "biome_json_syntax" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_rowan", - "serde", -] - -[[package]] -name = "biome_languages" -version = "0.1.0" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_console", - "biome_db", - "biome_rowan", - "biome_string_case", - "camino", - "directories", - "salsa", - "serde", - "tracing", -] - -[[package]] -name = "biome_markup" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "proc-macro-error2", - "proc-macro2", - "quote", -] - -[[package]] -name = "biome_parser" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_console", - "biome_diagnostics", - "biome_rowan", - "biome_unicode_table", - "drop_bomb", - "enumflags2", - "unicode-bom", -] - -[[package]] -name = "biome_rowan" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_text_edit", - "biome_text_size", - "hashbrown 0.15.5", - "rustc-hash", - "serde", -] - -[[package]] -name = "biome_string_case" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_rowan", - "caseless", -] - -[[package]] -name = "biome_text_edit" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "biome_text_size", - "serde", - "similar", -] - -[[package]] -name = "biome_text_size" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" -dependencies = [ - "serde", -] - -[[package]] -name = "biome_unicode_table" -version = "0.5.7" -source = "git+https://github.com/Princesseuh/biome?branch=fix%2Fastro#a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" - -[[package]] -name = "bitflags" -version = "2.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" -dependencies = [ - "serde_core", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "boxcar" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36f64beae40a84da1b4b26ff2761a5b895c12adc41dc25aaee1c4f2bbfe97a6e" - -[[package]] -name = "bstr" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f" -dependencies = [ - "memchr", - "regex-automata", - "serde_core", -] - -[[package]] -name = "camino" -version = "1.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1307f12aa967b5a58416e87b3653360e0fd614a016b6e970db08fecbb1b80d" - -[[package]] -name = "caseless" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6fd507454086c8edfd769ca6ada439193cdb209c7681712ef6275cccbfe5d8" -dependencies = [ - "unicode-normalization", -] - -[[package]] -name = "castaway" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" -dependencies = [ - "rustversion", -] - -[[package]] -name = "cc" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d262e149917187838d5b42777c8253bcb64500067342904e7d429499a6f277e" -dependencies = [ - "find-msvc-tools", - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" - -[[package]] -name = "clap" -version = "4.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473c7e07f409a8d772161724aa8db6a765a2532a70f9667eeb7b49d3d02fbdca" -dependencies = [ - "clap_builder", -] - -[[package]] -name = "clap_builder" -version = "4.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b48fea5a88e9ae728a2dcbedbfc0e730f7d60da42e1cb049a83c9fb8b789889" -dependencies = [ - "anstyle", - "clap_lex", - "terminal_size", -] - -[[package]] -name = "clap_lex" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" - -[[package]] -name = "cmake" -version = "0.1.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" -dependencies = [ - "cc", -] - -[[package]] -name = "cobs" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" -dependencies = [ - "thiserror", -] - -[[package]] -name = "compact_str" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dfdd1c2274d9aa354115b09dc9a901d6c5576818cdf70d14cae2bdb47df00ab" -dependencies = [ - "castaway", - "cfg-if", - "itoa", - "rustversion", - "ryu", - "serde", - "static_assertions", -] - -[[package]] -name = "condtype" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf0a07a401f374238ab8e2f11a104d2851bf9ce711ec69804834de8af45c7af" - -[[package]] -name = "console" -version = "0.16.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe5f465a4f6fee88fad41b85d990f84c835335e85b5d9e6e63e0d06d28cba7c" -dependencies = [ - "encode_unicode", - "libc", - "windows-sys", -] - -[[package]] -name = "const-str" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18f12cc9948ed9604230cdddc7c86e270f9401ccbe3c2e98a4378c5e7632212f" - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "convert_case" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "affbf0190ed2caf063e3def54ff444b449371d55c58e513a95ab98eca50adb49" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "cow-utils" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "417bef24afe1460300965a25ff4a24b8b45ad011948302ec221e8a0a81eb2c79" - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "803d13fb3b09d88be9f4dbc29062c66b19bf7170867ceb746d2a8689bf6c7a26" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" - -[[package]] -name = "crypto-common" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "cssparser" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9cdaae01d5ed7882b04d795e7f752f46ff52d2fa3b50a20d28c464510bba98" -dependencies = [ - "cssparser-macros", - "dtoa-short", - "itoa", - "phf 0.13.1", - "smallvec", -] - -[[package]] -name = "cssparser-color" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa233e1dcd9c13a5d3e3a8a2c0f5a727bac380398345dbcb31db4597edc86b" -dependencies = [ - "cssparser", -] - -[[package]] -name = "cssparser-macros" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a2a99df6e410a8ff4245aa2006499ea662245f967cc7c0a38c83ef8eb44dbf" -dependencies = [ - "quote", - "syn 2.0.119", -] - -[[package]] -name = "ctor" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d" - -[[package]] -name = "data-encoding" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06" - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "directories" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f5094c54661b38d03bd7e50df373292118db60b585c08a411c6d840017fe7d" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys", -] - -[[package]] -name = "divan" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a405457ec78b8fe08b0e32b4a3570ab5dff6dd16eb9e76a5ee0a9d9cbd898933" -dependencies = [ - "cfg-if", - "clap", - "condtype", - "divan-macros", - "libc", - "regex-lite", -] - -[[package]] -name = "divan-macros" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9556bc800956545d6420a640173e5ba7dfa82f38d3ea5a167eb555bc69ac3323" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "dragonbox_ecma" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd8e701084c37e7ef62d3f9e453b618130cbc0ef3573847785952a3ac3f746bf" - -[[package]] -name = "drop_bomb" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bda8e21c04aca2ae33ffc2fd8c23134f3cac46db123ba97bd9d3f3b8a4a85e1" - -[[package]] -name = "dtoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" - -[[package]] -name = "dtoa-short" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" -dependencies = [ - "dtoa", -] - -[[package]] -name = "either" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" - -[[package]] -name = "embedded-io" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" - -[[package]] -name = "embedded-io" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" - -[[package]] -name = "encode_unicode" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" - -[[package]] -name = "enumflags2" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" -dependencies = [ - "enumflags2_derive", - "serde", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "errno" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "fastrand" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" - -[[package]] -name = "find-msvc-tools" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b73573e6edcd2af0cdf47bd6cb58f0b3839491263c314eaad1ccf24430e1de" - -[[package]] -name = "flate2" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "foldhash" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" - -[[package]] -name = "futures" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88cf1f829d945f548cf8fec32c61b1f202b6d93b45848602fc02af4b12ad218" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "262590f4fe6afeb0bc83be1daa64e52657fe185690a958af7f3ad0e92085c5ae" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7" - -[[package]] -name = "futures-executor" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6754879cc9f2c66f88c6e5c35344bb0bdb0708b0352b1201815667c7eabc7458" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4577ecaa3c4f96589d473f679a71b596316f6641bc350038b962a5daf0085d7a" - -[[package]] -name = "futures-macro" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d6d3cde68c518367be28956066ddfef33813991b77a55005a69dae04bf3b10b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "futures-sink" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34418ac499d6305c2fb5ad0ed2f6ac998c5f8ca209b4510f7f94242c647e307" - -[[package]] -name = "futures-task" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109" - -[[package]] -name = "futures-util" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "getrandom" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" -dependencies = [ - "cfg-if", - "libc", - "r-efi 5.3.0", - "wasip2", -] - -[[package]] -name = "getrandom" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" -dependencies = [ - "cfg-if", - "libc", - "r-efi 6.0.0", -] - -[[package]] -name = "gimli" -version = "0.32.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" - -[[package]] -name = "globset" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07c34a9410465b45bd9787443bc7370f37735bad04b0f0cd57ff1a3186c98988" -dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "hashbrown" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" - -[[package]] -name = "hashbrown" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" -dependencies = [ - "allocator-api2", -] - -[[package]] -name = "hashbrown" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" -dependencies = [ - "allocator-api2", - "equivalent", - "foldhash", -] - -[[package]] -name = "hashlink" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32069d97bb81e38fa67eab65e3393bf804bb85969f2bc06bf13f64aef5aba248" -dependencies = [ - "hashbrown 0.17.1", -] - -[[package]] -name = "indexmap" -version = "2.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" -dependencies = [ - "equivalent", - "hashbrown 0.17.1", - "serde", - "serde_core", -] - -[[package]] -name = "insta" -version = "1.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0f8fee8c926415c58d6ae43a08523a26faccb2323f5e6b644fe7dd4ef6b82" -dependencies = [ - "console", - "globset", - "once_cell", - "similar", - "tempfile", - "walkdir", -] - -[[package]] -name = "intrusive-collections" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4275b20e6057cd7733fd8df8a5a31701e4fe44497dad0f3fa0e1c4fb971506be" - -[[package]] -name = "inventory" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b" -dependencies = [ - "rustversion", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" - -[[package]] -name = "json-escape-simd" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22a2041e3874a055a4eb03ea2395aaccdefa84ce75b31d542d72a741c3c6ad3" - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.189" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" - -[[package]] -name = "libloading" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "754ca22de805bb5744484a5b151a9e1a8e837d5dc232c2d7d8c2e3492edc8b60" -dependencies = [ - "cfg-if", - "windows-link", -] - -[[package]] -name = "libmimalloc-sys2" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "921641155d9dc4f434332abd912518e33c70e37c557434818b6cfd1fbbb6138d" -dependencies = [ - "cc", - "cmake", - "libc", -] - -[[package]] -name = "libredox" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2026a5056764a10b2bf5d56488cba40da507f5493a6a429340e2004d9ed085fa" -dependencies = [ - "libc", -] - -[[package]] -name = "lightningcss" -version = "1.0.0-alpha.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d31b760f96e8fdfe1d0c295e4bf76c503d6f15d2d470d53bd8cd1f7aa8c7d934" -dependencies = [ - "ahash", - "bitflags", - "const-str", - "cssparser", - "cssparser-color", - "data-encoding", - "getrandom 0.3.4", - "indexmap", - "itertools 0.10.5", - "lazy_static", - "lightningcss-derive", - "parcel_selectors", - "pastey", - "pathdiff", - "smallvec", - "static-self", -] - -[[package]] -name = "lightningcss-derive" -version = "1.0.0-alpha.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12744d1279367caed41739ef094c325d53fb0ffcd4f9b84a368796f870252" -dependencies = [ - "convert_case 0.6.0", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "linux-raw-sys" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" - -[[package]] -name = "lock_api" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" - -[[package]] -name = "memchr" -version = "2.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" - -[[package]] -name = "mimalloc-safe" -version = "0.1.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afd082b59cfceeb3bf31dbff65e7b96e1f94fa9b918e131d02353e6867a12824" -dependencies = [ - "libmimalloc-sys2", -] - -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", - "simd-adler32", -] - -[[package]] -name = "napi" -version = "3.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "459197f1592f4c3dbbf9c1b13f5a4599a343e4ef66b96bc340e2a518b36a6662" -dependencies = [ - "bitflags", - "ctor", - "futures", - "libc", - "napi-build", - "napi-sys", - "nohash-hasher", - "rustc-hash", - "tokio", -] - -[[package]] -name = "napi-build" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60fdf9b392c50e7c4170fa633bd909490ed7835cea4c046776d1a4dd8d2ae0ab" - -[[package]] -name = "napi-derive" -version = "3.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa55ea69990c90b888e9e77044410e304ce7f35de599dc6d0b5c1923d2e59af" -dependencies = [ - "convert_case 0.11.0", - "ctor", - "napi-derive-backend", - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "napi-derive-backend" -version = "6.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df4056ac7c18e4438ccf0edaed4340ca0d269278c8ec19284f7b23cb039fd0ae" -dependencies = [ - "convert_case 0.11.0", - "proc-macro2", - "quote", - "semver", - "syn 2.0.119", -] - -[[package]] -name = "napi-sys" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85fbf1fa9f1babfe396d74bbbf52b3643770243e8f5b0b46715d4caf7f0dfc9a" -dependencies = [ - "libloading", -] - -[[package]] -name = "nohash-hasher" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" - -[[package]] -name = "nonmax" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "610a5acd306ec67f907abe5567859a3c693fb9886eb1f012ab8f2a47bef3db51" - -[[package]] -name = "num-bigint" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "object" -version = "0.37.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "outref" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" - -[[package]] -name = "owo-colors" -version = "4.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d211803b9b6b570f68772237e415a029d5a50c65d382910b879fb19d3271f94d" - -[[package]] -name = "oxc-browserslist" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb7a1163a5501f935f8722d839b576491b749c695e7a066aa0b8df988b806df" -dependencies = [ - "flate2", - "postcard", - "rustc-hash", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "oxc-miette" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4356a61f2ed4c9b3610245215fbf48970eb277126919f87db9d0efa93a74245c" -dependencies = [ - "cfg-if", - "owo-colors", - "oxc-miette-derive", - "textwrap", - "thiserror", - "unicode-segmentation", - "unicode-width 0.2.2", -] - -[[package]] -name = "oxc-miette-derive" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b237422b014f8f8fff75bb9379e697d13f8d57551a22c88bebb39f073c1bf696" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "oxc_allocator" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "allocator-api2", - "hashbrown 0.16.1", - "oxc_data_structures", - "oxc_estree", - "rustc-hash", - "serde", -] - -[[package]] -name = "oxc_ast" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "bitflags", - "oxc_allocator", - "oxc_ast_macros", - "oxc_data_structures", - "oxc_diagnostics", - "oxc_estree", - "oxc_regular_expression", - "oxc_span", - "oxc_syntax", -] - -[[package]] -name = "oxc_ast_macros" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "phf 0.13.1", - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "oxc_ast_visit" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "oxc_allocator", - "oxc_ast", - "oxc_span", - "oxc_syntax", -] - -[[package]] -name = "oxc_codegen" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "bitflags", - "cow-utils", - "dragonbox_ecma", - "itoa", - "oxc_allocator", - "oxc_ast", - "oxc_data_structures", - "oxc_index", - "oxc_semantic", - "oxc_sourcemap", - "oxc_span", - "oxc_syntax", - "rustc-hash", -] - -[[package]] -name = "oxc_compat" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "cow-utils", - "oxc-browserslist", - "oxc_syntax", - "rustc-hash", - "serde", -] - -[[package]] -name = "oxc_data_structures" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "ropey", -] - -[[package]] -name = "oxc_diagnostics" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "cow-utils", - "oxc-miette", - "percent-encoding", -] - -[[package]] -name = "oxc_ecmascript" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "cow-utils", - "num-bigint", - "num-traits", - "oxc_allocator", - "oxc_ast", - "oxc_regular_expression", - "oxc_span", - "oxc_syntax", -] - -[[package]] -name = "oxc_estree" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "dragonbox_ecma", - "itoa", - "oxc_data_structures", -] - -[[package]] -name = "oxc_index" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3e6120999627ec9703025eab7c9f410ebb7e95557632a8902ca48210416c2b" -dependencies = [ - "nonmax", - "serde", -] - -[[package]] -name = "oxc_parser" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "bitflags", - "cow-utils", - "memchr", - "num-bigint", - "num-traits", - "oxc_allocator", - "oxc_ast", - "oxc_data_structures", - "oxc_diagnostics", - "oxc_ecmascript", - "oxc_regular_expression", - "oxc_span", - "oxc_syntax", - "rustc-hash", - "seq-macro", -] - -[[package]] -name = "oxc_regular_expression" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "bitflags", - "oxc_allocator", - "oxc_ast_macros", - "oxc_diagnostics", - "oxc_span", - "phf 0.13.1", - "rustc-hash", - "unicode-id-start", -] - -[[package]] -name = "oxc_semantic" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "itertools 0.14.0", - "memchr", - "oxc_allocator", - "oxc_ast", - "oxc_ast_visit", - "oxc_data_structures", - "oxc_diagnostics", - "oxc_ecmascript", - "oxc_index", - "oxc_span", - "oxc_syntax", - "rustc-hash", - "self_cell", - "smallvec", -] - -[[package]] -name = "oxc_sourcemap" -version = "6.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d378eb8bad20e89d66276aebab51f6a5408571092cac94abdd3eabb773713d6" -dependencies = [ - "base64-simd", - "json-escape-simd", - "rustc-hash", - "serde", - "serde_json", -] - -[[package]] -name = "oxc_span" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "compact_str", - "oxc-miette", - "oxc_allocator", - "oxc_ast_macros", - "oxc_estree", - "oxc_str", - "serde", -] - -[[package]] -name = "oxc_str" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "compact_str", - "hashbrown 0.16.1", - "oxc_allocator", - "oxc_estree", - "serde", -] - -[[package]] -name = "oxc_syntax" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "bitflags", - "cow-utils", - "dragonbox_ecma", - "nonmax", - "oxc_allocator", - "oxc_ast_macros", - "oxc_estree", - "oxc_index", - "oxc_span", - "phf 0.13.1", - "serde", - "unicode-id-start", -] - -[[package]] -name = "oxc_transformer" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "base64", - "compact_str", - "indexmap", - "itoa", - "memchr", - "oxc_allocator", - "oxc_ast", - "oxc_ast_visit", - "oxc_compat", - "oxc_data_structures", - "oxc_diagnostics", - "oxc_ecmascript", - "oxc_regular_expression", - "oxc_semantic", - "oxc_span", - "oxc_syntax", - "oxc_traverse", - "rustc-hash", - "serde", - "serde_json", - "sha1", -] - -[[package]] -name = "oxc_traverse" -version = "0.115.0" -source = "git+https://github.com/withastro/oxc?rev=8bb526fc0c20beb4649b223d3ac39851505caa5a#8bb526fc0c20beb4649b223d3ac39851505caa5a" -dependencies = [ - "itoa", - "oxc_allocator", - "oxc_ast", - "oxc_ast_visit", - "oxc_data_structures", - "oxc_ecmascript", - "oxc_semantic", - "oxc_span", - "oxc_str", - "oxc_syntax", - "rustc-hash", -] - -[[package]] -name = "parcel_selectors" -version = "0.28.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05f71e01edca03d245ab0a9f7ce13a974ceb79baaae8faf2ba0b11de6b90913" -dependencies = [ - "bitflags", - "cssparser", - "log", - "phf 0.11.3", - "phf_codegen", - "precomputed-hash", - "rustc-hash", - "smallvec", - "static-self", -] - -[[package]] -name = "parking_lot" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-link", -] - -[[package]] -name = "pastey" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" - -[[package]] -name = "pathdiff" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" - -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - -[[package]] -name = "phf" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" -dependencies = [ - "phf_shared 0.11.3", -] - -[[package]] -name = "phf" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" -dependencies = [ - "phf_macros", - "phf_shared 0.13.1", - "serde", -] - -[[package]] -name = "phf_codegen" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" -dependencies = [ - "phf_generator 0.11.3", - "phf_shared 0.11.3", -] - -[[package]] -name = "phf_generator" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" -dependencies = [ - "phf_shared 0.11.3", - "rand", -] - -[[package]] -name = "phf_generator" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" -dependencies = [ - "fastrand", - "phf_shared 0.13.1", -] - -[[package]] -name = "phf_macros" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" -dependencies = [ - "phf_generator 0.13.1", - "phf_shared 0.13.1", - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "phf_shared" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" -dependencies = [ - "siphasher", -] - -[[package]] -name = "phf_shared" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" - -[[package]] -name = "portable-atomic" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" - -[[package]] -name = "postcard" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" -dependencies = [ - "cobs", - "embedded-io 0.4.0", - "embedded-io 0.6.1", - "serde", -] - -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn 2.0.119", -] - -[[package]] -name = "proc-macro-error-attr2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro-error2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" -dependencies = [ - "proc-macro-error-attr2", - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro2" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - -[[package]] -name = "r-efi" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" - -[[package]] -name = "rand" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - -[[package]] -name = "rayon" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" -dependencies = [ - "getrandom 0.2.17", - "libredox", - "thiserror", -] - -[[package]] -name = "regex-automata" -version = "0.4.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-lite" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973" - -[[package]] -name = "regex-syntax" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" - -[[package]] -name = "ropey" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93411e420bcd1a75ddd1dc3caf18c23155eda2c090631a85af21ba19e97093b5" -dependencies = [ - "smallvec", - "str_indices", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb" - -[[package]] -name = "rustc-hash" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" - -[[package]] -name = "rustix" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[package]] -name = "rustversion" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" - -[[package]] -name = "ryu" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" - -[[package]] -name = "salsa" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbaab832e2ea754afda4a738f987dd1e8bd30c9e5d8c981ee6a3934386095e2" -dependencies = [ - "boxcar", - "crossbeam-queue", - "crossbeam-utils", - "hashbrown 0.17.1", - "hashlink", - "indexmap", - "intrusive-collections", - "inventory", - "parking_lot", - "portable-atomic", - "rayon", - "rustc-hash", - "salsa-macro-rules", - "salsa-macros", - "smallvec", - "thin-vec", - "tracing", - "typeid", -] - -[[package]] -name = "salsa-macro-rules" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de6872462ac73d39969a836273c24163e6a26a4e08f5114fcd80e25af30ea9c6" - -[[package]] -name = "salsa-macros" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc78ffaf65b1a9175818592c5130aa10b1bb245a905722fd4db87cea8a8457" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", - "synstructure", -] - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "self_cell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab42ca02749e120097e328d91d415325bdf43b1c72c4c8badf37375fe40a813" - -[[package]] -name = "semver" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" - -[[package]] -name = "seq-macro" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc" - -[[package]] -name = "serde" -version = "1.0.229" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" -dependencies = [ - "serde_core", - "serde_derive", -] - -[[package]] -name = "serde_core" -version = "1.0.229" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.229" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.3", -] - -[[package]] -name = "serde_json" -version = "1.0.151" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" -dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", -] - -[[package]] -name = "sha1" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "shlex" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" - -[[package]] -name = "simd-adler32" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" - -[[package]] -name = "similar" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" -dependencies = [ - "bstr", - "unicode-segmentation", -] - -[[package]] -name = "siphasher" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" - -[[package]] -name = "slab" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" - -[[package]] -name = "smallvec" -version = "1.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" -dependencies = [ - "serde", -] - -[[package]] -name = "smawk" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8e2fb0f499abb4d162f2bedad68f5ef91a1682b5a03596ddb67efd37768d100" - -[[package]] -name = "static-self" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6635404b73efc136af3a7956e53c53d4f34b2f16c95a15c438929add0f69412" -dependencies = [ - "indexmap", - "smallvec", - "static-self-derive", -] - -[[package]] -name = "static-self-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5268c96d4b907c558a9a52d8492522d6c7b559651a5e1d8f2d551e461b9425d5" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "str_indices" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d08889ec5408683408db66ad89e0e1f93dff55c73a4ccc71c427d5b277ee47e6" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.119" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "synstructure" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "tempfile" -version = "3.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" -dependencies = [ - "fastrand", - "getrandom 0.4.3", - "once_cell", - "rustix", - "windows-sys", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "terminal_size" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" -dependencies = [ - "rustix", - "windows-sys", -] - -[[package]] -name = "textwrap" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" -dependencies = [ - "smawk", - "unicode-linebreak", - "unicode-width 0.2.2", -] - -[[package]] -name = "thin-vec" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79def32ffcd477db1ff26f76dab9e3a91f0bd42a85ca96577089b24623056f9d" - -[[package]] -name = "thiserror" -version = "2.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.3", -] - -[[package]] -name = "tinyvec" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" -dependencies = [ - "pin-project-lite", -] - -[[package]] -name = "tracing" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "tracing-core" -version = "0.1.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typeid" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" - -[[package]] -name = "typenum" -version = "1.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" - -[[package]] -name = "unicode-bom" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" - -[[package]] -name = "unicode-id-start" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b79ad29b5e19de4260020f8919b443b2ef0277d242ce532ec7b7a2cc8b6007" - -[[package]] -name = "unicode-ident" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" - -[[package]] -name = "unicode-linebreak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" - -[[package]] -name = "unicode-normalization" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" - -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "unicode-width" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "vsimd" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.11.1+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" - -[[package]] -name = "wasip2" -version = "1.0.4+wasi-0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" -dependencies = [ - "wit-bindgen", -] - -[[package]] -name = "winapi-util" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "windows-link" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" - -[[package]] -name = "windows-sys" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" -dependencies = [ - "windows-link", -] - -[[package]] -name = "wit-bindgen" -version = "0.57.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" - -[[package]] -name = "zerocopy" -version = "0.8.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556764e583adb45a9f8d413c2a147fa7e8d821e48e12b14fd560b607998b75eb" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ab42fc20575779bd240faa45f94a74256f755c0fa9e89f0ede20d91d0cdfc1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "zmij" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/crates/astro2tsx/Cargo.toml b/crates/astro2tsx/Cargo.toml index fc5b45f2..e05d419e 100644 --- a/crates/astro2tsx/Cargo.toml +++ b/crates/astro2tsx/Cargo.toml @@ -15,12 +15,12 @@ test = true doctest = false [dependencies] -biome_html_parser = { git = "https://github.com/Princesseuh/biome", branch = "fix/astro" } -biome_html_syntax = { git = "https://github.com/Princesseuh/biome", branch = "fix/astro" } -biome_js_parser = { git = "https://github.com/Princesseuh/biome", branch = "fix/astro" } -biome_js_syntax = { git = "https://github.com/Princesseuh/biome", branch = "fix/astro" } -biome_languages = { git = "https://github.com/Princesseuh/biome", branch = "fix/astro" } -biome_rowan = { git = "https://github.com/Princesseuh/biome", branch = "fix/astro" } +biome_html_parser = { git = "https://github.com/Princesseuh/biome", rev = "a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" } +biome_html_syntax = { git = "https://github.com/Princesseuh/biome", rev = "a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" } +biome_js_parser = { git = "https://github.com/Princesseuh/biome", rev = "a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" } +biome_js_syntax = { git = "https://github.com/Princesseuh/biome", rev = "a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" } +biome_languages = { git = "https://github.com/Princesseuh/biome", rev = "a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" } +biome_rowan = { git = "https://github.com/Princesseuh/biome", rev = "a7fc0b0ea54b7bca38e4a20c9bf30245a7732f01" } napi = { workspace = true } napi-derive = { workspace = true } From f914b48cc8f039c452911d21f1ca1c902517bef2 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Tue, 11 Aug 2026 10:23:51 +0200 Subject: [PATCH 09/50] fix(astro2tsx): keep unclosed raw-text content and always pair spread object keys --- crates/astro2tsx/src/render.rs | 224 +++++++++++------------------ crates/astro2tsx/tests/fixtures.rs | 90 +++++++++--- 2 files changed, 151 insertions(+), 163 deletions(-) diff --git a/crates/astro2tsx/src/render.rs b/crates/astro2tsx/src/render.rs index 1ce62554..e4b3309a 100644 --- a/crates/astro2tsx/src/render.rs +++ b/crates/astro2tsx/src/render.rs @@ -1,6 +1,4 @@ -//! Walks the Biome HTML CST for an Astro file and emits TSX. Designed to -//! mirror the upstream printer (`internal/printer/print-to-tsx.go`) closely -//! enough that the same `.astro` input produces byte-equivalent output. +//! Walks the Biome HTML CST for an Astro file and emits TSX. use biome_html_syntax::{ AnyAstroDirective, AnyAstroFrontmatterElement, AnyHtmlAttribute, AnyHtmlAttributeInitializer, @@ -17,7 +15,7 @@ use crate::props::{PropsAnalysis, analyze as analyze_props}; use crate::sourcemap::GeneratedRange; use crate::utils::{ ScriptKind, classify_script_type, encode_double_quote, escape_braces, escape_text, - is_html_event_attribute, is_valid_tsx_attribute_name, is_void_element, tsx_component_name, + is_html_event_attribute, is_valid_tsx_attribute_name, tsx_component_name, }; const TSX_PREFIX: &str = "/* @jsxImportSource astro */\n\n"; @@ -29,9 +27,6 @@ pub(crate) fn render_root(printer: &mut Printer, root: HtmlRoot, options: &Conve let frontmatter = root.frontmatter(); let body = root.html(); - // Inspect the frontmatter for a `Props` binding and `getStaticPaths` - // export. This drives the synthetic `export default function` - // signature and the trailing Astro-global declaration. let props_analysis = frontmatter .as_ref() .and_then(extract_frontmatter_text) @@ -44,7 +39,7 @@ pub(crate) fn render_root(printer: &mut Printer, root: HtmlRoot, options: &Conve // The body is non-empty whenever there's a parsed child OR the source // contains a top-level HTML comment that the parser stashed as trivia. - let body_text_start = body_text_start_offset(&root, &frontmatter); + let body_text_start = body_text_start_offset(&frontmatter); let body_text_end = printer.source.len() as u32; let has_body_children = body.iter().next().is_some() || slice_has_html_comment(&printer.source, body_text_start, body_text_end); @@ -52,11 +47,8 @@ pub(crate) fn render_root(printer: &mut Printer, root: HtmlRoot, options: &Conve if has_body_children { if frontmatter.is_some() { - // The frontmatter may not end with a `;`, which would let the - // body's `` be parsed as a continuation expression - // (e.g. `Astro.props < Fragment >`). Mirror the upstream - // workaround: emit `{};` whenever the trailing non-space - // character isn't already `;`. + // Without a `;`, the body's `` parses as a continuation + // of the frontmatter's last expression (`Astro.props < Fragment >`). if needs_trailing_separator(&printer.output) { printer.map_nil(); printer.write("{};"); @@ -79,16 +71,11 @@ pub(crate) fn render_root(printer: &mut Printer, root: HtmlRoot, options: &Conve } if body_only_has_comments { - // The "body" is purely top-level HTML comments — emit them by - // translating the source between the frontmatter and EOF. emit_source_gap(printer, body_text_start, printer.source.len() as u32); } else if let Some(prev) = prev_end { - // Trailing whitespace / comments between the last child and - // EOF need translation too. emit_source_gap(printer, prev, printer.source.len() as u32); } - // Map a "trailing" position so consumers can still trace whitespace - // at the end of the source. + // One byte past EOF, so trailing whitespace still has a mapping. printer.map_to_offset(printer.source.len() as u32); printer.write("\n"); @@ -98,9 +85,7 @@ pub(crate) fn render_root(printer: &mut Printer, root: HtmlRoot, options: &Conve printer.map_nil(); printer.write("\n"); } else { - // The Go printer always adds an extra blank line before the - // synthetic export when there's no body, mirroring the trailing - // newline that a body would have provided. + // Stands in for the trailing newline a body would have provided. if frontmatter.is_some() { printer.map_nil(); printer.write("\n"); @@ -115,16 +100,12 @@ pub(crate) fn render_root(printer: &mut Printer, root: HtmlRoot, options: &Conve /// Returns the byte offset where body content begins. With a frontmatter /// present, this is the byte just after the closing `---` fence; without /// it, this is the start of the source. -fn body_text_start_offset( - root: &HtmlRoot, - frontmatter: &Option, -) -> u32 { +fn body_text_start_offset(frontmatter: &Option) -> u32 { if let Some(AnyAstroFrontmatterElement::AstroFrontmatterElement(node)) = frontmatter && let Ok(r_fence) = node.r_fence_token() { return u32::from(r_fence.text_trimmed_range().end()); } - let _ = root; 0 } @@ -139,9 +120,7 @@ fn extract_frontmatter_text(node: &AnyAstroFrontmatterElement) -> Option } fn emit_default_export(printer: &mut Printer, component: &str, analysis: &PropsAnalysis) { - // The function's `_props` annotation uses the parameterised form - // `Props`. The Astro global only needs the bare type ident, so we - // track them separately. + // `_props` takes the parameterised `Props`; the Astro global takes the bare ident. let (props_param, props_global) = if analysis.has_props { if analysis.generics_args.is_empty() { ("Props".to_string(), "Props".to_string()) @@ -213,8 +192,7 @@ fn emit_frontmatter(printer: &mut Printer, frontmatter: &AnyAstroFrontmatterElem emit_frontmatter_element(printer, node); } AnyAstroFrontmatterElement::AstroBogusFrontmatter(_) => { - // Recovery node — nothing semantic we can reproduce. Pass through - // as-is so the byte ranges still line up. + // Recovery node: every byte maps to offset 0, not to its own position. printer.map_to_offset(0); printer.write(frontmatter.syntax().text_trimmed().to_string().as_str()); } @@ -229,23 +207,14 @@ fn emit_frontmatter_element(printer: &mut Printer, node: &AstroFrontmatterElemen if let Ok(content) = node.content() && let Some(content_token) = content.content_token() { - // Use the full text range (including the leading newline in the - // Astro convention `---\n...code...---`) so the emitted frontmatter - // mirrors the source's whitespace. let range = content_token.text_range(); let text = slice_source(&printer.source, range); if !text.is_empty() { - // Top-level `return` statements are valid in Astro frontmatter - // (the body runs inside a generated function) but TS rejects - // them at module scope. Rewrite them to `throw ` so the - // generated TSX type-checks; the substitution preserves byte - // counts so source-mapping stays aligned. let rewritten = rewrite_top_level_returns(&text); printer.write_with_mapping(&rewritten, range_start(range)); } } - // The Go printer drops a final newline so the frontmatter section ends - // with a clean break before the body. + // Separates the frontmatter from the body that follows. printer.map_nil(); printer.write("\n"); } @@ -286,8 +255,6 @@ fn render_content(printer: &mut Printer, content: AnyHtmlContent) { printer.write_jsx_text_with_mapping(text, range_start(range)); } AnyHtmlContent::HtmlEmbeddedContent(node) => { - // Inside diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap new file mode 100644 index 00000000..29f24307 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap @@ -0,0 +1,11 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +input_file: crates/astro2tsx/tests/fixtures/raw_text_script_json.astro +--- +/* @jsxImportSource astro */ + + + + + +export default function __AstroComponent_(_props: Record): any {} diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_module.astro b/crates/astro2tsx/tests/fixtures/raw_text_script_module.astro new file mode 100644 index 00000000..7c249e20 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_module.astro @@ -0,0 +1 @@ + diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap new file mode 100644 index 00000000..9baac76a --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap @@ -0,0 +1,13 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +input_file: crates/astro2tsx/tests/fixtures/raw_text_script_module.astro +--- +/* @jsxImportSource astro */ + + + + + +export default function __AstroComponent_(_props: Record): any {} diff --git a/crates/astro2tsx/tests/fixtures/raw_text_style.astro b/crates/astro2tsx/tests/fixtures/raw_text_style.astro new file mode 100644 index 00000000..a3f097f4 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/raw_text_style.astro @@ -0,0 +1 @@ + diff --git a/crates/astro2tsx/tests/fixtures/raw_text_style.snap b/crates/astro2tsx/tests/fixtures/raw_text_style.snap new file mode 100644 index 00000000..f2527a1c --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/raw_text_style.snap @@ -0,0 +1,11 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +input_file: crates/astro2tsx/tests/fixtures/raw_text_style.astro +--- +/* @jsxImportSource astro */ + + + + + +export default function __AstroComponent_(_props: Record): any {} diff --git a/crates/astro2tsx/tests/fixtures/slot_element.astro b/crates/astro2tsx/tests/fixtures/slot_element.astro new file mode 100644 index 00000000..8042b69c --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/slot_element.astro @@ -0,0 +1 @@ +
diff --git a/crates/astro2tsx/tests/fixtures/slot_element.snap b/crates/astro2tsx/tests/fixtures/slot_element.snap new file mode 100644 index 00000000..0240b90a --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/slot_element.snap @@ -0,0 +1,11 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +input_file: crates/astro2tsx/tests/fixtures/slot_element.astro +--- +/* @jsxImportSource astro */ + + +
+ +
+export default function __AstroComponent_(_props: Record): any {} diff --git a/crates/astro2tsx/tests/fixtures/slots.astro b/crates/astro2tsx/tests/fixtures/slots.astro new file mode 100644 index 00000000..4a0bf640 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/slots.astro @@ -0,0 +1,4 @@ + + H +

body

+
diff --git a/crates/astro2tsx/tests/fixtures/slots.snap b/crates/astro2tsx/tests/fixtures/slots.snap new file mode 100644 index 00000000..c2d460c8 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/slots.snap @@ -0,0 +1,14 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +input_file: crates/astro2tsx/tests/fixtures/slots.astro +--- +/* @jsxImportSource astro */ + + + + H +

body

+
+ +
+export default function __AstroComponent_(_props: Record): any {} diff --git a/crates/astro2tsx/tests/fixtures/unclosed_tag.astro b/crates/astro2tsx/tests/fixtures/unclosed_tag.astro new file mode 100644 index 00000000..bab0a1c9 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/unclosed_tag.astro @@ -0,0 +1 @@ + + +export default function __AstroComponent_(_props: Record): any {} diff --git a/crates/astro2tsx/tests/fixtures/void_elements.astro b/crates/astro2tsx/tests/fixtures/void_elements.astro new file mode 100644 index 00000000..73ce2a8f --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/void_elements.astro @@ -0,0 +1 @@ +


diff --git a/crates/astro2tsx/tests/fixtures/void_elements.snap b/crates/astro2tsx/tests/fixtures/void_elements.snap new file mode 100644 index 00000000..52e1766c --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/void_elements.snap @@ -0,0 +1,11 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +input_file: crates/astro2tsx/tests/fixtures/void_elements.astro +--- +/* @jsxImportSource astro */ + + +


+ +
+export default function __AstroComponent_(_props: Record): any {} diff --git a/crates/astro2tsx/tests/fixtures.rs b/crates/astro2tsx/tests/regressions.rs similarity index 100% rename from crates/astro2tsx/tests/fixtures.rs rename to crates/astro2tsx/tests/regressions.rs diff --git a/crates/astro2tsx/tests/snapshots.rs b/crates/astro2tsx/tests/snapshots.rs new file mode 100644 index 00000000..127761fa --- /dev/null +++ b/crates/astro2tsx/tests/snapshots.rs @@ -0,0 +1,48 @@ +//! astro2tsx snapshot tests. Run `cargo insta review` to accept changes. +//! +//! A fixture may open with `// @config key=value` lines, stripped before +//! conversion. The only key is `filename`, which defaults to none. + +use std::fs; + +use astro2tsx::{ConvertOptions, convert_to_tsx}; + +/// Parse `// @config` directives from the top of a fixture file. +/// +/// Returns `(source_without_directives, options)`. +fn parse_fixture(raw: &str) -> (String, ConvertOptions) { + let mut options = ConvertOptions::default(); + + let mut remaining = raw; + loop { + let line = remaining.lines().next().unwrap_or(""); + let Some(config) = line.strip_prefix("// @config ") else { + break; + }; + if let Some(value) = config.strip_prefix("filename=") { + options.filename = Some(value.trim().to_string()); + } + remaining = remaining[line.len()..].trim_start_matches('\n'); + } + + (remaining.to_string(), options) +} + +#[test] +fn snapshots() { + insta::glob!("fixtures/*.astro", |path| { + let raw = fs::read_to_string(path).unwrap(); + let name = path.file_stem().unwrap().to_str().unwrap(); + let (source, options) = parse_fixture(&raw); + let output = convert_to_tsx(&source, options).code; + + insta::with_settings!({ + snapshot_path => path.parent().unwrap(), + prepend_module_to_snapshot => false, + snapshot_suffix => "", + omit_expression => true, + }, { + insta::assert_snapshot!(name, output); + }); + }); +} From 4ffa79ed41f2386a2d4a1b7d4a116dc717608cd2 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 03:44:01 +0200 Subject: [PATCH 18/50] test(astro2tsx): move output-shape assertions to snapshots --- crates/astro2tsx/tests/regressions.rs | 88 --------------------------- 1 file changed, 88 deletions(-) diff --git a/crates/astro2tsx/tests/regressions.rs b/crates/astro2tsx/tests/regressions.rs index 0af962e4..451f3cde 100644 --- a/crates/astro2tsx/tests/regressions.rs +++ b/crates/astro2tsx/tests/regressions.rs @@ -8,87 +8,6 @@ fn convert(source: &str) -> String { convert_to_tsx(source, ConvertOptions::default()).code } -fn convert_named(source: &str, filename: &str) -> String { - convert_to_tsx( - source, - ConvertOptions { - filename: Some(filename.to_string()), - }, - ) - .code -} - -#[test] -fn empty_no_props_default_export() { - let input = "
"; - let expected = format!( - "{PREFIX}\n
\n
\n\ - export default function __AstroComponent_(_props: Record): any {{}}\n" - ); - assert_eq!(convert(input), expected); -} - -#[test] -fn frontmatter_followed_by_body() { - let input = "\n---\nlet value = 'world';\n---\n\n

Hello {value}

\n"; - let actual = convert(input); - assert!(actual.contains("let value = 'world';")); - assert!(actual.contains("")); - // Text and expression are emitted as separate spans. - assert!(actual.contains("Hello ")); - assert!(actual.contains("{value}")); - assert!(actual.contains("")); - assert!(actual.contains("export default function __AstroComponent_")); -} - -#[test] -fn frontmatter_only_no_body() { - let input = "---\nfunction DoTheThing(Props) {}\n---"; - let actual = convert(input); - assert!(actual.starts_with(PREFIX)); - assert!(actual.contains("function DoTheThing(Props) {}")); - assert!(!actual.contains("")); - assert!(actual.contains("export default function __AstroComponent_")); -} - -#[test] -fn template_literal_attribute_passes_through_braces() { - let input = "
"; - let actual = convert(input); - assert!(actual.contains("
")); -} - -#[test] -fn invalid_attribute_collected_in_spread_object() { - let input = "
{}} name=\"value\">
"; - let actual = convert(input); - assert!(actual.contains("name=\"value\"")); - assert!(actual.contains("{...{")); - assert!(actual.contains("\"@click\"")); -} - -#[test] -fn named_export_uses_filename_basename() { - let input = "
"; - let actual = convert_named(input, "/Users/nmoo/test.astro"); - assert!(actual.contains("export default function Test__AstroComponent_")); -} - -#[test] -fn comment_emits_jsx_comment_with_leading_space() { - let input = ""; - let actual = convert(input); - assert!(actual.starts_with(PREFIX)); -} - -#[test] -fn unclosed_tag_passes_through() { - let input = "")); - assert!(actual.contains("")); -} - #[test] fn frontmatter_range_is_recorded() { let result = convert_to_tsx( @@ -121,13 +40,6 @@ fn parser_errors_surface_but_do_not_block_emission() { assert!(result.code.starts_with(PREFIX)); } -#[test] -fn shorthand_attribute_expands_to_named_form() { - let input = ""; - let actual = convert(input); - assert!(actual.contains("bar={bar}")); -} - #[test] fn unclosed_raw_text_element_keeps_content_and_siblings() { for (input, retained) in [ From f4c1e23a96cb570054ace72373fcc6c2b014125e Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 14:00:15 +0200 Subject: [PATCH 19/50] test(astro2tsx): capture the full convert result in snapshots --- .../fixtures/adjacent_siblings_top_level.snap | 13 ++ .../fixtures/attribute_event_and_style.snap | 19 +++ .../fixtures/attribute_expression_value.snap | 23 +++ .../fixtures/attribute_invalid_names.snap | 23 +++ .../fixtures/attribute_quoted_forms.snap | 21 +++ .../tests/fixtures/attribute_shorthand.snap | 21 +++ .../tests/fixtures/attribute_spread.snap | 19 +++ .../fixtures/attribute_template_literal.snap | 21 +++ .../tests/fixtures/crlf_frontmatter.snap | 16 +++ .../astro2tsx/tests/fixtures/directives.snap | 23 +++ .../expression_adjacent_siblings.snap | 17 +++ .../fixtures/expression_comment_only.snap | 13 ++ .../tests/fixtures/expression_empty.snap | 14 ++ .../tests/fixtures/expression_generics.snap | 13 ++ .../fixtures/expression_html_comment.snap | 17 +++ .../tests/fixtures/expression_identifier.snap | 13 ++ .../tests/fixtures/expression_map.snap | 13 ++ .../tests/fixtures/expression_nested.snap | 13 ++ .../fixtures/expression_object_literal.snap | 13 ++ .../fixtures/expression_single_element.snap | 13 ++ .../fixtures/expression_spread_child.snap | 13 ++ .../expression_string_with_markup.snap | 13 ++ .../expression_template_with_markup.snap | 13 ++ .../fixtures/expression_ternary_markup.snap | 13 ++ .../tests/fixtures/frontmatter_absent.snap | 13 ++ .../tests/fixtures/frontmatter_and_body.snap | 16 +++ .../tests/fixtures/frontmatter_empty.snap | 15 ++ .../tests/fixtures/frontmatter_imports.snap | 18 +++ .../tests/fixtures/frontmatter_only.snap | 14 ++ .../frontmatter_top_level_return.snap | 16 +++ .../fixtures/get_static_paths_export.snap | 16 +++ .../fixtures/get_static_paths_with_props.snap | 16 +++ .../tests/fixtures/html_comment_body.snap | 17 +++ .../fixtures/html_comment_top_level.snap | 13 ++ .../astro2tsx/tests/fixtures/multibyte.snap | 13 ++ .../tests/fixtures/multibyte_astral.snap | 16 +++ .../fixtures/named_component_export.snap | 13 ++ .../tests/fixtures/props_generic.snap | 16 +++ .../tests/fixtures/props_imported.snap | 16 +++ .../tests/fixtures/props_interface.snap | 16 +++ .../tests/fixtures/props_type_alias.snap | 16 +++ .../tests/fixtures/raw_text_is_raw.snap | 19 +++ .../tests/fixtures/raw_text_script_json.snap | 20 +++ .../fixtures/raw_text_script_module.snap | 20 +++ .../tests/fixtures/raw_text_style.snap | 18 +++ .../tests/fixtures/slot_element.snap | 19 +++ crates/astro2tsx/tests/fixtures/slots.snap | 15 ++ .../tests/fixtures/unclosed_tag.snap | 13 ++ .../tests/fixtures/void_elements.snap | 22 +++ crates/astro2tsx/tests/snapshots.rs | 132 +++++++++++++++++- 50 files changed, 926 insertions(+), 2 deletions(-) diff --git a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap index 13956d43..01263fa4 100644 --- a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap @@ -10,3 +10,16 @@ input_file: crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..72 +scripts: (none) +styles: (none) + +--- mappings: 20 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..72 x17 -> 0 +72..163 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap index cfac47df..c8ba70f8 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap @@ -9,3 +9,22 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_event_and_style.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..87 +scripts: + EventAttribute lang=Some("event-attribute") generated 55..59 content="go()" +styles: + StyleAttribute lang=Some("css") generated 68..77 content="color:red" + +--- mappings: 34 points in 7 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..45 x2 -> 0 +45..46 x1 -> - +46..60 x8 -> 5 +60..61 x1 -> - +61..87 x19 -> 20 +87..178 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap index bd04df42..4eb2c2d2 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap @@ -9,3 +9,26 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_expression_value.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..85 +scripts: (none) +styles: (none) + +--- mappings: 29 points in 13 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..45 x2 -> 0 +45..46 x1 -> - +46..52 x2 -> 5 +52..53 x1 -> - +53..56 x3 -> 12 +56..58 x2 -> - +58..69 x2 -> 17 +69..70 x1 -> - +70..75 x5 -> 29 +75..76 x1 -> - +76..85 x6 -> 35 +85..176 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap index 5122bbf8..eefe42bd 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap @@ -9,3 +9,26 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_invalid_names.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..103 +scripts: (none) +styles: (none) + +--- mappings: 34 points in 13 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..45 x2 -> 0 +45..46 x1 -> - +46..55 x6 -> 33 +55..61 x1 -> - +61..69 x1 -> 5 +69..71 x1 -> - +71..78 x7 -> 13 +78..80 x2 -> - +80..88 x1 -> 22 +88..94 x3 -> - +94..103 x6 -> 42 +103..194 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap index 7d6bef79..e7aa6847 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap @@ -9,3 +9,24 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_quoted_forms.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..99 +scripts: (none) +styles: (none) + +--- mappings: 41 points in 11 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..45 x2 -> 0 +45..46 x1 -> - +46..57 x10 -> 5 +57..58 x1 -> - +58..72 x10 -> 17 +72..73 x1 -> - +73..83 x5 -> 32 +83..84 x1 -> - +84..99 x7 -> 41 +99..190 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap index 45d53b15..e1090397 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap @@ -9,3 +9,24 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_shorthand.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..60 +scripts: (none) +styles: (none) + +--- mappings: 19 points in 11 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..45 x2 -> 0 +45..46 x1 -> - +46..49 x3 -> 6 +49..51 x2 -> - +51..54 x3 -> 6 +54..55 x1 -> - +55..56 x1 -> 10 +56..58 x1 -> 12 +58..60 x2 -> 13 +60..151 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/attribute_spread.snap b/crates/astro2tsx/tests/fixtures/attribute_spread.snap index 3ce13e95..c23842ca 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_spread.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_spread.snap @@ -9,3 +9,22 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_spread.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..69 +scripts: (none) +styles: (none) + +--- mappings: 22 points in 9 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..45 x2 -> 0 +45..50 x2 -> - +50..54 x4 -> 9 +54..56 x2 -> - +56..65 x6 -> 15 +65..67 x1 -> 25 +67..69 x2 -> 26 +69..160 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap index 3263d5c7..4ab174e2 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap @@ -9,3 +9,24 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_template_literal.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..68 +scripts: (none) +styles: (none) + +--- mappings: 25 points in 11 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..45 x2 -> 0 +45..46 x1 -> - +46..50 x2 -> 5 +50..51 x1 -> - +51..62 x11 -> 10 +62..63 x1 -> - +63..64 x1 -> 22 +64..66 x1 -> 24 +66..68 x2 -> 25 +68..159 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap index 50ce3c41..cf199a3a 100644 --- a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap +++ b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap @@ -14,3 +14,19 @@ import { Meta } from './Meta.astro'; export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 30..71 +body: 82..114 +scripts: (none) +styles: (none) + +--- mappings: 65 points in 6 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..30 x1 -> - +30..30 x1 -> 0 +30..70 x40 -> 3 +70..82 x2 -> - +82..114 x20 -> 48 +114..205 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/directives.snap b/crates/astro2tsx/tests/fixtures/directives.snap index 881fd151..5e5e2cb7 100644 --- a/crates/astro2tsx/tests/fixtures/directives.snap +++ b/crates/astro2tsx/tests/fixtures/directives.snap @@ -9,3 +9,26 @@ input_file: crates/astro2tsx/tests/fixtures/directives.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..116 +scripts: (none) +styles: (none) + +--- mappings: 60 points in 13 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..46 x2 -> 0 +46..47 x1 -> - +47..58 x11 -> 6 +58..59 x1 -> - +59..74 x15 -> 18 +74..75 x1 -> - +75..91 x16 -> 34 +91..92 x1 -> - +92..112 x6 -> 51 +112..114 x1 -> 72 +114..116 x2 -> 73 +116..207 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap index 456d4d1f..f65b9453 100644 --- a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap +++ b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap @@ -9,3 +9,20 @@ input_file: crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..114 +scripts: (none) +styles: (none) + +--- mappings: 52 points in 7 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..55 x12 -> 0 +55..65 x1 -> - +65..94 x29 -> 14 +94..105 x1 -> - +105..114 x6 -> 43 +114..205 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap index 19b81143..8876242c 100644 --- a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap +++ b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/expression_comment_only.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..69 +scripts: (none) +styles: (none) + +--- mappings: 26 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..69 x23 -> 0 +69..160 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_empty.snap b/crates/astro2tsx/tests/fixtures/expression_empty.snap index e8dec0d0..0088b030 100644 --- a/crates/astro2tsx/tests/fixtures/expression_empty.snap +++ b/crates/astro2tsx/tests/fixtures/expression_empty.snap @@ -9,3 +9,17 @@ input_file: crates/astro2tsx/tests/fixtures/expression_empty.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..54 +scripts: (none) +styles: (none) + +--- mappings: 11 points in 4 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..46 x3 -> 0 +46..54 x5 -> 7 +54..145 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_generics.snap b/crates/astro2tsx/tests/fixtures/expression_generics.snap index 27a41788..0e56805a 100644 --- a/crates/astro2tsx/tests/fixtures/expression_generics.snap +++ b/crates/astro2tsx/tests/fixtures/expression_generics.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/expression_generics.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..67 +scripts: (none) +styles: (none) + +--- mappings: 24 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..67 x21 -> 0 +67..158 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap index a9281e5f..cfc8d1b3 100644 --- a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap +++ b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap @@ -9,3 +9,20 @@ input_file: crates/astro2tsx/tests/fixtures/expression_html_comment.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..94 +scripts: (none) +styles: (none) + +--- mappings: 50 points in 7 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..68 x27 -> 0 +68..73 x1 -> - +73..75 x2 -> 31 +75..78 x1 -> - +78..94 x16 -> 36 +94..185 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_identifier.snap b/crates/astro2tsx/tests/fixtures/expression_identifier.snap index dba736cf..754ebf72 100644 --- a/crates/astro2tsx/tests/fixtures/expression_identifier.snap +++ b/crates/astro2tsx/tests/fixtures/expression_identifier.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/expression_identifier.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..61 +scripts: (none) +styles: (none) + +--- mappings: 18 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..61 x15 -> 0 +61..152 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_map.snap b/crates/astro2tsx/tests/fixtures/expression_map.snap index b5db50f8..26501365 100644 --- a/crates/astro2tsx/tests/fixtures/expression_map.snap +++ b/crates/astro2tsx/tests/fixtures/expression_map.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/expression_map.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..89 +scripts: (none) +styles: (none) + +--- mappings: 48 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..89 x45 -> 0 +89..180 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_nested.snap b/crates/astro2tsx/tests/fixtures/expression_nested.snap index c19447e2..34c70c3d 100644 --- a/crates/astro2tsx/tests/fixtures/expression_nested.snap +++ b/crates/astro2tsx/tests/fixtures/expression_nested.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/expression_nested.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..85 +scripts: (none) +styles: (none) + +--- mappings: 42 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..85 x39 -> 0 +85..176 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap index 078ac62e..038cc9fb 100644 --- a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap +++ b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/expression_object_literal.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..73 +scripts: (none) +styles: (none) + +--- mappings: 30 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..73 x27 -> 0 +73..164 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_single_element.snap b/crates/astro2tsx/tests/fixtures/expression_single_element.snap index 86f2fb75..bd5d2b86 100644 --- a/crates/astro2tsx/tests/fixtures/expression_single_element.snap +++ b/crates/astro2tsx/tests/fixtures/expression_single_element.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/expression_single_element.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..78 +scripts: (none) +styles: (none) + +--- mappings: 35 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..78 x32 -> 0 +78..169 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap index 58e379ac..f73bc62a 100644 --- a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap +++ b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/expression_spread_child.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..63 +scripts: (none) +styles: (none) + +--- mappings: 20 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..63 x17 -> 0 +63..154 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap index 3b04f798..cb5d6659 100644 --- a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/expression_string_with_markup.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..63 +scripts: (none) +styles: (none) + +--- mappings: 20 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..63 x17 -> 0 +63..154 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap index dddfb706..868c2357 100644 --- a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/expression_template_with_markup.astr export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..66 +scripts: (none) +styles: (none) + +--- mappings: 23 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..66 x20 -> 0 +66..157 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap index 62fc0bf4..2c4a5dee 100644 --- a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/expression_ternary_markup.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..95 +scripts: (none) +styles: (none) + +--- mappings: 52 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..95 x49 -> 0 +95..186 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap index 716b7bd9..5fdc5afe 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/frontmatter_absent.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..59 +scripts: (none) +styles: (none) + +--- mappings: 16 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..59 x13 -> 0 +59..150 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap index f72d06a2..ba63186a 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap @@ -12,3 +12,19 @@ let value = 'world'; export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 30..53 +body: 64..88 +scripts: (none) +styles: (none) + +--- mappings: 48 points in 6 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..30 x1 -> - +30..30 x1 -> 0 +30..52 x22 -> 3 +52..64 x2 -> - +64..88 x21 -> 30 +88..179 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap index 2f49a9b9..ed5e4da0 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap @@ -10,3 +10,18 @@ input_file: crates/astro2tsx/tests/fixtures/frontmatter_empty.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 30..31 +body: 42..55 +scripts: (none) +styles: (none) + +--- mappings: 13 points in 5 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..30 x1 -> - +30..30 x1 -> 0 +30..42 x2 -> - +42..55 x8 -> 8 +55..146 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap index f23d2905..2b71206c 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap @@ -13,3 +13,21 @@ import type { Foo } from './types'; export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 30..101 +body: 112..122 +scripts: (none) +styles: (none) + +--- mappings: 81 points in 8 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..30 x1 -> - +30..30 x1 -> 0 +30..100 x70 -> 3 +100..112 x2 -> - +112..118 x3 -> 77 +118..120 x1 -> 84 +120..122 x2 -> 85 +122..213 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap index e2665d75..7b89855c 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap @@ -9,3 +9,17 @@ const a = 1; export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 30..45 +body: 46..46 +scripts: (none) +styles: (none) + +--- mappings: 18 points in 4 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..30 x1 -> - +30..30 x1 -> 0 +30..44 x14 -> 3 +44..125 x2 -> - diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap index 82b8cabe..28d2f370 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap @@ -14,3 +14,19 @@ if (cond) { export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 30..76 +body: 90..100 +scripts: (none) +styles: (none) + +--- mappings: 60 points in 6 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..30 x1 -> - +30..30 x1 -> 0 +30..75 x45 -> 3 +75..90 x3 -> - +90..100 x9 -> 52 +100..191 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap b/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap index 2bb430c6..6bf6c8e4 100644 --- a/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap +++ b/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap @@ -23,3 +23,19 @@ type ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[ * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly>, typeof __AstroComponent_, ASTRO__Get>> + +--- result --- +has_parse_errors: false +frontmatter: 30..78 +body: 89..102 +scripts: (none) +styles: (none) + +--- mappings: 60 points in 6 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..30 x1 -> - +30..30 x1 -> 0 +30..77 x47 -> 3 +77..89 x2 -> - +89..102 x8 -> 54 +102..1244 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap b/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap index 0a67f258..7da704e5 100644 --- a/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap +++ b/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap @@ -24,3 +24,19 @@ type ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[ * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly>> + +--- result --- +has_parse_errors: false +frontmatter: 30..119 +body: 133..146 +scripts: (none) +styles: (none) + +--- mappings: 102 points in 6 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..30 x1 -> - +30..30 x1 -> 0 +30..118 x88 -> 3 +118..133 x3 -> - +133..146 x8 -> 95 +146..1162 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/html_comment_body.snap b/crates/astro2tsx/tests/fixtures/html_comment_body.snap index a48e9451..88dd03f7 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_body.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_body.snap @@ -9,3 +9,20 @@ input_file: crates/astro2tsx/tests/fixtures/html_comment_body.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..73 +scripts: (none) +styles: (none) + +--- mappings: 24 points in 7 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..46 x3 -> 0 +46..50 x1 -> - +50..54 x4 -> 9 +54..57 x1 -> - +57..73 x12 -> 16 +73..164 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap index fe92a9e0..a28ca974 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/html_comment_top_level.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..55 +scripts: (none) +styles: (none) + +--- mappings: 12 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..55 x9 -> 17 +55..146 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/multibyte.snap b/crates/astro2tsx/tests/fixtures/multibyte.snap index 444cc907..bbb22cea 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/multibyte.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..68 +scripts: (none) +styles: (none) + +--- mappings: 24 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..68 x21 -> 0 +68..159 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap index eb75708a..70d1d632 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap @@ -12,3 +12,19 @@ const π = Math.PI; export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 30..52 +body: 63..81 +scripts: (none) +styles: (none) + +--- mappings: 38 points in 6 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..30 x1 -> - +30..30 x1 -> 0 +30..51 x20 -> 3 +51..63 x2 -> - +63..81 x13 -> 28 +81..172 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/named_component_export.snap b/crates/astro2tsx/tests/fixtures/named_component_export.snap index 9917ad91..37deb8e5 100644 --- a/crates/astro2tsx/tests/fixtures/named_component_export.snap +++ b/crates/astro2tsx/tests/fixtures/named_component_export.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/named_component_export.astro export default function MyPage__AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..54 +scripts: (none) +styles: (none) + +--- mappings: 11 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..54 x8 -> 0 +54..151 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/props_generic.snap b/crates/astro2tsx/tests/fixtures/props_generic.snap index 8a11e057..1a4bffd4 100644 --- a/crates/astro2tsx/tests/fixtures/props_generic.snap +++ b/crates/astro2tsx/tests/fixtures/props_generic.snap @@ -20,3 +20,19 @@ export default function __AstroComponent_(_props: Props): a * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> + +--- result --- +has_parse_errors: false +frontmatter: 30..80 +body: 94..107 +scripts: (none) +styles: (none) + +--- mappings: 63 points in 6 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..30 x1 -> - +30..30 x1 -> 0 +30..79 x49 -> 3 +79..94 x3 -> - +94..107 x8 -> 56 +107..453 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/props_imported.snap b/crates/astro2tsx/tests/fixtures/props_imported.snap index 9a919406..257786a2 100644 --- a/crates/astro2tsx/tests/fixtures/props_imported.snap +++ b/crates/astro2tsx/tests/fixtures/props_imported.snap @@ -18,3 +18,19 @@ export default function __AstroComponent_(_props: Props): any {} * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> + +--- result --- +has_parse_errors: false +frontmatter: 30..70 +body: 81..94 +scripts: (none) +styles: (none) + +--- mappings: 52 points in 6 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..30 x1 -> - +30..30 x1 -> 0 +30..69 x39 -> 3 +69..81 x2 -> - +81..94 x8 -> 46 +94..419 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/props_interface.snap b/crates/astro2tsx/tests/fixtures/props_interface.snap index c62c666e..cf02eb2a 100644 --- a/crates/astro2tsx/tests/fixtures/props_interface.snap +++ b/crates/astro2tsx/tests/fixtures/props_interface.snap @@ -21,3 +21,19 @@ export default function __AstroComponent_(_props: Props): any {} * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> + +--- result --- +has_parse_errors: false +frontmatter: 30..99 +body: 110..128 +scripts: (none) +styles: (none) + +--- mappings: 88 points in 6 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..30 x1 -> - +30..30 x1 -> 0 +30..98 x68 -> 3 +98..110 x2 -> - +110..128 x15 -> 75 +128..453 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/props_type_alias.snap b/crates/astro2tsx/tests/fixtures/props_type_alias.snap index 72cb87fc..cbc055e2 100644 --- a/crates/astro2tsx/tests/fixtures/props_type_alias.snap +++ b/crates/astro2tsx/tests/fixtures/props_type_alias.snap @@ -18,3 +18,19 @@ export default function __AstroComponent_(_props: Props): any {} * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> + +--- result --- +has_parse_errors: false +frontmatter: 30..64 +body: 75..88 +scripts: (none) +styles: (none) + +--- mappings: 46 points in 6 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..30 x1 -> - +30..30 x1 -> 0 +30..63 x33 -> 3 +63..75 x2 -> - +75..88 x8 -> 40 +88..413 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap index 1f0de878..9f545bb7 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap @@ -9,3 +9,22 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_is_raw.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..82 +scripts: (none) +styles: (none) + +--- mappings: 37 points in 9 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..45 x2 -> 0 +45..46 x1 -> - +46..53 x7 -> 5 +53..55 x1 -> - +55..72 x17 -> 12 +72..74 x1 -> - +74..82 x5 -> 29 +82..173 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap index 29f24307..76e75b13 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap @@ -9,3 +9,23 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_script_json.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..95 +scripts: + Script lang=Some("json") generated 73..84 content="{\"a\":1}" +styles: (none) + +--- mappings: 41 points in 9 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..48 x2 -> 0 +48..49 x1 -> - +49..73 x21 -> 8 +73..75 x1 -> - +75..82 x7 -> 32 +82..84 x1 -> - +84..95 x5 -> 39 +95..186 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap index 9baac76a..6d269535 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap @@ -11,3 +11,23 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_script_module.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..98 +scripts: + Script lang=Some("module") generated 63..87 content="const a = 1;" +styles: (none) + +--- mappings: 36 points in 9 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..48 x2 -> 0 +48..49 x1 -> - +49..63 x11 -> 8 +63..72 x1 -> - +72..84 x12 -> 22 +84..87 x1 -> - +87..98 x5 -> 34 +98..189 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/raw_text_style.snap b/crates/astro2tsx/tests/fixtures/raw_text_style.snap index f2527a1c..96cb5727 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_style.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_style.snap @@ -9,3 +9,21 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_style.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..80 +scripts: (none) +styles: + Style lang=Some("css") generated 48..70 content=".a { color: red; }" + +--- mappings: 31 points in 7 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..48 x3 -> 0 +48..50 x1 -> - +50..68 x18 -> 7 +68..70 x1 -> - +70..80 x5 -> 25 +80..171 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/slot_element.snap b/crates/astro2tsx/tests/fixtures/slot_element.snap index 0240b90a..e33d87a6 100644 --- a/crates/astro2tsx/tests/fixtures/slot_element.snap +++ b/crates/astro2tsx/tests/fixtures/slot_element.snap @@ -9,3 +9,22 @@ input_file: crates/astro2tsx/tests/fixtures/slot_element.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..79 +scripts: (none) +styles: (none) + +--- mappings: 25 points in 9 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..51 x5 -> 0 +51..52 x1 -> - +52..61 x6 -> 11 +61..63 x1 -> 21 +63..69 x3 -> 22 +69..71 x1 -> 29 +71..79 x5 -> 30 +79..170 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/slots.snap b/crates/astro2tsx/tests/fixtures/slots.snap index c2d460c8..1773fcf4 100644 --- a/crates/astro2tsx/tests/fixtures/slots.snap +++ b/crates/astro2tsx/tests/fixtures/slots.snap @@ -12,3 +12,18 @@ input_file: crates/astro2tsx/tests/fixtures/slots.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..104 +scripts: (none) +styles: (none) + +--- mappings: 44 points in 5 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..56 x7 -> 0 +56..57 x1 -> - +57..104 x33 -> 16 +104..195 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap index c8f1b072..2d9b3c54 100644 --- a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap +++ b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap @@ -9,3 +9,16 @@ input_file: crates/astro2tsx/tests/fixtures/unclosed_tag.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: true +frontmatter: 0..0 +body: 41..55 +scripts: (none) +styles: (none) + +--- mappings: 17 points in 3 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..55 x14 -> 0 +55..146 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/void_elements.snap b/crates/astro2tsx/tests/fixtures/void_elements.snap index 52e1766c..8b453cc2 100644 --- a/crates/astro2tsx/tests/fixtures/void_elements.snap +++ b/crates/astro2tsx/tests/fixtures/void_elements.snap @@ -9,3 +9,25 @@ input_file: crates/astro2tsx/tests/fixtures/void_elements.astro export default function __AstroComponent_(_props: Record): any {} + +--- result --- +has_parse_errors: false +frontmatter: 0..0 +body: 41..103 +scripts: (none) +styles: (none) + +--- mappings: 43 points in 12 runs --- +generated_start..generated_end xpoints -> original; `-` is unmapped +0..41 x2 -> - +41..51 x6 -> 0 +51..55 x3 -> 9 +55..57 x1 -> 14 +57..61 x2 -> 15 +61..62 x1 -> - +62..75 x10 -> 20 +75..81 x2 -> 32 +81..82 x1 -> - +82..95 x9 -> 39 +95..103 x5 -> 51 +103..194 x1 -> - diff --git a/crates/astro2tsx/tests/snapshots.rs b/crates/astro2tsx/tests/snapshots.rs index 127761fa..e6d28f4a 100644 --- a/crates/astro2tsx/tests/snapshots.rs +++ b/crates/astro2tsx/tests/snapshots.rs @@ -1,11 +1,14 @@ //! astro2tsx snapshot tests. Run `cargo insta review` to accept changes. //! +//! Each snapshot captures the whole `ConvertResult`, not just its code. +//! //! A fixture may open with `// @config key=value` lines, stripped before //! conversion. The only key is `filename`, which defaults to none. +use std::fmt::Write as _; use std::fs; -use astro2tsx::{ConvertOptions, convert_to_tsx}; +use astro2tsx::{ConvertOptions, ConvertResult, ExtractedTag, Mapping, convert_to_tsx}; /// Parse `// @config` directives from the top of a fixture file. /// @@ -28,13 +31,110 @@ fn parse_fixture(raw: &str) -> (String, ConvertOptions) { (remaining.to_string(), options) } +/// Mappings are per character, so lockstep ones collapse into a run. +struct Run { + generated_start: u32, + generated_end: u32, + original: Option, + points: usize, +} + +fn runs(mappings: &[Mapping], code_len: u32) -> Vec { + let mut runs: Vec = Vec::new(); + for (index, mapping) in mappings.iter().enumerate() { + let generated_end = mappings + .get(index + 1) + .map_or(code_len, |next| next.generated); + if let Some(open) = runs.last_mut() { + let previous = &mappings[index - 1]; + let lockstep = match (previous.original, mapping.original) { + (None, None) => true, + (Some(before), Some(after)) => { + i64::from(mapping.generated) - i64::from(previous.generated) + == i64::from(after) - i64::from(before) + } + _ => false, + }; + if lockstep && mapping.generated >= previous.generated { + open.generated_end = generated_end; + open.points += 1; + continue; + } + } + runs.push(Run { + generated_start: mapping.generated, + generated_end, + original: mapping.original, + points: 1, + }); + } + runs +} + +fn write_tags(out: &mut String, label: &str, tags: &[ExtractedTag]) { + if tags.is_empty() { + let _ = writeln!(out, "{label}: (none)"); + return; + } + let _ = writeln!(out, "{label}:"); + for tag in tags { + let _ = writeln!( + out, + " {:?} lang={:?} generated {}..{} content={:?}", + tag.kind, tag.lang, tag.range.start, tag.range.end, tag.content + ); + } +} + +fn report(result: &ConvertResult) -> String { + let mut out = String::new(); + + out.push_str(&result.code); + if !result.code.ends_with('\n') { + out.push('\n'); + } + + out.push_str("\n--- result ---\n"); + let _ = writeln!(out, "has_parse_errors: {}", result.has_parse_errors); + let _ = writeln!( + out, + "frontmatter: {}..{}", + result.frontmatter.start, result.frontmatter.end + ); + let _ = writeln!(out, "body: {}..{}", result.body.start, result.body.end); + write_tags(&mut out, "scripts", &result.scripts); + write_tags(&mut out, "styles", &result.styles); + + let runs = runs(&result.mappings, result.code.len() as u32); + let _ = writeln!( + out, + "\n--- mappings: {} points in {} runs ---", + result.mappings.len(), + runs.len() + ); + out.push_str("generated_start..generated_end xpoints -> original; `-` is unmapped\n"); + for run in &runs { + let original = match run.original { + Some(offset) => offset.to_string(), + None => "-".to_string(), + }; + let _ = writeln!( + out, + "{}..{} x{} -> {}", + run.generated_start, run.generated_end, run.points, original + ); + } + + out +} + #[test] fn snapshots() { insta::glob!("fixtures/*.astro", |path| { let raw = fs::read_to_string(path).unwrap(); let name = path.file_stem().unwrap().to_str().unwrap(); let (source, options) = parse_fixture(&raw); - let output = convert_to_tsx(&source, options).code; + let output = report(&convert_to_tsx(&source, options)); insta::with_settings!({ snapshot_path => path.parent().unwrap(), @@ -46,3 +146,31 @@ fn snapshots() { }); }); } + +/// insta rewrites CRLF to LF when storing a snapshot, hiding this there. +#[test] +fn crlf_fixture_keeps_its_line_endings() { + let raw = fs::read_to_string(concat!( + env!("CARGO_MANIFEST_DIR"), + "/tests/fixtures/crlf_frontmatter.astro" + )) + .unwrap(); + let (source, options) = parse_fixture(&raw); + let result = convert_to_tsx(&source, options); + + assert_eq!( + source.matches('\n').count(), + source.matches("\r\n").count(), + "fixture is no longer CRLF-only, so this test proves nothing" + ); + for line in source.split("\r\n") { + if line.is_empty() || line == "---" { + continue; + } + assert!( + result.code.contains(&format!("{line}\r\n")), + "{line:?} lost its CRLF:\n{:?}", + result.code + ); + } +} From 1328da469e13ee1f00481d433ad53bcc8900bc5b Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 14:15:14 +0200 Subject: [PATCH 20/50] feat(astro2tsx): encode the mappings as a source map v3 --- crates/astro2tsx/Cargo.toml | 6 +- crates/astro2tsx/src/lib.rs | 12 ++- crates/astro2tsx/src/sourcemap.rs | 171 +++++++++++++++++++++++++++++- 3 files changed, 182 insertions(+), 7 deletions(-) diff --git a/crates/astro2tsx/Cargo.toml b/crates/astro2tsx/Cargo.toml index aeb67ee1..56c9912d 100644 --- a/crates/astro2tsx/Cargo.toml +++ b/crates/astro2tsx/Cargo.toml @@ -24,11 +24,11 @@ biome_rowan = { git = "https://github.com/Princesseuh/biome", rev = "2532865deaf napi = { workspace = true } napi-derive = { workspace = true } +serde = { version = "1", features = ["derive"] } +serde_json = "1" [dev-dependencies] -insta = { workspace = true, features = ["glob"] } -serde = { version = "1", features = ["derive"] } -serde_json = "1" +insta = { workspace = true, features = ["glob"] } [build-dependencies] napi-build = { workspace = true } diff --git a/crates/astro2tsx/src/lib.rs b/crates/astro2tsx/src/lib.rs index af968491..cb497293 100644 --- a/crates/astro2tsx/src/lib.rs +++ b/crates/astro2tsx/src/lib.rs @@ -18,7 +18,9 @@ mod utils; use biome_html_parser::parse_html; use biome_languages::HtmlFileSource; -pub use crate::sourcemap::{ExtractedKind, ExtractedTag, GeneratedRange, Mapping}; +pub use crate::sourcemap::{ + DEFAULT_SOURCE_NAME, ExtractedKind, ExtractedTag, GeneratedRange, Mapping, SourceMap, +}; #[derive(Clone, Debug, Default)] pub struct ConvertOptions { @@ -45,6 +47,14 @@ pub struct ConvertResult { pub has_parse_errors: bool, } +impl ConvertResult { + /// Encodes [`Self::mappings`] as a Source Map v3 document, embedding + /// `source` as `sourcesContent` so the map stands alone. + pub fn source_map(&self, source: &str, source_name: &str) -> SourceMap { + sourcemap::encode(source, &self.code, &self.mappings, source_name) + } +} + pub fn convert_to_tsx(source: &str, options: ConvertOptions) -> ConvertResult { let parse = parse_html(source, (&HtmlFileSource::astro()).into()); let has_parse_errors = parse.has_errors(); diff --git a/crates/astro2tsx/src/sourcemap.rs b/crates/astro2tsx/src/sourcemap.rs index 5143fe83..33659107 100644 --- a/crates/astro2tsx/src/sourcemap.rs +++ b/crates/astro2tsx/src/sourcemap.rs @@ -1,6 +1,10 @@ -//! Stores source-position information collected as the printer emits TSX. -//! -//! Offsets are raw and unencoded; VLQ encoding is left to consumers. +//! Source-position information collected as the printer emits TSX, and its +//! encoding as a standard Source Map v3 document. + +use serde::Serialize; + +/// Used for `sources[0]` when the caller supplies no filename. +pub const DEFAULT_SOURCE_NAME: &str = "input.astro"; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct Mapping { @@ -56,3 +60,164 @@ pub enum ExtractedKind { StyleAttribute, EventAttribute, } + +/// A Source Map v3 document. `sourcesContent` is always populated. +#[derive(Clone, Debug, PartialEq, Eq, Serialize)] +pub struct SourceMap { + pub version: u8, + pub sources: Vec, + #[serde(rename = "sourcesContent")] + pub sources_content: Vec>, + pub names: Vec, + pub mappings: String, +} + +impl SourceMap { + pub fn to_json(&self) -> String { + serde_json::to_string(self).expect("a source map contains only serialisable types") + } +} + +const BASE64: &[u8; 64] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +fn push_vlq(out: &mut String, value: i64) { + let mut remaining = if value < 0 { + ((value.unsigned_abs()) << 1) | 1 + } else { + (value as u64) << 1 + }; + loop { + let mut digit = (remaining & 0b1_1111) as usize; + remaining >>= 5; + if remaining > 0 { + digit |= 0b10_0000; + } + out.push(BASE64[digit] as char); + if remaining == 0 { + return; + } + } +} + +struct LineIndex<'a> { + text: &'a str, + line_starts: Vec, +} + +impl<'a> LineIndex<'a> { + fn new(text: &'a str) -> Self { + let mut line_starts = vec![0]; + line_starts.extend(text.match_indices('\n').map(|(index, _)| index + 1)); + Self { text, line_starts } + } + + /// Zero-based line and column; consumers index columns in UTF-16 units. + fn locate(&self, offset: u32) -> (u32, u32) { + let offset = (offset as usize).min(self.text.len()); + let line = self.line_starts.partition_point(|&start| start <= offset) - 1; + let line_start = self.line_starts[line]; + let mut column = 0usize; + for (index, ch) in self.text[line_start..].char_indices() { + if line_start + index >= offset { + break; + } + column += ch.len_utf16(); + } + (line as u32, column as u32) + } +} + +pub(crate) fn encode( + source: &str, + generated: &str, + mappings: &[Mapping], + source_name: &str, +) -> SourceMap { + let source_lines = LineIndex::new(source); + let generated_lines = LineIndex::new(generated); + + let mut encoded = String::new(); + let mut line = 0u32; + let mut column = 0i64; + let mut source_line = 0i64; + let mut source_column = 0i64; + let mut first_on_line = true; + + for mapping in mappings { + let (mapping_line, mapping_column) = generated_lines.locate(mapping.generated); + while line < mapping_line { + encoded.push(';'); + line += 1; + column = 0; + first_on_line = true; + } + if !first_on_line { + encoded.push(','); + } + first_on_line = false; + + push_vlq(&mut encoded, i64::from(mapping_column) - column); + column = i64::from(mapping_column); + + let Some(original) = mapping.original else { + continue; + }; + let (original_line, original_column) = source_lines.locate(original); + // There is only ever one source, so its index never moves. + push_vlq(&mut encoded, 0); + push_vlq(&mut encoded, i64::from(original_line) - source_line); + source_line = i64::from(original_line); + push_vlq(&mut encoded, i64::from(original_column) - source_column); + source_column = i64::from(original_column); + } + + SourceMap { + version: 3, + sources: vec![source_name.to_string()], + sources_content: vec![Some(source.to_string())], + names: Vec::new(), + mappings: encoded, + } +} + +#[cfg(test)] +mod tests { + use super::{LineIndex, push_vlq}; + + fn vlq(value: i64) -> String { + let mut out = String::new(); + push_vlq(&mut out, value); + out + } + + #[test] + fn vlq_matches_known_values() { + assert_eq!(vlq(0), "A"); + assert_eq!(vlq(1), "C"); + assert_eq!(vlq(-1), "D"); + assert_eq!(vlq(15), "e"); + assert_eq!(vlq(16), "gB"); + assert_eq!(vlq(-16), "hB"); + assert_eq!(vlq(1000), "w+B"); + } + + #[test] + fn columns_count_utf16_code_units() { + let index = LineIndex::new("

🦄 {π}

"); + assert_eq!(index.locate(0), (0, 0)); + assert_eq!(index.locate(3), (0, 3)); + // The emoji is four bytes but two UTF-16 code units. + assert_eq!(index.locate(7), (0, 5)); + assert_eq!(index.locate(8), (0, 6)); + } + + #[test] + fn lines_are_zero_based_and_columns_restart() { + let index = LineIndex::new("ab\ncd\n\nef"); + assert_eq!(index.locate(0), (0, 0)); + assert_eq!(index.locate(3), (1, 0)); + assert_eq!(index.locate(4), (1, 1)); + assert_eq!(index.locate(6), (2, 0)); + assert_eq!(index.locate(7), (3, 0)); + } +} From 9a948ed927141f606c11fd8da7da91deb3f1f1a4 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 14:16:21 +0200 Subject: [PATCH 21/50] test(astro2tsx): verify the encoded source map with an independent decoder --- crates/astro2tsx/Cargo.toml | 3 +- crates/astro2tsx/tests/source_map.rs | 160 +++++++++++++++++++++++++++ 2 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 crates/astro2tsx/tests/source_map.rs diff --git a/crates/astro2tsx/Cargo.toml b/crates/astro2tsx/Cargo.toml index 56c9912d..276f15ac 100644 --- a/crates/astro2tsx/Cargo.toml +++ b/crates/astro2tsx/Cargo.toml @@ -28,7 +28,8 @@ serde = { version = "1", features = ["derive"] } serde_json = "1" [dev-dependencies] -insta = { workspace = true, features = ["glob"] } +insta = { workspace = true, features = ["glob"] } +oxc_sourcemap = { workspace = true } [build-dependencies] napi-build = { workspace = true } diff --git a/crates/astro2tsx/tests/source_map.rs b/crates/astro2tsx/tests/source_map.rs new file mode 100644 index 00000000..987e569c --- /dev/null +++ b/crates/astro2tsx/tests/source_map.rs @@ -0,0 +1,160 @@ +//! Checks the encoded source map by decoding it with `oxc_sourcemap` rather +//! than by re-deriving it from the same code that produced it. + +use std::fs; + +use astro2tsx::{ConvertOptions, DEFAULT_SOURCE_NAME, convert_to_tsx}; +use oxc_sourcemap::SourceMap as DecodedMap; + +fn fixtures() -> Vec<(String, String)> { + let dir = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/fixtures"); + let mut fixtures: Vec<(String, String)> = fs::read_dir(dir) + .unwrap() + .filter_map(|entry| { + let path = entry.unwrap().path(); + if path.extension()? != "astro" { + return None; + } + let name = path.file_stem()?.to_str()?.to_string(); + Some((name, fs::read_to_string(&path).ok()?)) + }) + .collect(); + fixtures.sort(); + fixtures +} + +fn strip_directives(raw: &str) -> String { + let mut remaining = raw; + while let Some(line) = remaining.lines().next() { + if !line.starts_with("// @config ") { + break; + } + remaining = remaining[line.len()..].trim_start_matches('\n'); + } + remaining.to_string() +} + +/// Byte offset of a zero-based line and UTF-16 column, resolved through +/// `str::encode_utf16` so it shares no code with the encoder. +fn byte_offset(text: &str, line: u32, column: u32) -> Option { + let mut line_start = 0usize; + for (index, line_text) in text.split('\n').enumerate() { + if index as u32 == line { + let boundaries = line_text + .char_indices() + .map(|(byte, _)| byte) + .chain(std::iter::once(line_text.len())); + for byte in boundaries { + if line_text[..byte].encode_utf16().count() as u32 == column { + return Some(line_start + byte); + } + } + return None; + } + line_start += line_text.len() + 1; + } + None +} + +#[test] +fn every_fixture_round_trips_through_an_independent_decoder() { + for (name, raw) in fixtures() { + let source = strip_directives(&raw); + let result = convert_to_tsx(&source, ConvertOptions::default()); + let json = result.source_map(&source, DEFAULT_SOURCE_NAME).to_json(); + + let decoded = DecodedMap::from_json_string(&json) + .unwrap_or_else(|error| panic!("{name}: map did not decode: {error}")); + + assert_eq!( + decoded.get_source(0).map(|s| &**s), + Some(DEFAULT_SOURCE_NAME), + "{name}: sources[0] did not survive" + ); + assert_eq!( + decoded.get_source_content(0).map(|s| &**s), + Some(source.as_str()), + "{name}: sourcesContent did not survive" + ); + + let tokens: Vec<_> = decoded.get_tokens().collect(); + assert_eq!( + tokens.len(), + result.mappings.len(), + "{name}: decoded {} tokens for {} mappings", + tokens.len(), + result.mappings.len() + ); + + for (index, (token, mapping)) in tokens.iter().zip(&result.mappings).enumerate() { + let generated = byte_offset(&result.code, token.get_dst_line(), token.get_dst_col()) + .unwrap_or_else(|| { + panic!( + "{name}: mapping {index} decoded to generated {}:{}, which is off the end", + token.get_dst_line(), + token.get_dst_col() + ) + }); + assert_eq!( + generated as u32, mapping.generated, + "{name}: mapping {index} generated offset changed across the round trip" + ); + + match mapping.original { + Some(original) => { + assert!( + token.get_source_id().is_some(), + "{name}: mapping {index} lost its source" + ); + let decoded_original = byte_offset( + &source, + token.get_src_line(), + token.get_src_col(), + ) + .unwrap_or_else(|| { + panic!( + "{name}: mapping {index} decoded to source {}:{}, which is off the end", + token.get_src_line(), + token.get_src_col() + ) + }); + assert_eq!( + decoded_original as u32, original, + "{name}: mapping {index} original offset changed across the round trip" + ); + } + None => assert!( + token.get_source_id().is_none(), + "{name}: mapping {index} gained a source it never had" + ), + } + } + } +} + +/// A byte column would be 8 here and a scalar-value column 5, so this pins the +/// units down to UTF-16 rather than merely to "not bytes". +#[test] +fn astral_columns_are_utf16_code_units() { + let source = "---\nconst \u{3c0} = Math.PI;\n---\n

\u{1f984} {\u{3c0}}

\n"; + let result = convert_to_tsx(source, ConvertOptions::default()); + let json = result.source_map(source, DEFAULT_SOURCE_NAME).to_json(); + let decoded = DecodedMap::from_json_string(&json).unwrap(); + + let tokens: Vec<_> = decoded.get_tokens().collect(); + + // Selecting by raw byte offset keeps the assertion off the decoded columns. + let column_of = |offset: usize| { + let index = result + .mappings + .iter() + .position(|mapping| mapping.original == Some(offset as u32)) + .unwrap_or_else(|| panic!("byte {offset} is not mapped")); + let token = tokens[index]; + (token.get_src_line(), token.get_src_col()) + }; + + assert_eq!(column_of(source.find("{\u{3c0}}").unwrap()), (3, 6)); + assert_eq!(column_of(source.find("\u{3c0} = Math.PI").unwrap()), (1, 6)); + assert_eq!(column_of(source.find("

").unwrap()), (3, 9)); +} From 1c70a193026976c00a7a3a084adc138456440d6c Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 14:19:36 +0200 Subject: [PATCH 22/50] feat(astro2tsx): expose the source map through the napi binding --- crates/astro2tsx/index.d.ts | 2 ++ crates/astro2tsx/src/napi.rs | 10 +++++++++- crates/astro2tsx/test/astro2tsx.test.ts | 23 +++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/crates/astro2tsx/index.d.ts b/crates/astro2tsx/index.d.ts index 497d782a..9f738f48 100644 --- a/crates/astro2tsx/index.d.ts +++ b/crates/astro2tsx/index.d.ts @@ -20,6 +20,8 @@ export interface ConvertToTsxOptions { export interface ConvertToTsxResult { code: string mappings: Array + /** Source Map v3 JSON for `code`, with `sourcesContent` embedded. */ + map: string frontmatter: GeneratedRange body: GeneratedRange scripts: Array diff --git a/crates/astro2tsx/src/napi.rs b/crates/astro2tsx/src/napi.rs index 5b48e13d..8f3e587f 100644 --- a/crates/astro2tsx/src/napi.rs +++ b/crates/astro2tsx/src/napi.rs @@ -3,7 +3,7 @@ use napi_derive::napi; -use crate::{ConvertOptions, ExtractedKind, convert_to_tsx as convert_rs}; +use crate::{ConvertOptions, DEFAULT_SOURCE_NAME, ExtractedKind, convert_to_tsx as convert_rs}; /// Per-byte source-position mapping between the emitted TSX and the source. #[napi(object)] @@ -50,6 +50,8 @@ pub struct ConvertToTsxOptions { pub struct ConvertToTsxResult { pub code: String, pub mappings: Vec, + /// Source Map v3 JSON for `code`, with `sourcesContent` embedded. + pub map: String, pub frontmatter: GeneratedRange, pub body: GeneratedRange, pub scripts: Vec, @@ -65,15 +67,21 @@ pub struct ConvertToTsxResult { #[napi(js_name = "convertToTsx")] pub fn convert_to_tsx(source: String, options: Option) -> ConvertToTsxResult { let opts = options.unwrap_or_default(); + let source_name = opts + .filename + .clone() + .unwrap_or_else(|| DEFAULT_SOURCE_NAME.to_string()); let result = convert_rs( &source, ConvertOptions { filename: opts.filename, }, ); + let map = result.source_map(&source, &source_name).to_json(); ConvertToTsxResult { code: result.code, + map, mappings: result .mappings .into_iter() diff --git a/crates/astro2tsx/test/astro2tsx.test.ts b/crates/astro2tsx/test/astro2tsx.test.ts index ff3d66db..0fc56e14 100644 --- a/crates/astro2tsx/test/astro2tsx.test.ts +++ b/crates/astro2tsx/test/astro2tsx.test.ts @@ -43,3 +43,26 @@ test('mappings carry per-byte source offsets', () => { const mapped = result.mappings.find((m) => m.original !== null && m.original !== undefined); assert.ok(mapped, 'expected at least one mapped byte'); }); + +test('returns a self-contained source map v3', () => { + const input = '---\nlet x = 1;\n---\n

Hi

'; + const map = JSON.parse(convertToTsx(input).map); + assert.equal(map.version, 3); + assert.deepEqual(map.sources, ['input.astro']); + assert.deepEqual(map.sourcesContent, [input]); + assert.deepEqual(map.names, []); + assert.ok(map.mappings.length > 0); +}); + +test('names the source after the filename option', () => { + const map = JSON.parse(convertToTsx('

', { filename: 'Index.astro' }).map); + assert.deepEqual(map.sources, ['Index.astro']); +}); + +test('source map carries astral characters through unchanged', () => { + const input = '

🦄 {value}

'; + const result = convertToTsx(input); + const map = JSON.parse(result.map); + assert.equal(map.sourcesContent[0], input); + assert.ok(map.mappings.split(';').length <= result.code.split('\n').length); +}); From d4a4fb60b184fd181acaf015a9cb58d87a73e661 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 14:22:45 +0200 Subject: [PATCH 23/50] test(astro2tsx): include the encoded source map in snapshots --- .../fixtures/adjacent_siblings_top_level.snap | 13 +++++++++++++ .../fixtures/attribute_event_and_style.snap | 13 +++++++++++++ .../fixtures/attribute_expression_value.snap | 13 +++++++++++++ .../tests/fixtures/attribute_invalid_names.snap | 13 +++++++++++++ .../tests/fixtures/attribute_quoted_forms.snap | 13 +++++++++++++ .../tests/fixtures/attribute_shorthand.snap | 13 +++++++++++++ .../tests/fixtures/attribute_spread.snap | 13 +++++++++++++ .../fixtures/attribute_template_literal.snap | 13 +++++++++++++ .../tests/fixtures/crlf_frontmatter.snap | 13 +++++++++++++ crates/astro2tsx/tests/fixtures/directives.snap | 13 +++++++++++++ .../fixtures/expression_adjacent_siblings.snap | 13 +++++++++++++ .../tests/fixtures/expression_comment_only.snap | 13 +++++++++++++ .../tests/fixtures/expression_empty.snap | 13 +++++++++++++ .../tests/fixtures/expression_generics.snap | 13 +++++++++++++ .../tests/fixtures/expression_html_comment.snap | 13 +++++++++++++ .../tests/fixtures/expression_identifier.snap | 13 +++++++++++++ .../tests/fixtures/expression_map.snap | 13 +++++++++++++ .../tests/fixtures/expression_nested.snap | 13 +++++++++++++ .../fixtures/expression_object_literal.snap | 13 +++++++++++++ .../fixtures/expression_single_element.snap | 13 +++++++++++++ .../tests/fixtures/expression_spread_child.snap | 13 +++++++++++++ .../fixtures/expression_string_with_markup.snap | 13 +++++++++++++ .../expression_template_with_markup.snap | 13 +++++++++++++ .../fixtures/expression_ternary_markup.snap | 13 +++++++++++++ .../tests/fixtures/frontmatter_absent.snap | 13 +++++++++++++ .../tests/fixtures/frontmatter_and_body.snap | 13 +++++++++++++ .../tests/fixtures/frontmatter_empty.snap | 13 +++++++++++++ .../tests/fixtures/frontmatter_imports.snap | 13 +++++++++++++ .../tests/fixtures/frontmatter_only.snap | 13 +++++++++++++ .../fixtures/frontmatter_top_level_return.snap | 13 +++++++++++++ .../tests/fixtures/get_static_paths_export.snap | 13 +++++++++++++ .../fixtures/get_static_paths_with_props.snap | 13 +++++++++++++ .../tests/fixtures/html_comment_body.snap | 13 +++++++++++++ .../tests/fixtures/html_comment_top_level.snap | 13 +++++++++++++ crates/astro2tsx/tests/fixtures/multibyte.snap | 13 +++++++++++++ .../tests/fixtures/multibyte_astral.snap | 13 +++++++++++++ .../tests/fixtures/named_component_export.snap | 13 +++++++++++++ .../astro2tsx/tests/fixtures/props_generic.snap | 13 +++++++++++++ .../tests/fixtures/props_imported.snap | 13 +++++++++++++ .../tests/fixtures/props_interface.snap | 13 +++++++++++++ .../tests/fixtures/props_type_alias.snap | 13 +++++++++++++ .../tests/fixtures/raw_text_is_raw.snap | 13 +++++++++++++ .../tests/fixtures/raw_text_script_json.snap | 13 +++++++++++++ .../tests/fixtures/raw_text_script_module.snap | 13 +++++++++++++ .../tests/fixtures/raw_text_style.snap | 13 +++++++++++++ .../astro2tsx/tests/fixtures/slot_element.snap | 13 +++++++++++++ crates/astro2tsx/tests/fixtures/slots.snap | 13 +++++++++++++ .../astro2tsx/tests/fixtures/unclosed_tag.snap | 13 +++++++++++++ .../astro2tsx/tests/fixtures/void_elements.snap | 13 +++++++++++++ crates/astro2tsx/tests/snapshots.rs | 17 ++++++++++++++--- 50 files changed, 651 insertions(+), 3 deletions(-) diff --git a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap index 01263fa4..bd842ebd 100644 --- a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap @@ -23,3 +23,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..72 x17 -> 0 72..163 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "a\nb\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AACd,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AACd;A" +} diff --git a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap index c8ba70f8..f69e66f3 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap @@ -28,3 +28,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 60..61 x1 -> - 61..87 x19 -> 20 87..178 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,G,CAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,CAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAC5C;A" +} diff --git a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap index 4eb2c2d2..57697ce9 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap @@ -32,3 +32,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 75..76 x1 -> - 76..85 x6 -> 35 85..176 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,G,CAAI,KAAK,C,CAAE,CAAC,CAAC,C,C,CAAG,UAAU,C,CAAE,CAAC,CAAC,CAAC,CAAC,C,CAAE,CAAC,EAAE,GAAG,CAAC;AAC1C;A" +} diff --git a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap index eefe42bd..d212df6a 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap @@ -32,3 +32,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 88..94 x3 -> - 94..103 x6 -> 42 103..194 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,G,CAAgC,IAAI,CAAC,CAAC,CAAC,CAAC,C,MAApC,Q,EAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,C,CAAG,Q,C,G,EAAoB,CAAC,EAAE,GAAG,CAAC;AACjD;A" +} diff --git a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap index e7aa6847..87d5d0ae 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap @@ -30,3 +30,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 83..84 x1 -> - 84..99 x7 -> 41 99..190 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,G,CAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,CAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,CAAE,MAAM,CAAC,CAAC,CAAC,C,CAAA,MAAM,CAAC,EAAE,GAAG,CAAC;AACtD;A" +} diff --git a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap index e1090397..63b92fcc 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap @@ -30,3 +30,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 56..58 x1 -> 12 58..60 x2 -> 13 60..151 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,G,CAAK,CAAC,CAAC,C,C,CAAF,CAAC,CAAC,C,CAAE,CAAE,EAAC;AACb;A" +} diff --git a/crates/astro2tsx/tests/fixtures/attribute_spread.snap b/crates/astro2tsx/tests/fixtures/attribute_spread.snap index c23842ca..2a0ee94f 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_spread.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_spread.snap @@ -28,3 +28,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 65..67 x1 -> 25 67..69 x2 -> 26 69..160 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,G,E,GAAQ,CAAC,CAAC,CAAC,C,C,CAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAE,EAAC;AAC1B;A" +} diff --git a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap index 4ab174e2..d6668e5f 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap @@ -30,3 +30,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 64..66 x1 -> 24 66..68 x2 -> 25 68..159 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,G,CAAI,GAAG,C,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,CAAE,CAAE,EAAC;AACzB;A" +} diff --git a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap index cf199a3a..6a718308 100644 --- a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap +++ b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap @@ -30,3 +30,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 70..82 x2 -> - 82..114 x20 -> 48 114..205 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "---\r\nimport { Meta } from './Meta.astro';\r\n---\r\n
\r\na\r\n
\r\n" + ], + "names": [], + "mappings": "A;;AAAA,AAAG,CAAC;AACJ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAErC,CAAC,GAAG,CAAC,CAAC;AACN,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AACf,EAAE,GAAG,CAAC,CAAC;AACP;A" +} diff --git a/crates/astro2tsx/tests/fixtures/directives.snap b/crates/astro2tsx/tests/fixtures/directives.snap index 5e5e2cb7..009c3341 100644 --- a/crates/astro2tsx/tests/fixtures/directives.snap +++ b/crates/astro2tsx/tests/fixtures/directives.snap @@ -32,3 +32,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 112..114 x1 -> 72 114..116 x2 -> 73 116..207 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,I,CAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,CAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAE,EAAC;AACzE;A" +} diff --git a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap index f65b9453..515211de 100644 --- a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap +++ b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap @@ -26,3 +26,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 94..105 x1 -> - 105..114 x6 -> 43 114..205 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
{cond && a b}
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,UAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,WAAC,CAAC,EAAE,GAAG,CAAC;AAClD;A" +} diff --git a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap index 8876242c..3f8c0564 100644 --- a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap +++ b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..69 x23 -> 0 69..160 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
{/* keep me */}
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAC1B;A" +} diff --git a/crates/astro2tsx/tests/fixtures/expression_empty.snap b/crates/astro2tsx/tests/fixtures/expression_empty.snap index 0088b030..34750bbd 100644 --- a/crates/astro2tsx/tests/fixtures/expression_empty.snap +++ b/crates/astro2tsx/tests/fixtures/expression_empty.snap @@ -23,3 +23,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 41..46 x3 -> 0 46..54 x5 -> 7 54..145 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
{}
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAG,EAAE,GAAG,CAAC;AACb;A" +} diff --git a/crates/astro2tsx/tests/fixtures/expression_generics.snap b/crates/astro2tsx/tests/fixtures/expression_generics.snap index 0e56805a..1d197210 100644 --- a/crates/astro2tsx/tests/fixtures/expression_generics.snap +++ b/crates/astro2tsx/tests/fixtures/expression_generics.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..67 x21 -> 0 67..158 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
{foo(x)}
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AACxB;A" +} diff --git a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap index cfc8d1b3..53d0d9d0 100644 --- a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap +++ b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap @@ -26,3 +26,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 75..78 x1 -> - 78..94 x16 -> 36 94..185 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "{list.map(() => )}\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,KAAK,CAAC,C,GAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD;A" +} diff --git a/crates/astro2tsx/tests/fixtures/expression_identifier.snap b/crates/astro2tsx/tests/fixtures/expression_identifier.snap index 754ebf72..2e39863d 100644 --- a/crates/astro2tsx/tests/fixtures/expression_identifier.snap +++ b/crates/astro2tsx/tests/fixtures/expression_identifier.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..61 x15 -> 0 61..152 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
{value}
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAClB;A" +} diff --git a/crates/astro2tsx/tests/fixtures/expression_map.snap b/crates/astro2tsx/tests/fixtures/expression_map.snap index 26501365..dff76f54 100644 --- a/crates/astro2tsx/tests/fixtures/expression_map.snap +++ b/crates/astro2tsx/tests/fixtures/expression_map.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..89 x45 -> 0 89..180 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
    {items.map((i) =>
  • {i.name}
  • )}
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAC9C;A" +} diff --git a/crates/astro2tsx/tests/fixtures/expression_nested.snap b/crates/astro2tsx/tests/fixtures/expression_nested.snap index 34c70c3d..b5b52890 100644 --- a/crates/astro2tsx/tests/fixtures/expression_nested.snap +++ b/crates/astro2tsx/tests/fixtures/expression_nested.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..85 x39 -> 0 85..176 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
{outer && {inner}}
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAC1C;A" +} diff --git a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap index 038cc9fb..77ac45a3 100644 --- a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap +++ b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..73 x27 -> 0 73..164 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
{ { duration: 1 } }
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAC9B;A" +} diff --git a/crates/astro2tsx/tests/fixtures/expression_single_element.snap b/crates/astro2tsx/tests/fixtures/expression_single_element.snap index bd5d2b86..a9dd70e0 100644 --- a/crates/astro2tsx/tests/fixtures/expression_single_element.snap +++ b/crates/astro2tsx/tests/fixtures/expression_single_element.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..78 x32 -> 0 78..169 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
{cond && a}
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AACnC;A" +} diff --git a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap index f73bc62a..6dc5bac5 100644 --- a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap +++ b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..63 x17 -> 0 63..154 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
{...rest}
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AACpB;A" +} diff --git a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap index cb5d6659..6ce73756 100644 --- a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..63 x17 -> 0 63..154 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
{\"
\"}
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AACpB;A" +} diff --git a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap index 868c2357..d7981477 100644 --- a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..66 x20 -> 0 66..157 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
{`y`}
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AACvB;A" +} diff --git a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap index 2c4a5dee..c24b92a9 100644 --- a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..95 x49 -> 0 95..186 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
{cond ? yes : no}
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AACpD;A" +} diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap index 5fdc5afe..821ed1c9 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..59 x13 -> 0 59..150 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
plain
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAChB;A" +} diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap index ba63186a..b0feb708 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap @@ -28,3 +28,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 52..64 x2 -> - 64..88 x21 -> 30 88..179 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "---\nlet value = 'world';\n---\n\n

Hello {value}

\n" + ], + "names": [], + "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAGpB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACtB;A" +} diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap index ed5e4da0..5f28aad5 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap @@ -25,3 +25,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 30..42 x2 -> - 42..55 x8 -> 8 55..146 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "---\n---\n
\n" + ], + "names": [], + "mappings": "A;;AAAA,A;A;AAEA,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AACX;A" +} diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap index 2b71206c..0d3dfffc 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap @@ -31,3 +31,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 118..120 x1 -> 84 120..122 x2 -> 85 122..213 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "---\nimport Card from './Card.astro';\nimport type { Foo } from './types';\n---\n\n" + ], + "names": [], + "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAEnC,CAAC,IAAI,CAAE,EAAC;AACR;A" +} diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap index 7b89855c..a8bcbbf6 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap @@ -23,3 +23,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 30..30 x1 -> 0 30..44 x14 -> 3 44..125 x2 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "---\nconst a = 1;\n---\n" + ], + "names": [], + "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A" +} diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap index 28d2f370..02742c8d 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap @@ -30,3 +30,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 75..90 x3 -> - 90..100 x9 -> 52 100..191 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "---\nif (cond) {\n\treturn Astro.redirect('/x');\n}\n---\n

x

\n" + ], + "names": [], + "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACX,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7B,CAAC;A;A,G;AAED,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACR;A" +} diff --git a/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap b/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap index 6bf6c8e4..ed0d7ea0 100644 --- a/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap +++ b/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap @@ -39,3 +39,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 77..89 x2 -> - 89..102 x8 -> 54 102..1244 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "---\nexport const getStaticPaths = async () => [];\n---\n
\n" + ], + "names": [], + "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAE7C,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AACX;A" +} diff --git a/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap b/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap index 7da704e5..f4d6c7f4 100644 --- a/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap +++ b/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap @@ -40,3 +40,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 118..133 x3 -> - 133..146 x8 -> 95 146..1162 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "---\ninterface Props { slug: string }\nexport async function getStaticPaths() { return []; }\n---\n
\n" + ], + "names": [], + "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A,G;AAErD,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AACX;A" +} diff --git a/crates/astro2tsx/tests/fixtures/html_comment_body.snap b/crates/astro2tsx/tests/fixtures/html_comment_body.snap index 88dd03f7..d0c14de1 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_body.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_body.snap @@ -26,3 +26,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 54..57 x1 -> - 57..73 x12 -> 16 73..164 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "

x

\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,C,IAAK,CAAC,CAAC,CAAC,C,GAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC;AAC9B;A" +} diff --git a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap index a28ca974..ca1ac4c2 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..55 x9 -> 17 55..146 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "\n
x
\n" + ], + "names": [], + "mappings": "A;;A;AACA,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC;AACZ;A" +} diff --git a/crates/astro2tsx/tests/fixtures/multibyte.snap b/crates/astro2tsx/tests/fixtures/multibyte.snap index bbb22cea..97e98a99 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..68 x21 -> 0 68..159 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "

foobar

\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACvB;A" +} diff --git a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap index 70d1d632..9e3eb6bb 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap @@ -28,3 +28,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 51..63 x2 -> - 63..81 x13 -> 28 81..172 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "---\nconst π = Math.PI;\n---\n

🦄 {π}

\n" + ], + "names": [], + "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAElB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACb;A" +} diff --git a/crates/astro2tsx/tests/fixtures/named_component_export.snap b/crates/astro2tsx/tests/fixtures/named_component_export.snap index 37deb8e5..c46edc46 100644 --- a/crates/astro2tsx/tests/fixtures/named_component_export.snap +++ b/crates/astro2tsx/tests/fixtures/named_component_export.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..54 x8 -> 0 54..151 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "/src/pages/MyPage.astro" + ], + "sourcesContent": [ + "
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AACX;A" +} diff --git a/crates/astro2tsx/tests/fixtures/props_generic.snap b/crates/astro2tsx/tests/fixtures/props_generic.snap index 1a4bffd4..085efdad 100644 --- a/crates/astro2tsx/tests/fixtures/props_generic.snap +++ b/crates/astro2tsx/tests/fixtures/props_generic.snap @@ -36,3 +36,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 79..94 x3 -> - 94..107 x8 -> 56 107..453 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "---\ninterface Props {\n\titem: T;\n}\n---\n
\n" + ], + "names": [], + "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACT,CAAC;A;A,G;AAED,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AACX;A" +} diff --git a/crates/astro2tsx/tests/fixtures/props_imported.snap b/crates/astro2tsx/tests/fixtures/props_imported.snap index 257786a2..b69348a7 100644 --- a/crates/astro2tsx/tests/fixtures/props_imported.snap +++ b/crates/astro2tsx/tests/fixtures/props_imported.snap @@ -34,3 +34,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 69..81 x2 -> - 81..94 x8 -> 46 94..419 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "---\nimport type { Props } from './types';\n---\n
\n" + ], + "names": [], + "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAErC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AACX;A" +} diff --git a/crates/astro2tsx/tests/fixtures/props_interface.snap b/crates/astro2tsx/tests/fixtures/props_interface.snap index cf02eb2a..582737ac 100644 --- a/crates/astro2tsx/tests/fixtures/props_interface.snap +++ b/crates/astro2tsx/tests/fixtures/props_interface.snap @@ -37,3 +37,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 98..110 x2 -> - 110..128 x15 -> 75 128..453 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "---\ninterface Props {\n\ttitle: string;\n}\nconst { title } = Astro.props;\n---\n

{title}

\n" + ], + "names": [], + "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACf,CAAC;AACD,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAE9B,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAChB;A" +} diff --git a/crates/astro2tsx/tests/fixtures/props_type_alias.snap b/crates/astro2tsx/tests/fixtures/props_type_alias.snap index cbc055e2..a3701210 100644 --- a/crates/astro2tsx/tests/fixtures/props_type_alias.snap +++ b/crates/astro2tsx/tests/fixtures/props_type_alias.snap @@ -34,3 +34,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 63..75 x2 -> - 75..88 x8 -> 40 88..413 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "---\ntype Props = { title: string };\n---\n
\n" + ], + "names": [], + "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAE/B,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AACX;A" +} diff --git a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap index 9f545bb7..6ec35d15 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap @@ -28,3 +28,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 72..74 x1 -> - 74..82 x5 -> 29 82..173 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
not markup
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,G,CAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,EAAC,EAAE,GAAG,CAAC;AACnC;A" +} diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap index 76e75b13..83abd666 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap @@ -29,3 +29,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 82..84 x1 -> - 84..95 x5 -> 39 95..186 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,M,CAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,EAAC,EAAE,MAAM,CAAC;AAChD;A" +} diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap index 6d269535..0c4e9097 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap @@ -31,3 +31,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 84..87 x1 -> - 87..98 x5 -> 34 98..189 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,M,CAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C;QAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C;AAAC,EAAE,MAAM,CAAC;AAC3C;A" +} diff --git a/crates/astro2tsx/tests/fixtures/raw_text_style.snap b/crates/astro2tsx/tests/fixtures/raw_text_style.snap index 96cb5727..f7eb68c8 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_style.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_style.snap @@ -27,3 +27,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 68..70 x1 -> - 70..80 x5 -> 25 80..171 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,KAAK,C,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,EAAC,EAAE,KAAK,CAAC;AACjC;A" +} diff --git a/crates/astro2tsx/tests/fixtures/slot_element.snap b/crates/astro2tsx/tests/fixtures/slot_element.snap index e33d87a6..a9e90888 100644 --- a/crates/astro2tsx/tests/fixtures/slot_element.snap +++ b/crates/astro2tsx/tests/fixtures/slot_element.snap @@ -28,3 +28,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 69..71 x1 -> 29 71..79 x5 -> 30 79..170 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,I,CAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAE,EAAC,CAAC,IAAI,CAAE,EAAC,EAAE,GAAG,CAAC;AACpC;A" +} diff --git a/crates/astro2tsx/tests/fixtures/slots.snap b/crates/astro2tsx/tests/fixtures/slots.snap index 1773fcf4..08fac5b8 100644 --- a/crates/astro2tsx/tests/fixtures/slots.snap +++ b/crates/astro2tsx/tests/fixtures/slots.snap @@ -27,3 +27,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 56..57 x1 -> - 57..104 x33 -> 16 104..195 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "\n\tH\n\t

body

\n
\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,MAAM,CAAC;AACR,CAAC,CAAC,I,CAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AAC7B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACZ,EAAE,MAAM,CAAC;AACT;A" +} diff --git a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap index 2d9b3c54..23159456 100644 --- a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap +++ b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap @@ -22,3 +22,16 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..55 x14 -> 0 55..146 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + " original; `-` is unmapped 82..95 x9 -> 39 95..103 x5 -> 51 103..194 x1 -> - + +--- source map v3 (paste into any source map viewer) --- +{ + "version": 3, + "sources": [ + "input.astro" + ], + "sourcesContent": [ + "


\n" + ], + "names": [], + "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,EAAE,EAAC,CAAC,EAAE,CAAE,EAAC,CAAC,G,CAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,K,CAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,EAAE,GAAG,CAAC;AACzD;A" +} diff --git a/crates/astro2tsx/tests/snapshots.rs b/crates/astro2tsx/tests/snapshots.rs index e6d28f4a..efbcf51e 100644 --- a/crates/astro2tsx/tests/snapshots.rs +++ b/crates/astro2tsx/tests/snapshots.rs @@ -8,7 +8,9 @@ use std::fmt::Write as _; use std::fs; -use astro2tsx::{ConvertOptions, ConvertResult, ExtractedTag, Mapping, convert_to_tsx}; +use astro2tsx::{ + ConvertOptions, ConvertResult, DEFAULT_SOURCE_NAME, ExtractedTag, Mapping, convert_to_tsx, +}; /// Parse `// @config` directives from the top of a fixture file. /// @@ -86,7 +88,7 @@ fn write_tags(out: &mut String, label: &str, tags: &[ExtractedTag]) { } } -fn report(result: &ConvertResult) -> String { +fn report(source: &str, source_name: &str, result: &ConvertResult) -> String { let mut out = String::new(); out.push_str(&result.code); @@ -125,6 +127,11 @@ fn report(result: &ConvertResult) -> String { ); } + let map = result.source_map(source, source_name); + out.push_str("\n--- source map v3 (paste into any source map viewer) ---\n"); + out.push_str(&serde_json::to_string_pretty(&map).unwrap()); + out.push('\n'); + out } @@ -134,7 +141,11 @@ fn snapshots() { let raw = fs::read_to_string(path).unwrap(); let name = path.file_stem().unwrap().to_str().unwrap(); let (source, options) = parse_fixture(&raw); - let output = report(&convert_to_tsx(&source, options)); + let source_name = options + .filename + .clone() + .unwrap_or_else(|| DEFAULT_SOURCE_NAME.to_string()); + let output = report(&source, &source_name, &convert_to_tsx(&source, options)); insta::with_settings!({ snapshot_path => path.parent().unwrap(), From b40909fa7f8267e58830b8e9e3d48a8ee85acc64 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 14:42:32 +0200 Subject: [PATCH 24/50] feat(astro2tsx): render the source map as an inline data URI comment --- crates/astro2tsx/src/sourcemap.rs | 48 ++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/crates/astro2tsx/src/sourcemap.rs b/crates/astro2tsx/src/sourcemap.rs index 33659107..07cc568a 100644 --- a/crates/astro2tsx/src/sourcemap.rs +++ b/crates/astro2tsx/src/sourcemap.rs @@ -76,6 +76,40 @@ impl SourceMap { pub fn to_json(&self) -> String { serde_json::to_string(self).expect("a source map contains only serialisable types") } + + pub fn to_data_url(&self) -> String { + format!( + "data:application/json;charset=utf-8;base64,{}", + base64(self.to_json().as_bytes()) + ) + } + + /// The `//# sourceMappingURL=` line that carries this map inline. + pub fn to_inline_comment(&self) -> String { + format!("//# sourceMappingURL={}", self.to_data_url()) + } +} + +fn base64(bytes: &[u8]) -> String { + let mut out = String::with_capacity(bytes.len().div_ceil(3) * 4); + for chunk in bytes.chunks(3) { + let triple = (u32::from(chunk[0]) << 16) + | (u32::from(chunk.get(1).copied().unwrap_or(0)) << 8) + | u32::from(chunk.get(2).copied().unwrap_or(0)); + out.push(BASE64[(triple >> 18 & 63) as usize] as char); + out.push(BASE64[(triple >> 12 & 63) as usize] as char); + out.push(if chunk.len() > 1 { + BASE64[(triple >> 6 & 63) as usize] as char + } else { + '=' + }); + out.push(if chunk.len() > 2 { + BASE64[(triple & 63) as usize] as char + } else { + '=' + }); + } + out } const BASE64: &[u8; 64] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; @@ -182,7 +216,19 @@ pub(crate) fn encode( #[cfg(test)] mod tests { - use super::{LineIndex, push_vlq}; + use super::{LineIndex, base64, push_vlq}; + + #[test] + fn base64_matches_rfc4648_vectors() { + assert_eq!(base64(b""), ""); + assert_eq!(base64(b"f"), "Zg=="); + assert_eq!(base64(b"fo"), "Zm8="); + assert_eq!(base64(b"foo"), "Zm9v"); + assert_eq!(base64(b"foob"), "Zm9vYg=="); + assert_eq!(base64(b"fooba"), "Zm9vYmE="); + assert_eq!(base64(b"foobar"), "Zm9vYmFy"); + assert_eq!(base64("π🦄".as_bytes()), "z4Dwn6aE"); + } fn vlq(value: i64) -> String { let mut out = String::new(); From 0fc4119f66d16a18cf2765996a2e00959a6f1f34 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 14:42:32 +0200 Subject: [PATCH 25/50] test(astro2tsx): append the inline source map to snapshots --- .../fixtures/adjacent_siblings_top_level.snap | 15 ++------------- .../tests/fixtures/attribute_event_and_style.snap | 15 ++------------- .../fixtures/attribute_expression_value.snap | 15 ++------------- .../tests/fixtures/attribute_invalid_names.snap | 15 ++------------- .../tests/fixtures/attribute_quoted_forms.snap | 15 ++------------- .../tests/fixtures/attribute_shorthand.snap | 15 ++------------- .../tests/fixtures/attribute_spread.snap | 15 ++------------- .../fixtures/attribute_template_literal.snap | 15 ++------------- .../tests/fixtures/crlf_frontmatter.snap | 15 ++------------- crates/astro2tsx/tests/fixtures/directives.snap | 15 ++------------- .../fixtures/expression_adjacent_siblings.snap | 15 ++------------- .../tests/fixtures/expression_comment_only.snap | 15 ++------------- .../tests/fixtures/expression_empty.snap | 15 ++------------- .../tests/fixtures/expression_generics.snap | 15 ++------------- .../tests/fixtures/expression_html_comment.snap | 15 ++------------- .../tests/fixtures/expression_identifier.snap | 15 ++------------- .../astro2tsx/tests/fixtures/expression_map.snap | 15 ++------------- .../tests/fixtures/expression_nested.snap | 15 ++------------- .../tests/fixtures/expression_object_literal.snap | 15 ++------------- .../tests/fixtures/expression_single_element.snap | 15 ++------------- .../tests/fixtures/expression_spread_child.snap | 15 ++------------- .../fixtures/expression_string_with_markup.snap | 15 ++------------- .../fixtures/expression_template_with_markup.snap | 15 ++------------- .../tests/fixtures/expression_ternary_markup.snap | 15 ++------------- .../tests/fixtures/frontmatter_absent.snap | 15 ++------------- .../tests/fixtures/frontmatter_and_body.snap | 15 ++------------- .../tests/fixtures/frontmatter_empty.snap | 15 ++------------- .../tests/fixtures/frontmatter_imports.snap | 15 ++------------- .../tests/fixtures/frontmatter_only.snap | 15 ++------------- .../fixtures/frontmatter_top_level_return.snap | 15 ++------------- .../tests/fixtures/get_static_paths_export.snap | 15 ++------------- .../fixtures/get_static_paths_with_props.snap | 15 ++------------- .../tests/fixtures/html_comment_body.snap | 15 ++------------- .../tests/fixtures/html_comment_top_level.snap | 15 ++------------- crates/astro2tsx/tests/fixtures/multibyte.snap | 15 ++------------- .../tests/fixtures/multibyte_astral.snap | 15 ++------------- .../tests/fixtures/named_component_export.snap | 15 ++------------- .../astro2tsx/tests/fixtures/props_generic.snap | 15 ++------------- .../astro2tsx/tests/fixtures/props_imported.snap | 15 ++------------- .../astro2tsx/tests/fixtures/props_interface.snap | 15 ++------------- .../tests/fixtures/props_type_alias.snap | 15 ++------------- .../astro2tsx/tests/fixtures/raw_text_is_raw.snap | 15 ++------------- .../tests/fixtures/raw_text_script_json.snap | 15 ++------------- .../tests/fixtures/raw_text_script_module.snap | 15 ++------------- .../astro2tsx/tests/fixtures/raw_text_style.snap | 15 ++------------- crates/astro2tsx/tests/fixtures/slot_element.snap | 15 ++------------- crates/astro2tsx/tests/fixtures/slots.snap | 15 ++------------- crates/astro2tsx/tests/fixtures/unclosed_tag.snap | 15 ++------------- .../astro2tsx/tests/fixtures/void_elements.snap | 15 ++------------- crates/astro2tsx/tests/snapshots.rs | 9 ++++----- 50 files changed, 102 insertions(+), 642 deletions(-) diff --git a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap index bd842ebd..8ede8555 100644 --- a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -10,6 +11,7 @@ input_file: crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzcGFuPmE8L3NwYW4+XG48c3Bhbj5iPC9zcGFuPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLElBQUksQ0FBQztBQUNkLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUM7QUFDZDtBIn0= --- result --- has_parse_errors: false @@ -23,16 +25,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..72 x17 -> 0 72..163 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "a\nb\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AACd,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AACd;A" -} diff --git a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap index f69e66f3..72e1e240 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/attribute_event_and_style.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_event_and_style.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgb25jbGljaz1cImdvKClcIiBzdHlsZT1cImNvbG9yOnJlZFwiPjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHLENBQUksT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQzVDO0EifQ== --- result --- has_parse_errors: false @@ -28,16 +30,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 60..61 x1 -> - 61..87 x19 -> 20 87..178 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,G,CAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,CAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAC5C;A" -} diff --git a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap index 57697ce9..709b8b47 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/attribute_expression_value.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_expression_value.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgY2xhc3M9e2Nsc30gYXJpYS1sYWJlbD17bGFiZWx9PjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHLENBQUksS0FBSyxDLENBQUUsQ0FBQyxDQUFDLEMsQyxDQUFHLFVBQVUsQyxDQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDMUM7QSJ9 --- result --- has_parse_errors: false @@ -32,16 +34,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 75..76 x1 -> - 76..85 x6 -> 35 85..176 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,G,CAAI,KAAK,C,CAAE,CAAC,CAAC,C,C,CAAG,UAAU,C,CAAE,CAAC,CAAC,CAAC,CAAC,C,CAAE,CAAC,EAAE,GAAG,CAAC;AAC1C;A" -} diff --git a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap index d212df6a..9ecdff14 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/attribute_invalid_names.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_invalid_names.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgQGNsaWNrPXtoYW5kbGVyfSA6Y2xhc3M9XCJ4XCIgbmFtZT1cIm9rXCI+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBZ0MsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsTUFBcEMsUSxFQUFRLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsQyxDQUFHLFEsQyxHLEVBQW9CLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDakQ7QSJ9 --- result --- has_parse_errors: false @@ -32,16 +34,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 88..94 x3 -> - 94..103 x6 -> 42 103..194 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,G,CAAgC,IAAI,CAAC,CAAC,CAAC,CAAC,C,MAApC,Q,EAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,C,CAAG,Q,C,G,EAAoB,CAAC,EAAE,GAAG,CAAC;AACjD;A" -} diff --git a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap index 87d5d0ae..3c3d5c57 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/attribute_quoted_forms.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_quoted_forms.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgaWQ9J3NpbmdsZScgY2xhc3M9XCJkb3VibGVcIiBkYXRhLW49MyBoaWRkZW4+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBSSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsQyxDQUFBLE1BQU0sQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN0RDtBIn0= --- result --- has_parse_errors: false @@ -30,16 +32,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 83..84 x1 -> - 84..99 x7 -> 41 99..190 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,G,CAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,CAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,CAAE,MAAM,CAAC,CAAC,CAAC,C,CAAA,MAAM,CAAC,EAAE,GAAG,CAAC;AACtD;A" -} diff --git a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap index 63b92fcc..b952eb46 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/attribute_shorthand.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_shorthand.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxGb28ge2Jhcn0gLz5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFLLENBQUMsQ0FBQyxDLEMsQ0FBRixDQUFDLENBQUMsQyxDQUFFLENBQUUsRUFBQztBQUNiO0EifQ== --- result --- has_parse_errors: false @@ -30,16 +32,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 56..58 x1 -> 12 58..60 x2 -> 13 60..151 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,G,CAAK,CAAC,CAAC,C,C,CAAF,CAAC,CAAC,C,CAAE,CAAE,EAAC;AACb;A" -} diff --git a/crates/astro2tsx/tests/fixtures/attribute_spread.snap b/crates/astro2tsx/tests/fixtures/attribute_spread.snap index 2a0ee94f..c97312a8 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_spread.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_spread.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/attribute_spread.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_spread.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxGb28gey4uLnJlc3R9IG5hbWU9XCJ4XCIgLz5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxFLEdBQVEsQ0FBQyxDQUFDLENBQUMsQyxDLENBQUcsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsRUFBQztBQUMxQjtBIn0= --- result --- has_parse_errors: false @@ -28,16 +30,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 65..67 x1 -> 25 67..69 x2 -> 26 69..160 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,G,E,GAAQ,CAAC,CAAC,CAAC,C,C,CAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAE,EAAC;AAC1B;A" -} diff --git a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap index d6668e5f..9b2e37aa 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/attribute_template_literal.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_template_literal.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxUYWcgc3JjPXtgYmFyJHtmb299YH0gLz5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFJLEdBQUcsQyxDQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLENBQUUsRUFBQztBQUN6QjtBIn0= --- result --- has_parse_errors: false @@ -30,16 +32,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 64..66 x1 -> 24 66..68 x2 -> 25 68..159 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,G,CAAI,GAAG,C,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,CAAE,CAAE,EAAC;AACzB;A" -} diff --git a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap index 6a718308..29c58d45 100644 --- a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap +++ b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/crlf_frontmatter.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -14,6 +15,7 @@ import { Meta } from './Meta.astro'; export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxyXG5pbXBvcnQgeyBNZXRhIH0gZnJvbSAnLi9NZXRhLmFzdHJvJztcclxuLS0tXHJcbjxkaXY+XHJcbjxzcGFuPmE8L3NwYW4+XHJcbjwvZGl2PlxyXG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRyxDQUFDO0FBQ0osQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0E7QUFFckMsQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNOLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUMsQ0FBQztBQUNmLEVBQUUsR0FBRyxDQUFDLENBQUM7QUFDUDtBIn0= --- result --- has_parse_errors: false @@ -30,16 +32,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 70..82 x2 -> - 82..114 x20 -> 48 114..205 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "---\r\nimport { Meta } from './Meta.astro';\r\n---\r\n
\r\na\r\n
\r\n" - ], - "names": [], - "mappings": "A;;AAAA,AAAG,CAAC;AACJ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAErC,CAAC,GAAG,CAAC,CAAC;AACN,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AACf,EAAE,GAAG,CAAC,CAAC;AACP;A" -} diff --git a/crates/astro2tsx/tests/fixtures/directives.snap b/crates/astro2tsx/tests/fixtures/directives.snap index 009c3341..8b57d511 100644 --- a/crates/astro2tsx/tests/fixtures/directives.snap +++ b/crates/astro2tsx/tests/fixtures/directives.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/directives.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/directives.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxDb21wIGNsaWVudDpsb2FkIHNldDpodG1sPXtodG1sfSBjbGFzczpsaXN0PXtjbHN9IHRyYW5zaXRpb246bmFtZT1cIm5cIiAvPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxJLENBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsQ0FBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsZUFBZSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsRUFBQztBQUN6RTtBIn0= --- result --- has_parse_errors: false @@ -32,16 +34,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 112..114 x1 -> 72 114..116 x2 -> 73 116..207 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,I,CAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,CAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAE,EAAC;AACzE;A" -} diff --git a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap index 515211de..078affd8 100644 --- a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap +++ b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2NvbmQgJiYgPHNwYW4+YTwvc3Bhbj4gPHNwYW4+Yjwvc3Bhbj59PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxVQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxXQUFDLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDbEQ7QSJ9 --- result --- has_parse_errors: false @@ -26,16 +28,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 94..105 x1 -> - 105..114 x6 -> 43 114..205 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
{cond && a b}
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,UAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,WAAC,CAAC,EAAE,GAAG,CAAC;AAClD;A" -} diff --git a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap index 3f8c0564..2f675ded 100644 --- a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap +++ b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/expression_comment_only.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/expression_comment_only.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+ey8qIGtlZXAgbWUgKi99PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUMxQjtBIn0= --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..69 x23 -> 0 69..160 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
{/* keep me */}
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAC1B;A" -} diff --git a/crates/astro2tsx/tests/fixtures/expression_empty.snap b/crates/astro2tsx/tests/fixtures/expression_empty.snap index 34750bbd..e30ff196 100644 --- a/crates/astro2tsx/tests/fixtures/expression_empty.snap +++ b/crates/astro2tsx/tests/fixtures/expression_empty.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/expression_empty.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/expression_empty.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e308L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFHLEVBQUUsR0FBRyxDQUFDO0FBQ2I7QSJ9 --- result --- has_parse_errors: false @@ -23,16 +25,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 41..46 x3 -> 0 46..54 x5 -> 7 54..145 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
{}
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAG,EAAE,GAAG,CAAC;AACb;A" -} diff --git a/crates/astro2tsx/tests/fixtures/expression_generics.snap b/crates/astro2tsx/tests/fixtures/expression_generics.snap index 1d197210..339d9b6d 100644 --- a/crates/astro2tsx/tests/fixtures/expression_generics.snap +++ b/crates/astro2tsx/tests/fixtures/expression_generics.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/expression_generics.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/expression_generics.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2ZvbzxCYXI+KHgpfTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN4QjtBIn0= --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..67 x21 -> 0 67..158 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
{foo(x)}
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AACxB;A" -} diff --git a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap index 53d0d9d0..94f7737d 100644 --- a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap +++ b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/expression_html_comment.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/expression_html_comment.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIntsaXN0Lm1hcCgoKSA9PiA8Q29tcG9uZW50PjwhLS1IaS0tPjwvQ29tcG9uZW50Pil9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxLQUFLLENBQUMsQyxHQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsRDtBIn0= --- result --- has_parse_errors: false @@ -26,16 +28,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 75..78 x1 -> - 78..94 x16 -> 36 94..185 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "{list.map(() => )}\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,KAAK,CAAC,C,GAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD;A" -} diff --git a/crates/astro2tsx/tests/fixtures/expression_identifier.snap b/crates/astro2tsx/tests/fixtures/expression_identifier.snap index 2e39863d..45646314 100644 --- a/crates/astro2tsx/tests/fixtures/expression_identifier.snap +++ b/crates/astro2tsx/tests/fixtures/expression_identifier.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/expression_identifier.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/expression_identifier.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e3ZhbHVlfTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNsQjtBIn0= --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..61 x15 -> 0 61..152 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
{value}
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAClB;A" -} diff --git a/crates/astro2tsx/tests/fixtures/expression_map.snap b/crates/astro2tsx/tests/fixtures/expression_map.snap index dff76f54..ec3adc41 100644 --- a/crates/astro2tsx/tests/fixtures/expression_map.snap +++ b/crates/astro2tsx/tests/fixtures/expression_map.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/expression_map.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/expression_map.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjx1bD57aXRlbXMubWFwKChpKSA9PiA8bGk+e2kubmFtZX08L2xpPil9PC91bD5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUM7QUFDOUM7QSJ9 --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..89 x45 -> 0 89..180 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
    {items.map((i) =>
  • {i.name}
  • )}
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAC9C;A" -} diff --git a/crates/astro2tsx/tests/fixtures/expression_nested.snap b/crates/astro2tsx/tests/fixtures/expression_nested.snap index b5b52890..25f48ce4 100644 --- a/crates/astro2tsx/tests/fixtures/expression_nested.snap +++ b/crates/astro2tsx/tests/fixtures/expression_nested.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/expression_nested.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/expression_nested.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e291dGVyICYmIDxzcGFuPntpbm5lcn08L3NwYW4+fTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUMxQztBIn0= --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..85 x39 -> 0 85..176 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
{outer && {inner}}
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAC1C;A" -} diff --git a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap index 77ac45a3..a9d01b35 100644 --- a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap +++ b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/expression_object_literal.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/expression_object_literal.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+eyB7IGR1cmF0aW9uOiAxIH0gfTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUM5QjtBIn0= --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..73 x27 -> 0 73..164 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
{ { duration: 1 } }
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAC9B;A" -} diff --git a/crates/astro2tsx/tests/fixtures/expression_single_element.snap b/crates/astro2tsx/tests/fixtures/expression_single_element.snap index a9dd70e0..16465f68 100644 --- a/crates/astro2tsx/tests/fixtures/expression_single_element.snap +++ b/crates/astro2tsx/tests/fixtures/expression_single_element.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/expression_single_element.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/expression_single_element.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2NvbmQgJiYgPHNwYW4+YTwvc3Bhbj59PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNuQztBIn0= --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..78 x32 -> 0 78..169 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
{cond && a}
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AACnC;A" -} diff --git a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap index 6dc5bac5..492845b5 100644 --- a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap +++ b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/expression_spread_child.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/expression_spread_child.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+ey4uLnJlc3R9PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNwQjtBIn0= --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..63 x17 -> 0 63..154 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
{...rest}
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AACpB;A" -} diff --git a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap index 6ce73756..1ad9f8c8 100644 --- a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/expression_string_with_markup.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/expression_string_with_markup.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e1wiPGJyLz5cIn08L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ3BCO0EifQ== --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..63 x17 -> 0 63..154 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
{\"
\"}
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AACpB;A" -} diff --git a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap index d7981477..37617a25 100644 --- a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/expression_template_with_markup.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/expression_template_with_markup.astr export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2A8Yj55PC9iPmB9PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN2QjtBIn0= --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..66 x20 -> 0 66..157 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
{`y`}
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AACvB;A" -} diff --git a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap index c24b92a9..03f0898e 100644 --- a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/expression_ternary_markup.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/expression_ternary_markup.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2NvbmQgPyA8YSBocmVmPScveCc+eWVzPC9hPiA6IDxiPm5vPC9iPn08L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNwRDtBIn0= --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..95 x49 -> 0 95..186 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
{cond ? yes : no}
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AACpD;A" -} diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap index 821ed1c9..4b767263 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/frontmatter_absent.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/frontmatter_absent.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+cGxhaW48L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNoQjtBIn0= --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..59 x13 -> 0 59..150 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
plain
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAChB;A" -} diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap index b0feb708..ad1f6652 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/frontmatter_and_body.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -12,6 +13,7 @@ let value = 'world'; export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxubGV0IHZhbHVlID0gJ3dvcmxkJztcbi0tLVxuXG48aDE+SGVsbG8ge3ZhbHVlfTwvaDE+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0E7QUFHcEIsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQztBQUN0QjtBIn0= --- result --- has_parse_errors: false @@ -28,16 +30,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 52..64 x2 -> - 64..88 x21 -> 30 88..179 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "---\nlet value = 'world';\n---\n\n

Hello {value}

\n" - ], - "names": [], - "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAGpB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACtB;A" -} diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap index 5f28aad5..bcd9281d 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/frontmatter_empty.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -10,6 +11,7 @@ input_file: crates/astro2tsx/tests/fixtures/frontmatter_empty.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuLS0tXG48ZGl2PjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBQUFBLEE7QTtBQUVBLENBQUMsR0FBRyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ1g7QSJ9 --- result --- has_parse_errors: false @@ -25,16 +27,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 30..42 x2 -> - 42..55 x8 -> 8 55..146 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "---\n---\n
\n" - ], - "names": [], - "mappings": "A;;AAAA,A;A;AAEA,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AACX;A" -} diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap index 0d3dfffc..0edb3682 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/frontmatter_imports.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -13,6 +14,7 @@ import type { Foo } from './types'; export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW1wb3J0IENhcmQgZnJvbSAnLi9DYXJkLmFzdHJvJztcbmltcG9ydCB0eXBlIHsgRm9vIH0gZnJvbSAnLi90eXBlcyc7XG4tLS1cbjxDYXJkIC8+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNoQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBO0FBRW5DLENBQUMsSUFBSSxDQUFFLEVBQUM7QUFDUjtBIn0= --- result --- has_parse_errors: false @@ -31,16 +33,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 118..120 x1 -> 84 120..122 x2 -> 85 122..213 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "---\nimport Card from './Card.astro';\nimport type { Foo } from './types';\n---\n\n" - ], - "names": [], - "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAEnC,CAAC,IAAI,CAAE,EAAC;AACR;A" -} diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap index a8bcbbf6..166d787e 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/frontmatter_only.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ const a = 1; export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuY29uc3QgYSA9IDE7XG4tLS1cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QUFBQSxBQUFHO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBIn0= --- result --- has_parse_errors: false @@ -23,16 +25,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 30..30 x1 -> 0 30..44 x14 -> 3 44..125 x2 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "---\nconst a = 1;\n---\n" - ], - "names": [], - "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A" -} diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap index 02742c8d..b1baec9c 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -14,6 +15,7 @@ if (cond) { export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaWYgKGNvbmQpIHtcblx0cmV0dXJuIEFzdHJvLnJlZGlyZWN0KCcveCcpO1xufVxuLS0tXG48cD54PC9wPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDWCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDN0IsQ0FBQztBO0EsRztBQUVELENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDUjtBIn0= --- result --- has_parse_errors: false @@ -30,16 +32,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 75..90 x3 -> - 90..100 x9 -> 52 100..191 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "---\nif (cond) {\n\treturn Astro.redirect('/x');\n}\n---\n

x

\n" - ], - "names": [], - "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACX,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7B,CAAC;A;A,G;AAED,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACR;A" -} diff --git a/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap b/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap index ed0d7ea0..3a23aef4 100644 --- a/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap +++ b/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/get_static_paths_export.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -23,6 +24,7 @@ type ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[ * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly>, typeof __AstroComponent_, ASTRO__Get>> +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuZXhwb3J0IGNvbnN0IGdldFN0YXRpY1BhdGhzID0gYXN5bmMgKCkgPT4gW107XG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QTtBQUU3QyxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== --- result --- has_parse_errors: false @@ -39,16 +41,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 77..89 x2 -> - 89..102 x8 -> 54 102..1244 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "---\nexport const getStaticPaths = async () => [];\n---\n
\n" - ], - "names": [], - "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAE7C,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AACX;A" -} diff --git a/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap b/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap index f4d6c7f4..2f5ef746 100644 --- a/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap +++ b/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/get_static_paths_with_props.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -24,6 +25,7 @@ type ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[ * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly>> +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW50ZXJmYWNlIFByb3BzIHsgc2x1Zzogc3RyaW5nIH1cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRTdGF0aWNQYXRocygpIHsgcmV0dXJuIFtdOyB9XG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNoQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBLEc7QUFFckQsQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWDtBIn0= --- result --- has_parse_errors: false @@ -40,16 +42,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 118..133 x3 -> - 133..146 x8 -> 95 146..1162 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "---\ninterface Props { slug: string }\nexport async function getStaticPaths() { return []; }\n---\n
\n" - ], - "names": [], - "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A,G;AAErD,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AACX;A" -} diff --git a/crates/astro2tsx/tests/fixtures/html_comment_body.snap b/crates/astro2tsx/tests/fixtures/html_comment_body.snap index d0c14de1..ed1f9a55 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_body.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_body.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/html_comment_body.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/html_comment_body.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PCEtLSBoaSAtLT48cD54PC9wPjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLEMsSUFBSyxDQUFDLENBQUMsQ0FBQyxDLEdBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUM5QjtBIn0= --- result --- has_parse_errors: false @@ -26,16 +28,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 54..57 x1 -> - 57..73 x12 -> 16 73..164 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "

x

\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,C,IAAK,CAAC,CAAC,CAAC,C,GAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC;AAC9B;A" -} diff --git a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap index ca1ac4c2..9d26a1b5 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/html_comment_top_level.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/html_comment_top_level.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjwhLS0gbGVhZGluZyAtLT5cbjxkaXY+eDwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQ0EsQ0FBQyxHQUFHLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNaO0EifQ== --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..55 x9 -> 17 55..146 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "\n
x
\n" - ], - "names": [], - "mappings": "A;;A;AACA,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC;AACZ;A" -} diff --git a/crates/astro2tsx/tests/fixtures/multibyte.snap b/crates/astro2tsx/tests/fixtures/multibyte.snap index 97e98a99..de82d074 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/multibyte.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/multibyte.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxoMT7jg4Q8L2gxPjxwPmZvb2JhcjwvcD5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDdkI7QSJ9 --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..68 x21 -> 0 68..159 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "

foobar

\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACvB;A" -} diff --git a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap index 9e3eb6bb..83618101 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/multibyte_astral.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -12,6 +13,7 @@ const π = Math.PI; export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuY29uc3Qgz4AgPSBNYXRoLlBJO1xuLS0tXG48cD7wn6aEIHvPgH08L3A+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QTtBQUVsQixDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDYjtBIn0= --- result --- has_parse_errors: false @@ -28,16 +30,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 51..63 x2 -> - 63..81 x13 -> 28 81..172 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "---\nconst π = Math.PI;\n---\n

🦄 {π}

\n" - ], - "names": [], - "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAElB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACb;A" -} diff --git a/crates/astro2tsx/tests/fixtures/named_component_export.snap b/crates/astro2tsx/tests/fixtures/named_component_export.snap index c46edc46..8ddefdc0 100644 --- a/crates/astro2tsx/tests/fixtures/named_component_export.snap +++ b/crates/astro2tsx/tests/fixtures/named_component_export.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/named_component_export.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/named_component_export.astro export default function MyPage__AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9zcmMvcGFnZXMvTXlQYWdlLmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== --- result --- has_parse_errors: false @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..54 x8 -> 0 54..151 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "/src/pages/MyPage.astro" - ], - "sourcesContent": [ - "
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AACX;A" -} diff --git a/crates/astro2tsx/tests/fixtures/props_generic.snap b/crates/astro2tsx/tests/fixtures/props_generic.snap index 085efdad..864ee20c 100644 --- a/crates/astro2tsx/tests/fixtures/props_generic.snap +++ b/crates/astro2tsx/tests/fixtures/props_generic.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/props_generic.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -20,6 +21,7 @@ export default function __AstroComponent_(_props: Props): a * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW50ZXJmYWNlIFByb3BzPFQgZXh0ZW5kcyBzdHJpbmc+IHtcblx0aXRlbTogVDtcbn1cbi0tLVxuPGRpdj48L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QUFBQSxBQUFHO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ25DLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ1QsQ0FBQztBO0EsRztBQUVELENBQUMsR0FBRyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ1g7QSJ9 --- result --- has_parse_errors: false @@ -36,16 +38,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 79..94 x3 -> - 94..107 x8 -> 56 107..453 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "---\ninterface Props {\n\titem: T;\n}\n---\n
\n" - ], - "names": [], - "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACT,CAAC;A;A,G;AAED,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AACX;A" -} diff --git a/crates/astro2tsx/tests/fixtures/props_imported.snap b/crates/astro2tsx/tests/fixtures/props_imported.snap index b69348a7..cda7414f 100644 --- a/crates/astro2tsx/tests/fixtures/props_imported.snap +++ b/crates/astro2tsx/tests/fixtures/props_imported.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/props_imported.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -18,6 +19,7 @@ export default function __AstroComponent_(_props: Props): any {} * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW1wb3J0IHR5cGUgeyBQcm9wcyB9IGZyb20gJy4vdHlwZXMnO1xuLS0tXG48ZGl2PjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QTtBQUVyQyxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== --- result --- has_parse_errors: false @@ -34,16 +36,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 69..81 x2 -> - 81..94 x8 -> 46 94..419 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "---\nimport type { Props } from './types';\n---\n
\n" - ], - "names": [], - "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAErC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AACX;A" -} diff --git a/crates/astro2tsx/tests/fixtures/props_interface.snap b/crates/astro2tsx/tests/fixtures/props_interface.snap index 582737ac..3f9333db 100644 --- a/crates/astro2tsx/tests/fixtures/props_interface.snap +++ b/crates/astro2tsx/tests/fixtures/props_interface.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/props_interface.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -21,6 +22,7 @@ export default function __AstroComponent_(_props: Props): any {} * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW50ZXJmYWNlIFByb3BzIHtcblx0dGl0bGU6IHN0cmluZztcbn1cbmNvbnN0IHsgdGl0bGUgfSA9IEFzdHJvLnByb3BzO1xuLS0tXG48aDE+e3RpdGxlfTwvaDE+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNqQixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNmLENBQUM7QUFDRCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0E7QUFFOUIsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQztBQUNoQjtBIn0= --- result --- has_parse_errors: false @@ -37,16 +39,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 98..110 x2 -> - 110..128 x15 -> 75 128..453 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "---\ninterface Props {\n\ttitle: string;\n}\nconst { title } = Astro.props;\n---\n

{title}

\n" - ], - "names": [], - "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACf,CAAC;AACD,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAE9B,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAChB;A" -} diff --git a/crates/astro2tsx/tests/fixtures/props_type_alias.snap b/crates/astro2tsx/tests/fixtures/props_type_alias.snap index a3701210..198954d8 100644 --- a/crates/astro2tsx/tests/fixtures/props_type_alias.snap +++ b/crates/astro2tsx/tests/fixtures/props_type_alias.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/props_type_alias.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -18,6 +19,7 @@ export default function __AstroComponent_(_props: Props): any {} * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxudHlwZSBQcm9wcyA9IHsgdGl0bGU6IHN0cmluZyB9O1xuLS0tXG48ZGl2PjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QTtBQUUvQixDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== --- result --- has_parse_errors: false @@ -34,16 +36,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 63..75 x2 -> - 75..88 x8 -> 40 88..413 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "---\ntype Props = { title: string };\n---\n
\n" - ], - "names": [], - "mappings": "A;;AAAA,AAAG;AACH,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;A;A;AAE/B,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;AACX;A" -} diff --git a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap index 6ec35d15..dc27dae1 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/raw_text_is_raw.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_is_raw.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgaXM6cmF3PjxiPm5vdCBtYXJrdXA8L2I+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsRUFBRSxHQUFHLENBQUM7QUFDbkM7QSJ9 --- result --- has_parse_errors: false @@ -28,16 +30,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 72..74 x1 -> - 74..82 x5 -> 29 82..173 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
not markup
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,G,CAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,EAAC,EAAE,GAAG,CAAC;AACnC;A" -} diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap index 83abd666..fec09f92 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/raw_text_script_json.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_script_json.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzY3JpcHQgdHlwZT1cImFwcGxpY2F0aW9uL2pzb25cIj57XCJhXCI6MX08L3NjcmlwdD5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsTSxDQUFPLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxFQUFDLEVBQUUsTUFBTSxDQUFDO0FBQ2hEO0EifQ== --- result --- has_parse_errors: false @@ -29,16 +31,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 82..84 x1 -> - 84..95 x5 -> 39 95..186 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,M,CAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,EAAC,EAAE,MAAM,CAAC;AAChD;A" -} diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap index 0c4e9097..41fb624e 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/raw_text_script_module.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,6 +12,7 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_script_module.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzY3JpcHQgdHlwZT1cIm1vZHVsZVwiPmNvbnN0IGEgPSAxOzwvc2NyaXB0PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxNLENBQU8sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDO1FBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEM7QUFBQyxFQUFFLE1BQU0sQ0FBQztBQUMzQztBIn0= --- result --- has_parse_errors: false @@ -31,16 +33,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 84..87 x1 -> - 87..98 x5 -> 34 98..189 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,M,CAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C;QAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C;AAAC,EAAE,MAAM,CAAC;AAC3C;A" -} diff --git a/crates/astro2tsx/tests/fixtures/raw_text_style.snap b/crates/astro2tsx/tests/fixtures/raw_text_style.snap index f7eb68c8..dcfae796 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_style.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_style.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/raw_text_style.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_style.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzdHlsZT4uYSB7IGNvbG9yOiByZWQ7IH08L3N0eWxlPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxLQUFLLEMsRUFBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxFQUFDLEVBQUUsS0FBSyxDQUFDO0FBQ2pDO0EifQ== --- result --- has_parse_errors: false @@ -27,16 +29,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 68..70 x1 -> - 70..80 x5 -> 25 80..171 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,KAAK,C,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C,EAAC,EAAE,KAAK,CAAC;AACjC;A" -} diff --git a/crates/astro2tsx/tests/fixtures/slot_element.snap b/crates/astro2tsx/tests/fixtures/slot_element.snap index a9e90888..9a96d6c6 100644 --- a/crates/astro2tsx/tests/fixtures/slot_element.snap +++ b/crates/astro2tsx/tests/fixtures/slot_element.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/slot_element.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/slot_element.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PHNsb3QgbmFtZT1cImFcIiAvPjxzbG90IC8+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEksQ0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBRSxFQUFDLENBQUMsSUFBSSxDQUFFLEVBQUMsRUFBRSxHQUFHLENBQUM7QUFDcEM7QSJ9 --- result --- has_parse_errors: false @@ -28,16 +30,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 69..71 x1 -> 29 71..79 x5 -> 30 79..170 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,I,CAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAE,EAAC,CAAC,IAAI,CAAE,EAAC,EAAE,GAAG,CAAC;AACpC;A" -} diff --git a/crates/astro2tsx/tests/fixtures/slots.snap b/crates/astro2tsx/tests/fixtures/slots.snap index 08fac5b8..f1e94053 100644 --- a/crates/astro2tsx/tests/fixtures/slots.snap +++ b/crates/astro2tsx/tests/fixtures/slots.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/slots.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -12,6 +13,7 @@ input_file: crates/astro2tsx/tests/fixtures/slots.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxMYXlvdXQ+XG5cdDxzcGFuIHNsb3Q9XCJoZWFkZXJcIj5IPC9zcGFuPlxuXHQ8cD5ib2R5PC9wPlxuPC9MYXlvdXQ+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLE1BQU0sQ0FBQztBQUNSLENBQUMsQ0FBQyxJLENBQUssSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUM7QUFDN0IsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQ1osRUFBRSxNQUFNLENBQUM7QUFDVDtBIn0= --- result --- has_parse_errors: false @@ -27,16 +29,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 56..57 x1 -> - 57..104 x33 -> 16 104..195 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "\n\tH\n\t

body

\n
\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,MAAM,CAAC;AACR,CAAC,CAAC,I,CAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AAC7B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACZ,EAAE,MAAM,CAAC;AACT;A" -} diff --git a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap index 23159456..6364eded 100644 --- a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap +++ b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap @@ -2,6 +2,7 @@ source: crates/astro2tsx/tests/snapshots.rs input_file: crates/astro2tsx/tests/fixtures/unclosed_tag.astro --- +--- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/unclosed_tag.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxjb21wb25lbnRzLlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDWjtBIn0= --- result --- has_parse_errors: true @@ -22,16 +24,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 0..41 x2 -> - 41..55 x14 -> 0 55..146 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - " @@ -9,6 +10,7 @@ input_file: crates/astro2tsx/tests/fixtures/void_elements.astro export default function __AstroComponent_(_props: Record): any {} +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PGJyPjxociAvPjxpbWcgc3JjPVwiYS5wbmdcIj48aW5wdXQgdHlwZT1cInRleHRcIj48L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxFQUFDLENBQUMsRUFBRSxDQUFFLEVBQUMsQ0FBQyxHLENBQUksR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBQyxDQUFDLEssQ0FBTSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBQyxFQUFFLEdBQUcsQ0FBQztBQUN6RDtBIn0= --- result --- has_parse_errors: false @@ -31,16 +33,3 @@ generated_start..generated_end xpoints -> original; `-` is unmapped 82..95 x9 -> 39 95..103 x5 -> 51 103..194 x1 -> - - ---- source map v3 (paste into any source map viewer) --- -{ - "version": 3, - "sources": [ - "input.astro" - ], - "sourcesContent": [ - "


\n" - ], - "names": [], - "mappings": "A;;A;AAAA,CAAC,GAAG,CAAC,CAAC,EAAE,EAAC,CAAC,EAAE,CAAE,EAAC,CAAC,G,CAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,K,CAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,EAAE,GAAG,CAAC;AACzD;A" -} diff --git a/crates/astro2tsx/tests/snapshots.rs b/crates/astro2tsx/tests/snapshots.rs index efbcf51e..540d537a 100644 --- a/crates/astro2tsx/tests/snapshots.rs +++ b/crates/astro2tsx/tests/snapshots.rs @@ -90,11 +90,15 @@ fn write_tags(out: &mut String, label: &str, tags: &[ExtractedTag]) { fn report(source: &str, source_name: &str, result: &ConvertResult) -> String { let mut out = String::new(); + let map = result.source_map(source, source_name); + out.push_str("--- code, with an inline source map this harness appends ---\n"); out.push_str(&result.code); if !result.code.ends_with('\n') { out.push('\n'); } + out.push_str(&map.to_inline_comment()); + out.push('\n'); out.push_str("\n--- result ---\n"); let _ = writeln!(out, "has_parse_errors: {}", result.has_parse_errors); @@ -127,11 +131,6 @@ fn report(source: &str, source_name: &str, result: &ConvertResult) -> String { ); } - let map = result.source_map(source, source_name); - out.push_str("\n--- source map v3 (paste into any source map viewer) ---\n"); - out.push_str(&serde_json::to_string_pretty(&map).unwrap()); - out.push('\n'); - out } From df892ddb4d435b3687368705a09119b81bca6b95 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 14:52:47 +0200 Subject: [PATCH 26/50] test(astro2tsx): move result metadata into the insta info header --- crates/astro2tsx/Cargo.toml | 2 +- .../fixtures/adjacent_siblings_top_level.snap | 24 ++- .../fixtures/attribute_event_and_style.snap | 42 ++--- .../fixtures/attribute_expression_value.snap | 34 ++-- .../fixtures/attribute_invalid_names.snap | 34 ++-- .../fixtures/attribute_quoted_forms.snap | 32 ++-- .../tests/fixtures/attribute_shorthand.snap | 32 ++-- .../tests/fixtures/attribute_spread.snap | 30 ++-- .../fixtures/attribute_template_literal.snap | 32 ++-- .../tests/fixtures/crlf_frontmatter.snap | 27 ++- .../astro2tsx/tests/fixtures/directives.snap | 34 ++-- .../expression_adjacent_siblings.snap | 28 ++-- .../fixtures/expression_comment_only.snap | 24 ++- .../tests/fixtures/expression_empty.snap | 25 ++- .../tests/fixtures/expression_generics.snap | 24 ++- .../fixtures/expression_html_comment.snap | 28 ++-- .../tests/fixtures/expression_identifier.snap | 24 ++- .../tests/fixtures/expression_map.snap | 24 ++- .../tests/fixtures/expression_nested.snap | 24 ++- .../fixtures/expression_object_literal.snap | 24 ++- .../fixtures/expression_single_element.snap | 24 ++- .../fixtures/expression_spread_child.snap | 24 ++- .../expression_string_with_markup.snap | 24 ++- .../expression_template_with_markup.snap | 24 ++- .../fixtures/expression_ternary_markup.snap | 24 ++- .../tests/fixtures/frontmatter_absent.snap | 24 ++- .../tests/fixtures/frontmatter_and_body.snap | 27 ++- .../tests/fixtures/frontmatter_empty.snap | 26 ++- .../tests/fixtures/frontmatter_imports.snap | 29 ++-- .../tests/fixtures/frontmatter_only.snap | 25 ++- .../frontmatter_top_level_return.snap | 27 ++- .../fixtures/get_static_paths_export.snap | 27 ++- .../fixtures/get_static_paths_with_props.snap | 27 ++- .../tests/fixtures/html_comment_body.snap | 28 ++-- .../fixtures/html_comment_top_level.snap | 24 ++- .../astro2tsx/tests/fixtures/multibyte.snap | 24 ++- .../tests/fixtures/multibyte_astral.snap | 27 ++- .../fixtures/named_component_export.snap | 24 ++- .../tests/fixtures/props_generic.snap | 27 ++- .../tests/fixtures/props_imported.snap | 27 ++- .../tests/fixtures/props_interface.snap | 27 ++- .../tests/fixtures/props_type_alias.snap | 27 ++- .../tests/fixtures/raw_text_is_raw.snap | 30 ++-- .../tests/fixtures/raw_text_script_json.snap | 37 ++--- .../fixtures/raw_text_script_module.snap | 37 ++--- .../tests/fixtures/raw_text_style.snap | 35 ++-- .../tests/fixtures/slot_element.snap | 30 ++-- crates/astro2tsx/tests/fixtures/slots.snap | 26 ++- .../tests/fixtures/unclosed_tag.snap | 24 ++- .../tests/fixtures/void_elements.snap | 33 ++-- crates/astro2tsx/tests/snapshots.rs | 157 +++++++----------- 51 files changed, 580 insertions(+), 944 deletions(-) diff --git a/crates/astro2tsx/Cargo.toml b/crates/astro2tsx/Cargo.toml index 276f15ac..cc420e90 100644 --- a/crates/astro2tsx/Cargo.toml +++ b/crates/astro2tsx/Cargo.toml @@ -28,7 +28,7 @@ serde = { version = "1", features = ["derive"] } serde_json = "1" [dev-dependencies] -insta = { workspace = true, features = ["glob"] } +insta = { workspace = true, features = ["glob", "serde"] } oxc_sourcemap = { workspace = true } [build-dependencies] diff --git a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap index 8ede8555..340f9bb9 100644 --- a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 72 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -12,16 +21,3 @@ input_file: crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzcGFuPmE8L3NwYW4+XG48c3Bhbj5iPC9zcGFuPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLElBQUksQ0FBQztBQUNkLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUM7QUFDZDtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..72 -scripts: (none) -styles: (none) - ---- mappings: 20 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..72 x17 -> 0 -72..163 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap index 72e1e240..3e5b78d1 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap @@ -1,8 +1,29 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 87 + scripts: + - kind: EventAttribute + lang: event-attribute + generated: + start: 55 + end: 59 + content: go() + styles: + - kind: StyleAttribute + lang: css + generated: + start: 68 + end: 77 + content: "color:red" input_file: crates/astro2tsx/tests/fixtures/attribute_event_and_style.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,22 +32,3 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_event_and_style.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgb25jbGljaz1cImdvKClcIiBzdHlsZT1cImNvbG9yOnJlZFwiPjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHLENBQUksT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQzVDO0EifQ== - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..87 -scripts: - EventAttribute lang=Some("event-attribute") generated 55..59 content="go()" -styles: - StyleAttribute lang=Some("css") generated 68..77 content="color:red" - ---- mappings: 34 points in 7 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..45 x2 -> 0 -45..46 x1 -> - -46..60 x8 -> 5 -60..61 x1 -> - -61..87 x19 -> 20 -87..178 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap index 709b8b47..1f196c75 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 85 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/attribute_expression_value.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,26 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_expression_value.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgY2xhc3M9e2Nsc30gYXJpYS1sYWJlbD17bGFiZWx9PjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHLENBQUksS0FBSyxDLENBQUUsQ0FBQyxDQUFDLEMsQyxDQUFHLFVBQVUsQyxDQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDMUM7QSJ9 - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..85 -scripts: (none) -styles: (none) - ---- mappings: 29 points in 13 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..45 x2 -> 0 -45..46 x1 -> - -46..52 x2 -> 5 -52..53 x1 -> - -53..56 x3 -> 12 -56..58 x2 -> - -58..69 x2 -> 17 -69..70 x1 -> - -70..75 x5 -> 29 -75..76 x1 -> - -76..85 x6 -> 35 -85..176 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap index 9ecdff14..18ec8434 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 103 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/attribute_invalid_names.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,26 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_invalid_names.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgQGNsaWNrPXtoYW5kbGVyfSA6Y2xhc3M9XCJ4XCIgbmFtZT1cIm9rXCI+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBZ0MsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsTUFBcEMsUSxFQUFRLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsQyxDQUFHLFEsQyxHLEVBQW9CLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDakQ7QSJ9 - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..103 -scripts: (none) -styles: (none) - ---- mappings: 34 points in 13 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..45 x2 -> 0 -45..46 x1 -> - -46..55 x6 -> 33 -55..61 x1 -> - -61..69 x1 -> 5 -69..71 x1 -> - -71..78 x7 -> 13 -78..80 x2 -> - -80..88 x1 -> 22 -88..94 x3 -> - -94..103 x6 -> 42 -103..194 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap index 3c3d5c57..8f90a03b 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 99 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/attribute_quoted_forms.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,24 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_quoted_forms.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgaWQ9J3NpbmdsZScgY2xhc3M9XCJkb3VibGVcIiBkYXRhLW49MyBoaWRkZW4+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBSSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsQyxDQUFBLE1BQU0sQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN0RDtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..99 -scripts: (none) -styles: (none) - ---- mappings: 41 points in 11 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..45 x2 -> 0 -45..46 x1 -> - -46..57 x10 -> 5 -57..58 x1 -> - -58..72 x10 -> 17 -72..73 x1 -> - -73..83 x5 -> 32 -83..84 x1 -> - -84..99 x7 -> 41 -99..190 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap index b952eb46..d108d61b 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 60 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/attribute_shorthand.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,24 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_shorthand.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxGb28ge2Jhcn0gLz5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFLLENBQUMsQ0FBQyxDLEMsQ0FBRixDQUFDLENBQUMsQyxDQUFFLENBQUUsRUFBQztBQUNiO0EifQ== - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..60 -scripts: (none) -styles: (none) - ---- mappings: 19 points in 11 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..45 x2 -> 0 -45..46 x1 -> - -46..49 x3 -> 6 -49..51 x2 -> - -51..54 x3 -> 6 -54..55 x1 -> - -55..56 x1 -> 10 -56..58 x1 -> 12 -58..60 x2 -> 13 -60..151 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/attribute_spread.snap b/crates/astro2tsx/tests/fixtures/attribute_spread.snap index c97312a8..60bfc888 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_spread.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_spread.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 69 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/attribute_spread.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,22 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_spread.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxGb28gey4uLnJlc3R9IG5hbWU9XCJ4XCIgLz5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxFLEdBQVEsQ0FBQyxDQUFDLENBQUMsQyxDLENBQUcsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsRUFBQztBQUMxQjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..69 -scripts: (none) -styles: (none) - ---- mappings: 22 points in 9 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..45 x2 -> 0 -45..50 x2 -> - -50..54 x4 -> 9 -54..56 x2 -> - -56..65 x6 -> 15 -65..67 x1 -> 25 -67..69 x2 -> 26 -69..160 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap index 9b2e37aa..3666723b 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 68 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/attribute_template_literal.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,24 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_template_literal.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxUYWcgc3JjPXtgYmFyJHtmb299YH0gLz5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFJLEdBQUcsQyxDQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLENBQUUsRUFBQztBQUN6QjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..68 -scripts: (none) -styles: (none) - ---- mappings: 25 points in 11 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..45 x2 -> 0 -45..46 x1 -> - -46..50 x2 -> 5 -50..51 x1 -> - -51..62 x11 -> 10 -62..63 x1 -> - -63..64 x1 -> 22 -64..66 x1 -> 24 -66..68 x2 -> 25 -68..159 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap index 29c58d45..0701e53f 100644 --- a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap +++ b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 71 + body: + start: 82 + end: 114 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/crlf_frontmatter.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -16,19 +25,3 @@ import { Meta } from './Meta.astro'; export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxyXG5pbXBvcnQgeyBNZXRhIH0gZnJvbSAnLi9NZXRhLmFzdHJvJztcclxuLS0tXHJcbjxkaXY+XHJcbjxzcGFuPmE8L3NwYW4+XHJcbjwvZGl2PlxyXG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRyxDQUFDO0FBQ0osQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0E7QUFFckMsQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNOLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUMsQ0FBQztBQUNmLEVBQUUsR0FBRyxDQUFDLENBQUM7QUFDUDtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 30..71 -body: 82..114 -scripts: (none) -styles: (none) - ---- mappings: 65 points in 6 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..30 x1 -> - -30..30 x1 -> 0 -30..70 x40 -> 3 -70..82 x2 -> - -82..114 x20 -> 48 -114..205 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/directives.snap b/crates/astro2tsx/tests/fixtures/directives.snap index 8b57d511..3e7add16 100644 --- a/crates/astro2tsx/tests/fixtures/directives.snap +++ b/crates/astro2tsx/tests/fixtures/directives.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 116 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/directives.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,26 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/directives.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxDb21wIGNsaWVudDpsb2FkIHNldDpodG1sPXtodG1sfSBjbGFzczpsaXN0PXtjbHN9IHRyYW5zaXRpb246bmFtZT1cIm5cIiAvPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxJLENBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsQ0FBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsZUFBZSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsRUFBQztBQUN6RTtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..116 -scripts: (none) -styles: (none) - ---- mappings: 60 points in 13 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..46 x2 -> 0 -46..47 x1 -> - -47..58 x11 -> 6 -58..59 x1 -> - -59..74 x15 -> 18 -74..75 x1 -> - -75..91 x16 -> 34 -91..92 x1 -> - -92..112 x6 -> 51 -112..114 x1 -> 72 -114..116 x2 -> 73 -116..207 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap index 078affd8..b1ba3c0a 100644 --- a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap +++ b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 114 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,20 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2NvbmQgJiYgPHNwYW4+YTwvc3Bhbj4gPHNwYW4+Yjwvc3Bhbj59PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxVQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxXQUFDLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDbEQ7QSJ9 - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..114 -scripts: (none) -styles: (none) - ---- mappings: 52 points in 7 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..55 x12 -> 0 -55..65 x1 -> - -65..94 x29 -> 14 -94..105 x1 -> - -105..114 x6 -> 43 -114..205 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap index 2f675ded..c5e07dd3 100644 --- a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap +++ b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 69 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_comment_only.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/expression_comment_only.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+ey8qIGtlZXAgbWUgKi99PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUMxQjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..69 -scripts: (none) -styles: (none) - ---- mappings: 26 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..69 x23 -> 0 -69..160 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_empty.snap b/crates/astro2tsx/tests/fixtures/expression_empty.snap index e30ff196..bc7316a9 100644 --- a/crates/astro2tsx/tests/fixtures/expression_empty.snap +++ b/crates/astro2tsx/tests/fixtures/expression_empty.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 54 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_empty.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,17 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/expression_empty.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e308L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFHLEVBQUUsR0FBRyxDQUFDO0FBQ2I7QSJ9 - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..54 -scripts: (none) -styles: (none) - ---- mappings: 11 points in 4 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..46 x3 -> 0 -46..54 x5 -> 7 -54..145 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_generics.snap b/crates/astro2tsx/tests/fixtures/expression_generics.snap index 339d9b6d..223cd269 100644 --- a/crates/astro2tsx/tests/fixtures/expression_generics.snap +++ b/crates/astro2tsx/tests/fixtures/expression_generics.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 67 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_generics.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/expression_generics.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2ZvbzxCYXI+KHgpfTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN4QjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..67 -scripts: (none) -styles: (none) - ---- mappings: 24 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..67 x21 -> 0 -67..158 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap index 94f7737d..2b40b0da 100644 --- a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap +++ b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 94 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_html_comment.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,20 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/expression_html_comment.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIntsaXN0Lm1hcCgoKSA9PiA8Q29tcG9uZW50PjwhLS1IaS0tPjwvQ29tcG9uZW50Pil9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxLQUFLLENBQUMsQyxHQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsRDtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..94 -scripts: (none) -styles: (none) - ---- mappings: 50 points in 7 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..68 x27 -> 0 -68..73 x1 -> - -73..75 x2 -> 31 -75..78 x1 -> - -78..94 x16 -> 36 -94..185 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_identifier.snap b/crates/astro2tsx/tests/fixtures/expression_identifier.snap index 45646314..1968fc71 100644 --- a/crates/astro2tsx/tests/fixtures/expression_identifier.snap +++ b/crates/astro2tsx/tests/fixtures/expression_identifier.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 61 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_identifier.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/expression_identifier.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e3ZhbHVlfTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNsQjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..61 -scripts: (none) -styles: (none) - ---- mappings: 18 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..61 x15 -> 0 -61..152 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_map.snap b/crates/astro2tsx/tests/fixtures/expression_map.snap index ec3adc41..7034f62b 100644 --- a/crates/astro2tsx/tests/fixtures/expression_map.snap +++ b/crates/astro2tsx/tests/fixtures/expression_map.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 89 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_map.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/expression_map.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjx1bD57aXRlbXMubWFwKChpKSA9PiA8bGk+e2kubmFtZX08L2xpPil9PC91bD5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUM7QUFDOUM7QSJ9 - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..89 -scripts: (none) -styles: (none) - ---- mappings: 48 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..89 x45 -> 0 -89..180 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_nested.snap b/crates/astro2tsx/tests/fixtures/expression_nested.snap index 25f48ce4..bb01c7db 100644 --- a/crates/astro2tsx/tests/fixtures/expression_nested.snap +++ b/crates/astro2tsx/tests/fixtures/expression_nested.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 85 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_nested.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/expression_nested.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e291dGVyICYmIDxzcGFuPntpbm5lcn08L3NwYW4+fTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUMxQztBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..85 -scripts: (none) -styles: (none) - ---- mappings: 42 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..85 x39 -> 0 -85..176 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap index a9d01b35..8005c7b1 100644 --- a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap +++ b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 73 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_object_literal.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/expression_object_literal.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+eyB7IGR1cmF0aW9uOiAxIH0gfTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUM5QjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..73 -scripts: (none) -styles: (none) - ---- mappings: 30 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..73 x27 -> 0 -73..164 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_single_element.snap b/crates/astro2tsx/tests/fixtures/expression_single_element.snap index 16465f68..24e23011 100644 --- a/crates/astro2tsx/tests/fixtures/expression_single_element.snap +++ b/crates/astro2tsx/tests/fixtures/expression_single_element.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 78 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_single_element.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/expression_single_element.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2NvbmQgJiYgPHNwYW4+YTwvc3Bhbj59PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNuQztBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..78 -scripts: (none) -styles: (none) - ---- mappings: 35 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..78 x32 -> 0 -78..169 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap index 492845b5..045f4bde 100644 --- a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap +++ b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 63 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_spread_child.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/expression_spread_child.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+ey4uLnJlc3R9PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNwQjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..63 -scripts: (none) -styles: (none) - ---- mappings: 20 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..63 x17 -> 0 -63..154 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap index 1ad9f8c8..7f6c01d7 100644 --- a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 63 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_string_with_markup.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/expression_string_with_markup.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e1wiPGJyLz5cIn08L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ3BCO0EifQ== - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..63 -scripts: (none) -styles: (none) - ---- mappings: 20 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..63 x17 -> 0 -63..154 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap index 37617a25..1322825f 100644 --- a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 66 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_template_with_markup.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/expression_template_with_markup.astr export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2A8Yj55PC9iPmB9PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN2QjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..66 -scripts: (none) -styles: (none) - ---- mappings: 23 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..66 x20 -> 0 -66..157 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap index 03f0898e..008cff55 100644 --- a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 95 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_ternary_markup.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/expression_ternary_markup.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2NvbmQgPyA8YSBocmVmPScveCc+eWVzPC9hPiA6IDxiPm5vPC9iPn08L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNwRDtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..95 -scripts: (none) -styles: (none) - ---- mappings: 52 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..95 x49 -> 0 -95..186 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap index 4b767263..8216a7ba 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 59 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/frontmatter_absent.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/frontmatter_absent.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+cGxhaW48L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNoQjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..59 -scripts: (none) -styles: (none) - ---- mappings: 16 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..59 x13 -> 0 -59..150 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap index ad1f6652..3462dc37 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 53 + body: + start: 64 + end: 88 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/frontmatter_and_body.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -14,19 +23,3 @@ let value = 'world'; export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxubGV0IHZhbHVlID0gJ3dvcmxkJztcbi0tLVxuXG48aDE+SGVsbG8ge3ZhbHVlfTwvaDE+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0E7QUFHcEIsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQztBQUN0QjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 30..53 -body: 64..88 -scripts: (none) -styles: (none) - ---- mappings: 48 points in 6 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..30 x1 -> - -30..30 x1 -> 0 -30..52 x22 -> 3 -52..64 x2 -> - -64..88 x21 -> 30 -88..179 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap index bcd9281d..25af5c4e 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 31 + body: + start: 42 + end: 55 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/frontmatter_empty.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -12,18 +21,3 @@ input_file: crates/astro2tsx/tests/fixtures/frontmatter_empty.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuLS0tXG48ZGl2PjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBQUFBLEE7QTtBQUVBLENBQUMsR0FBRyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ1g7QSJ9 - ---- result --- -has_parse_errors: false -frontmatter: 30..31 -body: 42..55 -scripts: (none) -styles: (none) - ---- mappings: 13 points in 5 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..30 x1 -> - -30..30 x1 -> 0 -30..42 x2 -> - -42..55 x8 -> 8 -55..146 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap index 0edb3682..47660edd 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 101 + body: + start: 112 + end: 122 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/frontmatter_imports.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -15,21 +24,3 @@ import type { Foo } from './types'; export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW1wb3J0IENhcmQgZnJvbSAnLi9DYXJkLmFzdHJvJztcbmltcG9ydCB0eXBlIHsgRm9vIH0gZnJvbSAnLi90eXBlcyc7XG4tLS1cbjxDYXJkIC8+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNoQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBO0FBRW5DLENBQUMsSUFBSSxDQUFFLEVBQUM7QUFDUjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 30..101 -body: 112..122 -scripts: (none) -styles: (none) - ---- mappings: 81 points in 8 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..30 x1 -> - -30..30 x1 -> 0 -30..100 x70 -> 3 -100..112 x2 -> - -112..118 x3 -> 77 -118..120 x1 -> 84 -120..122 x2 -> 85 -122..213 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap index 166d787e..df3aab74 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 45 + body: + start: 46 + end: 46 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/frontmatter_only.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,17 +20,3 @@ const a = 1; export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuY29uc3QgYSA9IDE7XG4tLS1cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QUFBQSxBQUFHO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 30..45 -body: 46..46 -scripts: (none) -styles: (none) - ---- mappings: 18 points in 4 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..30 x1 -> - -30..30 x1 -> 0 -30..44 x14 -> 3 -44..125 x2 -> - diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap index b1baec9c..7ff87c90 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 76 + body: + start: 90 + end: 100 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -16,19 +25,3 @@ if (cond) { export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaWYgKGNvbmQpIHtcblx0cmV0dXJuIEFzdHJvLnJlZGlyZWN0KCcveCcpO1xufVxuLS0tXG48cD54PC9wPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDWCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDN0IsQ0FBQztBO0EsRztBQUVELENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDUjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 30..76 -body: 90..100 -scripts: (none) -styles: (none) - ---- mappings: 60 points in 6 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..30 x1 -> - -30..30 x1 -> 0 -30..75 x45 -> 3 -75..90 x3 -> - -90..100 x9 -> 52 -100..191 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap b/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap index 3a23aef4..e0391205 100644 --- a/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap +++ b/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 78 + body: + start: 89 + end: 102 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/get_static_paths_export.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -25,19 +34,3 @@ type ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[ */ declare const Astro: Readonly>, typeof __AstroComponent_, ASTRO__Get>> //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuZXhwb3J0IGNvbnN0IGdldFN0YXRpY1BhdGhzID0gYXN5bmMgKCkgPT4gW107XG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QTtBQUU3QyxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== - ---- result --- -has_parse_errors: false -frontmatter: 30..78 -body: 89..102 -scripts: (none) -styles: (none) - ---- mappings: 60 points in 6 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..30 x1 -> - -30..30 x1 -> 0 -30..77 x47 -> 3 -77..89 x2 -> - -89..102 x8 -> 54 -102..1244 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap b/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap index 2f5ef746..80ecf8b6 100644 --- a/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap +++ b/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 119 + body: + start: 133 + end: 146 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/get_static_paths_with_props.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -26,19 +35,3 @@ type ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[ */ declare const Astro: Readonly>> //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW50ZXJmYWNlIFByb3BzIHsgc2x1Zzogc3RyaW5nIH1cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRTdGF0aWNQYXRocygpIHsgcmV0dXJuIFtdOyB9XG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNoQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBLEc7QUFFckQsQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWDtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 30..119 -body: 133..146 -scripts: (none) -styles: (none) - ---- mappings: 102 points in 6 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..30 x1 -> - -30..30 x1 -> 0 -30..118 x88 -> 3 -118..133 x3 -> - -133..146 x8 -> 95 -146..1162 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/html_comment_body.snap b/crates/astro2tsx/tests/fixtures/html_comment_body.snap index ed1f9a55..f6ea54f4 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_body.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_body.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 73 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/html_comment_body.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,20 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/html_comment_body.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PCEtLSBoaSAtLT48cD54PC9wPjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLEMsSUFBSyxDQUFDLENBQUMsQ0FBQyxDLEdBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUM5QjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..73 -scripts: (none) -styles: (none) - ---- mappings: 24 points in 7 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..46 x3 -> 0 -46..50 x1 -> - -50..54 x4 -> 9 -54..57 x1 -> - -57..73 x12 -> 16 -73..164 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap index 9d26a1b5..3c49a911 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 55 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/html_comment_top_level.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/html_comment_top_level.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjwhLS0gbGVhZGluZyAtLT5cbjxkaXY+eDwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQ0EsQ0FBQyxHQUFHLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNaO0EifQ== - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..55 -scripts: (none) -styles: (none) - ---- mappings: 12 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..55 x9 -> 17 -55..146 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/multibyte.snap b/crates/astro2tsx/tests/fixtures/multibyte.snap index de82d074..285c43be 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 68 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/multibyte.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/multibyte.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxoMT7jg4Q8L2gxPjxwPmZvb2JhcjwvcD5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDdkI7QSJ9 - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..68 -scripts: (none) -styles: (none) - ---- mappings: 24 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..68 x21 -> 0 -68..159 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap index 83618101..09793395 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 52 + body: + start: 63 + end: 81 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/multibyte_astral.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -14,19 +23,3 @@ const π = Math.PI; export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuY29uc3Qgz4AgPSBNYXRoLlBJO1xuLS0tXG48cD7wn6aEIHvPgH08L3A+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QTtBQUVsQixDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDYjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 30..52 -body: 63..81 -scripts: (none) -styles: (none) - ---- mappings: 38 points in 6 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..30 x1 -> - -30..30 x1 -> 0 -30..51 x20 -> 3 -51..63 x2 -> - -63..81 x13 -> 28 -81..172 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/named_component_export.snap b/crates/astro2tsx/tests/fixtures/named_component_export.snap index 8ddefdc0..a09c5716 100644 --- a/crates/astro2tsx/tests/fixtures/named_component_export.snap +++ b/crates/astro2tsx/tests/fixtures/named_component_export.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 54 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/named_component_export.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/named_component_export.astro export default function MyPage__AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9zcmMvcGFnZXMvTXlQYWdlLmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..54 -scripts: (none) -styles: (none) - ---- mappings: 11 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..54 x8 -> 0 -54..151 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/props_generic.snap b/crates/astro2tsx/tests/fixtures/props_generic.snap index 864ee20c..4acb78e0 100644 --- a/crates/astro2tsx/tests/fixtures/props_generic.snap +++ b/crates/astro2tsx/tests/fixtures/props_generic.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 80 + body: + start: 94 + end: 107 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/props_generic.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -22,19 +31,3 @@ export default function __AstroComponent_(_props: Props): a */ declare const Astro: Readonly> //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW50ZXJmYWNlIFByb3BzPFQgZXh0ZW5kcyBzdHJpbmc+IHtcblx0aXRlbTogVDtcbn1cbi0tLVxuPGRpdj48L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QUFBQSxBQUFHO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ25DLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ1QsQ0FBQztBO0EsRztBQUVELENBQUMsR0FBRyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ1g7QSJ9 - ---- result --- -has_parse_errors: false -frontmatter: 30..80 -body: 94..107 -scripts: (none) -styles: (none) - ---- mappings: 63 points in 6 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..30 x1 -> - -30..30 x1 -> 0 -30..79 x49 -> 3 -79..94 x3 -> - -94..107 x8 -> 56 -107..453 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/props_imported.snap b/crates/astro2tsx/tests/fixtures/props_imported.snap index cda7414f..2be8796e 100644 --- a/crates/astro2tsx/tests/fixtures/props_imported.snap +++ b/crates/astro2tsx/tests/fixtures/props_imported.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 70 + body: + start: 81 + end: 94 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/props_imported.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -20,19 +29,3 @@ export default function __AstroComponent_(_props: Props): any {} */ declare const Astro: Readonly> //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW1wb3J0IHR5cGUgeyBQcm9wcyB9IGZyb20gJy4vdHlwZXMnO1xuLS0tXG48ZGl2PjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QTtBQUVyQyxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== - ---- result --- -has_parse_errors: false -frontmatter: 30..70 -body: 81..94 -scripts: (none) -styles: (none) - ---- mappings: 52 points in 6 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..30 x1 -> - -30..30 x1 -> 0 -30..69 x39 -> 3 -69..81 x2 -> - -81..94 x8 -> 46 -94..419 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/props_interface.snap b/crates/astro2tsx/tests/fixtures/props_interface.snap index 3f9333db..987d6cb1 100644 --- a/crates/astro2tsx/tests/fixtures/props_interface.snap +++ b/crates/astro2tsx/tests/fixtures/props_interface.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 99 + body: + start: 110 + end: 128 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/props_interface.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -23,19 +32,3 @@ export default function __AstroComponent_(_props: Props): any {} */ declare const Astro: Readonly> //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW50ZXJmYWNlIFByb3BzIHtcblx0dGl0bGU6IHN0cmluZztcbn1cbmNvbnN0IHsgdGl0bGUgfSA9IEFzdHJvLnByb3BzO1xuLS0tXG48aDE+e3RpdGxlfTwvaDE+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNqQixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNmLENBQUM7QUFDRCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0E7QUFFOUIsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQztBQUNoQjtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 30..99 -body: 110..128 -scripts: (none) -styles: (none) - ---- mappings: 88 points in 6 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..30 x1 -> - -30..30 x1 -> 0 -30..98 x68 -> 3 -98..110 x2 -> - -110..128 x15 -> 75 -128..453 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/props_type_alias.snap b/crates/astro2tsx/tests/fixtures/props_type_alias.snap index 198954d8..02d73504 100644 --- a/crates/astro2tsx/tests/fixtures/props_type_alias.snap +++ b/crates/astro2tsx/tests/fixtures/props_type_alias.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 64 + body: + start: 75 + end: 88 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/props_type_alias.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -20,19 +29,3 @@ export default function __AstroComponent_(_props: Props): any {} */ declare const Astro: Readonly> //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxudHlwZSBQcm9wcyA9IHsgdGl0bGU6IHN0cmluZyB9O1xuLS0tXG48ZGl2PjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QTtBQUUvQixDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== - ---- result --- -has_parse_errors: false -frontmatter: 30..64 -body: 75..88 -scripts: (none) -styles: (none) - ---- mappings: 46 points in 6 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..30 x1 -> - -30..30 x1 -> 0 -30..63 x33 -> 3 -63..75 x2 -> - -75..88 x8 -> 40 -88..413 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap index dc27dae1..4cc21bb6 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 82 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/raw_text_is_raw.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,22 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_is_raw.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgaXM6cmF3PjxiPm5vdCBtYXJrdXA8L2I+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsRUFBRSxHQUFHLENBQUM7QUFDbkM7QSJ9 - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..82 -scripts: (none) -styles: (none) - ---- mappings: 37 points in 9 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..45 x2 -> 0 -45..46 x1 -> - -46..53 x7 -> 5 -53..55 x1 -> - -55..72 x17 -> 12 -72..74 x1 -> - -74..82 x5 -> 29 -82..173 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap index fec09f92..521eb714 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap @@ -1,8 +1,23 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 95 + scripts: + - kind: Script + lang: json + generated: + start: 73 + end: 84 + content: "{\"a\":1}" + styles: [] input_file: crates/astro2tsx/tests/fixtures/raw_text_script_json.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,23 +26,3 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_script_json.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzY3JpcHQgdHlwZT1cImFwcGxpY2F0aW9uL2pzb25cIj57XCJhXCI6MX08L3NjcmlwdD5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsTSxDQUFPLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxFQUFDLEVBQUUsTUFBTSxDQUFDO0FBQ2hEO0EifQ== - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..95 -scripts: - Script lang=Some("json") generated 73..84 content="{\"a\":1}" -styles: (none) - ---- mappings: 41 points in 9 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..48 x2 -> 0 -48..49 x1 -> - -49..73 x21 -> 8 -73..75 x1 -> - -75..82 x7 -> 32 -82..84 x1 -> - -84..95 x5 -> 39 -95..186 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap index 41fb624e..a967da42 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap @@ -1,8 +1,23 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 98 + scripts: + - kind: Script + lang: module + generated: + start: 63 + end: 87 + content: const a = 1; + styles: [] input_file: crates/astro2tsx/tests/fixtures/raw_text_script_module.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -13,23 +28,3 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_script_module.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzY3JpcHQgdHlwZT1cIm1vZHVsZVwiPmNvbnN0IGEgPSAxOzwvc2NyaXB0PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxNLENBQU8sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDO1FBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEM7QUFBQyxFQUFFLE1BQU0sQ0FBQztBQUMzQztBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..98 -scripts: - Script lang=Some("module") generated 63..87 content="const a = 1;" -styles: (none) - ---- mappings: 36 points in 9 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..48 x2 -> 0 -48..49 x1 -> - -49..63 x11 -> 8 -63..72 x1 -> - -72..84 x12 -> 22 -84..87 x1 -> - -87..98 x5 -> 34 -98..189 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/raw_text_style.snap b/crates/astro2tsx/tests/fixtures/raw_text_style.snap index dcfae796..cff92bd3 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_style.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_style.snap @@ -1,8 +1,23 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 80 + scripts: [] + styles: + - kind: Style + lang: css + generated: + start: 48 + end: 70 + content: ".a { color: red; }" input_file: crates/astro2tsx/tests/fixtures/raw_text_style.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,21 +26,3 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_style.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzdHlsZT4uYSB7IGNvbG9yOiByZWQ7IH08L3N0eWxlPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxLQUFLLEMsRUFBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxFQUFDLEVBQUUsS0FBSyxDQUFDO0FBQ2pDO0EifQ== - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..80 -scripts: (none) -styles: - Style lang=Some("css") generated 48..70 content=".a { color: red; }" - ---- mappings: 31 points in 7 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..48 x3 -> 0 -48..50 x1 -> - -50..68 x18 -> 7 -68..70 x1 -> - -70..80 x5 -> 25 -80..171 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/slot_element.snap b/crates/astro2tsx/tests/fixtures/slot_element.snap index 9a96d6c6..f40ad72f 100644 --- a/crates/astro2tsx/tests/fixtures/slot_element.snap +++ b/crates/astro2tsx/tests/fixtures/slot_element.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 79 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/slot_element.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,22 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/slot_element.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PHNsb3QgbmFtZT1cImFcIiAvPjxzbG90IC8+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEksQ0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBRSxFQUFDLENBQUMsSUFBSSxDQUFFLEVBQUMsRUFBRSxHQUFHLENBQUM7QUFDcEM7QSJ9 - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..79 -scripts: (none) -styles: (none) - ---- mappings: 25 points in 9 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..51 x5 -> 0 -51..52 x1 -> - -52..61 x6 -> 11 -61..63 x1 -> 21 -63..69 x3 -> 22 -69..71 x1 -> 29 -71..79 x5 -> 30 -79..170 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/slots.snap b/crates/astro2tsx/tests/fixtures/slots.snap index f1e94053..aa2492dc 100644 --- a/crates/astro2tsx/tests/fixtures/slots.snap +++ b/crates/astro2tsx/tests/fixtures/slots.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 104 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/slots.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -14,18 +23,3 @@ input_file: crates/astro2tsx/tests/fixtures/slots.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxMYXlvdXQ+XG5cdDxzcGFuIHNsb3Q9XCJoZWFkZXJcIj5IPC9zcGFuPlxuXHQ8cD5ib2R5PC9wPlxuPC9MYXlvdXQ+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLE1BQU0sQ0FBQztBQUNSLENBQUMsQ0FBQyxJLENBQUssSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUM7QUFDN0IsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQ1osRUFBRSxNQUFNLENBQUM7QUFDVDtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..104 -scripts: (none) -styles: (none) - ---- mappings: 44 points in 5 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..56 x7 -> 0 -56..57 x1 -> - -57..104 x33 -> 16 -104..195 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap index 6364eded..800d7e6b 100644 --- a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap +++ b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: true + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 55 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/unclosed_tag.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,16 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/unclosed_tag.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxjb21wb25lbnRzLlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDWjtBIn0= - ---- result --- -has_parse_errors: true -frontmatter: 0..0 -body: 41..55 -scripts: (none) -styles: (none) - ---- mappings: 17 points in 3 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..55 x14 -> 0 -55..146 x1 -> - diff --git a/crates/astro2tsx/tests/fixtures/void_elements.snap b/crates/astro2tsx/tests/fixtures/void_elements.snap index 6512de62..d8967670 100644 --- a/crates/astro2tsx/tests/fixtures/void_elements.snap +++ b/crates/astro2tsx/tests/fixtures/void_elements.snap @@ -1,8 +1,17 @@ --- source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 103 + scripts: [] + styles: [] input_file: crates/astro2tsx/tests/fixtures/void_elements.astro --- ---- code, with an inline source map this harness appends --- /* @jsxImportSource astro */ @@ -11,25 +20,3 @@ input_file: crates/astro2tsx/tests/fixtures/void_elements.astro export default function __AstroComponent_(_props: Record): any {} //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PGJyPjxociAvPjxpbWcgc3JjPVwiYS5wbmdcIj48aW5wdXQgdHlwZT1cInRleHRcIj48L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxFQUFDLENBQUMsRUFBRSxDQUFFLEVBQUMsQ0FBQyxHLENBQUksR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBQyxDQUFDLEssQ0FBTSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBQyxFQUFFLEdBQUcsQ0FBQztBQUN6RDtBIn0= - ---- result --- -has_parse_errors: false -frontmatter: 0..0 -body: 41..103 -scripts: (none) -styles: (none) - ---- mappings: 43 points in 12 runs --- -generated_start..generated_end xpoints -> original; `-` is unmapped -0..41 x2 -> - -41..51 x6 -> 0 -51..55 x3 -> 9 -55..57 x1 -> 14 -57..61 x2 -> 15 -61..62 x1 -> - -62..75 x10 -> 20 -75..81 x2 -> 32 -81..82 x1 -> - -82..95 x9 -> 39 -95..103 x5 -> 51 -103..194 x1 -> - diff --git a/crates/astro2tsx/tests/snapshots.rs b/crates/astro2tsx/tests/snapshots.rs index 540d537a..c7f67377 100644 --- a/crates/astro2tsx/tests/snapshots.rs +++ b/crates/astro2tsx/tests/snapshots.rs @@ -1,16 +1,15 @@ //! astro2tsx snapshot tests. Run `cargo insta review` to accept changes. //! -//! Each snapshot captures the whole `ConvertResult`, not just its code. +//! The body is only the TSX and its inline source map, so it pastes straight +//! into a viewer; the rest of the result rides in insta's `info` header. //! //! A fixture may open with `// @config key=value` lines, stripped before //! conversion. The only key is `filename`, which defaults to none. -use std::fmt::Write as _; use std::fs; -use astro2tsx::{ - ConvertOptions, ConvertResult, DEFAULT_SOURCE_NAME, ExtractedTag, Mapping, convert_to_tsx, -}; +use astro2tsx::{ConvertOptions, ConvertResult, DEFAULT_SOURCE_NAME, ExtractedTag, convert_to_tsx}; +use serde::Serialize; /// Parse `// @config` directives from the top of a fixture file. /// @@ -33,105 +32,57 @@ fn parse_fixture(raw: &str) -> (String, ConvertOptions) { (remaining.to_string(), options) } -/// Mappings are per character, so lockstep ones collapse into a run. -struct Run { - generated_start: u32, - generated_end: u32, - original: Option, - points: usize, +#[derive(Serialize)] +struct Info { + has_parse_errors: bool, + frontmatter: Range, + body: Range, + scripts: Vec, + styles: Vec, } -fn runs(mappings: &[Mapping], code_len: u32) -> Vec { - let mut runs: Vec = Vec::new(); - for (index, mapping) in mappings.iter().enumerate() { - let generated_end = mappings - .get(index + 1) - .map_or(code_len, |next| next.generated); - if let Some(open) = runs.last_mut() { - let previous = &mappings[index - 1]; - let lockstep = match (previous.original, mapping.original) { - (None, None) => true, - (Some(before), Some(after)) => { - i64::from(mapping.generated) - i64::from(previous.generated) - == i64::from(after) - i64::from(before) - } - _ => false, - }; - if lockstep && mapping.generated >= previous.generated { - open.generated_end = generated_end; - open.points += 1; - continue; - } - } - runs.push(Run { - generated_start: mapping.generated, - generated_end, - original: mapping.original, - points: 1, - }); - } - runs +#[derive(Serialize)] +struct Range { + start: u32, + end: u32, } -fn write_tags(out: &mut String, label: &str, tags: &[ExtractedTag]) { - if tags.is_empty() { - let _ = writeln!(out, "{label}: (none)"); - return; - } - let _ = writeln!(out, "{label}:"); - for tag in tags { - let _ = writeln!( - out, - " {:?} lang={:?} generated {}..{} content={:?}", - tag.kind, tag.lang, tag.range.start, tag.range.end, tag.content - ); - } +#[derive(Serialize)] +struct Tag { + kind: String, + lang: Option, + generated: Range, + content: String, } -fn report(source: &str, source_name: &str, result: &ConvertResult) -> String { - let mut out = String::new(); - let map = result.source_map(source, source_name); - - out.push_str("--- code, with an inline source map this harness appends ---\n"); - out.push_str(&result.code); - if !result.code.ends_with('\n') { - out.push('\n'); - } - out.push_str(&map.to_inline_comment()); - out.push('\n'); - - out.push_str("\n--- result ---\n"); - let _ = writeln!(out, "has_parse_errors: {}", result.has_parse_errors); - let _ = writeln!( - out, - "frontmatter: {}..{}", - result.frontmatter.start, result.frontmatter.end - ); - let _ = writeln!(out, "body: {}..{}", result.body.start, result.body.end); - write_tags(&mut out, "scripts", &result.scripts); - write_tags(&mut out, "styles", &result.styles); +fn tags(tags: &[ExtractedTag]) -> Vec { + tags.iter() + .map(|tag| Tag { + kind: format!("{:?}", tag.kind), + lang: tag.lang.clone(), + generated: Range { + start: tag.range.start, + end: tag.range.end, + }, + content: tag.content.clone(), + }) + .collect() +} - let runs = runs(&result.mappings, result.code.len() as u32); - let _ = writeln!( - out, - "\n--- mappings: {} points in {} runs ---", - result.mappings.len(), - runs.len() - ); - out.push_str("generated_start..generated_end xpoints -> original; `-` is unmapped\n"); - for run in &runs { - let original = match run.original { - Some(offset) => offset.to_string(), - None => "-".to_string(), - }; - let _ = writeln!( - out, - "{}..{} x{} -> {}", - run.generated_start, run.generated_end, run.points, original - ); +fn info(result: &ConvertResult) -> Info { + Info { + has_parse_errors: result.has_parse_errors, + frontmatter: Range { + start: result.frontmatter.start, + end: result.frontmatter.end, + }, + body: Range { + start: result.body.start, + end: result.body.end, + }, + scripts: tags(&result.scripts), + styles: tags(&result.styles), } - - out } #[test] @@ -144,15 +95,25 @@ fn snapshots() { .filename .clone() .unwrap_or_else(|| DEFAULT_SOURCE_NAME.to_string()); - let output = report(&source, &source_name, &convert_to_tsx(&source, options)); + let result = convert_to_tsx(&source, options); + let map = result.source_map(&source, &source_name); + + // A leading blank line would shift every generated line by one. + let mut body = String::new(); + body.push_str(&result.code); + if !result.code.ends_with('\n') { + body.push('\n'); + } + body.push_str(&map.to_inline_comment()); insta::with_settings!({ snapshot_path => path.parent().unwrap(), prepend_module_to_snapshot => false, snapshot_suffix => "", omit_expression => true, + info => &info(&result), }, { - insta::assert_snapshot!(name, output); + insta::assert_snapshot!(name, body); }); }); } From 676eb024726cf13665b32e262421aada55516306 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 15:06:28 +0200 Subject: [PATCH 27/50] feat(astro2tsx): append the inline source map comment unless sourcemap is external --- crates/astro2tsx/index.d.ts | 2 ++ crates/astro2tsx/src/lib.rs | 15 +++++++++++-- crates/astro2tsx/src/napi.rs | 10 ++++++++- crates/astro2tsx/src/sourcemap.rs | 10 +++++++++ crates/astro2tsx/test/astro2tsx.test.ts | 16 ++++++++++++++ crates/astro2tsx/tests/contract.rs | 1 + crates/astro2tsx/tests/ported_parity.rs | 1 + crates/astro2tsx/tests/source_map.rs | 26 ++++++++++++++++++++++- crates/astro2tsx/tests/upstream_corpus.rs | 3 +++ 9 files changed, 80 insertions(+), 4 deletions(-) diff --git a/crates/astro2tsx/index.d.ts b/crates/astro2tsx/index.d.ts index 9f738f48..74364100 100644 --- a/crates/astro2tsx/index.d.ts +++ b/crates/astro2tsx/index.d.ts @@ -15,6 +15,8 @@ export interface ConvertToTsxOptions { * (e.g. `MyPage.astro` produces `MyPage__AstroComponent_`). Optional. */ filename?: string + /** `"external"` omits the inline `//# sourceMappingURL=`; anything else appends it. */ + sourcemap?: string } export interface ConvertToTsxResult { diff --git a/crates/astro2tsx/src/lib.rs b/crates/astro2tsx/src/lib.rs index cb497293..f6e1a292 100644 --- a/crates/astro2tsx/src/lib.rs +++ b/crates/astro2tsx/src/lib.rs @@ -20,12 +20,14 @@ use biome_languages::HtmlFileSource; pub use crate::sourcemap::{ DEFAULT_SOURCE_NAME, ExtractedKind, ExtractedTag, GeneratedRange, Mapping, SourceMap, + SourceMapMode, }; #[derive(Clone, Debug, Default)] pub struct ConvertOptions { - /// Display name used to derive the default-exported component identifier. + /// Component identifier source, and `sources[0]` in the source map. pub filename: Option, + pub sourcemap: SourceMapMode, } /// `code` is always populated, whether or not the input parsed cleanly. @@ -63,7 +65,7 @@ pub fn convert_to_tsx(source: &str, options: ConvertOptions) -> ConvertResult { let mut printer = printer::Printer::new(source); render::render_root(&mut printer, root, &options); - ConvertResult { + let mut result = ConvertResult { code: printer.output, mappings: printer.mappings, frontmatter: printer.frontmatter_range, @@ -71,5 +73,14 @@ pub fn convert_to_tsx(source: &str, options: ConvertOptions) -> ConvertResult { scripts: printer.scripts, styles: printer.styles, has_parse_errors, + }; + + if options.sourcemap == SourceMapMode::Inline { + let source_name = options.filename.as_deref().unwrap_or(DEFAULT_SOURCE_NAME); + let comment = result.source_map(source, source_name).to_inline_comment(); + result.code.push('\n'); + result.code.push_str(&comment); } + + result } diff --git a/crates/astro2tsx/src/napi.rs b/crates/astro2tsx/src/napi.rs index 8f3e587f..6906d927 100644 --- a/crates/astro2tsx/src/napi.rs +++ b/crates/astro2tsx/src/napi.rs @@ -3,7 +3,9 @@ use napi_derive::napi; -use crate::{ConvertOptions, DEFAULT_SOURCE_NAME, ExtractedKind, convert_to_tsx as convert_rs}; +use crate::{ + ConvertOptions, DEFAULT_SOURCE_NAME, ExtractedKind, SourceMapMode, convert_to_tsx as convert_rs, +}; /// Per-byte source-position mapping between the emitted TSX and the source. #[napi(object)] @@ -44,6 +46,8 @@ pub struct ConvertToTsxOptions { /// Filename used to derive the default-exported component identifier /// (e.g. `MyPage.astro` produces `MyPage__AstroComponent_`). Optional. pub filename: Option, + /// `"external"` omits the inline `//# sourceMappingURL=`; anything else appends it. + pub sourcemap: Option, } #[napi(object)] @@ -75,6 +79,10 @@ pub fn convert_to_tsx(source: String, options: Option) -> C &source, ConvertOptions { filename: opts.filename, + sourcemap: match opts.sourcemap.as_deref() { + Some("external") => SourceMapMode::External, + _ => SourceMapMode::Inline, + }, }, ); let map = result.source_map(&source, &source_name).to_json(); diff --git a/crates/astro2tsx/src/sourcemap.rs b/crates/astro2tsx/src/sourcemap.rs index 07cc568a..2943e25c 100644 --- a/crates/astro2tsx/src/sourcemap.rs +++ b/crates/astro2tsx/src/sourcemap.rs @@ -6,6 +6,16 @@ use serde::Serialize; /// Used for `sources[0]` when the caller supplies no filename. pub const DEFAULT_SOURCE_NAME: &str = "input.astro"; +/// Whether the generated code carries its source map inline. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum SourceMapMode { + /// Append a `//# sourceMappingURL=` data URI comment to `code`. + #[default] + Inline, + /// Leave `code` alone; the map is only available separately. + External, +} + #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct Mapping { /// Offset into the generated TSX, in bytes. diff --git a/crates/astro2tsx/test/astro2tsx.test.ts b/crates/astro2tsx/test/astro2tsx.test.ts index 0fc56e14..45f8b76a 100644 --- a/crates/astro2tsx/test/astro2tsx.test.ts +++ b/crates/astro2tsx/test/astro2tsx.test.ts @@ -66,3 +66,19 @@ test('source map carries astral characters through unchanged', () => { assert.equal(map.sourcesContent[0], input); assert.ok(map.mappings.split(';').length <= result.code.split('\n').length); }); + +test('appends the inline source map comment by default', () => { + const { code, map } = convertToTsx('

Hi

'); + const marker = '\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,'; + assert.ok(code.includes(marker)); + const blob = code.slice(code.indexOf(marker) + marker.length); + assert.deepEqual(JSON.parse(Buffer.from(blob, 'base64').toString('utf8')), JSON.parse(map)); +}); + +test("sourcemap: 'external' leaves the code without the comment", () => { + const inline = convertToTsx('

Hi

'); + const external = convertToTsx('

Hi

', { sourcemap: 'external' }); + assert.doesNotMatch(external.code, /sourceMappingURL/); + assert.equal(external.map, inline.map); + assert.ok(inline.code.startsWith(external.code)); +}); diff --git a/crates/astro2tsx/tests/contract.rs b/crates/astro2tsx/tests/contract.rs index 0073d2da..93b173c7 100644 --- a/crates/astro2tsx/tests/contract.rs +++ b/crates/astro2tsx/tests/contract.rs @@ -32,6 +32,7 @@ fn never_fails_on_truncated_input() { t, ConvertOptions { filename: Some("index.astro".into()), + ..Default::default() }, ); assert!(!r.code.is_empty(), "empty output for {t:?}"); diff --git a/crates/astro2tsx/tests/ported_parity.rs b/crates/astro2tsx/tests/ported_parity.rs index 97c07e82..f6b38c41 100644 --- a/crates/astro2tsx/tests/ported_parity.rs +++ b/crates/astro2tsx/tests/ported_parity.rs @@ -7,6 +7,7 @@ fn convert(input: &str) -> astro2tsx::ConvertResult { input, ConvertOptions { filename: Some("index.astro".to_string()), + ..Default::default() }, ) } diff --git a/crates/astro2tsx/tests/source_map.rs b/crates/astro2tsx/tests/source_map.rs index 987e569c..6b9a59c5 100644 --- a/crates/astro2tsx/tests/source_map.rs +++ b/crates/astro2tsx/tests/source_map.rs @@ -3,7 +3,7 @@ use std::fs; -use astro2tsx::{ConvertOptions, DEFAULT_SOURCE_NAME, convert_to_tsx}; +use astro2tsx::{ConvertOptions, DEFAULT_SOURCE_NAME, SourceMapMode, convert_to_tsx}; use oxc_sourcemap::SourceMap as DecodedMap; fn fixtures() -> Vec<(String, String)> { @@ -132,6 +132,30 @@ fn every_fixture_round_trips_through_an_independent_decoder() { } } +#[test] +fn external_mode_omits_the_inline_comment() { + let source = "---\nlet x = 1;\n---\n

Hi

\n"; + const COMMENT: &str = "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,"; + + let external = convert_to_tsx( + source, + ConvertOptions { + sourcemap: SourceMapMode::External, + ..Default::default() + }, + ); + assert!(!external.code.contains(COMMENT)); + + let inline = convert_to_tsx(source, ConvertOptions::default()); + assert!(inline.code.contains(COMMENT)); + assert_eq!( + inline.code.split_once(COMMENT).unwrap().0, + external.code, + "the two modes should agree on everything before the comment" + ); + assert_eq!(inline.mappings, external.mappings); +} + /// A byte column would be 8 here and a scalar-value column 5, so this pins the /// units down to UTF-16 rather than merely to "not bytes". #[test] diff --git a/crates/astro2tsx/tests/upstream_corpus.rs b/crates/astro2tsx/tests/upstream_corpus.rs index 5ac7991e..2b1fcc4a 100644 --- a/crates/astro2tsx/tests/upstream_corpus.rs +++ b/crates/astro2tsx/tests/upstream_corpus.rs @@ -70,6 +70,7 @@ fn dump_named_diff() { &record.input, ConvertOptions { filename: record.options.filename.clone(), + ..Default::default() }, ) .code; @@ -92,6 +93,7 @@ fn dump_first_diff_per_file() { &record.input, ConvertOptions { filename: record.options.filename.clone(), + ..Default::default() }, ) .code; @@ -134,6 +136,7 @@ fn corpus_parity() { &record.input, ConvertOptions { filename: record.options.filename.clone(), + ..Default::default() }, ) .code; From a2f5469cf789b4fae6acfd37311f960ebc5a566f Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 15:06:28 +0200 Subject: [PATCH 28/50] test(astro2tsx): snapshot the emitted code verbatim --- .../fixtures/adjacent_siblings_top_level.snap | 1 + .../fixtures/attribute_event_and_style.snap | 1 + .../fixtures/attribute_expression_value.snap | 1 + .../fixtures/attribute_invalid_names.snap | 1 + .../fixtures/attribute_quoted_forms.snap | 1 + .../tests/fixtures/attribute_shorthand.snap | 1 + .../tests/fixtures/attribute_spread.snap | 1 + .../fixtures/attribute_template_literal.snap | 1 + .../tests/fixtures/crlf_frontmatter.snap | 1 + .../astro2tsx/tests/fixtures/directives.snap | 1 + .../expression_adjacent_siblings.snap | 1 + .../fixtures/expression_comment_only.snap | 1 + .../tests/fixtures/expression_empty.snap | 1 + .../tests/fixtures/expression_generics.snap | 1 + .../fixtures/expression_html_comment.snap | 1 + .../tests/fixtures/expression_identifier.snap | 1 + .../tests/fixtures/expression_map.snap | 1 + .../tests/fixtures/expression_nested.snap | 1 + .../fixtures/expression_object_literal.snap | 1 + .../fixtures/expression_single_element.snap | 1 + .../fixtures/expression_spread_child.snap | 1 + .../expression_string_with_markup.snap | 1 + .../expression_template_with_markup.snap | 1 + .../fixtures/expression_ternary_markup.snap | 1 + .../tests/fixtures/frontmatter_absent.snap | 1 + .../tests/fixtures/frontmatter_and_body.snap | 1 + .../tests/fixtures/frontmatter_empty.snap | 1 + .../tests/fixtures/frontmatter_imports.snap | 1 + .../tests/fixtures/frontmatter_only.snap | 1 + .../frontmatter_top_level_return.snap | 1 + .../tests/fixtures/html_comment_body.snap | 1 + .../fixtures/html_comment_top_level.snap | 1 + .../astro2tsx/tests/fixtures/multibyte.snap | 1 + .../tests/fixtures/multibyte_astral.snap | 1 + .../fixtures/named_component_export.snap | 1 + .../tests/fixtures/raw_text_is_raw.snap | 1 + .../tests/fixtures/raw_text_script_json.snap | 1 + .../fixtures/raw_text_script_module.snap | 1 + .../tests/fixtures/raw_text_style.snap | 1 + .../tests/fixtures/slot_element.snap | 1 + crates/astro2tsx/tests/fixtures/slots.snap | 1 + .../tests/fixtures/unclosed_tag.snap | 1 + .../tests/fixtures/void_elements.snap | 1 + crates/astro2tsx/tests/snapshots.rs | 21 ++++--------------- 44 files changed, 47 insertions(+), 17 deletions(-) diff --git a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap index 340f9bb9..c343f537 100644 --- a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap @@ -20,4 +20,5 @@ input_file: crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzcGFuPmE8L3NwYW4+XG48c3Bhbj5iPC9zcGFuPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLElBQUksQ0FBQztBQUNkLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUM7QUFDZDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap index 3e5b78d1..c782f781 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap @@ -31,4 +31,5 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_event_and_style.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgb25jbGljaz1cImdvKClcIiBzdHlsZT1cImNvbG9yOnJlZFwiPjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHLENBQUksT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQzVDO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap index 1f196c75..e62ce02f 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_expression_value.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgY2xhc3M9e2Nsc30gYXJpYS1sYWJlbD17bGFiZWx9PjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHLENBQUksS0FBSyxDLENBQUUsQ0FBQyxDQUFDLEMsQyxDQUFHLFVBQVUsQyxDQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDMUM7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap index 18ec8434..0bee1c1c 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_invalid_names.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgQGNsaWNrPXtoYW5kbGVyfSA6Y2xhc3M9XCJ4XCIgbmFtZT1cIm9rXCI+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBZ0MsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsTUFBcEMsUSxFQUFRLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsQyxDQUFHLFEsQyxHLEVBQW9CLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDakQ7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap index 8f90a03b..42131a16 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_quoted_forms.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgaWQ9J3NpbmdsZScgY2xhc3M9XCJkb3VibGVcIiBkYXRhLW49MyBoaWRkZW4+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBSSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsQyxDQUFBLE1BQU0sQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN0RDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap index d108d61b..62f16c63 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_shorthand.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxGb28ge2Jhcn0gLz5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFLLENBQUMsQ0FBQyxDLEMsQ0FBRixDQUFDLENBQUMsQyxDQUFFLENBQUUsRUFBQztBQUNiO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/attribute_spread.snap b/crates/astro2tsx/tests/fixtures/attribute_spread.snap index 60bfc888..0dcf48f4 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_spread.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_spread.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_spread.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxGb28gey4uLnJlc3R9IG5hbWU9XCJ4XCIgLz5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxFLEdBQVEsQ0FBQyxDQUFDLENBQUMsQyxDLENBQUcsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsRUFBQztBQUMxQjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap index 3666723b..390a6b58 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_template_literal.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxUYWcgc3JjPXtgYmFyJHtmb299YH0gLz5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFJLEdBQUcsQyxDQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLENBQUUsRUFBQztBQUN6QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap index 0701e53f..c653d655 100644 --- a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap +++ b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap @@ -24,4 +24,5 @@ import { Meta } from './Meta.astro'; export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxyXG5pbXBvcnQgeyBNZXRhIH0gZnJvbSAnLi9NZXRhLmFzdHJvJztcclxuLS0tXHJcbjxkaXY+XHJcbjxzcGFuPmE8L3NwYW4+XHJcbjwvZGl2PlxyXG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRyxDQUFDO0FBQ0osQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0E7QUFFckMsQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNOLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUMsQ0FBQztBQUNmLEVBQUUsR0FBRyxDQUFDLENBQUM7QUFDUDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/directives.snap b/crates/astro2tsx/tests/fixtures/directives.snap index 3e7add16..b0b8e7e0 100644 --- a/crates/astro2tsx/tests/fixtures/directives.snap +++ b/crates/astro2tsx/tests/fixtures/directives.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/directives.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxDb21wIGNsaWVudDpsb2FkIHNldDpodG1sPXtodG1sfSBjbGFzczpsaXN0PXtjbHN9IHRyYW5zaXRpb246bmFtZT1cIm5cIiAvPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxJLENBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsQ0FBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsZUFBZSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsRUFBQztBQUN6RTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap index b1ba3c0a..0e0c24bf 100644 --- a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap +++ b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2NvbmQgJiYgPHNwYW4+YTwvc3Bhbj4gPHNwYW4+Yjwvc3Bhbj59PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxVQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxXQUFDLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDbEQ7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap index c5e07dd3..69fa0d7b 100644 --- a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap +++ b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/expression_comment_only.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+ey8qIGtlZXAgbWUgKi99PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUMxQjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_empty.snap b/crates/astro2tsx/tests/fixtures/expression_empty.snap index bc7316a9..74a7eb13 100644 --- a/crates/astro2tsx/tests/fixtures/expression_empty.snap +++ b/crates/astro2tsx/tests/fixtures/expression_empty.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/expression_empty.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e308L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFHLEVBQUUsR0FBRyxDQUFDO0FBQ2I7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/expression_generics.snap b/crates/astro2tsx/tests/fixtures/expression_generics.snap index 223cd269..760b5ca7 100644 --- a/crates/astro2tsx/tests/fixtures/expression_generics.snap +++ b/crates/astro2tsx/tests/fixtures/expression_generics.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/expression_generics.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2ZvbzxCYXI+KHgpfTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN4QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap index 2b40b0da..dad2e576 100644 --- a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap +++ b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/expression_html_comment.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIntsaXN0Lm1hcCgoKSA9PiA8Q29tcG9uZW50PjwhLS1IaS0tPjwvQ29tcG9uZW50Pil9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxLQUFLLENBQUMsQyxHQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsRDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_identifier.snap b/crates/astro2tsx/tests/fixtures/expression_identifier.snap index 1968fc71..a3c13aab 100644 --- a/crates/astro2tsx/tests/fixtures/expression_identifier.snap +++ b/crates/astro2tsx/tests/fixtures/expression_identifier.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/expression_identifier.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e3ZhbHVlfTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNsQjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_map.snap b/crates/astro2tsx/tests/fixtures/expression_map.snap index 7034f62b..2af8af90 100644 --- a/crates/astro2tsx/tests/fixtures/expression_map.snap +++ b/crates/astro2tsx/tests/fixtures/expression_map.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/expression_map.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjx1bD57aXRlbXMubWFwKChpKSA9PiA8bGk+e2kubmFtZX08L2xpPil9PC91bD5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUM7QUFDOUM7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/expression_nested.snap b/crates/astro2tsx/tests/fixtures/expression_nested.snap index bb01c7db..4623356b 100644 --- a/crates/astro2tsx/tests/fixtures/expression_nested.snap +++ b/crates/astro2tsx/tests/fixtures/expression_nested.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/expression_nested.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e291dGVyICYmIDxzcGFuPntpbm5lcn08L3NwYW4+fTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUMxQztBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap index 8005c7b1..7b654cb1 100644 --- a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap +++ b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/expression_object_literal.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+eyB7IGR1cmF0aW9uOiAxIH0gfTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUM5QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_single_element.snap b/crates/astro2tsx/tests/fixtures/expression_single_element.snap index 24e23011..9357bfaf 100644 --- a/crates/astro2tsx/tests/fixtures/expression_single_element.snap +++ b/crates/astro2tsx/tests/fixtures/expression_single_element.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/expression_single_element.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2NvbmQgJiYgPHNwYW4+YTwvc3Bhbj59PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNuQztBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap index 045f4bde..f1a9506e 100644 --- a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap +++ b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/expression_spread_child.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+ey4uLnJlc3R9PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNwQjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap index 7f6c01d7..e0451a9b 100644 --- a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/expression_string_with_markup.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e1wiPGJyLz5cIn08L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ3BCO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap index 1322825f..9c6369f3 100644 --- a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/expression_template_with_markup.astr export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2A8Yj55PC9iPmB9PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN2QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap index 008cff55..61962e94 100644 --- a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/expression_ternary_markup.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2NvbmQgPyA8YSBocmVmPScveCc+eWVzPC9hPiA6IDxiPm5vPC9iPn08L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNwRDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap index 8216a7ba..7e9238ec 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/frontmatter_absent.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+cGxhaW48L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNoQjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap index 3462dc37..a910c2f9 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap @@ -22,4 +22,5 @@ let value = 'world'; export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxubGV0IHZhbHVlID0gJ3dvcmxkJztcbi0tLVxuXG48aDE+SGVsbG8ge3ZhbHVlfTwvaDE+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0E7QUFHcEIsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQztBQUN0QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap index 25af5c4e..bd06795a 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap @@ -20,4 +20,5 @@ input_file: crates/astro2tsx/tests/fixtures/frontmatter_empty.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuLS0tXG48ZGl2PjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBQUFBLEE7QTtBQUVBLENBQUMsR0FBRyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ1g7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap index 47660edd..41186eac 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap @@ -23,4 +23,5 @@ import type { Foo } from './types'; export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW1wb3J0IENhcmQgZnJvbSAnLi9DYXJkLmFzdHJvJztcbmltcG9ydCB0eXBlIHsgRm9vIH0gZnJvbSAnLi90eXBlcyc7XG4tLS1cbjxDYXJkIC8+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNoQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBO0FBRW5DLENBQUMsSUFBSSxDQUFFLEVBQUM7QUFDUjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap index df3aab74..fbf536e1 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap @@ -19,4 +19,5 @@ const a = 1; export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuY29uc3QgYSA9IDE7XG4tLS1cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QUFBQSxBQUFHO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap index 7ff87c90..e8259085 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap @@ -24,4 +24,5 @@ if (cond) { export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaWYgKGNvbmQpIHtcblx0cmV0dXJuIEFzdHJvLnJlZGlyZWN0KCcveCcpO1xufVxuLS0tXG48cD54PC9wPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDWCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDN0IsQ0FBQztBO0EsRztBQUVELENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDUjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/html_comment_body.snap b/crates/astro2tsx/tests/fixtures/html_comment_body.snap index f6ea54f4..ace1fdba 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_body.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_body.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/html_comment_body.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PCEtLSBoaSAtLT48cD54PC9wPjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLEMsSUFBSyxDQUFDLENBQUMsQ0FBQyxDLEdBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUM5QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap index 3c49a911..8673a351 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/html_comment_top_level.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjwhLS0gbGVhZGluZyAtLT5cbjxkaXY+eDwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQ0EsQ0FBQyxHQUFHLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNaO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/multibyte.snap b/crates/astro2tsx/tests/fixtures/multibyte.snap index 285c43be..43e0fef6 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/multibyte.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxoMT7jg4Q8L2gxPjxwPmZvb2JhcjwvcD5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDdkI7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap index 09793395..3d7dce2e 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap @@ -22,4 +22,5 @@ const π = Math.PI; export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuY29uc3Qgz4AgPSBNYXRoLlBJO1xuLS0tXG48cD7wn6aEIHvPgH08L3A+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QTtBQUVsQixDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDYjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/named_component_export.snap b/crates/astro2tsx/tests/fixtures/named_component_export.snap index a09c5716..9556ecb3 100644 --- a/crates/astro2tsx/tests/fixtures/named_component_export.snap +++ b/crates/astro2tsx/tests/fixtures/named_component_export.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/named_component_export.astro export default function MyPage__AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9zcmMvcGFnZXMvTXlQYWdlLmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap index 4cc21bb6..607c4c20 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_is_raw.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgaXM6cmF3PjxiPm5vdCBtYXJrdXA8L2I+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsRUFBRSxHQUFHLENBQUM7QUFDbkM7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap index 521eb714..57500ff0 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap @@ -25,4 +25,5 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_script_json.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzY3JpcHQgdHlwZT1cImFwcGxpY2F0aW9uL2pzb25cIj57XCJhXCI6MX08L3NjcmlwdD5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsTSxDQUFPLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxFQUFDLEVBQUUsTUFBTSxDQUFDO0FBQ2hEO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap index a967da42..3aa136af 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap @@ -27,4 +27,5 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_script_module.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzY3JpcHQgdHlwZT1cIm1vZHVsZVwiPmNvbnN0IGEgPSAxOzwvc2NyaXB0PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxNLENBQU8sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDO1FBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEM7QUFBQyxFQUFFLE1BQU0sQ0FBQztBQUMzQztBIn0= diff --git a/crates/astro2tsx/tests/fixtures/raw_text_style.snap b/crates/astro2tsx/tests/fixtures/raw_text_style.snap index cff92bd3..9c7470d7 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_style.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_style.snap @@ -25,4 +25,5 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_style.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzdHlsZT4uYSB7IGNvbG9yOiByZWQ7IH08L3N0eWxlPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxLQUFLLEMsRUFBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxFQUFDLEVBQUUsS0FBSyxDQUFDO0FBQ2pDO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/slot_element.snap b/crates/astro2tsx/tests/fixtures/slot_element.snap index f40ad72f..c9071bed 100644 --- a/crates/astro2tsx/tests/fixtures/slot_element.snap +++ b/crates/astro2tsx/tests/fixtures/slot_element.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/slot_element.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PHNsb3QgbmFtZT1cImFcIiAvPjxzbG90IC8+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEksQ0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBRSxFQUFDLENBQUMsSUFBSSxDQUFFLEVBQUMsRUFBRSxHQUFHLENBQUM7QUFDcEM7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/slots.snap b/crates/astro2tsx/tests/fixtures/slots.snap index aa2492dc..476a5a3c 100644 --- a/crates/astro2tsx/tests/fixtures/slots.snap +++ b/crates/astro2tsx/tests/fixtures/slots.snap @@ -22,4 +22,5 @@ input_file: crates/astro2tsx/tests/fixtures/slots.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxMYXlvdXQ+XG5cdDxzcGFuIHNsb3Q9XCJoZWFkZXJcIj5IPC9zcGFuPlxuXHQ8cD5ib2R5PC9wPlxuPC9MYXlvdXQ+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLE1BQU0sQ0FBQztBQUNSLENBQUMsQ0FBQyxJLENBQUssSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUM7QUFDN0IsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQ1osRUFBRSxNQUFNLENBQUM7QUFDVDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap index 800d7e6b..6a87c036 100644 --- a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap +++ b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/unclosed_tag.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxjb21wb25lbnRzLlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDWjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/void_elements.snap b/crates/astro2tsx/tests/fixtures/void_elements.snap index d8967670..f26f35f1 100644 --- a/crates/astro2tsx/tests/fixtures/void_elements.snap +++ b/crates/astro2tsx/tests/fixtures/void_elements.snap @@ -19,4 +19,5 @@ input_file: crates/astro2tsx/tests/fixtures/void_elements.astro export default function __AstroComponent_(_props: Record): any {} + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PGJyPjxociAvPjxpbWcgc3JjPVwiYS5wbmdcIj48aW5wdXQgdHlwZT1cInRleHRcIj48L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxFQUFDLENBQUMsRUFBRSxDQUFFLEVBQUMsQ0FBQyxHLENBQUksR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBQyxDQUFDLEssQ0FBTSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBQyxFQUFFLEdBQUcsQ0FBQztBQUN6RDtBIn0= diff --git a/crates/astro2tsx/tests/snapshots.rs b/crates/astro2tsx/tests/snapshots.rs index c7f67377..10b56210 100644 --- a/crates/astro2tsx/tests/snapshots.rs +++ b/crates/astro2tsx/tests/snapshots.rs @@ -1,14 +1,14 @@ //! astro2tsx snapshot tests. Run `cargo insta review` to accept changes. //! -//! The body is only the TSX and its inline source map, so it pastes straight -//! into a viewer; the rest of the result rides in insta's `info` header. +//! The body is `code` verbatim, inline source map and all, so it pastes +//! straight into a viewer; the rest of the result rides in insta's `info`. //! //! A fixture may open with `// @config key=value` lines, stripped before //! conversion. The only key is `filename`, which defaults to none. use std::fs; -use astro2tsx::{ConvertOptions, ConvertResult, DEFAULT_SOURCE_NAME, ExtractedTag, convert_to_tsx}; +use astro2tsx::{ConvertOptions, ConvertResult, ExtractedTag, convert_to_tsx}; use serde::Serialize; /// Parse `// @config` directives from the top of a fixture file. @@ -91,20 +91,7 @@ fn snapshots() { let raw = fs::read_to_string(path).unwrap(); let name = path.file_stem().unwrap().to_str().unwrap(); let (source, options) = parse_fixture(&raw); - let source_name = options - .filename - .clone() - .unwrap_or_else(|| DEFAULT_SOURCE_NAME.to_string()); let result = convert_to_tsx(&source, options); - let map = result.source_map(&source, &source_name); - - // A leading blank line would shift every generated line by one. - let mut body = String::new(); - body.push_str(&result.code); - if !result.code.ends_with('\n') { - body.push('\n'); - } - body.push_str(&map.to_inline_comment()); insta::with_settings!({ snapshot_path => path.parent().unwrap(), @@ -113,7 +100,7 @@ fn snapshots() { omit_expression => true, info => &info(&result), }, { - insta::assert_snapshot!(name, body); + insta::assert_snapshot!(name, result.code); }); }); } From 76dd40edfc8748440d048c8cdbbcbfe11b08c451 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 15:40:56 +0200 Subject: [PATCH 29/50] feat(astro2tsx)!: exclude script and style bodies from the emitted TSX --- crates/astro2tsx/src/render.rs | 38 ++---------- crates/astro2tsx/tests/contract.rs | 62 +++++++++++++++++++ .../tests/fixtures/raw_text_script_json.snap | 8 +-- .../fixtures/raw_text_script_module.snap | 10 ++- .../tests/fixtures/raw_text_style.snap | 8 +-- crates/astro2tsx/tests/regressions.rs | 39 +++++++----- crates/astro2tsx/tests/upstream_corpus.rs | 42 +++++++++++-- 7 files changed, 140 insertions(+), 67 deletions(-) diff --git a/crates/astro2tsx/src/render.rs b/crates/astro2tsx/src/render.rs index 74ceaa2d..c9c5a32a 100644 --- a/crates/astro2tsx/src/render.rs +++ b/crates/astro2tsx/src/render.rs @@ -496,15 +496,8 @@ fn render_html_element(printer: &mut Printer, node: HtmlElement) { let element_is_raw = attrs_for_classify .iter() .any(|a| attribute_key(a).as_deref() == Some("is:raw")); - let script_label = if is_script { - Some(classify_script_label(&attrs_for_classify)) - } else { - None - }; - // `"); + assert!(result.code.contains("")); + assert!(!result.code.contains("const a = 1;")); +} + +#[test] +fn json_script_text_is_excluded_but_the_tag_remains() { + let result = convert(""); + assert!(result.code.contains(""); + assert!(result.code.contains(""); + assert!(!script.code.contains("const a = 1;"), "{}", script.code); + + let style = convert(""); + assert!(!style.code.contains("color: red"), "{}", style.code); +} + +#[test] +fn excluded_bodies_are_still_reported_as_extracted_tags() { + let result = convert(""); + assert_eq!(result.scripts.len(), 1); + assert_eq!(result.scripts[0].content, "const a = 1;"); + assert_eq!(result.styles.len(), 1); + assert_eq!(result.styles[0].content, ".a{color:red}"); +} diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap index 57500ff0..926ac62b 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap @@ -7,13 +7,13 @@ info: end: 0 body: start: 41 - end: 95 + end: 84 scripts: - kind: Script lang: json generated: start: 73 - end: 84 + end: 73 content: "{\"a\":1}" styles: [] input_file: crates/astro2tsx/tests/fixtures/raw_text_script_json.astro @@ -21,9 +21,9 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_script_json.astro /* @jsxImportSource astro */ - + export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzY3JpcHQgdHlwZT1cImFwcGxpY2F0aW9uL2pzb25cIj57XCJhXCI6MX08L3NjcmlwdD5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsTSxDQUFPLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxFQUFDLEVBQUUsTUFBTSxDQUFDO0FBQ2hEO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzY3JpcHQgdHlwZT1cImFwcGxpY2F0aW9uL2pzb25cIj57XCJhXCI6MX08L3NjcmlwdD5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsTSxDQUFPLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFRLEVBQUUsTUFBTSxDQUFDO0FBQ2hEO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap index 3aa136af..fec5e1de 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap @@ -7,13 +7,13 @@ info: end: 0 body: start: 41 - end: 98 + end: 74 scripts: - kind: Script lang: module generated: start: 63 - end: 87 + end: 63 content: const a = 1; styles: [] input_file: crates/astro2tsx/tests/fixtures/raw_text_script_module.astro @@ -21,11 +21,9 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_script_module.astro /* @jsxImportSource astro */ - + export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzY3JpcHQgdHlwZT1cIm1vZHVsZVwiPmNvbnN0IGEgPSAxOzwvc2NyaXB0PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxNLENBQU8sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDO1FBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEM7QUFBQyxFQUFFLE1BQU0sQ0FBQztBQUMzQztBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzY3JpcHQgdHlwZT1cIm1vZHVsZVwiPmNvbnN0IGEgPSAxOzwvc2NyaXB0PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxNLENBQU8sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFhLEVBQUUsTUFBTSxDQUFDO0FBQzNDO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/raw_text_style.snap b/crates/astro2tsx/tests/fixtures/raw_text_style.snap index 9c7470d7..92b869a9 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_style.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_style.snap @@ -7,23 +7,23 @@ info: end: 0 body: start: 41 - end: 80 + end: 58 scripts: [] styles: - kind: Style lang: css generated: start: 48 - end: 70 + end: 48 content: ".a { color: red; }" input_file: crates/astro2tsx/tests/fixtures/raw_text_style.astro --- /* @jsxImportSource astro */ - + export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzdHlsZT4uYSB7IGNvbG9yOiByZWQ7IH08L3N0eWxlPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxLQUFLLEMsRUFBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxFQUFDLEVBQUUsS0FBSyxDQUFDO0FBQ2pDO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzdHlsZT4uYSB7IGNvbG9yOiByZWQ7IH08L3N0eWxlPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxLQUFLLENBQW1CLEVBQUUsS0FBSyxDQUFDO0FBQ2pDO0EifQ== diff --git a/crates/astro2tsx/tests/regressions.rs b/crates/astro2tsx/tests/regressions.rs index 451f3cde..deddd971 100644 --- a/crates/astro2tsx/tests/regressions.rs +++ b/crates/astro2tsx/tests/regressions.rs @@ -40,23 +40,30 @@ fn parser_errors_surface_but_do_not_block_emission() { assert!(result.code.starts_with(PREFIX)); } +/// Excluded bodies must stay reachable through the extracted arrays. #[test] -fn unclosed_raw_text_element_keeps_content_and_siblings() { - for (input, retained) in [ - ("")] + .into_iter() + .filter_map(|(open, close)| rest.find(open).map(|at| (at, open, close))) + .min_by_key(|(at, _, _)| *at); + + let Some((at, _, close)) = next else { + out.push_str(rest); + return out; + }; + let Some(body) = rest[at..].find('>').map(|i| at + i + 1) else { + out.push_str(rest); + return out; + }; + let Some(end) = rest[body..].find(close).map(|i| body + i) else { + out.push_str(rest); + return out; + }; + out.push_str(&rest[..body]); + rest = &rest[end..]; + } +} + /// Drops the trailing inline sourcemap comment, which is not compared. fn strip_inline_sourcemap(code: &str) -> &str { if let Some(idx) = code.rfind("\n//# sourceMappingURL=") { @@ -78,9 +106,12 @@ fn dump_named_diff() { eprintln!("--- INPUT ---"); eprintln!("{:?}", record.input); eprintln!("--- EXPECTED ---"); - eprintln!("{:?}", strip_inline_sourcemap(&record.expected)); + eprintln!( + "{:?}", + strip_tag_bodies(strip_inline_sourcemap(&record.expected)) + ); eprintln!("--- ACTUAL ---"); - eprintln!("{:?}", strip_inline_sourcemap(&actual)); + eprintln!("{:?}", strip_tag_bodies(strip_inline_sourcemap(&actual))); } } @@ -141,15 +172,16 @@ fn corpus_parity() { ) .code; - let matched = strip_inline_sourcemap(&actual) == strip_inline_sourcemap(&record.expected); + let matched = strip_tag_bodies(strip_inline_sourcemap(&actual)) + == strip_tag_bodies(strip_inline_sourcemap(&record.expected)); let allowed = INTENTIONAL_DIVERGENCES.contains(&key.as_str()); match (matched, allowed) { (false, false) => regressions.push(format!( " {key}\n input: {:?}\n expected: {:?}\n actual: {:?}", record.input, - strip_inline_sourcemap(&record.expected), - strip_inline_sourcemap(&actual), + strip_tag_bodies(strip_inline_sourcemap(&record.expected)), + strip_tag_bodies(strip_inline_sourcemap(&actual)), )), (true, true) => resolved.push(key), _ => {} From 5ebed8b26994452149813a1193d7aba2627f66b1 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 16:59:34 +0200 Subject: [PATCH 30/50] build: consolidate biome fork pins in workspace dependencies --- Cargo.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 25b15391..76667b46 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,14 @@ oxc_syntax = { git = "https://github.com/withastro/oxc", rev = "8bb526fc0c20beb4 oxc_transformer = { git = "https://github.com/withastro/oxc", rev = "8bb526fc0c20beb4649b223d3ac39851505caa5a" } oxc_sourcemap = "6.0.1" +# Biome dependencies via git, all pinned to the same fork revision +biome_html_parser = { git = "https://github.com/Princesseuh/biome", rev = "2e96281bb1bfb2601d07929de917b6b64030663f" } +biome_html_syntax = { git = "https://github.com/Princesseuh/biome", rev = "2e96281bb1bfb2601d07929de917b6b64030663f" } +biome_js_parser = { git = "https://github.com/Princesseuh/biome", rev = "2e96281bb1bfb2601d07929de917b6b64030663f" } +biome_js_syntax = { git = "https://github.com/Princesseuh/biome", rev = "2e96281bb1bfb2601d07929de917b6b64030663f" } +biome_languages = { git = "https://github.com/Princesseuh/biome", rev = "2e96281bb1bfb2601d07929de917b6b64030663f" } +biome_rowan = { git = "https://github.com/Princesseuh/biome", rev = "2e96281bb1bfb2601d07929de917b6b64030663f" } + # NAPI napi = { version = "3", features = ["tokio_rt"] } napi-build = "2" From 4292fc5ed4444e6f00fe8602c55fe6035c7fda3e Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 16:59:34 +0200 Subject: [PATCH 31/50] fix(astro2tsx): drive props, comments, and separators from the parsed tree --- crates/astro2tsx/src/frontmatter.rs | 64 ++-- crates/astro2tsx/src/printer.rs | 64 +++- crates/astro2tsx/src/props.rs | 364 ++++--------------- crates/astro2tsx/src/render.rs | 518 +++++++++++----------------- crates/astro2tsx/src/utils.rs | 56 +-- 5 files changed, 386 insertions(+), 680 deletions(-) diff --git a/crates/astro2tsx/src/frontmatter.rs b/crates/astro2tsx/src/frontmatter.rs index cf4599de..b697292b 100644 --- a/crates/astro2tsx/src/frontmatter.rs +++ b/crates/astro2tsx/src/frontmatter.rs @@ -1,27 +1,34 @@ -//! Frontmatter post-processing: rewrites top-level `return` statements -//! into `throw ` so the generated TSX type-checks. Astro frontmatter runs -//! inside an implicit function at runtime, so top-level returns are valid -//! Astro syntax — but TS rejects them at the module level. -//! -//! `throw ` is six bytes like `return`, keeping source mapping aligned. +//! Frontmatter runs in an implicit function, so its top-level `return`s are +//! valid Astro but invalid TS; they become `throw `, whose six bytes match +//! `return` and keep source mappings aligned. -use biome_js_parser::{JsParserOptions, parse}; use biome_js_syntax::{AnyJsRoot, JsReturnStatement, JsSyntaxKind}; -use biome_languages::JsFileSource; use biome_rowan::{AstNode, WalkEvent}; -/// Returns the byte offsets (relative to `source`) of every `return` -/// keyword that sits at module scope. Offsets address the start of the -/// keyword, ready for substitution. -pub(crate) fn find_top_level_returns(source: &str) -> Vec { - let parse = parse(source, JsFileSource::astro(), JsParserOptions::default()); - let root: AnyJsRoot = parse.tree(); - let syntax = root.syntax().clone(); +/// `root` must be the parse of `source`. +pub(crate) fn rewrite_top_level_returns(source: &str, root: &AnyJsRoot) -> String { + let offsets = find_top_level_returns(root); + if offsets.is_empty() { + return source.to_string(); + } + let mut out = String::with_capacity(source.len()); + let mut cursor = 0usize; + for offset in offsets { + let offset = offset as usize; + out.push_str(&source[cursor..offset]); + out.push_str("throw "); + cursor = offset + "return".len(); + } + out.push_str(&source[cursor..]); + out +} +/// Byte offsets of every `return` keyword sitting at module scope, ascending. +fn find_top_level_returns(root: &AnyJsRoot) -> Vec { let mut offsets = Vec::new(); let mut function_depth: u32 = 0; - for event in syntax.preorder() { + for event in root.syntax().preorder() { match event { WalkEvent::Enter(node) => { if is_function_like(node.kind()) { @@ -59,28 +66,3 @@ fn is_function_like(kind: JsSyntaxKind) -> bool { | JsSyntaxKind::JS_CONSTRUCTOR_CLASS_MEMBER ) } - -/// Replaces the keyword `return` with `throw ` at every top-level return. -pub(crate) fn rewrite_top_level_returns(source: &str) -> String { - let offsets = find_top_level_returns(source); - if offsets.is_empty() { - return source.to_string(); - } - let bytes = source.as_bytes(); - let mut out = Vec::with_capacity(bytes.len()); - let mut cursor = 0usize; - for offset in offsets { - let offset = offset as usize; - if offset < cursor || offset + b"return".len() > bytes.len() { - continue; - } - if &bytes[offset..offset + b"return".len()] != b"return" { - continue; - } - out.extend_from_slice(&bytes[cursor..offset]); - out.extend_from_slice(b"throw "); - cursor = offset + b"return".len(); - } - out.extend_from_slice(&bytes[cursor..]); - String::from_utf8(out).expect("ASCII substitution must remain valid UTF-8") -} diff --git a/crates/astro2tsx/src/printer.rs b/crates/astro2tsx/src/printer.rs index 9af85288..06c9abdd 100644 --- a/crates/astro2tsx/src/printer.rs +++ b/crates/astro2tsx/src/printer.rs @@ -1,12 +1,14 @@ -//! Internal mutable buffer the renderer writes into. Tracks both the -//! generated TSX bytes and the running list of source-position mappings. +//! Mutable output buffer: generated TSX bytes plus source-position mappings. use biome_rowan::TextRange; use crate::sourcemap::{ExtractedKind, ExtractedTag, GeneratedRange, Mapping}; +use crate::utils::{comment_body_escape, template_text_escape}; -pub(crate) struct Printer { - pub(crate) source: String, +pub(crate) struct Printer<'a> { + pub(crate) source: &'a str, + /// Ranges of `` trivia, ascending, straight from the lexer. + pub(crate) comment_ranges: Vec, pub(crate) output: String, pub(crate) mappings: Vec, pub(crate) frontmatter_range: GeneratedRange, @@ -15,10 +17,11 @@ pub(crate) struct Printer { pub(crate) styles: Vec, } -impl Printer { - pub(crate) fn new(source: &str) -> Self { +impl<'a> Printer<'a> { + pub(crate) fn new(source: &'a str) -> Self { Self { - source: source.to_string(), + source, + comment_ranges: Vec::new(), output: String::new(), mappings: Vec::new(), frontmatter_range: GeneratedRange::default(), @@ -47,8 +50,7 @@ impl Printer { self.mappings.push(Mapping::nil(generated)); } - /// Emits `text` while attaching a per-character mapping back to the - /// source range starting at `original_start`. + /// Emits `text` with per-character mappings starting at `original_start`. pub(crate) fn write_with_mapping(&mut self, text: &str, original_start: u32) { let mut original = original_start; for ch in text.chars() { @@ -58,8 +60,7 @@ impl Printer { } } - /// JSX cannot contain raw `>` or `}`, so emit them inside `{\`...\`}` - /// when they show up in text content. + /// JSX text cannot contain raw `>` or `}`; they emit as `{\`>\`}`. pub(crate) fn write_jsx_text_with_mapping(&mut self, text: &str, original_start: u32) { let mut original = original_start; for ch in text.chars() { @@ -78,12 +79,45 @@ impl Printer { } } - pub(crate) fn record_frontmatter_range(&mut self, range: GeneratedRange) { - self.frontmatter_range = range; + /// Template-body escaping; inserted escapes map to the character they + /// escape, so they never shift later mappings. + pub(crate) fn write_template_text_with_mapping(&mut self, text: &str, original_start: u32) { + let mut original = original_start; + let mut chars = text.chars().peekable(); + while let Some(ch) = chars.next() { + match template_text_escape(ch, chars.peek().copied()) { + Some(escaped) => self.write_mapped_str(escaped, original), + None => { + self.map_to_offset(original); + self.output.push(ch); + } + } + original += ch.len_utf8() as u32; + } + } + + /// JSX-comment-body escaping, with the same mapping guarantee as above. + pub(crate) fn write_comment_body_with_mapping(&mut self, body: &str, original_start: u32) { + let mut original = original_start; + let mut previous = None; + for ch in body.chars() { + match comment_body_escape(previous, ch) { + Some(escaped) => self.write_mapped_str(escaped, original), + None => { + self.map_to_offset(original); + self.output.push(ch); + } + } + previous = Some(ch); + original += ch.len_utf8() as u32; + } } - pub(crate) fn record_body_range(&mut self, range: GeneratedRange) { - self.body_range = range; + fn write_mapped_str(&mut self, text: &str, original: u32) { + for ch in text.chars() { + self.map_to_offset(original); + self.output.push(ch); + } } pub(crate) fn add_script_block( diff --git a/crates/astro2tsx/src/props.rs b/crates/astro2tsx/src/props.rs index d16a14bc..a9bb3130 100644 --- a/crates/astro2tsx/src/props.rs +++ b/crates/astro2tsx/src/props.rs @@ -1,252 +1,115 @@ -//! Detects the `Props` type binding and the `getStaticPaths` export in Astro -//! frontmatter, shaping the synthetic `export default function` signature. +//! Frontmatter analysis shaping the synthetic `export default function` signature. -use biome_js_parser::{JsParserOptions, parse}; use biome_js_syntax::{ AnyJsRoot, JsLanguage, JsSyntaxKind, TsInterfaceDeclaration, TsTypeAliasDeclaration, + TsTypeParameters, }; -use biome_languages::JsFileSource; -use biome_rowan::{AstNode, AstNodeList, SyntaxNode}; +use biome_rowan::{AstNode, AstNodeList, AstSeparatedList, SyntaxNode}; type JsNode = SyntaxNode; #[derive(Debug, Default, Clone)] pub(crate) struct PropsAnalysis { - /// `true` when a top-level `Props` binding (interface, type alias, - /// import, or alias-import) is present. + /// A top-level `Props` binding exists: interface, type alias, or import. pub has_props: bool, - /// The full generic parameter list, e.g. ``. Empty - /// when there are no type parameters. + /// Full generic parameter list, e.g. ``; empty when none. pub generics_decl: String, - /// Bare generic argument names, e.g. ``. Used at the type-application - /// site `Props`. + /// Bare argument names for the application site `Props`, e.g. ``. pub generics_args: String, - /// `true` when the frontmatter exports a top-level `getStaticPaths` - /// declaration. pub has_get_static_paths: bool, } -pub(crate) fn analyze(source: &str) -> PropsAnalysis { - if source.is_empty() { - return PropsAnalysis::default(); - } - let parse = parse(source, JsFileSource::astro(), JsParserOptions::default()); - let root: AnyJsRoot = parse.tree(); - +pub(crate) fn analyze(root: &AnyJsRoot) -> PropsAnalysis { let mut analysis = PropsAnalysis::default(); - for top in module_items(&root) { - let kind = top.kind(); - match kind { - JsSyntaxKind::TS_INTERFACE_DECLARATION => { - if let Some(decl) = TsInterfaceDeclaration::cast_ref(&top) - && let Ok(id) = decl.id() - && id.syntax().text_trimmed() == "Props" - { - analysis.has_props = true; - fill_generics_textually(&mut analysis, source, &top); - } - } - JsSyntaxKind::TS_TYPE_ALIAS_DECLARATION => { - if let Some(decl) = TsTypeAliasDeclaration::cast_ref(&top) - && let Ok(id) = decl.binding_identifier() - && id.syntax().text_trimmed() == "Props" - { - analysis.has_props = true; - fill_generics_textually(&mut analysis, source, &top); - } - } - JsSyntaxKind::JS_IMPORT => { - let text = top.text_trimmed().to_string(); - if import_binds_props(&text) { - analysis.has_props = true; - } - } - _ => {} + for top in module_items(root) { + if let Some(declaration) = type_declaration_in(&top) { + inspect_type_declaration(&mut analysis, &declaration); + } else if top.kind() == JsSyntaxKind::JS_IMPORT && import_binds_props(&top) { + analysis.has_props = true; } if !analysis.has_get_static_paths && exports_get_static_paths(&top) { analysis.has_get_static_paths = true; } } - // The JS parser rejects generic forms real fixtures use, e.g. - // `Props`. - if !analysis.has_props { - text_scan_props_binding(source, &mut analysis); - } - analysis } -/// Brace-balanced extraction of the `<...>` immediately following a -/// keyword + `Props` pair. -fn fill_generics_textually(analysis: &mut PropsAnalysis, source: &str, top: &JsNode) { - let trimmed_range = top.text_trimmed_range(); - let start = u32::from(trimmed_range.start()) as usize; - let end = (u32::from(trimmed_range.end()) as usize).min(source.len()); - if start >= end { - return; - } - let slice = &source[start..end]; - let Some(props_idx) = slice.find("Props") else { - return; - }; - let after_props = props_idx + "Props".len(); - let mut iter = slice[after_props..].bytes().enumerate(); - let mut first_after = None; - for (i, b) in iter.by_ref() { - if !(b as char).is_whitespace() { - first_after = Some((i, b)); - break; - } - } - let Some((relative, b'<')) = first_after else { - return; - }; - let l_angle_at = after_props + relative; - let bytes = slice.as_bytes(); - let mut depth = 1; - let mut i = l_angle_at + 1; - while i < bytes.len() { - match bytes[i] { - b'<' => depth += 1, - b'>' => { - depth -= 1; - if depth == 0 { - break; - } - } - _ => {} - } - i += 1; - } - if depth != 0 { - return; - } - let r_angle_at = i; - analysis.generics_decl = slice[l_angle_at..=r_angle_at].to_string(); - analysis.generics_args = collect_top_level_arg_names(&slice[l_angle_at + 1..r_angle_at]); +/// The interface or type-alias declared by `item`, unwrapping an `export`. +fn type_declaration_in(item: &JsNode) -> Option { + const TYPE_DECLARATIONS: [JsSyntaxKind; 2] = [ + JsSyntaxKind::TS_INTERFACE_DECLARATION, + JsSyntaxKind::TS_TYPE_ALIAS_DECLARATION, + ]; + if TYPE_DECLARATIONS.contains(&item.kind()) { + return Some(item.clone()); + } + if item.kind() == JsSyntaxKind::JS_EXPORT { + return item + .children() + .find(|child| TYPE_DECLARATIONS.contains(&child.kind())); + } + None } -/// Splits `T extends X, P extends Y` on top-level commas (depth-0 brackets -/// only) and returns the leading identifier of each entry, formatted as -/// ``. Returns an empty string if no parameters are recognised. -fn collect_top_level_arg_names(inside: &str) -> String { - let mut args: Vec = Vec::new(); - let bytes = inside.as_bytes(); - let mut depth_angle: i32 = 0; - let mut depth_curly: i32 = 0; - let mut depth_paren: i32 = 0; - let mut depth_square: i32 = 0; - let mut start = 0usize; - for i in 0..=bytes.len() { - let at_end = i == bytes.len(); - let b = if at_end { b',' } else { bytes[i] }; - if !at_end { - match b { - b'<' => depth_angle += 1, - b'>' => depth_angle -= 1, - b'{' => depth_curly += 1, - b'}' => depth_curly -= 1, - b'(' => depth_paren += 1, - b')' => depth_paren -= 1, - b'[' => depth_square += 1, - b']' => depth_square -= 1, - _ => {} - } +fn inspect_type_declaration(analysis: &mut PropsAnalysis, declaration: &JsNode) { + let (name, type_parameters) = match declaration.kind() { + JsSyntaxKind::TS_INTERFACE_DECLARATION => { + let Some(decl) = TsInterfaceDeclaration::cast_ref(declaration) else { + return; + }; + let Ok(id) = decl.id() else { return }; + ( + id.syntax().text_trimmed().to_string(), + decl.type_parameters(), + ) } - let outermost = - depth_angle == 0 && depth_curly == 0 && depth_paren == 0 && depth_square == 0; - if b == b',' && outermost { - let segment = &inside[start..i]; - if let Some(name) = leading_identifier(segment) { - args.push(name.to_string()); - } - start = i + 1; + JsSyntaxKind::TS_TYPE_ALIAS_DECLARATION => { + let Some(decl) = TsTypeAliasDeclaration::cast_ref(declaration) else { + return; + }; + let Ok(id) = decl.binding_identifier() else { + return; + }; + ( + id.syntax().text_trimmed().to_string(), + decl.type_parameters(), + ) } + _ => return, + }; + if name != "Props" { + return; } - if args.is_empty() { - String::new() - } else { - format!("<{}>", args.join(", ")) + analysis.has_props = true; + if let Some(parameters) = type_parameters { + fill_generics(analysis, ¶meters); } } -fn leading_identifier(segment: &str) -> Option<&str> { - let trimmed = segment.trim(); - let bytes = trimmed.as_bytes(); - let mut end = 0; - while end < bytes.len() && is_ident_byte(bytes[end]) { - end += 1; - } - if end == 0 { - None - } else { - Some(&trimmed[..end]) +fn fill_generics(analysis: &mut PropsAnalysis, parameters: &TsTypeParameters) { + let names: Vec = parameters + .items() + .iter() + .filter_map(|parameter| { + let name = parameter.ok()?.name().ok()?; + Some(name.ident_token().ok()?.text_trimmed().to_string()) + }) + .collect(); + if names.is_empty() { + return; } + analysis.generics_decl = parameters.syntax().text_trimmed().to_string(); + analysis.generics_args = format!("<{}>", names.join(", ")); } -/// Last-resort text scan for `interface Props` / `type Props`, used whenever -/// the tree walk found no binding. Records generics if a `<...>` follows. -fn text_scan_props_binding(source: &str, analysis: &mut PropsAnalysis) { - for keyword in ["interface", "type"] { - let mut search_from = 0usize; - while let Some(pos) = source[search_from..].find(keyword) { - let abs_pos = search_from + pos; - let after_kw = abs_pos + keyword.len(); - // `interface` / `type` must be a whole token. - let before = if abs_pos == 0 { - b' ' - } else { - source.as_bytes()[abs_pos - 1] - }; - if is_ident_byte(before) { - search_from = after_kw; - continue; - } - // Skip whitespace then expect `Props` followed by ` ` / `<` / `{`. - let bytes = source.as_bytes(); - let mut i = after_kw; - while i < bytes.len() && (bytes[i] as char).is_whitespace() { - i += 1; - } - if i + "Props".len() <= bytes.len() - && &bytes[i..i + "Props".len()] == b"Props" - && (i + "Props".len() == bytes.len() || !is_ident_byte(bytes[i + "Props".len()])) - { - analysis.has_props = true; - let mut j = i + "Props".len(); - while j < bytes.len() && (bytes[j] as char).is_whitespace() { - j += 1; - } - if j < bytes.len() && bytes[j] == b'<' { - let mut depth = 1; - let l_angle_at = j; - let mut k = j + 1; - while k < bytes.len() { - match bytes[k] { - b'<' => depth += 1, - b'>' => { - depth -= 1; - if depth == 0 { - break; - } - } - _ => {} - } - k += 1; - } - if depth == 0 { - analysis.generics_decl = source[l_angle_at..=k].to_string(); - analysis.generics_args = - collect_top_level_arg_names(&source[l_angle_at + 1..k]); - } - } - return; - } - search_from = after_kw; - } - } +/// Local bindings are the only `JS_IDENTIFIER_BINDING`s in an import, so module +/// specifiers and the pre-`as` name in `Props as Other` can never match. +fn import_binds_props(import: &JsNode) -> bool { + import.descendants().any(|node| { + node.kind() == JsSyntaxKind::JS_IDENTIFIER_BINDING && node.text_trimmed() == "Props" + }) } fn module_items(root: &AnyJsRoot) -> Vec { @@ -264,83 +127,6 @@ fn module_items(root: &AnyJsRoot) -> Vec { } } -fn import_binds_props(import_text: &str) -> bool { - let stripped = strip_comments(import_text); - scan_props_import(&stripped) -} - -fn strip_comments(text: &str) -> String { - let mut out = String::with_capacity(text.len()); - let bytes = text.as_bytes(); - let mut i = 0; - while i < bytes.len() { - if i + 1 < bytes.len() && bytes[i] == b'/' && bytes[i + 1] == b'/' { - while i < bytes.len() && bytes[i] != b'\n' { - i += 1; - } - } else if i + 1 < bytes.len() && bytes[i] == b'/' && bytes[i + 1] == b'*' { - i += 2; - while i + 1 < bytes.len() && !(bytes[i] == b'*' && bytes[i + 1] == b'/') { - i += 1; - } - i = i.saturating_add(2); - } else { - out.push(bytes[i] as char); - i += 1; - } - } - out -} - -fn scan_props_import(text: &str) -> bool { - let bytes = text.as_bytes(); - let needle = b"Props"; - let mut i = 0; - while i + needle.len() <= bytes.len() { - if &bytes[i..i + needle.len()] == needle { - let before = if i == 0 { b' ' } else { bytes[i - 1] }; - let after = if i + needle.len() < bytes.len() { - bytes[i + needle.len()] - } else { - b' ' - }; - if !is_ident_byte(before) && !is_ident_byte(after) { - // `{ Props as Other }` binds `Other`, not `Props`. - let after_pos = i + needle.len(); - if !next_token_is_as(bytes, after_pos) { - return true; - } - } - } - i += 1; - } - false -} - -fn next_token_is_as(bytes: &[u8], from: usize) -> bool { - let mut j = from; - while j < bytes.len() && bytes[j].is_ascii_whitespace() { - j += 1; - } - if j + 2 > bytes.len() { - return false; - } - if &bytes[j..j + 2] == b"as" { - // Ensure it's the keyword `as`, not an identifier prefix. - let after = if j + 2 < bytes.len() { - bytes[j + 2] - } else { - b' ' - }; - return !is_ident_byte(after); - } - false -} - -fn is_ident_byte(b: u8) -> bool { - b.is_ascii_alphanumeric() || b == b'_' || b == b'$' -} - /// Detects an `export` binding `getStaticPaths`, including `export { x as getStaticPaths }`. fn exports_get_static_paths(node: &JsNode) -> bool { if node.kind() != JsSyntaxKind::JS_EXPORT { diff --git a/crates/astro2tsx/src/render.rs b/crates/astro2tsx/src/render.rs index c9c5a32a..c47741bf 100644 --- a/crates/astro2tsx/src/render.rs +++ b/crates/astro2tsx/src/render.rs @@ -3,14 +3,14 @@ use biome_html_syntax::{ AnyAstroDirective, AnyAstroFrontmatterElement, AnyHtmlAttribute, AnyHtmlAttributeInitializer, AnyHtmlComponentObjectName, AnyHtmlContent, AnyHtmlElement, AnyHtmlTagName, - AnyHtmlTextExpression, AstroFrontmatterElement, HtmlAttribute, HtmlElement, HtmlRoot, - HtmlSelfClosingElement, HtmlSingleTextExpression, HtmlSpreadAttribute, + AnyHtmlTextExpression, HtmlAttribute, HtmlElement, HtmlRoot, HtmlSelfClosingElement, + HtmlSingleTextExpression, HtmlSpreadAttribute, }; -use biome_js_parser::{JsOffsetParse, JsParserOptions, parse_js_with_offset}; +use biome_js_parser::{JsOffsetParse, JsParserOptions, parse, parse_js_with_offset}; use biome_js_syntax::JsSyntaxKind; use biome_languages::JsFileSource; use biome_languages::javascript::JsEmbeddingKind; -use biome_rowan::{AstNode, AstNodeList, TextRange, TextSize}; +use biome_rowan::{AstNode, AstNodeList, Direction, TextRange, TextSize}; use crate::ConvertOptions; use crate::frontmatter::rewrite_top_level_returns; @@ -18,73 +18,76 @@ use crate::printer::{Printer, range_start}; use crate::props::{PropsAnalysis, analyze as analyze_props}; use crate::sourcemap::GeneratedRange; use crate::utils::{ - ScriptKind, classify_script_type, encode_double_quote, escape_braces, escape_text, - is_html_event_attribute, is_valid_tsx_attribute_name, tsx_component_name, + ScriptKind, classify_script_type, comment_needs_leading_space, encode_double_quote, + escape_comment_body, is_html_event_attribute, is_valid_tsx_attribute_name, tsx_component_name, }; const TSX_PREFIX: &str = "/* @jsxImportSource astro */\n\n"; pub(crate) fn render_root(printer: &mut Printer, root: HtmlRoot, options: &ConvertOptions) { + printer.comment_ranges = comment_trivia_ranges(&root); printer.map_nil(); printer.write(TSX_PREFIX); let frontmatter = root.frontmatter(); let body = root.html(); - let props_analysis = frontmatter - .as_ref() - .and_then(extract_frontmatter_text) - .map(|s| analyze_props(&s)) - .unwrap_or_default(); + let content = frontmatter.as_ref().and_then(frontmatter_content); + let mut props_analysis = PropsAnalysis::default(); + let mut rewritten: Option<(String, u32)> = None; + if let Some((text, start)) = &content + && !text.is_empty() + { + let parse = parse(text, JsFileSource::astro(), JsParserOptions::default()); + let js_root = parse.tree(); + props_analysis = analyze_props(&js_root); + rewritten = Some((rewrite_top_level_returns(text, &js_root), *start)); + } - if let Some(frontmatter) = &frontmatter { - emit_frontmatter(printer, frontmatter); + if let Some(node) = &frontmatter { + emit_frontmatter(printer, node, rewritten.as_ref()); } - // The body is non-empty whenever there's a parsed child OR the source - // contains a top-level HTML comment that the parser stashed as trivia. let body_text_start = body_text_start_offset(&frontmatter); - let body_text_end = printer.source.len() as u32; + // A childless body still needs its `` when comment trivia remains. let has_body_children = body.iter().next().is_some() - || slice_has_html_comment(&printer.source, body_text_start, body_text_end); + || printer + .comment_ranges + .iter() + .any(|range| u32::from(range.start()) >= body_text_start); let body_start; if has_body_children { - if frontmatter.is_some() { - // Without a `;`, the body's `` parses as a continuation - // of the frontmatter's last expression (`Astro.props < Fragment >`). - if needs_trailing_separator(&printer.output) { - printer.map_nil(); - printer.write("{};"); - } + // Unterminated frontmatter would swallow the body as `x < Fragment > ...`. + let frontmatter_needs_terminator = match &frontmatter { + Some(AnyAstroFrontmatterElement::AstroFrontmatterElement(_)) => content + .as_ref() + .is_some_and(|(text, _)| !text.trim().is_empty()), + Some(AnyAstroFrontmatterElement::AstroBogusFrontmatter(_)) => true, + None => false, + }; + if frontmatter_needs_terminator { + printer.map_nil(); + printer.write("{};"); } printer.map_nil(); printer.write("\n"); body_start = printer.position(); - let mut prev_end: Option = None; - let body_only_has_comments = body.iter().next().is_none(); + let mut prev_end = body_text_start; for element in body.iter() { let element_range = element.range(); - let element_start = u32::from(element_range.start()); - if let Some(prev) = prev_end { - emit_source_gap(printer, prev, element_start); - } + emit_source_gap(printer, prev_end, u32::from(element_range.start())); render_element(printer, element); - prev_end = Some(u32::from(element_range.end())); - } - - if body_only_has_comments { - emit_source_gap(printer, body_text_start, printer.source.len() as u32); - } else if let Some(prev) = prev_end { - emit_source_gap(printer, prev, printer.source.len() as u32); + prev_end = u32::from(element_range.end()); } + emit_source_gap(printer, prev_end, printer.source.len() as u32); // One byte past EOF, so trailing whitespace still has a mapping. printer.map_to_offset(printer.source.len() as u32); printer.write("\n"); let body_end = printer.position(); - printer.record_body_range(GeneratedRange::new(body_start, body_end)); + printer.body_range = GeneratedRange::new(body_start, body_end); printer.map_nil(); printer.write("\n"); @@ -94,7 +97,7 @@ pub(crate) fn render_root(printer: &mut Printer, root: HtmlRoot, options: &Conve printer.map_nil(); printer.write("\n"); } - printer.record_body_range(GeneratedRange::new(printer.position(), printer.position())); + printer.body_range = GeneratedRange::new(printer.position(), printer.position()); } let component_name = tsx_component_name(options.filename.as_deref()); @@ -113,12 +116,13 @@ fn body_text_start_offset(frontmatter: &Option) -> u 0 } -fn extract_frontmatter_text(node: &AnyAstroFrontmatterElement) -> Option { +/// The frontmatter's JS text (trivia included) and its source offset. +fn frontmatter_content(node: &AnyAstroFrontmatterElement) -> Option<(String, u32)> { if let AnyAstroFrontmatterElement::AstroFrontmatterElement(frontmatter) = node && let Ok(content) = frontmatter.content() && let Some(token) = content.content_token() { - return Some(token.text_trimmed().to_string()); + return Some((token.text().to_string(), range_start(token.text_range()))); } None } @@ -180,20 +184,21 @@ fn emit_default_export(printer: &mut Printer, component: &str, analysis: &PropsA } } -fn needs_trailing_separator(output: &str) -> bool { - let trimmed = output.trim_end(); - if trimmed.len() <= TSX_PREFIX.len() + 1 { - return false; - } - !trimmed.ends_with(';') -} - -fn emit_frontmatter(printer: &mut Printer, frontmatter: &AnyAstroFrontmatterElement) { +fn emit_frontmatter( + printer: &mut Printer, + frontmatter: &AnyAstroFrontmatterElement, + rewritten: Option<&(String, u32)>, +) { let frontmatter_start = printer.position(); match frontmatter { - AnyAstroFrontmatterElement::AstroFrontmatterElement(node) => { - emit_frontmatter_element(printer, node); + AnyAstroFrontmatterElement::AstroFrontmatterElement(_) => { + printer.map_to_offset(0); + if let Some((text, start)) = rewritten { + printer.write_with_mapping(text, *start); + } + printer.map_nil(); + printer.write("\n"); } AnyAstroFrontmatterElement::AstroBogusFrontmatter(_) => { // Recovery node: every byte maps to offset 0, not to its own position. @@ -203,24 +208,7 @@ fn emit_frontmatter(printer: &mut Printer, frontmatter: &AnyAstroFrontmatterElem } let frontmatter_end = printer.position(); - printer.record_frontmatter_range(GeneratedRange::new(frontmatter_start, frontmatter_end)); -} - -fn emit_frontmatter_element(printer: &mut Printer, node: &AstroFrontmatterElement) { - printer.map_to_offset(0); - if let Ok(content) = node.content() - && let Some(content_token) = content.content_token() - { - let range = content_token.text_range(); - let text = slice_source(&printer.source, range); - if !text.is_empty() { - let rewritten = rewrite_top_level_returns(&text); - printer.write_with_mapping(&rewritten, range_start(range)); - } - } - // Separates the frontmatter from the body that follows. - printer.map_nil(); - printer.write("\n"); + printer.frontmatter_range = GeneratedRange::new(frontmatter_start, frontmatter_end); } fn render_element(printer: &mut Printer, element: AnyHtmlElement) { @@ -239,8 +227,8 @@ fn render_element(printer: &mut Printer, element: AnyHtmlElement) { // preserve the original text and let downstream tooling surface // diagnostics. let range = element.range(); - let text = slice_source(&printer.source, range); - printer.write_with_mapping(&text, range_start(range)); + let text = slice_source(printer.source, range); + printer.write_with_mapping(text, range_start(range)); } } } @@ -264,10 +252,9 @@ fn render_content(printer: &mut Printer, content: AnyHtmlContent) { }; let original_start = u32::from(token.text_trimmed_range().start()); let raw = token.text_trimmed().to_string(); - let escaped = escape_text(&raw); printer.map_nil(); printer.write("{`"); - printer.write_with_mapping(&escaped, original_start); + printer.write_template_text_with_mapping(&raw, original_start); printer.map_nil(); printer.write("`}"); } @@ -286,13 +273,13 @@ fn render_text_expression(printer: &mut Printer, expression: AnyHtmlTextExpressi // `{{ … }}` is Vue's syntax — Astro doesn't use it, but we // accept it for HTML mode by passing through the raw text. let range = node.range(); - let text = slice_source(&printer.source, range); - printer.write_with_mapping(&text, range_start(range)); + let text = slice_source(printer.source, range); + printer.write_with_mapping(text, range_start(range)); } AnyHtmlTextExpression::HtmlBogusTextExpression(node) => { let range = node.range(); - let text = slice_source(&printer.source, range); - printer.write_with_mapping(&text, range_start(range)); + let text = slice_source(printer.source, range); + printer.write_with_mapping(text, range_start(range)); } AnyHtmlTextExpression::AnySvelteBlock(_) => { // Not relevant for Astro. @@ -320,11 +307,10 @@ fn render_single_text_expression(printer: &mut Printer, node: HtmlSingleTextExpr if expression.html_literal_token().is_ok() { let original_start = u32::from(l_curly_range.end()); // Whitespace touching `{` is trivia, which the literal token drops. - let body = slice_source( - &printer.source, + let raw = slice_source( + printer.source, TextRange::new(l_curly_range.end(), r_curly_range.start()), ); - let raw = body.as_str(); if raw.is_empty() { printer.map_nil(); printer.write("(void 0)"); @@ -382,35 +368,59 @@ fn implicit_fragment_spans(parse: &JsOffsetParse, len: usize) -> Vec<(usize, usi spans } -/// Rewrites `` as `{/** x*/}`, matching what the printer emits, so a -/// body carrying HTML comments can be test-parsed before it is emitted. +/// The HTML lexer reads an expression body as one token, so its `` +/// comments must be found by scan; an unterminated comment stays text. +fn split_on_html_comments(text: &str) -> Vec<(usize, &str, bool)> { + let mut segments = Vec::new(); + let mut cursor = 0usize; + while let Some(found) = text[cursor..].find("") else { + break; + }; + let body_end = body_start + close; + if comment_start > cursor { + segments.push((cursor, &text[cursor..comment_start], false)); + } + segments.push((body_start, &text[body_start..body_end], true)); + cursor = body_end + "-->".len(); + } + if cursor < text.len() { + segments.push((cursor, &text[cursor..], false)); + } + segments +} + +/// Translates comments exactly as emission does, so a passing test-parse +/// guarantees the emitted body parses too. fn html_comments_as_jsx(text: &str) -> String { - let bytes = text.as_bytes(); let mut out = String::with_capacity(text.len()); - let mut i = 0usize; - while i < bytes.len() { - if i + 4 <= bytes.len() && &bytes[i..i + 4] == b"" { - end += 1; - } - if end + 3 > bytes.len() { - out.push_str(&text[i..]); - return out; - } + for (_, slice, is_comment) in split_on_html_comments(text) { + if is_comment { out.push_str("{/**"); - out.push_str(&escape_braces(&text[body_start..end])); + if comment_needs_leading_space(slice) { + out.push(' '); + } + out.push_str(&escape_comment_body(slice)); out.push_str("*/}"); - i = end + 3; } else { - out.push(bytes[i] as char); - i += 1; + out.push_str(slice); } } out } +fn emit_expression_with_comments(printer: &mut Printer, raw: &str, original_start: u32) { + for (offset, slice, is_comment) in split_on_html_comments(raw) { + if is_comment { + emit_html_comment(printer, slice, original_start + offset as u32); + } else { + printer.write_with_mapping(slice, original_start + offset as u32); + } + } +} + fn emit_expression_body(printer: &mut Printer, raw: &str, original_start: u32) { let parse = parse_expression_body(raw, original_start); if parse.diagnostics().is_empty() { @@ -438,7 +448,7 @@ fn emit_expression_body(printer: &mut Printer, raw: &str, original_start: u32) { .diagnostics() .is_empty() { - emit_with_comment_translation(printer, raw, original_start); + emit_expression_with_comments(printer, raw, original_start); return; } printer.write_with_mapping(raw, original_start); @@ -462,25 +472,28 @@ fn render_html_element(printer: &mut Printer, node: HtmlElement) { // the result is invalid TSX within that span alone. if open_r_angle.is_none() { let range = node.syntax().text_trimmed_range(); - let text = slice_source(&printer.source, range); - printer.write_with_mapping(&text, range_start(range)); + let text = slice_source(printer.source, range); + printer.write_with_mapping(text, range_start(range)); return; } let tag_name = tag_name_text(&name); - let attributes = opening.attributes(); + let attributes: Vec = opening.attributes().iter().collect(); emit_open_tag( printer, &tag_name, u32::from(open_l_angle.text_trimmed_range().start()), u32::from(name.range().start()), - attributes.iter(), + &attributes, ); let open_r_angle = open_r_angle.expect("checked above"); let r_angle_start = u32::from(open_r_angle.text_trimmed_range().start()); - let attrs_end = open_tag_attrs_end(&name, &attributes); + let attrs_end = attributes + .last() + .map(|attr| u32::from(attr.range().end())) + .unwrap_or_else(|| u32::from(name.range().end())); emit_intra_tag_space(printer, attrs_end, r_angle_start); printer.map_to_offset(r_angle_start); printer.write(">"); @@ -492,8 +505,7 @@ fn render_html_element(printer: &mut Printer, node: HtmlElement) { let body_start = printer.position(); let opening_end = u32::from(open_r_angle.text_trimmed_range().end()); - let attrs_for_classify = attributes_to_iter(&node); - let element_is_raw = attrs_for_classify + let element_is_raw = attributes .iter() .any(|a| attribute_key(a).as_deref() == Some("is:raw")); // Script and style win over `is:raw` when classifying the body. @@ -512,11 +524,10 @@ fn render_html_element(printer: &mut Printer, node: HtmlElement) { let inner_start = opening_end; let inner_end = closing_inner_start.unwrap_or_else(|| u32::from(node.range().end())); if inner_end > inner_start { - let raw = printer.source[inner_start as usize..inner_end as usize].to_string(); - let escaped = escape_text(&raw); + let raw = &printer.source[inner_start as usize..inner_end as usize]; printer.map_nil(); printer.write("{`"); - printer.write_with_mapping(&escaped, inner_start); + printer.write_template_text_with_mapping(raw, inner_start); printer.map_nil(); printer.write("`}"); } @@ -543,18 +554,19 @@ fn render_html_element(printer: &mut Printer, node: HtmlElement) { // downstream consumers — `tsxRanges.scripts[].position` etc. let inner_range = inner_range(&node); if let Some((start, end)) = inner_range { - let content = slice_source(&printer.source, TextRange::new(start.into(), end.into())); + let content = + slice_source(printer.source, TextRange::new(start.into(), end.into())).to_string(); if is_script { printer.add_script_block( GeneratedRange::new(body_start, body_end), content, - classify_script_label(&attributes_to_iter(&node)), + classify_script_label(&attributes), ); } else { printer.add_style_block( GeneratedRange::new(body_start, body_end), content, - style_lang_label(&attributes_to_iter(&node)), + style_lang_label(&attributes), ); } } @@ -589,13 +601,6 @@ fn render_html_element(printer: &mut Printer, node: HtmlElement) { // Unclosed tags are unsupported, so no synthetic `
` is emitted. } -fn attributes_to_iter(node: &HtmlElement) -> Vec { - let Ok(opening) = node.opening_element() else { - return Vec::new(); - }; - opening.attributes().iter().collect() -} - fn classify_script_label(attrs: &[AnyHtmlAttribute]) -> &'static str { let type_value = find_attr_value(attrs, "type"); let is_raw = attrs @@ -699,7 +704,7 @@ fn render_self_closing_element(printer: &mut Printer, node: HtmlSelfClosingEleme let Ok(r_angle) = node.r_angle_token() else { return; }; - let attributes = node.attributes(); + let attributes: Vec = node.attributes().iter().collect(); let tag_name = tag_name_text(&name); emit_open_tag( @@ -707,26 +712,20 @@ fn render_self_closing_element(printer: &mut Printer, node: HtmlSelfClosingEleme &tag_name, u32::from(l_angle.text_trimmed_range().start()), u32::from(name.range().start()), - attributes.iter(), + &attributes, ); - // Emit any whitespace trivia between the last attribute (or tag name) - // and the `/>` so `` and `` are both preserved. We look - // *before* the slash, since the slash itself sits between the - // whitespace and the `>`. + // The probe point sits before the slash: `` keeps its space, `` stays tight. let r_angle_start = u32::from(r_angle.text_trimmed_range().start()); let pre_slash = node .slash_token() .map(|s| u32::from(s.text_trimmed_range().start())) .unwrap_or(r_angle_start); - let trivia_start = self_closing_attrs_end(&node); - if trivia_start < pre_slash { - let slice_bytes = &printer.source[trivia_start as usize..pre_slash as usize]; - if slice_bytes.chars().any(|c| c.is_whitespace()) { - printer.map_to_offset(trivia_start); - printer.write(" "); - } - } + let attrs_end = attributes + .last() + .map(|attr| u32::from(attr.range().end())) + .unwrap_or_else(|| u32::from(name.range().end())); + emit_intra_tag_space(printer, attrs_end, pre_slash); printer.map_to_offset(r_angle_start); printer.write("/>"); } @@ -793,79 +792,34 @@ fn render_fragment_shorthand(printer: &mut Printer, node: &HtmlElement) { } } -/// Position immediately after the last attribute (or the tag name when -/// there are no attributes). Used to detect whether there's whitespace -/// between the attributes and the closing `>`/`/>` of the open tag. -fn open_tag_attrs_end( - name: &AnyHtmlTagName, - attributes: &biome_html_syntax::HtmlAttributeList, -) -> u32 { - let attrs: Vec<_> = attributes.iter().collect(); - if let Some(last) = attrs.last() { - return u32::from(last.range().end()); - } - u32::from(name.range().end()) -} - -/// Emits a single space when the source has whitespace between two positions -/// in a tag header. JSX collapses runs of spaces, so `` becomes ``. +/// Anything between trimmed tag-header tokens is whitespace or comment +/// trivia; both collapse to the single space JSX expects. fn emit_intra_tag_space(printer: &mut Printer, from: u32, to: u32) { - if from >= to { - return; - } - let from_usize = from as usize; - let to_usize = (to as usize).min(printer.source.len()); - if from_usize >= to_usize { - return; - } - let slice = &printer.source[from_usize..to_usize]; - if slice.chars().any(|c| c.is_whitespace()) { + if from < to { printer.map_to_offset(from); printer.write(" "); } } -fn self_closing_attrs_end(node: &HtmlSelfClosingElement) -> u32 { - let attrs: Vec<_> = node.attributes().iter().collect(); - if let Some(last) = attrs.last() { - return u32::from(last.range().end()); - } - if let Ok(name) = node.name() { - return u32::from(name.range().end()); - } - 0 -} - -fn emit_open_tag( +fn emit_open_tag( printer: &mut Printer, tag_name: &str, angle_start: u32, name_start: u32, - attributes: I, -) where - I: IntoIterator, -{ + attrs: &[AnyHtmlAttribute], +) { printer.map_to_offset(angle_start); printer.write("<"); printer.map_to_offset(name_start); printer.write(tag_name); - let attrs: Vec = attributes.into_iter().collect(); - let mut invalid: Vec = Vec::new(); + let mut invalid: Vec<&AnyHtmlAttribute> = Vec::new(); - for attr in &attrs { - if matches!(attr, AnyHtmlAttribute::HtmlBogusAttribute(_)) { - // In Astro mode the parser misclassifies `:foo=""` / `@foo=""` as Vue - // directives, so their source text has to be recovered by hand. - if let Some(rec) = recover_bogus_attribute(&printer.source, attr) { - invalid.push(rec); - } - continue; - } + for attr in attrs { if let Some(name) = attribute_key(attr) && !is_valid_tsx_attribute_name(&name) { - invalid.push(InvalidAttr::Node(attr.clone())); + invalid.push(attr); continue; } emit_attribute(printer, attr); @@ -875,67 +829,14 @@ fn emit_open_tag( printer.map_nil(); printer.write(" {...{"); let mut wrote_entry = false; - for attr in invalid.iter() { - match attr { - InvalidAttr::Node(node) => { - wrote_entry |= emit_invalid_attribute(printer, node, wrote_entry); - } - InvalidAttr::Recovered { key, value } => { - if wrote_entry { - printer.map_nil(); - printer.write(","); - } - printer.map_nil(); - printer.write(&format!("{key}:{value}")); - wrote_entry = true; - } - } + for attr in invalid { + wrote_entry |= emit_invalid_attribute(printer, attr, wrote_entry); } printer.map_nil(); printer.write("}}"); } } -enum InvalidAttr { - Node(AnyHtmlAttribute), - Recovered { key: String, value: String }, -} - -/// Reconstructs `:class="hey"` (or any other bogus-parsed attribute) -/// from its raw source text. Returns `None` for shapes we can't safely -/// route into the spread block; the attribute is then dropped. -fn recover_bogus_attribute(source: &str, attr: &AnyHtmlAttribute) -> Option { - let range = attr.range(); - let start = u32::from(range.start()) as usize; - let end = u32::from(range.end()) as usize; - if start >= end || end > source.len() { - return None; - } - let text = source[start..end].trim_end(); - let (key, value) = match text.find('=') { - Some(idx) => { - let raw_key = text[..idx].trim(); - let raw_value = text[idx + 1..].trim(); - let key = format!("\"{}\"", raw_key.replace('"', "\\\"")); - let value = if raw_value.starts_with('"') || raw_value.starts_with('\'') { - raw_value.to_string() - } else if raw_value.starts_with('{') && raw_value.ends_with('}') { - // Expression form: `{foo}` becomes `(foo)` so the spread - // object literal stays a valid expression. - format!("({})", &raw_value[1..raw_value.len() - 1]) - } else { - format!("\"{}\"", raw_value.replace('"', "\\\"")) - }; - (key, value) - } - None => { - let key = format!("\"{}\"", text.trim().replace('"', "\\\"")); - (key, "true".to_string()) - } - }; - Some(InvalidAttr::Recovered { key, value }) -} - fn emit_attribute(printer: &mut Printer, attr: &AnyHtmlAttribute) { match attr { AnyHtmlAttribute::HtmlAttribute(attr_node) => emit_html_attribute(printer, attr_node), @@ -1110,10 +1011,10 @@ fn emit_spread_attribute(printer: &mut Printer, spread: &HtmlSpreadAttribute) { fn emit_astro_directive(printer: &mut Printer, directive: &AnyAstroDirective) { // Astro directives are valid TSX attributes because JSX supports `:` namespaces. let range = directive.range(); - let text = slice_source(&printer.source, range); + let text = slice_source(printer.source, range); printer.map_nil(); printer.write(" "); - printer.write_with_mapping(&text, range_start(range)); + printer.write_with_mapping(text, range_start(range)); } /// Returns whether an entry was written; a skipped entry must not be separated. @@ -1138,8 +1039,11 @@ fn emit_invalid_attribute( printer.map_nil(); printer.write(","); } - printer.map_to_offset(key_start); - printer.write(&format!("\"{key_text}\"")); + printer.map_nil(); + printer.write("\""); + printer.write_with_mapping(&key_text, key_start); + printer.map_nil(); + printer.write("\""); match attr_node.initializer() { None => { @@ -1253,85 +1157,79 @@ fn inner_range(node: &HtmlElement) -> Option<(u32, u32)> { } } -/// Copies `source[from..to]` into the output with per-byte mappings, turning -/// embedded `` into `{/** ... */}` so the gap stays valid TSX. -fn emit_source_gap(printer: &mut Printer, from: u32, to: u32) { - if to <= from { - return; +/// HTML comments never become nodes; the lexer stores them as token trivia. +fn comment_trivia_ranges(root: &HtmlRoot) -> Vec { + let mut ranges = Vec::new(); + for token in root + .syntax() + .descendants_with_tokens(Direction::Next) + .filter_map(|element| element.into_token()) + { + for piece in token + .leading_trivia() + .pieces() + .chain(token.trailing_trivia().pieces()) + { + if piece.is_comments() { + ranges.push(piece.text_range()); + } + } } - let from_usize = from as usize; - let to_usize = (to as usize).min(printer.source.len()); - if from_usize >= to_usize { + ranges +} + +/// Emits `source[from..to]`, rewriting `` to `{/** */}` for TSX. +fn emit_source_gap(printer: &mut Printer, from: u32, to: u32) { + let source = printer.source; + let to = (to as usize).min(source.len()); + let mut cursor = from as usize; + if to <= cursor { return; } - let slice = printer.source[from_usize..to_usize].to_string(); - emit_with_comment_translation(printer, &slice, from); -} -fn emit_with_comment_translation(printer: &mut Printer, slice: &str, base_offset: u32) { - let bytes = slice.as_bytes(); - let mut i = 0usize; - while i < bytes.len() { - if i + 4 <= bytes.len() && &bytes[i..i + 4] == b"" { - end += 1; - } - if end + 3 > bytes.len() { - // Emitted as plain text so no content is dropped. - let chunk = &slice[i..]; - printer.write_with_mapping(chunk, base_offset + i as u32); - return; - } - let body = &slice[body_start..end]; - let original_offset = base_offset + body_start as u32; - emit_html_comment(printer, body, original_offset); - i = end + 3; - } else { - // Emit a maximal non-comment run, mapping byte-by-byte. - let chunk_start = i; - while i < bytes.len() && !(i + 4 <= bytes.len() && &bytes[i..i + 4] == b"")) + { + Some(body) => emit_html_comment(printer, body, start as u32 + 4), + // An unterminated comment passes through so no content is dropped. + None => printer.write_with_mapping(text, start as u32), + } + cursor = end; } + printer.write_with_mapping(&source[cursor..to], cursor as u32); } fn emit_html_comment(printer: &mut Printer, body: &str, original_offset: u32) { printer.map_nil(); printer.write("{/**"); - // Without a space, `{/**/}` would close the comment immediately. - let needs_leading_space = body.chars().next().is_none_or(|c| !c.is_whitespace()); - if needs_leading_space { + if comment_needs_leading_space(body) { printer.write(" "); } - let escaped = escape_braces(body); - printer.write_with_mapping(&escaped, original_offset); + printer.write_comment_body_with_mapping(body, original_offset); printer.map_nil(); printer.write("*/}"); } -/// Returns true when the source between `from` and `to` contains an HTML -/// comment that the parser stored as token trivia. -fn slice_has_html_comment(source: &str, from: u32, to: u32) -> bool { - let from_usize = from as usize; - let to_usize = (to as usize).min(source.len()); - if from_usize >= to_usize { - return false; - } - source[from_usize..to_usize].contains("","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n{/** \\\\{
Not JSX!
\\\\}*/}\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n{/** \\\\{
Not JSX!
\\\\}*/}\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"escape.ts","name":"always inserts space before comment","input":"","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n{/** /
Error?
*/}\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n{/** /
Error?
*/}\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"escape.ts","name":"simple escapes star slashes (*/)","input":"","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n{/** *\\/
Evil comment
*/}\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n{/** *\\/
Evil comment
*/}\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"escape.ts","name":"multiple escapes star slashes (*/)","input":"","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n{/** ***\\/*\\/**\\/*\\/*\\/*\\/
Even more evil comment
*/}\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n{/** ***\\/*\\/**\\/*\\/*\\/*\\/
Even more evil comment
*/}\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"escape.ts","name":"does not escape tag opening unnecessarily","input":"
\n\n
\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n
\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"escape.ts","name":"does not escape tag opening unnecessarily II","input":"
\n\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n
\n
\n
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n
\n
\n
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"escape.ts","name":"does not escape tag opening unnecessarily III","input":"
{[].map((something) =>
)}
","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n
{[].map((something) =>
)
}
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n
{[].map((something) =>
)
}
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"literal-style-tag.ts","name":"preserve style tag position I","input":"

Hello world!

\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n

Hello world!

\n\n
\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n

Hello world!

\n\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"literal-style-tag.ts","name":"preserve style tag position II","input":"\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"literal-style-tag.ts","name":"preserve style tag position III","input":"\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"literal-style-tag.ts","name":"preserve style tag position IV","input":"
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n
\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n
\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"literal-style-tag.ts","name":"preserve style tag position V","input":"
","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n
\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n
\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"meta.ts","name":"return ranges","input":"---\nconsole.log(\"Hello!\")\n---\n\n
","options":{"sourcemap":"external"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\nconsole.log(\"Hello!\")\n\n{};\n
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"meta.ts","name":"return ranges - no frontmatter","input":"
","options":{"sourcemap":"external"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\n
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"meta.ts","name":"return proper ranges with multibyte characters","input":"---\n🦄\n---\n\n
","options":{"sourcemap":"external"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\n🦄\n\n{};\n
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"meta.ts","name":"extract scripts","input":"
","options":{"sourcemap":"external"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\n
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"meta.ts","name":"extract styles","input":"
","options":{"sourcemap":"external"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\n
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"meta.ts","name":"extract scripts and styles with multibyte characters","input":"","options":{"sourcemap":"external"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"meta.ts","name":"extract scripts with multibyte characters II","input":"🀄✂🇸🇪👩🏻‍❤️‍👩🏽🀄✂🇸🇪👩🏻‍❤️‍👩🏽
","options":{"sourcemap":"external"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\n🀄✂🇸🇪👩🏻‍❤️‍👩🏽🀄✂🇸🇪👩🏻‍❤️‍👩🏽
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"nested-generics.ts","name":"handles plain aliases","input":"---\ninterface LocalImageProps {}\ntype Props = LocalImageProps;\n---","options":{"filename":"index.astro","sourcemap":"inline"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\ninterface LocalImageProps {}\ntype Props = LocalImageProps;\n\n\nexport default function Index__AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiaW5kZXguYXN0cm8iXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi0tLVxuaW50ZXJmYWNlIExvY2FsSW1hZ2VQcm9wcyB7fVxudHlwZSBQcm9wcyA9IExvY2FsSW1hZ2VQcm9wcztcbi0tLSJdLAogICJtYXBwaW5ncyI6ICI7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDNUIsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzdCLEFBQUcsQUFISDtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOyIsCiAgIm5hbWVzIjogW10KfQ=="} -{"file":"nested-generics.ts","name":"handles aliases with nested generics","input":"---\ninterface LocalImageProps {\n src: Promise<{ default: string }>;\n}\n\ntype Props = LocalImageProps;\n---","options":{"filename":"index.astro","sourcemap":"inline"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\ninterface LocalImageProps {\n src: Promise<{ default: string }>;\n}\n\ntype Props = LocalImageProps;\n\n\nexport default function Index__AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiaW5kZXguYXN0cm8iXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi0tLVxuaW50ZXJmYWNlIExvY2FsSW1hZ2VQcm9wcyB7XG4gIHNyYzogUHJvbWlzZVx1MDAzY3sgZGVmYXVsdDogc3RyaW5nIH1cdTAwM2U7XG59XG5cbnR5cGUgUHJvcHMgPSBMb2NhbEltYWdlUHJvcHM7XG4tLS0iXSwKICAibWFwcGluZ3MiOiAiOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUMzQixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNwQyxDQUFDO0FBQ0Q7QUFDQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDN0IsQUFBRyxBQU5IO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7IiwKICAibmFtZXMiOiBbXQp9"} -{"file":"nested-generics.ts","name":"gracefully handles Image props","input":"---\ninterface LocalImageProps\n\textends Omit,\n\t\tOmit,\n\t\tPick {\n\tsrc: ImageMetadata | Promise<{ default: ImageMetadata }>;\n\t/** Defines an alternative text description of the image. Set to an empty string (alt=\"\") if the image is not a key part of the content (it's decoration or a tracking pixel). */\n\talt: string;\n\tsizes: HTMLImageElement['sizes'];\n\twidths: number[];\n\tformats?: OutputFormat[];\n}\ninterface RemoteImageProps\n\textends Omit,\n\t\tTransformOptions,\n\t\tPick {\n\tsrc: string;\n\t/** Defines an alternative text description of the image. Set to an empty string (alt=\"\") if the image is not a key part of the content (it's decoration or a tracking pixel). */\n\talt: string;\n\tsizes: HTMLImageElement['sizes'];\n\twidths: number[];\n\taspectRatio: TransformOptions['aspectRatio'];\n\tformats?: OutputFormat[];\n\tbackground: TransformOptions['background'];\n}\nexport type Props = LocalImageProps | RemoteImageProps;\n---","options":{"filename":"index.astro","sourcemap":"inline"},"static_expected":null,"expected":"/* @jsxImportSource astro */\n\n\ninterface LocalImageProps\n\textends Omit,\n\t\tOmit,\n\t\tPick {\n\tsrc: ImageMetadata | Promise<{ default: ImageMetadata }>;\n\t/** Defines an alternative text description of the image. Set to an empty string (alt=\"\") if the image is not a key part of the content (it's decoration or a tracking pixel). */\n\talt: string;\n\tsizes: HTMLImageElement['sizes'];\n\twidths: number[];\n\tformats?: OutputFormat[];\n}\ninterface RemoteImageProps\n\textends Omit,\n\t\tTransformOptions,\n\t\tPick {\n\tsrc: string;\n\t/** Defines an alternative text description of the image. Set to an empty string (alt=\"\") if the image is not a key part of the content (it's decoration or a tracking pixel). */\n\talt: string;\n\tsizes: HTMLImageElement['sizes'];\n\twidths: number[];\n\taspectRatio: TransformOptions['aspectRatio'];\n\tformats?: OutputFormat[];\n\tbackground: TransformOptions['background'];\n}\nexport type Props = LocalImageProps | RemoteImageProps;\n\n\nexport default function Index__AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiaW5kZXguYXN0cm8iXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi0tLVxuaW50ZXJmYWNlIExvY2FsSW1hZ2VQcm9wc1xuXHRleHRlbmRzIE9taXRcdTAwM2NIVE1MQXR0cmlidXRlcywgJ3NyYycgfCAnd2lkdGgnIHwgJ2hlaWdodCdcdTAwM2UsXG5cdFx0T21pdFx1MDAzY1RyYW5zZm9ybU9wdGlvbnMsICdzcmMnXHUwMDNlLFxuXHRcdFBpY2tcdTAwM2Nhc3Ryb0hUTUwuSlNYLkltZ0hUTUxBdHRyaWJ1dGVzLCAnbG9hZGluZycgfCAnZGVjb2RpbmcnXHUwMDNlIHtcblx0c3JjOiBJbWFnZU1ldGFkYXRhIHwgUHJvbWlzZVx1MDAzY3sgZGVmYXVsdDogSW1hZ2VNZXRhZGF0YSB9XHUwMDNlO1xuXHQvKiogRGVmaW5lcyBhbiBhbHRlcm5hdGl2ZSB0ZXh0IGRlc2NyaXB0aW9uIG9mIHRoZSBpbWFnZS4gU2V0IHRvIGFuIGVtcHR5IHN0cmluZyAoYWx0PVwiXCIpIGlmIHRoZSBpbWFnZSBpcyBub3QgYSBrZXkgcGFydCBvZiB0aGUgY29udGVudCAoaXQncyBkZWNvcmF0aW9uIG9yIGEgdHJhY2tpbmcgcGl4ZWwpLiAqL1xuXHRhbHQ6IHN0cmluZztcblx0c2l6ZXM6IEhUTUxJbWFnZUVsZW1lbnRbJ3NpemVzJ107XG5cdHdpZHRoczogbnVtYmVyW107XG5cdGZvcm1hdHM/OiBPdXRwdXRGb3JtYXRbXTtcbn1cbmludGVyZmFjZSBSZW1vdGVJbWFnZVByb3BzXG5cdGV4dGVuZHMgT21pdFx1MDAzY0hUTUxBdHRyaWJ1dGVzLCAnc3JjJyB8ICd3aWR0aCcgfCAnaGVpZ2h0J1x1MDAzZSxcblx0XHRUcmFuc2Zvcm1PcHRpb25zLFxuXHRcdFBpY2tcdTAwM2NJbWdIVE1MQXR0cmlidXRlcywgJ2xvYWRpbmcnIHwgJ2RlY29kaW5nJ1x1MDAzZSB7XG5cdHNyYzogc3RyaW5nO1xuXHQvKiogRGVmaW5lcyBhbiBhbHRlcm5hdGl2ZSB0ZXh0IGRlc2NyaXB0aW9uIG9mIHRoZSBpbWFnZS4gU2V0IHRvIGFuIGVtcHR5IHN0cmluZyAoYWx0PVwiXCIpIGlmIHRoZSBpbWFnZSBpcyBub3QgYSBrZXkgcGFydCBvZiB0aGUgY29udGVudCAoaXQncyBkZWNvcmF0aW9uIG9yIGEgdHJhY2tpbmcgcGl4ZWwpLiAqL1xuXHRhbHQ6IHN0cmluZztcblx0c2l6ZXM6IEhUTUxJbWFnZUVsZW1lbnRbJ3NpemVzJ107XG5cdHdpZHRoczogbnVtYmVyW107XG5cdGFzcGVjdFJhdGlvOiBUcmFuc2Zvcm1PcHRpb25zWydhc3BlY3RSYXRpbyddO1xuXHRmb3JtYXRzPzogT3V0cHV0Rm9ybWF0W107XG5cdGJhY2tncm91bmQ6IFRyYW5zZm9ybU9wdGlvbnNbJ2JhY2tncm91bmQnXTtcbn1cbmV4cG9ydCB0eXBlIFByb3BzID0gTG9jYWxJbWFnZVByb3BzIHwgUmVtb3RlSW1hZ2VQcm9wcztcbi0tLSJdLAogICJtYXBwaW5ncyI6ICI7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDekIsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUMxRCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDaEMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ2pFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDMUQsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsTCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ2IsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsQixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDMUIsQ0FBQztBQUNELENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUMxQixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzFELENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbkIsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbkQsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNiLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbEwsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNiLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbEMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbEIsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUM5QyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDMUIsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzVDLENBQUM7QUFDRCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3ZELEFBQUcsQUExQkg7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTsiLAogICJuYW1lcyI6IFtdCn0="} -{"file":"props-and-getStaticPaths.ts","name":"explicit props definition","input":"---\ninterface Props {};\nexport function getStaticPaths() {\n return {};\n}\n---\n\n
","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props {};\nexport function getStaticPaths() {\n return {};\n}\n\n{};\n
\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props {};\nexport function getStaticPaths() {\n return {};\n}\n\n{};\n
\n
\nexport default function __AstroComponent_(_props: Props): any {}\ntype ASTRO__ArrayElement = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;\ntype ASTRO__Flattened = T extends Array ? ASTRO__Flattened : T;\ntype ASTRO__InferredGetStaticPath = ASTRO__Flattened>>>;\ntype ASTRO__MergeUnion = T extends unknown ? T & { [P in Exclude]?: never } extends infer O ? { [P in keyof O]: O[P] } : never : never;\ntype ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[K] : never;\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>>"} -{"file":"props-and-getStaticPaths.ts","name":"inferred props","input":"---\nexport function getStaticPaths() {\n return {};\n}\n---\n\n
","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nexport function getStaticPaths() {\n return {};\n}\n\n{};\n
\n
\nexport default function __AstroComponent_(_props: ASTRO__MergeUnion>): any {}\n__UNRESOLVED_CALL__\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\nexport function getStaticPaths() {\n return {};\n}\n\n{};\n
\n
\nexport default function __AstroComponent_(_props: ASTRO__MergeUnion>): any {}\ntype ASTRO__ArrayElement = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;\ntype ASTRO__Flattened = T extends Array ? ASTRO__Flattened : T;\ntype ASTRO__InferredGetStaticPath = ASTRO__Flattened>>>;\ntype ASTRO__MergeUnion = T extends unknown ? T & { [P in Exclude]?: never } extends infer O ? { [P in keyof O]: O[P] } : never : never;\ntype ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[K] : never;\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>, typeof __AstroComponent_, ASTRO__Get>>"} -{"file":"props.ts","name":"no props","input":"
","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"props.ts","name":"nested Props","input":"---\nfunction DoTheThing(Props) {}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nfunction DoTheThing(Props) {}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nfunction DoTheThing(Props) {}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"props.ts","name":"props interface","input":"\n---\ninterface Props {}\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"props.ts","name":"props import","input":"\n---\nimport { Props } from './somewhere';\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nimport { Props } from './somewhere';\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\nimport { Props } from './somewhere';\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"props.ts","name":"props alias","input":"\n---\nimport { MyComponent as Props } from './somewhere';\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nimport { MyComponent as Props } from './somewhere';\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\nimport { MyComponent as Props } from './somewhere';\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"props.ts","name":"props type import","input":"\n---\nimport type { Props } from './somewhere';\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nimport type { Props } from './somewhere';\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\nimport type { Props } from './somewhere';\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"props.ts","name":"props type","input":"\n---\ntype Props = {}\n---\n\n
\n","options":{"filename":"/Users/nmoo/test.astro","sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ntype Props = {}\n\n{};\n
\n\n
\nexport default function Test__AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ntype Props = {}\n\n{};\n
\n\n
\nexport default function Test__AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"props.ts","name":"props generic (simple)","input":"\n---\ninterface Props {}\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"props.ts","name":"props generic (complex)","input":"\n---\ninterface Props> {}\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props> {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_>(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props> {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_>(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"props.ts","name":"props generic (very complex)","input":"\n---\ninterface Props {}\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"props.ts","name":"props generic (very complex II)","input":"\n---\ninterface Props ? A : B, P extends string ? { [key: string]: any }: never> {}\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props ? A : B, P extends string ? { [key: string]: any }: never> {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_ ? A : B, P extends string ? { [key: string]: any }: never>(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props ? A : B, P extends string ? { [key: string]: any }: never> {}\n\n{};\n
\n\n
\nexport default function __AstroComponent_ ? A : B, P extends string ? { [key: string]: any }: never>(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"props.ts","name":"polymorphic props","input":"\n---\ninterface Props extends HTMLAttributes {\n as?: Tag;\n}\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props extends HTMLAttributes {\n as?: Tag;\n}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props extends HTMLAttributes {\n as?: Tag;\n}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"props.ts","name":"unrelated prop import","input":"\n---\nimport SvelteOptionalProps from './SvelteOptionalProps.svelte';\n---\n\n\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nimport SvelteOptionalProps from './SvelteOptionalProps.svelte';\n\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nimport SvelteOptionalProps from './SvelteOptionalProps.svelte';\n\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"props.ts","name":"unrelated sibling prop","input":"---\nimport type { Props as ComponentBProps } from './ComponentB.astro'\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nimport type { Props as ComponentBProps } from './ComponentB.astro'\n\n{};\n
\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nimport type { Props as ComponentBProps } from './ComponentB.astro'\n\n{};\n
\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"props.ts","name":"props interface with as property","input":"---\ninterface Props {\n as?: string;\n href?: string;\n}\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props {\n as?: string;\n href?: string;\n}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props {\n as?: string;\n href?: string;\n}\n\n{};\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"props.ts","name":"props with destructured as property","input":"---\ninterface Props {\n as?: string;\n className?: string;\n}\n\nconst { as, className } = Astro.props;\n---\n\n
{as}
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props {\n as?: string;\n className?: string;\n}\n\nconst { as, className } = Astro.props;\n\n\n
{as}
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props {\n as?: string;\n className?: string;\n}\n\nconst { as, className } = Astro.props;\n\n\n
{as}
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"props.ts","name":"props with renamed as property in destructuring","input":"---\ninterface Props {\n as?: string;\n}\n\nconst { as: element } = Astro.props;\n---\n\n
{element}
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props {\n as?: string;\n}\n\nconst { as: element } = Astro.props;\n\n\n
{element}
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props {\n as?: string;\n}\n\nconst { as: element } = Astro.props;\n\n\n
{element}
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"props.ts","name":"props interface with as and other properties","input":"---\ninterface Props extends HTMLAttributes<'div'> {\n as?: keyof HTMLElementTagNameMap;\n variant?: 'primary' | 'secondary';\n size?: 'sm' | 'md' | 'lg';\n}\n\nconst { as = 'div', variant = 'primary', size = 'md', ...rest } = Astro.props;\n---\n\n
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ninterface Props extends HTMLAttributes<'div'> {\n as?: keyof HTMLElementTagNameMap;\n variant?: 'primary' | 'secondary';\n size?: 'sm' | 'md' | 'lg';\n}\n\nconst { as = 'div', variant = 'primary', size = 'md', ...rest } = Astro.props;\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ninterface Props extends HTMLAttributes<'div'> {\n as?: keyof HTMLElementTagNameMap;\n variant?: 'primary' | 'secondary';\n size?: 'sm' | 'md' | 'lg';\n}\n\nconst { as = 'div', variant = 'primary', size = 'md', ...rest } = Astro.props;\n\n\n
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"props.ts","name":"props type alias with as property","input":"---\ntype Props = {\n as?: string;\n children?: any;\n}\n\nconst props = Astro.props as Props;\n---\n\n
{props.children}
\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ntype Props = {\n as?: string;\n children?: any;\n}\n\nconst props = Astro.props as Props;\n\n\n
{props.children}
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n__UNRESOLVED_CALL__","expected":"/* @jsxImportSource astro */\n\n\ntype Props = {\n as?: string;\n children?: any;\n}\n\nconst props = Astro.props as Props;\n\n\n
{props.children}
\n\n
\nexport default function __AstroComponent_(_props: Props): any {}\n/**\n * Astro global available in all contexts in .astro files\n *\n * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global)\n*/\ndeclare const Astro: Readonly>"} -{"file":"raw.ts","name":"style is raw","input":"","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"raw.ts","name":"is:raw is raw","input":"
A{B}C
","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n
{`A{B}C`}
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n
{`A{B}C`}
\n
\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"script.ts","name":"script function","input":"","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"script.ts","name":"partytown function","input":"","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"script.ts","name":"ld+json wrapping","input":"","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"script.ts","name":"escape unknown types","input":"","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"script.ts","name":"don't include scripts if disabled","input":"\n\n\n\n\n","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\n\n\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\n\n\n\n\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"top-level-returns.ts","name":"transforms top-level returns to throw statements","input":"---\nif (something) {\n\treturn Astro.redirect();\n}\n\nfunction thatDoesSomething() {\n\treturn \"Hey\";\n}\n\nclass Component {\n\trender() {\n\t\treturn \"wow\"!\n\t}\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nif (something) {\n\tthrow Astro.redirect();\n}\n\nfunction thatDoesSomething() {\n\treturn \"Hey\";\n}\n\nclass Component {\n\trender() {\n\t\treturn \"wow\"!\n\t}\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nif (something) {\n\tthrow Astro.redirect();\n}\n\nfunction thatDoesSomething() {\n\treturn \"Hey\";\n}\n\nclass Component {\n\trender() {\n\t\treturn \"wow\"!\n\t}\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"top-level-returns.ts","name":"preserves returns inside arrow functions","input":"---\nconst foo = () => {\n\treturn \"value\";\n}\n\nif (condition) {\n\treturn Astro.redirect(\"/login\");\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nconst foo = () => {\n\treturn \"value\";\n}\n\nif (condition) {\n\tthrow Astro.redirect(\"/login\");\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nconst foo = () => {\n\treturn \"value\";\n}\n\nif (condition) {\n\tthrow Astro.redirect(\"/login\");\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"top-level-returns.ts","name":"preserves returns inside object methods","input":"---\nconst something = {\n\tsomeFunction: () => {\n\t\treturn \"Hello World\";\n\t},\n\tsomeOtherFunction() {\n\t\treturn \"Hello World\";\n\t},\n};\n\nif (true) {\n\treturn Astro.redirect();\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nconst something = {\n\tsomeFunction: () => {\n\t\treturn \"Hello World\";\n\t},\n\tsomeOtherFunction() {\n\t\treturn \"Hello World\";\n\t},\n};\n\nif (true) {\n\tthrow Astro.redirect();\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nconst something = {\n\tsomeFunction: () => {\n\t\treturn \"Hello World\";\n\t},\n\tsomeOtherFunction() {\n\t\treturn \"Hello World\";\n\t},\n};\n\nif (true) {\n\tthrow Astro.redirect();\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"top-level-returns.ts","name":"handles multiple top-level returns","input":"---\nif (condition1) {\n\treturn Astro.redirect(\"/a\");\n}\n\nif (condition2) {\n\treturn Astro.redirect(\"/b\");\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nif (condition1) {\n\tthrow Astro.redirect(\"/a\");\n}\n\nif (condition2) {\n\tthrow Astro.redirect(\"/b\");\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nif (condition1) {\n\tthrow Astro.redirect(\"/a\");\n}\n\nif (condition2) {\n\tthrow Astro.redirect(\"/b\");\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"top-level-returns.ts","name":"no transformation when no top-level returns","input":"---\nfunction foo() {\n\treturn \"bar\";\n}\n\nconst arrow = () => {\n\treturn \"baz\";\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nfunction foo() {\n\treturn \"bar\";\n}\n\nconst arrow = () => {\n\treturn \"baz\";\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nfunction foo() {\n\treturn \"bar\";\n}\n\nconst arrow = () => {\n\treturn \"baz\";\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"top-level-returns.ts","name":"handles TypeScript syntax without losing returns","input":"---\ntype Response = { status: number };\nconst handler = (input: string): Response => {\n\treturn { status: 200 };\n};\n\nconst value = (foo as string);\n\nif (value) {\n\treturn Astro.redirect('/ok');\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ntype Response = { status: number };\nconst handler = (input: string): Response => {\n\treturn { status: 200 };\n};\n\nconst value = (foo as string);\n\nif (value) {\n\tthrow Astro.redirect('/ok');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\ntype Response = { status: number };\nconst handler = (input: string): Response => {\n\treturn { status: 200 };\n};\n\nconst value = (foo as string);\n\nif (value) {\n\tthrow Astro.redirect('/ok');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"top-level-returns.ts","name":"does not transform returns in nested class or object methods","input":"---\nclass Foo {\n\tmethod() {\n\t\treturn 'foo';\n\t}\n\tarrow = () => {\n\t\treturn 'bar';\n\t}\n}\n\nconst obj = {\n\tmethod() {\n\t\treturn 'baz';\n\t},\n};\n\nif (true) {\n\treturn Astro.redirect('/nested');\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nclass Foo {\n\tmethod() {\n\t\treturn 'foo';\n\t}\n\tarrow = () => {\n\t\treturn 'bar';\n\t}\n}\n\nconst obj = {\n\tmethod() {\n\t\treturn 'baz';\n\t},\n};\n\nif (true) {\n\tthrow Astro.redirect('/nested');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nclass Foo {\n\tmethod() {\n\t\treturn 'foo';\n\t}\n\tarrow = () => {\n\t\treturn 'bar';\n\t}\n}\n\nconst obj = {\n\tmethod() {\n\t\treturn 'baz';\n\t},\n};\n\nif (true) {\n\tthrow Astro.redirect('/nested');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"top-level-returns.ts","name":"handles computed methods and generic arrows","input":"---\nclass Foo {\n\t['get']() {\n\t\treturn 'ok';\n\t}\n\n\tstatic ['load']() {\n\t\treturn 'static';\n\t}\n}\n\nconst obj = {\n\t['get']() {\n\t\treturn 'obj';\n\t},\n};\n\nconst generic = (value: T) => {\n\treturn value;\n};\n\nif (true) {\n\treturn Astro.redirect('/computed');\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nclass Foo {\n\t['get']() {\n\t\treturn 'ok';\n\t}\n\n\tstatic ['load']() {\n\t\treturn 'static';\n\t}\n}\n\nconst obj = {\n\t['get']() {\n\t\treturn 'obj';\n\t},\n};\n\nconst generic = (value: T) => {\n\treturn value;\n};\n\nif (true) {\n\tthrow Astro.redirect('/computed');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nclass Foo {\n\t['get']() {\n\t\treturn 'ok';\n\t}\n\n\tstatic ['load']() {\n\t\treturn 'static';\n\t}\n}\n\nconst obj = {\n\t['get']() {\n\t\treturn 'obj';\n\t},\n};\n\nconst generic = (value: T) => {\n\treturn value;\n};\n\nif (true) {\n\tthrow Astro.redirect('/computed');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"top-level-returns.ts","name":"handles satisfies and as const in top-level conditionals","input":"---\nconst config = {\n\tflag: true,\n} as const;\n\nconst map = {\n\tname: 'astro',\n} satisfies Record;\n\nif (config.flag) {\n\treturn Astro.redirect('/satisfies');\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\nconst config = {\n\tflag: true,\n} as const;\n\nconst map = {\n\tname: 'astro',\n} satisfies Record;\n\nif (config.flag) {\n\tthrow Astro.redirect('/satisfies');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\nconst config = {\n\tflag: true,\n} as const;\n\nconst map = {\n\tname: 'astro',\n} satisfies Record;\n\nif (config.flag) {\n\tthrow Astro.redirect('/satisfies');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} -{"file":"top-level-returns.ts","name":"handles type-position arrows without missing top-level returns","input":"---\ntype Fn = () => void;\ntype Factory = (value: string) => { ok: boolean };\n\nif (true) {\n\treturn Astro.redirect('/types');\n}\n---","options":{"sourcemap":"external"},"static_expected":"/* @jsxImportSource astro */\n\n\ntype Fn = () => void;\ntype Factory = (value: string) => { ok: boolean };\n\nif (true) {\n\tthrow Astro.redirect('/types');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n","expected":"/* @jsxImportSource astro */\n\n\ntype Fn = () => void;\ntype Factory = (value: string) => { ok: boolean };\n\nif (true) {\n\tthrow Astro.redirect('/types');\n}\n\n\nexport default function __AstroComponent_(_props: Record): any {}\n"} diff --git a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap index c343f537..fadec325 100644 --- a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap @@ -21,4 +21,4 @@ input_file: crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzcGFuPmE8L3NwYW4+XG48c3Bhbj5iPC9zcGFuPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLElBQUksQ0FBQztBQUNkLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUM7QUFDZDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHNwYW4+YTwvc3Bhbj5cbjxzcGFuPmI8L3NwYW4+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLElBQUksQ0FBQztBQUNkLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUM7QUFDZDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap index c782f781..f7a78f97 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap @@ -32,4 +32,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_event_and_style.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgb25jbGljaz1cImdvKClcIiBzdHlsZT1cImNvbG9yOnJlZFwiPjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHLENBQUksT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQzVDO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBvbmNsaWNrPVwiZ28oKVwiIHN0eWxlPVwiY29sb3I6cmVkXCI+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHLENBQUksT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQzVDO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap index e62ce02f..35c8d9a2 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_expression_value.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgY2xhc3M9e2Nsc30gYXJpYS1sYWJlbD17bGFiZWx9PjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHLENBQUksS0FBSyxDLENBQUUsQ0FBQyxDQUFDLEMsQyxDQUFHLFVBQVUsQyxDQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDMUM7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBjbGFzcz17Y2xzfSBhcmlhLWxhYmVsPXtsYWJlbH0+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHLENBQUksS0FBSyxDLENBQUUsQ0FBQyxDQUFDLEMsQyxDQUFHLFVBQVUsQyxDQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDMUM7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap index 0bee1c1c..ac3d2f25 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_invalid_names.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgQGNsaWNrPXtoYW5kbGVyfSA6Y2xhc3M9XCJ4XCIgbmFtZT1cIm9rXCI+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBZ0MsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsTUFBcEMsUSxFQUFRLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsQyxDQUFHLFEsQyxHLEVBQW9CLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDakQ7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBAY2xpY2s9e2hhbmRsZXJ9IDpjbGFzcz1cInhcIiBuYW1lPVwib2tcIj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBZ0MsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsTSxDQUFwQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDLEVBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDLEMsQ0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDLEMsRyxFQUFlLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDakQ7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap index 42131a16..626752eb 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_quoted_forms.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgaWQ9J3NpbmdsZScgY2xhc3M9XCJkb3VibGVcIiBkYXRhLW49MyBoaWRkZW4+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBSSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsQyxDQUFBLE1BQU0sQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN0RDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBpZD0nc2luZ2xlJyBjbGFzcz1cImRvdWJsZVwiIGRhdGEtbj0zIGhpZGRlbj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBSSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsQyxDQUFBLE1BQU0sQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN0RDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap index 62f16c63..52a6efbf 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_shorthand.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxGb28ge2Jhcn0gLz5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFLLENBQUMsQ0FBQyxDLEMsQ0FBRixDQUFDLENBQUMsQyxDQUFFLENBQUUsRUFBQztBQUNiO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPEZvbyB7YmFyfSAvPlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFLLENBQUMsQ0FBQyxDLEMsQ0FBRixDQUFDLENBQUMsQyxDQUFFLENBQUUsRUFBQztBQUNiO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/attribute_spread.snap b/crates/astro2tsx/tests/fixtures/attribute_spread.snap index 0dcf48f4..d53a53d3 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_spread.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_spread.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_spread.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxGb28gey4uLnJlc3R9IG5hbWU9XCJ4XCIgLz5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxFLEdBQVEsQ0FBQyxDQUFDLENBQUMsQyxDLENBQUcsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsRUFBQztBQUMxQjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPEZvbyB7Li4ucmVzdH0gbmFtZT1cInhcIiAvPlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxFLEdBQVEsQ0FBQyxDQUFDLENBQUMsQyxDLENBQUcsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsRUFBQztBQUMxQjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap index 390a6b58..9ecff752 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_template_literal.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxUYWcgc3JjPXtgYmFyJHtmb299YH0gLz5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFJLEdBQUcsQyxDQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLENBQUUsRUFBQztBQUN6QjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPFRhZyBzcmM9e2BiYXIke2Zvb31gfSAvPlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFJLEdBQUcsQyxDQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLENBQUUsRUFBQztBQUN6QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.astro b/crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.astro new file mode 100644 index 00000000..8db6f50e --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.astro @@ -0,0 +1,5 @@ +--- +const a = 1; +--- + +
x
diff --git a/crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.snap b/crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.snap new file mode 100644 index 00000000..3cad0256 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.snap @@ -0,0 +1,28 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 45 + body: + start: 59 + end: 91 + scripts: [] + styles: [] +input_file: crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.astro +--- +/* @jsxImportSource astro */ + + +const a = 1; + +{}; + +{/** between */} +
x
+ +
+export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5jb25zdCBhID0gMTtcbi0tLVxuPCEtLSBiZXR3ZWVuIC0tPlxuPGRpdj54PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0EsRztBQUNUO0EsSUFDQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxHQUFJO0FBQ2hCLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap index c653d655..69f6e43f 100644 --- a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap +++ b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap @@ -6,8 +6,8 @@ info: start: 30 end: 71 body: - start: 82 - end: 114 + start: 85 + end: 119 scripts: [] styles: [] input_file: crates/astro2tsx/tests/fixtures/crlf_frontmatter.astro @@ -17,7 +17,8 @@ input_file: crates/astro2tsx/tests/fixtures/crlf_frontmatter.astro import { Meta } from './Meta.astro'; - +{}; +
a
@@ -25,4 +26,4 @@ import { Meta } from './Meta.astro';
export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxyXG5pbXBvcnQgeyBNZXRhIH0gZnJvbSAnLi9NZXRhLmFzdHJvJztcclxuLS0tXHJcbjxkaXY+XHJcbjxzcGFuPmE8L3NwYW4+XHJcbjwvZGl2PlxyXG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRyxDQUFDO0FBQ0osQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0E7QUFFckMsQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNOLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUMsQ0FBQztBQUNmLEVBQUUsR0FBRyxDQUFDLENBQUM7QUFDUDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXHJcbmltcG9ydCB7IE1ldGEgfSBmcm9tICcuL01ldGEuYXN0cm8nO1xyXG4tLS1cclxuPGRpdj5cclxuPHNwYW4+YTwvc3Bhbj5cclxuPC9kaXY+XHJcbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRyxDQUFDO0FBQ0osQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0EsRztBQUNsQyxDQUFDO0FBQ0osQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNOLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUMsQ0FBQztBQUNmLEVBQUUsR0FBRyxDQUFDLENBQUM7QUFDUDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/directives.snap b/crates/astro2tsx/tests/fixtures/directives.snap index b0b8e7e0..a2b4aa9d 100644 --- a/crates/astro2tsx/tests/fixtures/directives.snap +++ b/crates/astro2tsx/tests/fixtures/directives.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/directives.astro
export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxDb21wIGNsaWVudDpsb2FkIHNldDpodG1sPXtodG1sfSBjbGFzczpsaXN0PXtjbHN9IHRyYW5zaXRpb246bmFtZT1cIm5cIiAvPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxJLENBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsQ0FBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsZUFBZSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsRUFBQztBQUN6RTtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPENvbXAgY2xpZW50OmxvYWQgc2V0Omh0bWw9e2h0bWx9IGNsYXNzOmxpc3Q9e2Nsc30gdHJhbnNpdGlvbjpuYW1lPVwiblwiIC8+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxJLENBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsQ0FBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsZUFBZSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsRUFBQztBQUN6RTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/escape_comment_bodies.astro b/crates/astro2tsx/tests/fixtures/escape_comment_bodies.astro new file mode 100644 index 00000000..7f0007b1 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/escape_comment_bodies.astro @@ -0,0 +1,2 @@ + +
diff --git a/crates/astro2tsx/tests/fixtures/escape_comment_bodies.snap b/crates/astro2tsx/tests/fixtures/escape_comment_bodies.snap new file mode 100644 index 00000000..9812133b --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/escape_comment_bodies.snap @@ -0,0 +1,24 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 116 + scripts: [] + styles: [] +input_file: crates/astro2tsx/tests/fixtures/escape_comment_bodies.astro +--- +/* @jsxImportSource astro */ + + +{/** outer \\{ braces \\} and *\/ star-slash */} +
{/** tight*/}
+ +
+export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPCEtLSBvdXRlciB7IGJyYWNlcyB9IGFuZCAqLyBzdGFyLXNsYXNoIC0tPlxuPGRpdj48IS0tdGlnaHQtLT48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQSxDQUFBLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUEsQ0FBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxHQUFJO0FBQzNDLENBQUMsR0FBRyxDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEdBQUksRUFBRSxHQUFHLENBQUM7QUFDdkI7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap index 0e0c24bf..83ae1814 100644 --- a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap +++ b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2NvbmQgJiYgPHNwYW4+YTwvc3Bhbj4gPHNwYW4+Yjwvc3Bhbj59PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxVQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxXQUFDLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDbEQ7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Y29uZCAmJiA8c3Bhbj5hPC9zcGFuPiA8c3Bhbj5iPC9zcGFuPn08L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxVQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxXQUFDLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDbEQ7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap index 69fa0d7b..0d24ae6e 100644 --- a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap +++ b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_comment_only.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+ey8qIGtlZXAgbWUgKi99PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUMxQjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Lyoga2VlcCBtZSAqL308L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUMxQjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_empty.snap b/crates/astro2tsx/tests/fixtures/expression_empty.snap index 74a7eb13..bfd2f803 100644 --- a/crates/astro2tsx/tests/fixtures/expression_empty.snap +++ b/crates/astro2tsx/tests/fixtures/expression_empty.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_empty.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e308L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFHLEVBQUUsR0FBRyxDQUFDO0FBQ2I7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57fTwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFHLEVBQUUsR0FBRyxDQUFDO0FBQ2I7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/expression_generics.snap b/crates/astro2tsx/tests/fixtures/expression_generics.snap index 760b5ca7..b423e53c 100644 --- a/crates/astro2tsx/tests/fixtures/expression_generics.snap +++ b/crates/astro2tsx/tests/fixtures/expression_generics.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_generics.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2ZvbzxCYXI+KHgpfTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN4QjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Zm9vPEJhcj4oeCl9PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN4QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap index dad2e576..48b511b3 100644 --- a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap +++ b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_html_comment.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIntsaXN0Lm1hcCgoKSA9PiA8Q29tcG9uZW50PjwhLS1IaS0tPjwvQ29tcG9uZW50Pil9XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxLQUFLLENBQUMsQyxHQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsRDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2xpc3QubWFwKCgpID0+IDxDb21wb25lbnQ+PCEtLUhpLS0+PC9Db21wb25lbnQ+KX1cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxLQUFLLENBQUMsQyxHQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsRDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_identifier.snap b/crates/astro2tsx/tests/fixtures/expression_identifier.snap index a3c13aab..9cc45200 100644 --- a/crates/astro2tsx/tests/fixtures/expression_identifier.snap +++ b/crates/astro2tsx/tests/fixtures/expression_identifier.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_identifier.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e3ZhbHVlfTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNsQjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57dmFsdWV9PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNsQjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_map.snap b/crates/astro2tsx/tests/fixtures/expression_map.snap index 2af8af90..4016e0f3 100644 --- a/crates/astro2tsx/tests/fixtures/expression_map.snap +++ b/crates/astro2tsx/tests/fixtures/expression_map.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_map.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjx1bD57aXRlbXMubWFwKChpKSA9PiA8bGk+e2kubmFtZX08L2xpPil9PC91bD5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUM7QUFDOUM7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHVsPntpdGVtcy5tYXAoKGkpID0+IDxsaT57aS5uYW1lfTwvbGk+KX08L3VsPlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUM7QUFDOUM7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/expression_nested.snap b/crates/astro2tsx/tests/fixtures/expression_nested.snap index 4623356b..adab918d 100644 --- a/crates/astro2tsx/tests/fixtures/expression_nested.snap +++ b/crates/astro2tsx/tests/fixtures/expression_nested.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_nested.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e291dGVyICYmIDxzcGFuPntpbm5lcn08L3NwYW4+fTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUMxQztBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57b3V0ZXIgJiYgPHNwYW4+e2lubmVyfTwvc3Bhbj59PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUMxQztBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap index 7b654cb1..da6cd20b 100644 --- a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap +++ b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_object_literal.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+eyB7IGR1cmF0aW9uOiAxIH0gfTwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUM5QjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57IHsgZHVyYXRpb246IDEgfSB9PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUM5QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_single_element.snap b/crates/astro2tsx/tests/fixtures/expression_single_element.snap index 9357bfaf..034ae37a 100644 --- a/crates/astro2tsx/tests/fixtures/expression_single_element.snap +++ b/crates/astro2tsx/tests/fixtures/expression_single_element.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_single_element.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2NvbmQgJiYgPHNwYW4+YTwvc3Bhbj59PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNuQztBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Y29uZCAmJiA8c3Bhbj5hPC9zcGFuPn08L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNuQztBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap index f1a9506e..958bad86 100644 --- a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap +++ b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_spread_child.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+ey4uLnJlc3R9PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNwQjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Li4ucmVzdH08L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNwQjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap index e0451a9b..0ec33457 100644 --- a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_string_with_markup.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e1wiPGJyLz5cIn08L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ3BCO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57XCI8YnIvPlwifTwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ3BCO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap index 9c6369f3..317e47c6 100644 --- a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_template_with_markup.astr export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2A8Yj55PC9iPmB9PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN2QjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57YDxiPnk8L2I+YH08L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN2QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap index 61962e94..87ff1f27 100644 --- a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_ternary_markup.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+e2NvbmQgPyA8YSBocmVmPScveCc+eWVzPC9hPiA6IDxiPm5vPC9iPn08L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNwRDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Y29uZCA/IDxhIGhyZWY9Jy94Jz55ZXM8L2E+IDogPGI+bm88L2I+fTwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNwRDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/fragment_shorthand.astro b/crates/astro2tsx/tests/fixtures/fragment_shorthand.astro new file mode 100644 index 00000000..458e54fc --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/fragment_shorthand.astro @@ -0,0 +1,4 @@ +<> +
a
+
b
+ diff --git a/crates/astro2tsx/tests/fixtures/fragment_shorthand.snap b/crates/astro2tsx/tests/fixtures/fragment_shorthand.snap new file mode 100644 index 00000000..2dd2c356 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/fragment_shorthand.snap @@ -0,0 +1,26 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 75 + scripts: [] + styles: [] +input_file: crates/astro2tsx/tests/fixtures/fragment_shorthand.astro +--- +/* @jsxImportSource astro */ + + +<> +
a
+
b
+ + +
+export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPD5cbjxkaXY+YTwvZGl2PlxuPGRpdj5iPC9kaXY+XG48Lz5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUM7QUFDRixDQUFDLEdBQUcsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ1osQ0FBQyxHQUFHLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNaLEVBQUUsQ0FBQztBQUNIO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap index 7e9238ec..1d071b77 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/frontmatter_absent.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+cGxhaW48L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNoQjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj5wbGFpbjwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNoQjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap index a910c2f9..cc4c8b60 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap @@ -6,8 +6,8 @@ info: start: 30 end: 53 body: - start: 64 - end: 88 + start: 67 + end: 93 scripts: [] styles: [] input_file: crates/astro2tsx/tests/fixtures/frontmatter_and_body.astro @@ -17,10 +17,12 @@ input_file: crates/astro2tsx/tests/fixtures/frontmatter_and_body.astro let value = 'world'; - +{}; + +

Hello {value}

export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxubGV0IHZhbHVlID0gJ3dvcmxkJztcbi0tLVxuXG48aDE+SGVsbG8ge3ZhbHVlfTwvaDE+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0E7QUFHcEIsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQztBQUN0QjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5sZXQgdmFsdWUgPSAnd29ybGQnO1xuLS0tXG5cbjxoMT5IZWxsbyB7dmFsdWV9PC9oMT5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0EsRztBQUNqQjtBQUNIO0FBQ0EsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQztBQUN0QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap index bd06795a..5fce6eda 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap @@ -7,7 +7,7 @@ info: end: 31 body: start: 42 - end: 55 + end: 56 scripts: [] styles: [] input_file: crates/astro2tsx/tests/fixtures/frontmatter_empty.astro @@ -16,9 +16,10 @@ input_file: crates/astro2tsx/tests/fixtures/frontmatter_empty.astro +
export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuLS0tXG48ZGl2PjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBQUFBLEE7QTtBQUVBLENBQUMsR0FBRyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ1g7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFBLEE7QTtBQUNHO0FBQ0gsQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap index 41186eac..68463b5b 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap @@ -6,8 +6,8 @@ info: start: 30 end: 101 body: - start: 112 - end: 122 + start: 115 + end: 126 scripts: [] styles: [] input_file: crates/astro2tsx/tests/fixtures/frontmatter_imports.astro @@ -18,10 +18,11 @@ input_file: crates/astro2tsx/tests/fixtures/frontmatter_imports.astro import Card from './Card.astro'; import type { Foo } from './types'; - +{}; + export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW1wb3J0IENhcmQgZnJvbSAnLi9DYXJkLmFzdHJvJztcbmltcG9ydCB0eXBlIHsgRm9vIH0gZnJvbSAnLi90eXBlcyc7XG4tLS1cbjxDYXJkIC8+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNoQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBO0FBRW5DLENBQUMsSUFBSSxDQUFFLEVBQUM7QUFDUjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbXBvcnQgQ2FyZCBmcm9tICcuL0NhcmQuYXN0cm8nO1xuaW1wb3J0IHR5cGUgeyBGb28gfSBmcm9tICcuL3R5cGVzJztcbi0tLVxuPENhcmQgLz5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNoQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBLEc7QUFDaEM7QUFDSCxDQUFDLElBQUksQ0FBRSxFQUFDO0FBQ1I7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap index fbf536e1..344dec17 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap @@ -20,4 +20,4 @@ const a = 1; export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuY29uc3QgYSA9IDE7XG4tLS1cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QUFBQSxBQUFHO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5jb25zdCBhID0gMTtcbi0tLVxuIl0sIm1hcHBpbmdzIjoiQTs7QUFBQSxBQUFHO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap index e8259085..10046596 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap @@ -7,7 +7,7 @@ info: end: 76 body: start: 90 - end: 100 + end: 101 scripts: [] styles: [] input_file: crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.astro @@ -20,9 +20,10 @@ if (cond) { } {}; +

x

export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaWYgKGNvbmQpIHtcblx0cmV0dXJuIEFzdHJvLnJlZGlyZWN0KCcveCcpO1xufVxuLS0tXG48cD54PC9wPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDWCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDN0IsQ0FBQztBO0EsRztBQUVELENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDUjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pZiAoY29uZCkge1xuXHRyZXR1cm4gQXN0cm8ucmVkaXJlY3QoJy94Jyk7XG59XG4tLS1cbjxwPng8L3A+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDWCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDN0IsQ0FBQztBO0EsRztBQUNFO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQztBQUNSO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap b/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap index e0391205..cb108068 100644 --- a/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap +++ b/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap @@ -6,8 +6,8 @@ info: start: 30 end: 78 body: - start: 89 - end: 102 + start: 92 + end: 106 scripts: [] styles: [] input_file: crates/astro2tsx/tests/fixtures/get_static_paths_export.astro @@ -17,7 +17,8 @@ input_file: crates/astro2tsx/tests/fixtures/get_static_paths_export.astro export const getStaticPaths = async () => []; - +{}; +
@@ -33,4 +34,4 @@ type ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[ * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly>, typeof __AstroComponent_, ASTRO__Get>> -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuZXhwb3J0IGNvbnN0IGdldFN0YXRpY1BhdGhzID0gYXN5bmMgKCkgPT4gW107XG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QTtBQUU3QyxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5leHBvcnQgY29uc3QgZ2V0U3RhdGljUGF0aHMgPSBhc3luYyAoKSA9PiBbXTtcbi0tLVxuPGRpdj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QSxHO0FBQzFDO0FBQ0gsQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap b/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap index 80ecf8b6..32aacb61 100644 --- a/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap +++ b/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap @@ -7,7 +7,7 @@ info: end: 119 body: start: 133 - end: 146 + end: 147 scripts: [] styles: [] input_file: crates/astro2tsx/tests/fixtures/get_static_paths_with_props.astro @@ -19,6 +19,7 @@ interface Props { slug: string } export async function getStaticPaths() { return []; } {}; +
@@ -34,4 +35,4 @@ type ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[ * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly>> -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW50ZXJmYWNlIFByb3BzIHsgc2x1Zzogc3RyaW5nIH1cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBnZXRTdGF0aWNQYXRocygpIHsgcmV0dXJuIFtdOyB9XG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNoQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBLEc7QUFFckQsQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHMgeyBzbHVnOiBzdHJpbmcgfVxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGdldFN0YXRpY1BhdGhzKCkgeyByZXR1cm4gW107IH1cbi0tLVxuPGRpdj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNoQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBLEc7QUFDbEQ7QUFDSCxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/html_comment_body.snap b/crates/astro2tsx/tests/fixtures/html_comment_body.snap index ace1fdba..4fc38a36 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_body.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_body.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/html_comment_body.astro
export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PCEtLSBoaSAtLT48cD54PC9wPjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLEMsSUFBSyxDQUFDLENBQUMsQ0FBQyxDLEdBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUM5QjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj48IS0tIGhpIC0tPjxwPng8L3A+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLEMsSUFBSyxDQUFDLENBQUMsQ0FBQyxDLEdBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUM5QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap index 8673a351..82cd3f15 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap @@ -7,7 +7,7 @@ info: end: 0 body: start: 41 - end: 55 + end: 72 scripts: [] styles: [] input_file: crates/astro2tsx/tests/fixtures/html_comment_top_level.astro @@ -15,9 +15,10 @@ input_file: crates/astro2tsx/tests/fixtures/html_comment_top_level.astro /* @jsxImportSource astro */ +{/** leading */}
x
export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjwhLS0gbGVhZGluZyAtLT5cbjxkaXY+eDwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQ0EsQ0FBQyxHQUFHLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNaO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPCEtLSBsZWFkaW5nIC0tPlxuPGRpdj54PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0EsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxHQUFJO0FBQ2hCLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/multibyte.snap b/crates/astro2tsx/tests/fixtures/multibyte.snap index 43e0fef6..60547b02 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/multibyte.astro
export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxoMT7jg4Q8L2gxPjxwPmZvb2JhcjwvcD5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDdkI7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGgxPuODhDwvaDE+PHA+Zm9vYmFyPC9wPlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDdkI7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap index 3d7dce2e..0a3e43e3 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap @@ -6,8 +6,8 @@ info: start: 30 end: 52 body: - start: 63 - end: 81 + start: 66 + end: 85 scripts: [] styles: [] input_file: crates/astro2tsx/tests/fixtures/multibyte_astral.astro @@ -17,10 +17,11 @@ input_file: crates/astro2tsx/tests/fixtures/multibyte_astral.astro const π = Math.PI; - +{}; +

🦄 {π}

export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuY29uc3Qgz4AgPSBNYXRoLlBJO1xuLS0tXG48cD7wn6aEIHvPgH08L3A+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QTtBQUVsQixDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDYjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5jb25zdCDPgCA9IE1hdGguUEk7XG4tLS1cbjxwPvCfpoQge8+AfTwvcD5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QSxHO0FBQ2Y7QUFDSCxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDYjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/named_component_export.snap b/crates/astro2tsx/tests/fixtures/named_component_export.snap index 9556ecb3..feed2689 100644 --- a/crates/astro2tsx/tests/fixtures/named_component_export.snap +++ b/crates/astro2tsx/tests/fixtures/named_component_export.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/named_component_export.astro
export default function MyPage__AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9zcmMvcGFnZXMvTXlQYWdlLmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiL3NyYy9wYWdlcy9NeVBhZ2UuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/props_exported_alias_union.astro b/crates/astro2tsx/tests/fixtures/props_exported_alias_union.astro new file mode 100644 index 00000000..a43f6839 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/props_exported_alias_union.astro @@ -0,0 +1,6 @@ +--- +interface LocalProps { a: string } +interface RemoteProps { b: string } +export type Props = LocalProps | RemoteProps; +--- +
diff --git a/crates/astro2tsx/tests/fixtures/props_exported_alias_union.snap b/crates/astro2tsx/tests/fixtures/props_exported_alias_union.snap new file mode 100644 index 00000000..755d1aff --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/props_exported_alias_union.snap @@ -0,0 +1,34 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 149 + body: + start: 163 + end: 172 + scripts: [] + styles: [] +input_file: crates/astro2tsx/tests/fixtures/props_exported_alias_union.astro +--- +/* @jsxImportSource astro */ + + +interface LocalProps { a: string } +interface RemoteProps { b: string } +export type Props = LocalProps | RemoteProps; + +{}; + +
+ + +export default function __AstroComponent_(_props: Props): any {} +/** + * Astro global available in all contexts in .astro files + * + * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) +*/ +declare const Astro: Readonly> +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgTG9jYWxQcm9wcyB7IGE6IHN0cmluZyB9XG5pbnRlcmZhY2UgUmVtb3RlUHJvcHMgeyBiOiBzdHJpbmcgfVxuZXhwb3J0IHR5cGUgUHJvcHMgPSBMb2NhbFByb3BzIHwgUmVtb3RlUHJvcHM7XG4tLS1cbjxkaXYvPlxuIl0sIm1hcHBpbmdzIjoiQTs7QUFBQSxBQUFHO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbkMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBLEc7QUFDMUM7QUFDSCxDQUFDLEdBQUksRUFBQztBQUNOO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/props_generic.snap b/crates/astro2tsx/tests/fixtures/props_generic.snap index 4acb78e0..42cf183d 100644 --- a/crates/astro2tsx/tests/fixtures/props_generic.snap +++ b/crates/astro2tsx/tests/fixtures/props_generic.snap @@ -7,7 +7,7 @@ info: end: 80 body: start: 94 - end: 107 + end: 108 scripts: [] styles: [] input_file: crates/astro2tsx/tests/fixtures/props_generic.astro @@ -20,6 +20,7 @@ interface Props { } {}; +
@@ -30,4 +31,4 @@ export default function __AstroComponent_(_props: Props): a * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW50ZXJmYWNlIFByb3BzPFQgZXh0ZW5kcyBzdHJpbmc+IHtcblx0aXRlbTogVDtcbn1cbi0tLVxuPGRpdj48L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QUFBQSxBQUFHO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ25DLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ1QsQ0FBQztBO0EsRztBQUVELENBQUMsR0FBRyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ1g7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHM8VCBleHRlbmRzIHN0cmluZz4ge1xuXHRpdGVtOiBUO1xufVxuLS0tXG48ZGl2PjwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QUFBQSxBQUFHO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ25DLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ1QsQ0FBQztBO0EsRztBQUNFO0FBQ0gsQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/props_generic_invalid.astro b/crates/astro2tsx/tests/fixtures/props_generic_invalid.astro new file mode 100644 index 00000000..87786888 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/props_generic_invalid.astro @@ -0,0 +1,4 @@ +--- +interface Props {} +--- +
diff --git a/crates/astro2tsx/tests/fixtures/props_generic_invalid.snap b/crates/astro2tsx/tests/fixtures/props_generic_invalid.snap new file mode 100644 index 00000000..3d4b4e15 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/props_generic_invalid.snap @@ -0,0 +1,27 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 135 + body: + start: 149 + end: 158 + scripts: [] + styles: [] +input_file: crates/astro2tsx/tests/fixtures/props_generic_invalid.astro +--- +/* @jsxImportSource astro */ + + +interface Props {} + +{}; + +
+ + +export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHM8VCBleHRlbmRzIHsgW2tleTogc3RyaW5nXTogYW55IH0sIFAgZXh0ZW5kcyBzdHJpbmcgPyB7IFtrZXk6IHN0cmluZ106IGFueSB9OiBuZXZlcj4ge31cbi0tLVxuPGRpdi8+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0EsRztBQUNuRztBQUNILENBQUMsR0FBSSxFQUFDO0FBQ047QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/props_imported.snap b/crates/astro2tsx/tests/fixtures/props_imported.snap index 2be8796e..5ccefb05 100644 --- a/crates/astro2tsx/tests/fixtures/props_imported.snap +++ b/crates/astro2tsx/tests/fixtures/props_imported.snap @@ -6,8 +6,8 @@ info: start: 30 end: 70 body: - start: 81 - end: 94 + start: 84 + end: 98 scripts: [] styles: [] input_file: crates/astro2tsx/tests/fixtures/props_imported.astro @@ -17,7 +17,8 @@ input_file: crates/astro2tsx/tests/fixtures/props_imported.astro import type { Props } from './types'; - +{}; +
@@ -28,4 +29,4 @@ export default function __AstroComponent_(_props: Props): any {} * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW1wb3J0IHR5cGUgeyBQcm9wcyB9IGZyb20gJy4vdHlwZXMnO1xuLS0tXG48ZGl2PjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QTtBQUVyQyxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbXBvcnQgdHlwZSB7IFByb3BzIH0gZnJvbSAnLi90eXBlcyc7XG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QSxHO0FBQ2xDO0FBQ0gsQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/props_interface.snap b/crates/astro2tsx/tests/fixtures/props_interface.snap index 987d6cb1..78b4de7b 100644 --- a/crates/astro2tsx/tests/fixtures/props_interface.snap +++ b/crates/astro2tsx/tests/fixtures/props_interface.snap @@ -6,8 +6,8 @@ info: start: 30 end: 99 body: - start: 110 - end: 128 + start: 113 + end: 132 scripts: [] styles: [] input_file: crates/astro2tsx/tests/fixtures/props_interface.astro @@ -20,7 +20,8 @@ interface Props { } const { title } = Astro.props; - +{}; +

{title}

@@ -31,4 +32,4 @@ export default function __AstroComponent_(_props: Props): any {} * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxuaW50ZXJmYWNlIFByb3BzIHtcblx0dGl0bGU6IHN0cmluZztcbn1cbmNvbnN0IHsgdGl0bGUgfSA9IEFzdHJvLnByb3BzO1xuLS0tXG48aDE+e3RpdGxlfTwvaDE+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNqQixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNmLENBQUM7QUFDRCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0E7QUFFOUIsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQztBQUNoQjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHMge1xuXHR0aXRsZTogc3RyaW5nO1xufVxuY29uc3QgeyB0aXRsZSB9ID0gQXN0cm8ucHJvcHM7XG4tLS1cbjxoMT57dGl0bGV9PC9oMT5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNqQixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNmLENBQUM7QUFDRCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0EsRztBQUMzQjtBQUNILENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUM7QUFDaEI7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/props_polymorphic.astro b/crates/astro2tsx/tests/fixtures/props_polymorphic.astro new file mode 100644 index 00000000..69e03d70 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/props_polymorphic.astro @@ -0,0 +1,6 @@ +--- +interface Props extends HTMLAttributes { + as?: Tag; +} +--- +
diff --git a/crates/astro2tsx/tests/fixtures/props_polymorphic.snap b/crates/astro2tsx/tests/fixtures/props_polymorphic.snap new file mode 100644 index 00000000..47d55ca5 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/props_polymorphic.snap @@ -0,0 +1,34 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 133 + body: + start: 147 + end: 156 + scripts: [] + styles: [] +input_file: crates/astro2tsx/tests/fixtures/props_polymorphic.astro +--- +/* @jsxImportSource astro */ + + +interface Props extends HTMLAttributes { + as?: Tag; +} + +{}; + +
+ + +export default function __AstroComponent_(_props: Props): any {} +/** + * Astro global available in all contexts in .astro files + * + * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) +*/ +declare const Astro: Readonly> +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHM8VGFnIGV4dGVuZHMga2V5b2YgSlNYLkludHJpbnNpY0VsZW1lbnRzPiBleHRlbmRzIEhUTUxBdHRyaWJ1dGVzPFRhZz4ge1xuICBhcz86IFRhZztcbn1cbi0tLVxuPGRpdi8+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDdEYsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ1gsQ0FBQztBO0EsRztBQUNFO0FBQ0gsQ0FBQyxHQUFJLEVBQUM7QUFDTjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/props_type_alias.snap b/crates/astro2tsx/tests/fixtures/props_type_alias.snap index 02d73504..7038f86d 100644 --- a/crates/astro2tsx/tests/fixtures/props_type_alias.snap +++ b/crates/astro2tsx/tests/fixtures/props_type_alias.snap @@ -6,8 +6,8 @@ info: start: 30 end: 64 body: - start: 75 - end: 88 + start: 78 + end: 92 scripts: [] styles: [] input_file: crates/astro2tsx/tests/fixtures/props_type_alias.astro @@ -17,7 +17,8 @@ input_file: crates/astro2tsx/tests/fixtures/props_type_alias.astro type Props = { title: string }; - +{}; +
@@ -28,4 +29,4 @@ export default function __AstroComponent_(_props: Props): any {} * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIi0tLVxudHlwZSBQcm9wcyA9IHsgdGl0bGU6IHN0cmluZyB9O1xuLS0tXG48ZGl2PjwvZGl2PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QTtBQUUvQixDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG50eXBlIFByb3BzID0geyB0aXRsZTogc3RyaW5nIH07XG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QSxHO0FBQzVCO0FBQ0gsQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap index 607c4c20..f5b5e673 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_is_raw.astro
export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXYgaXM6cmF3PjxiPm5vdCBtYXJrdXA8L2I+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsRUFBRSxHQUFHLENBQUM7QUFDbkM7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBpczpyYXc+PGI+bm90IG1hcmt1cDwvYj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsRUFBRSxHQUFHLENBQUM7QUFDbkM7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap index 926ac62b..b2ed40dd 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap @@ -26,4 +26,4 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_script_json.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzY3JpcHQgdHlwZT1cImFwcGxpY2F0aW9uL2pzb25cIj57XCJhXCI6MX08L3NjcmlwdD5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsTSxDQUFPLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFRLEVBQUUsTUFBTSxDQUFDO0FBQ2hEO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHNjcmlwdCB0eXBlPVwiYXBwbGljYXRpb24vanNvblwiPntcImFcIjoxfTwvc2NyaXB0PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsTSxDQUFPLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFRLEVBQUUsTUFBTSxDQUFDO0FBQ2hEO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap index fec5e1de..0459c985 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap @@ -26,4 +26,4 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_script_module.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzY3JpcHQgdHlwZT1cIm1vZHVsZVwiPmNvbnN0IGEgPSAxOzwvc2NyaXB0PlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxNLENBQU8sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFhLEVBQUUsTUFBTSxDQUFDO0FBQzNDO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHNjcmlwdCB0eXBlPVwibW9kdWxlXCI+Y29uc3QgYSA9IDE7PC9zY3JpcHQ+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxNLENBQU8sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFhLEVBQUUsTUFBTSxDQUFDO0FBQzNDO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/raw_text_style.snap b/crates/astro2tsx/tests/fixtures/raw_text_style.snap index 92b869a9..0d2a9a75 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_style.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_style.snap @@ -26,4 +26,4 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_style.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxzdHlsZT4uYSB7IGNvbG9yOiByZWQ7IH08L3N0eWxlPlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxLQUFLLENBQW1CLEVBQUUsS0FBSyxDQUFDO0FBQ2pDO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHN0eWxlPi5hIHsgY29sb3I6IHJlZDsgfTwvc3R5bGU+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxLQUFLLENBQW1CLEVBQUUsS0FBSyxDQUFDO0FBQ2pDO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/script_type_labels.astro b/crates/astro2tsx/tests/fixtures/script_type_labels.astro new file mode 100644 index 00000000..4701dadb --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/script_type_labels.astro @@ -0,0 +1,3 @@ + + + diff --git a/crates/astro2tsx/tests/fixtures/script_type_labels.snap b/crates/astro2tsx/tests/fixtures/script_type_labels.snap new file mode 100644 index 00000000..ee45dbdf --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/script_type_labels.snap @@ -0,0 +1,43 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 174 + scripts: + - kind: Script + lang: inline + generated: + start: 71 + end: 71 + content: go(); + - kind: Script + lang: json + generated: + start: 113 + end: 113 + content: "{\"a\":1}" + - kind: Script + lang: unknown + generated: + start: 163 + end: 163 + content: wat + styles: [] +input_file: crates/astro2tsx/tests/fixtures/script_type_labels.astro +--- +/* @jsxImportSource astro */ + + + + + + + +export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHNjcmlwdCB0eXBlPVwidGV4dC9wYXJ0eXRvd25cIj5nbygpOzwvc2NyaXB0PlxuPHNjcmlwdCB0eXBlPVwic3BlY3VsYXRpb25ydWxlc1wiPntcImFcIjoxfTwvc2NyaXB0PlxuPHNjcmlwdCBpczppbmxpbmUgdHlwZT1cInRleHQveC11bmtub3duXCI+d2F0PC9zY3JpcHQ+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxNLENBQU8sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBTSxFQUFFLE1BQU0sQ0FBQztBQUM1QyxDQUFDLE0sQ0FBTyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBUSxFQUFFLE1BQU0sQ0FBQztBQUNoRCxDQUFDLE0sQ0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUksRUFBRSxNQUFNLENBQUM7QUFDcEQ7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/slot_element.snap b/crates/astro2tsx/tests/fixtures/slot_element.snap index c9071bed..5ce75c6b 100644 --- a/crates/astro2tsx/tests/fixtures/slot_element.snap +++ b/crates/astro2tsx/tests/fixtures/slot_element.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/slot_element.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PHNsb3QgbmFtZT1cImFcIiAvPjxzbG90IC8+PC9kaXY+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEksQ0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBRSxFQUFDLENBQUMsSUFBSSxDQUFFLEVBQUMsRUFBRSxHQUFHLENBQUM7QUFDcEM7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj48c2xvdCBuYW1lPVwiYVwiIC8+PHNsb3QgLz48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEksQ0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBRSxFQUFDLENBQUMsSUFBSSxDQUFFLEVBQUMsRUFBRSxHQUFHLENBQUM7QUFDcEM7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/slots.snap b/crates/astro2tsx/tests/fixtures/slots.snap index 476a5a3c..681aa1a3 100644 --- a/crates/astro2tsx/tests/fixtures/slots.snap +++ b/crates/astro2tsx/tests/fixtures/slots.snap @@ -23,4 +23,4 @@ input_file: crates/astro2tsx/tests/fixtures/slots.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxMYXlvdXQ+XG5cdDxzcGFuIHNsb3Q9XCJoZWFkZXJcIj5IPC9zcGFuPlxuXHQ8cD5ib2R5PC9wPlxuPC9MYXlvdXQ+XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLE1BQU0sQ0FBQztBQUNSLENBQUMsQ0FBQyxJLENBQUssSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUM7QUFDN0IsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQ1osRUFBRSxNQUFNLENBQUM7QUFDVDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPExheW91dD5cblx0PHNwYW4gc2xvdD1cImhlYWRlclwiPkg8L3NwYW4+XG5cdDxwPmJvZHk8L3A+XG48L0xheW91dD5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLE1BQU0sQ0FBQztBQUNSLENBQUMsQ0FBQyxJLENBQUssSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUM7QUFDN0IsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQ1osRUFBRSxNQUFNLENBQUM7QUFDVDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/style_lang_label.astro b/crates/astro2tsx/tests/fixtures/style_lang_label.astro new file mode 100644 index 00000000..09f71f5a --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/style_lang_label.astro @@ -0,0 +1 @@ + diff --git a/crates/astro2tsx/tests/fixtures/style_lang_label.snap b/crates/astro2tsx/tests/fixtures/style_lang_label.snap new file mode 100644 index 00000000..1af2c300 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/style_lang_label.snap @@ -0,0 +1,29 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 70 + scripts: [] + styles: + - kind: Style + lang: scss + generated: + start: 60 + end: 60 + content: ".a { color: red; }" +input_file: crates/astro2tsx/tests/fixtures/style_lang_label.astro +--- +/* @jsxImportSource astro */ + + + + + +export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHN0eWxlIGxhbmc9XCJzY3NzXCI+LmEgeyBjb2xvcjogcmVkOyB9PC9zdHlsZT5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEssQ0FBTSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBbUIsRUFBRSxLQUFLLENBQUM7QUFDN0M7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.astro b/crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.astro new file mode 100644 index 00000000..bc87018d --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.astro @@ -0,0 +1,2 @@ +
spaced
diff --git a/crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.snap b/crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.snap new file mode 100644 index 00000000..5ec45f39 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.snap @@ -0,0 +1,23 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 78 + scripts: [] + styles: [] +input_file: crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.astro +--- +/* @jsxImportSource astro */ + + +
spaced
+ +
+export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiAgIGNsYXNzPVwiYVwiXG5cdGlkPVwiYlwiICAgPnNwYWNlZDwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFNLEtBQUssQ0FBQyxDQUFDLENBQUMsQyxDQUNkLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDdkI7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/top_level_returns_nested.astro b/crates/astro2tsx/tests/fixtures/top_level_returns_nested.astro new file mode 100644 index 00000000..171373f7 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/top_level_returns_nested.astro @@ -0,0 +1,10 @@ +--- +if (broken) { + return Astro.redirect("/"); +} +const fn = () => { return 1; }; +function inner() { return 2; } +class C { method() { return 3; } } +return "top"; +--- +
diff --git a/crates/astro2tsx/tests/fixtures/top_level_returns_nested.snap b/crates/astro2tsx/tests/fixtures/top_level_returns_nested.snap new file mode 100644 index 00000000..286c5fd4 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/top_level_returns_nested.snap @@ -0,0 +1,33 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 30 + end: 190 + body: + start: 204 + end: 213 + scripts: [] + styles: [] +input_file: crates/astro2tsx/tests/fixtures/top_level_returns_nested.astro +--- +/* @jsxImportSource astro */ + + +if (broken) { + throw Astro.redirect("/"); +} +const fn = () => { return 1; }; +function inner() { return 2; } +class C { method() { return 3; } } +throw "top"; + +{}; + +
+ + +export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pZiAoYnJva2VuKSB7XG4gIHJldHVybiBBc3Ryby5yZWRpcmVjdChcIi9cIik7XG59XG5jb25zdCBmbiA9ICgpID0+IHsgcmV0dXJuIDE7IH07XG5mdW5jdGlvbiBpbm5lcigpIHsgcmV0dXJuIDI7IH1cbmNsYXNzIEMgeyBtZXRob2QoKSB7IHJldHVybiAzOyB9IH1cbnJldHVybiBcInRvcFwiO1xuLS0tXG48ZGl2Lz5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDYixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDN0IsQ0FBQztBQUNELENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDL0IsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDOUIsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QSxHO0FBQ1Y7QUFDSCxDQUFDLEdBQUksRUFBQztBQUNOO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/unclosed_member_tag.astro b/crates/astro2tsx/tests/fixtures/unclosed_member_tag.astro new file mode 100644 index 00000000..e1bc493d --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/unclosed_member_tag.astro @@ -0,0 +1,5 @@ +--- +const myMarkdown = await import("../content/post.md"); +--- + + + + + +export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5jb25zdCBteU1hcmtkb3duID0gYXdhaXQgaW1wb3J0KFwiLi4vY29udGVudC9wb3N0Lm1kXCIpO1xuLS0tXG5cbjxteU1hcmtkb3duLiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QSxHO0FBQ25EO0FBQ0g7QUFDQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBIn0= diff --git a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap index 6a87c036..b9e03c5f 100644 --- a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap +++ b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/unclosed_tag.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxjb21wb25lbnRzLlxuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDWjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGNvbXBvbmVudHMuXG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDWjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/void_elements.snap b/crates/astro2tsx/tests/fixtures/void_elements.snap index f26f35f1..12d6eb10 100644 --- a/crates/astro2tsx/tests/fixtures/void_elements.snap +++ b/crates/astro2tsx/tests/fixtures/void_elements.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/void_elements.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmFzdHJvIl0sInNvdXJjZXNDb250ZW50IjpbIjxkaXY+PGJyPjxociAvPjxpbWcgc3JjPVwiYS5wbmdcIj48aW5wdXQgdHlwZT1cInRleHRcIj48L2Rpdj5cbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxFQUFDLENBQUMsRUFBRSxDQUFFLEVBQUMsQ0FBQyxHLENBQUksR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBQyxDQUFDLEssQ0FBTSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBQyxFQUFFLEdBQUcsQ0FBQztBQUN6RDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj48YnI+PGhyIC8+PGltZyBzcmM9XCJhLnBuZ1wiPjxpbnB1dCB0eXBlPVwidGV4dFwiPjwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxFQUFDLENBQUMsRUFBRSxDQUFFLEVBQUMsQ0FBQyxHLENBQUksR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBQyxDQUFDLEssQ0FBTSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBQyxFQUFFLEdBQUcsQ0FBQztBQUN6RDtBIn0= diff --git a/crates/astro2tsx/tests/ported_parity.rs b/crates/astro2tsx/tests/ported_parity.rs index f6b38c41..a8398a84 100644 --- a/crates/astro2tsx/tests/ported_parity.rs +++ b/crates/astro2tsx/tests/ported_parity.rs @@ -210,8 +210,7 @@ const SOURCEMAP_CASES: &[(&str, &str, &str)] = &[ ), ]; -// Non-identifier attribute names map onto the opening quote of `"name":`, not the name. -const KNOWN_GAPS: &[&str] = &["template/special-attributes", "windows/special-attributes"]; +const KNOWN_GAPS: &[&str] = &[]; #[test] fn sourcemap_resolves_to_snippet() { diff --git a/crates/astro2tsx/tests/regressions.rs b/crates/astro2tsx/tests/regressions.rs index deddd971..836bdc3b 100644 --- a/crates/astro2tsx/tests/regressions.rs +++ b/crates/astro2tsx/tests/regressions.rs @@ -214,11 +214,67 @@ fn extracted_ranges_are_generated_offsets() { "go()" ); + // An excluded body leaves an empty range between the tags. let tag = convert_to_tsx("", ConvertOptions::default()); let range = tag.styles[0].range; + assert_eq!(range.start, range.end); + assert!(tag.code[..range.start as usize].ends_with("")); +} + +#[test] +fn props_binding_needs_a_local_name() { + for (input, has_props) in [ + ("---\nimport Foo from './Props';\nFoo;\n---\n
", false), + ( + "---\nimport { Props as Other } from './t';\n---\n
", + false, + ), + ("---\nexport { Props } from './t';\n---\n
", false), + ( + "---\n// mentions Props only in a comment\n---\n
", + false, + ), + ( + "---\nimport { Other as Props } from './t';\n---\n
", + true, + ), + ("---\nimport type { Props } from './t';\n---\n
", true), + ("---\nimport Props from './t';\n---\n
", true), + ( + "---\nexport interface Props { a: string }\n---\n
", + true, + ), + ] { + let actual = convert(input); + assert_eq!( + actual.contains("_props: Props"), + has_props, + "wrong Props detection for {input:?}:\n{actual}" + ); + } +} + +#[test] +fn frontmatter_is_terminated_even_when_a_comment_ends_with_a_semicolon() { + let actual = convert("---\nconst x = foo\n// note;\n---\n
"); assert!( - tag.code - .get(range.start as usize..range.end as usize) - .is_some() + actual.contains("{};"), + "`` can continue the unterminated expression:\n{actual}" ); } + +#[test] +fn comments_before_the_first_element_survive() { + for input in [ + "\n
x
", + "---\nconst a = 1;\n---\n\n
x
", + ] { + let actual = convert(input); + assert!( + actual.contains("{/** leading */}") || actual.contains("{/** between */}"), + "a leading comment was dropped for {input:?}:\n{actual}" + ); + assert!(!actual.contains("")) + { + printer.map_nil(); + printer.write("{/**"); + if comment_needs_leading_space(body) { + printer.write(" "); + } + printer.write_comment_body_with_mapping(body, abs(base, piece.text_range().start()) + 4); + printer.map_nil(); + printer.write("*/}"); + return; + } + printer.write_with_mapping(text, abs(base, piece.text_range().start())); +} + +fn emit_jsx_text(printer: &mut Printer, text: &JsxText, base: u32) { + let Ok(token) = text.value_token() else { + return; + }; + for piece in token.leading_trivia().pieces() { + emit_trivia(printer, &piece, base); + } + printer.write_jsx_text_with_mapping( + token.text_trimmed(), + abs(base, token.text_trimmed_range().start()), + ); + for piece in token.trailing_trivia().pieces() { + emit_trivia(printer, &piece, base); + } +} + +fn emit_jsx_fragment(printer: &mut Printer, fragment: &JsxFragment, base: u32) { + let implicit = fragment.is_implicit(); + if implicit { + printer.map_nil(); + printer.write(""); + } else if let Ok(opening) = fragment.opening_fragment() { + emit_node(printer, opening.syntax(), base); + } + for child in fragment.children() { + emit_node(printer, child.syntax(), base); + } + if implicit { + printer.map_nil(); + printer.write(""); + } else if let Ok(closing) = fragment.closing_fragment() { + emit_node(printer, closing.syntax(), base); + } +} + +enum ChildrenMode { + Normal, + /// `} diff --git a/crates/astro2tsx/tests/fixtures/expression_script_exclusion.snap b/crates/astro2tsx/tests/fixtures/expression_script_exclusion.snap new file mode 100644 index 00000000..d8e3fc6e --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/expression_script_exclusion.snap @@ -0,0 +1,29 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 70 + scripts: + - kind: Script + lang: processed-module + generated: + start: 58 + end: 58 + content: "if (a < b) { go(); }" + styles: [] +input_file: crates/astro2tsx/tests/fixtures/expression_script_exclusion.astro +--- +/* @jsxImportSource astro */ + + +{cond && } + + +export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPHNjcmlwdD5pZiAoYSA8IGIpIHsgZ28oKTsgfTwvc2NyaXB0Pn1cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQXFCLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDL0M7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/expression_shorthand_attr.astro b/crates/astro2tsx/tests/fixtures/expression_shorthand_attr.astro new file mode 100644 index 00000000..48d64935 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/expression_shorthand_attr.astro @@ -0,0 +1 @@ +{cond && } diff --git a/crates/astro2tsx/tests/fixtures/expression_shorthand_attr.snap b/crates/astro2tsx/tests/fixtures/expression_shorthand_attr.snap new file mode 100644 index 00000000..6f300d52 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/expression_shorthand_attr.snap @@ -0,0 +1,23 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 74 + scripts: [] + styles: [] +input_file: crates/astro2tsx/tests/fixtures/expression_shorthand_attr.astro +--- +/* @jsxImportSource astro */ + + +{cond && } + + +export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPENhcmQge3RpdGxlfSAvPn1cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsRUFBSixDQUFDLENBQUMsQ0FBQyxDQUFDLEMsQ0FBRyxDQUFDLENBQUMsQ0FBQztBQUMxQjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_style_exclusion.astro b/crates/astro2tsx/tests/fixtures/expression_style_exclusion.astro new file mode 100644 index 00000000..8cac4e65 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/expression_style_exclusion.astro @@ -0,0 +1 @@ +{cond && } diff --git a/crates/astro2tsx/tests/fixtures/expression_style_exclusion.snap b/crates/astro2tsx/tests/fixtures/expression_style_exclusion.snap new file mode 100644 index 00000000..10309cfd --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/expression_style_exclusion.snap @@ -0,0 +1,29 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 68 + scripts: [] + styles: + - kind: Style + lang: css + generated: + start: 57 + end: 57 + content: ".a{color:red}" +input_file: crates/astro2tsx/tests/fixtures/expression_style_exclusion.astro +--- +/* @jsxImportSource astro */ + + +{cond && } + + +export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPHN0eWxlPi5he2NvbG9yOnJlZH08L3N0eWxlPn1cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFjLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3RDO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/expression_void_element.astro b/crates/astro2tsx/tests/fixtures/expression_void_element.astro new file mode 100644 index 00000000..a7da0caf --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/expression_void_element.astro @@ -0,0 +1 @@ +{items.map(i =>
  • {i}
  • )} diff --git a/crates/astro2tsx/tests/fixtures/expression_void_element.snap b/crates/astro2tsx/tests/fixtures/expression_void_element.snap new file mode 100644 index 00000000..ddd7ccf3 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/expression_void_element.snap @@ -0,0 +1,23 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 78 + scripts: [] + styles: [] +input_file: crates/astro2tsx/tests/fixtures/expression_void_element.astro +--- +/* @jsxImportSource astro */ + + +{items.map(i =>
  • {i}
  • )} + +
    +export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2l0ZW1zLm1hcChpID0+IDxsaT57aX08YnI+PC9saT4pfVxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsQztBIn0= From 79c7a7c33306afa955c9e81bce3e3ed8079df70e Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 19:12:18 +0200 Subject: [PATCH 36/50] feat(astro2tsx): parse astro attribute and comment syntax inside expressions --- Cargo.toml | 12 ++-- crates/astro2tsx/src/expression.rs | 8 +++ crates/astro2tsx/src/render.rs | 65 +------------------ crates/astro2tsx/src/utils.rs | 13 ---- .../tests/fixtures/expression_bare_gt.astro | 1 + .../tests/fixtures/expression_bare_gt.snap | 23 +++++++ .../expression_special_attr_names.astro | 1 + .../expression_special_attr_names.snap | 23 +++++++ .../fixtures/expression_template_attr.astro | 1 + .../fixtures/expression_template_attr.snap | 23 +++++++ .../fixtures/expression_unquoted_attr.astro | 1 + .../fixtures/expression_unquoted_attr.snap | 23 +++++++ 12 files changed, 111 insertions(+), 83 deletions(-) create mode 100644 crates/astro2tsx/tests/fixtures/expression_bare_gt.astro create mode 100644 crates/astro2tsx/tests/fixtures/expression_bare_gt.snap create mode 100644 crates/astro2tsx/tests/fixtures/expression_special_attr_names.astro create mode 100644 crates/astro2tsx/tests/fixtures/expression_special_attr_names.snap create mode 100644 crates/astro2tsx/tests/fixtures/expression_template_attr.astro create mode 100644 crates/astro2tsx/tests/fixtures/expression_template_attr.snap create mode 100644 crates/astro2tsx/tests/fixtures/expression_unquoted_attr.astro create mode 100644 crates/astro2tsx/tests/fixtures/expression_unquoted_attr.snap diff --git a/Cargo.toml b/Cargo.toml index 76667b46..5690a37c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,12 +34,12 @@ oxc_transformer = { git = "https://github.com/withastro/oxc", rev = "8bb526fc0c2 oxc_sourcemap = "6.0.1" # Biome dependencies via git, all pinned to the same fork revision -biome_html_parser = { git = "https://github.com/Princesseuh/biome", rev = "2e96281bb1bfb2601d07929de917b6b64030663f" } -biome_html_syntax = { git = "https://github.com/Princesseuh/biome", rev = "2e96281bb1bfb2601d07929de917b6b64030663f" } -biome_js_parser = { git = "https://github.com/Princesseuh/biome", rev = "2e96281bb1bfb2601d07929de917b6b64030663f" } -biome_js_syntax = { git = "https://github.com/Princesseuh/biome", rev = "2e96281bb1bfb2601d07929de917b6b64030663f" } -biome_languages = { git = "https://github.com/Princesseuh/biome", rev = "2e96281bb1bfb2601d07929de917b6b64030663f" } -biome_rowan = { git = "https://github.com/Princesseuh/biome", rev = "2e96281bb1bfb2601d07929de917b6b64030663f" } +biome_html_parser = { git = "https://github.com/Princesseuh/biome", rev = "310ebae9ba53a72cfc469ae7d453ab3e8b860913" } +biome_html_syntax = { git = "https://github.com/Princesseuh/biome", rev = "310ebae9ba53a72cfc469ae7d453ab3e8b860913" } +biome_js_parser = { git = "https://github.com/Princesseuh/biome", rev = "310ebae9ba53a72cfc469ae7d453ab3e8b860913" } +biome_js_syntax = { git = "https://github.com/Princesseuh/biome", rev = "310ebae9ba53a72cfc469ae7d453ab3e8b860913" } +biome_languages = { git = "https://github.com/Princesseuh/biome", rev = "310ebae9ba53a72cfc469ae7d453ab3e8b860913" } +biome_rowan = { git = "https://github.com/Princesseuh/biome", rev = "310ebae9ba53a72cfc469ae7d453ab3e8b860913" } # NAPI napi = { version = "3", features = ["tokio_rt"] } diff --git a/crates/astro2tsx/src/expression.rs b/crates/astro2tsx/src/expression.rs index 44acecd8..f0d6f480 100644 --- a/crates/astro2tsx/src/expression.rs +++ b/crates/astro2tsx/src/expression.rs @@ -364,6 +364,14 @@ fn emit_plain_jsx_attribute(printer: &mut Printer, attribute: &JsxAttribute, bas AnyJsxAttributeValue::AnyJsxTag(tag) => { emit_node(printer, tag.syntax(), base); } + // Astro's `attr=`t${x}`` needs braces to be a TSX attribute value. + AnyJsxAttributeValue::JsTemplateExpression(template) => { + printer.map_nil(); + printer.write("{"); + emit_node(printer, template.syntax(), base); + printer.map_nil(); + printer.write("}"); + } } } diff --git a/crates/astro2tsx/src/render.rs b/crates/astro2tsx/src/render.rs index 92e9b754..500b82f5 100644 --- a/crates/astro2tsx/src/render.rs +++ b/crates/astro2tsx/src/render.rs @@ -19,7 +19,7 @@ use crate::props::{PropsAnalysis, analyze as analyze_props}; use crate::sourcemap::GeneratedRange; use crate::utils::{ ScriptKind, classify_script_type, comment_needs_leading_space, encode_double_quote, - escape_comment_body, is_html_event_attribute, is_valid_tsx_attribute_name, tsx_component_name, + is_html_event_attribute, is_valid_tsx_attribute_name, tsx_component_name, }; const TSX_PREFIX: &str = "/* @jsxImportSource astro */\n\n"; @@ -340,59 +340,6 @@ fn parse_expression_body(text: &str, base_offset: u32) -> JsOffsetParse { ) } -/// The HTML lexer reads an expression body as one token, so its `` -/// comments must be found by scan; an unterminated comment stays text. -fn split_on_html_comments(text: &str) -> Vec<(usize, &str, bool)> { - let mut segments = Vec::new(); - let mut cursor = 0usize; - while let Some(found) = text[cursor..].find("") else { - break; - }; - let body_end = body_start + close; - if comment_start > cursor { - segments.push((cursor, &text[cursor..comment_start], false)); - } - segments.push((body_start, &text[body_start..body_end], true)); - cursor = body_end + "-->".len(); - } - if cursor < text.len() { - segments.push((cursor, &text[cursor..], false)); - } - segments -} - -/// Translates comments exactly as emission does, so a passing test-parse -/// guarantees the emitted body parses too. -fn html_comments_as_jsx(text: &str) -> String { - let mut out = String::with_capacity(text.len()); - for (_, slice, is_comment) in split_on_html_comments(text) { - if is_comment { - out.push_str("{/**"); - if comment_needs_leading_space(slice) { - out.push(' '); - } - out.push_str(&escape_comment_body(slice)); - out.push_str("*/}"); - } else { - out.push_str(slice); - } - } - out -} - -fn emit_expression_with_comments(printer: &mut Printer, raw: &str, original_start: u32) { - for (offset, slice, is_comment) in split_on_html_comments(raw) { - if is_comment { - emit_html_comment(printer, slice, original_start + offset as u32); - } else { - printer.write_with_mapping(slice, original_start + offset as u32); - } - } -} - fn emit_expression_body(printer: &mut Printer, raw: &str, original_start: u32) { let parse = parse_expression_body(raw, original_start); if parse.diagnostics().is_empty() { @@ -400,16 +347,6 @@ fn emit_expression_body(printer: &mut Printer, raw: &str, original_start: u32) { emit_expression_tree(printer, syntax.inner(), original_start); return; } - // HTML comments are not a JS production, so a body carrying one cannot parse - // until they are rewritten as JSX comments. - if raw.contains("")) { printer.map_nil(); - printer.write("{/**"); + printer.write(if in_children { "{/**" } else { "/**" }); if comment_needs_leading_space(body) { printer.write(" "); } printer.write_comment_body_with_mapping(body, abs(base, piece.text_range().start()) + 4); printer.map_nil(); - printer.write("*/}"); + printer.write(if in_children { "*/}" } else { "*/" }); return; } printer.write_with_mapping(text, abs(base, piece.text_range().start())); @@ -100,14 +105,14 @@ fn emit_jsx_text(printer: &mut Printer, text: &JsxText, base: u32) { return; }; for piece in token.leading_trivia().pieces() { - emit_trivia(printer, &piece, base); + emit_trivia(printer, &piece, base, true); } printer.write_jsx_text_with_mapping( token.text_trimmed(), abs(base, token.text_trimmed_range().start()), ); for piece in token.trailing_trivia().pieces() { - emit_trivia(printer, &piece, base); + emit_trivia(printer, &piece, base, true); } } @@ -117,16 +122,16 @@ fn emit_jsx_fragment(printer: &mut Printer, fragment: &JsxFragment, base: u32) { printer.map_nil(); printer.write(""); } else if let Ok(opening) = fragment.opening_fragment() { - emit_node(printer, opening.syntax(), base); + emit_node(printer, opening.syntax(), base, true); } for child in fragment.children() { - emit_node(printer, child.syntax(), base); + emit_node(printer, child.syntax(), base, true); } if implicit { printer.map_nil(); printer.write(""); } else if let Ok(closing) = fragment.closing_fragment() { - emit_node(printer, closing.syntax(), base); + emit_node(printer, closing.syntax(), base, false); } } @@ -168,21 +173,30 @@ fn emit_jsx_element(printer: &mut Printer, element: &JsxElement, base: u32) { let mode = children_mode(&name_text, &opening.attributes()); if let Ok(l_angle) = opening.l_angle_token() { - emit_token(printer, &l_angle, base); + emit_token(printer, &l_angle, base, false); } if let Ok(name) = opening.name() { emit_verbatim(printer, name.syntax(), base); } emit_jsx_attributes(printer, &opening.attributes(), base); if let Ok(r_angle) = opening.r_angle_token() { - emit_token(printer, &r_angle, base); + for piece in r_angle.leading_trivia().pieces() { + emit_trivia(printer, &piece, base, false); + } + printer.write_with_mapping( + r_angle.text_trimmed(), + abs(base, r_angle.text_trimmed_range().start()), + ); + for piece in r_angle.trailing_trivia().pieces() { + emit_trivia(printer, &piece, base, true); + } } let body_start = printer.position(); match mode { ChildrenMode::Normal => { for child in element.children() { - emit_node(printer, child.syntax(), base); + emit_node(printer, child.syntax(), base, true); } } ChildrenMode::RawTemplate => { @@ -215,7 +229,20 @@ fn emit_jsx_element(printer: &mut Printer, element: &JsxElement, base: u32) { } if let Ok(closing) = element.closing_element() { - emit_verbatim(printer, closing.syntax(), base); + let mut first = true; + for child in closing.syntax().children_with_tokens() { + match child { + biome_rowan::SyntaxElement::Token(token) => { + // The `<` of `` carries children-position leading trivia. + emit_token(printer, &token, base, first); + first = false; + } + biome_rowan::SyntaxElement::Node(node) => { + emit_verbatim(printer, &node, base); + first = false; + } + } + } } } @@ -240,7 +267,7 @@ fn children_source_span(element: &JsxElement) -> Option<(TextSize, TextSize)> { fn emit_self_closing_element(printer: &mut Printer, element: &JsxSelfClosingElement, base: u32) { if let Ok(l_angle) = element.l_angle_token() { - emit_token(printer, &l_angle, base); + emit_token(printer, &l_angle, base, false); } if let Ok(name) = element.name() { emit_verbatim(printer, name.syntax(), base); @@ -248,16 +275,16 @@ fn emit_self_closing_element(printer: &mut Printer, element: &JsxSelfClosingElem emit_jsx_attributes(printer, &element.attributes(), base); match element.slash_token() { Some(slash) => { - emit_token(printer, &slash, base); + emit_token(printer, &slash, base, false); if let Ok(r_angle) = element.r_angle_token() { - emit_token(printer, &r_angle, base); + emit_token(printer, &r_angle, base, false); } } // A void element parses without `/`, but TSX requires the slash. None => { if let Ok(r_angle) = element.r_angle_token() { for piece in r_angle.leading_trivia().pieces() { - emit_trivia(printer, &piece, base); + emit_trivia(printer, &piece, base, false); } printer.map_nil(); printer.write("/"); @@ -266,7 +293,7 @@ fn emit_self_closing_element(printer: &mut Printer, element: &JsxSelfClosingElem abs(base, r_angle.text_trimmed_range().start()), ); for piece in r_angle.trailing_trivia().pieces() { - emit_trivia(printer, &piece, base); + emit_trivia(printer, &piece, base, false); } } else { printer.map_nil(); @@ -280,7 +307,7 @@ fn emit_verbatim(printer: &mut Printer, node: &JsNode, base: u32) { for child in node.children_with_tokens() { match child { biome_rowan::SyntaxElement::Node(child) => emit_verbatim(printer, &child, base), - biome_rowan::SyntaxElement::Token(token) => emit_token(printer, &token, base), + biome_rowan::SyntaxElement::Token(token) => emit_token(printer, &token, base, false), } } } @@ -313,7 +340,7 @@ fn emit_jsx_attributes(printer: &mut Printer, attributes: &JsxAttributeList, bas let start = abs(base, token.text_trimmed_range().start()); if let Ok(l_curly) = shorthand.l_curly_token() { for piece in l_curly.leading_trivia().pieces() { - emit_trivia(printer, &piece, base); + emit_trivia(printer, &piece, base, false); } } printer.write_with_mapping(&text, start); @@ -325,7 +352,7 @@ fn emit_jsx_attributes(printer: &mut Printer, attributes: &JsxAttributeList, bas } } AnyJsxAttribute::JsxSpreadAttribute(spread) => { - emit_node(printer, spread.syntax(), base); + emit_node(printer, spread.syntax(), base, false); } _ => {} } @@ -351,7 +378,7 @@ fn emit_plain_jsx_attribute(printer: &mut Printer, attribute: &JsxAttribute, bas return; }; if let Ok(eq) = initializer.eq_token() { - emit_token(printer, &eq, base); + emit_token(printer, &eq, base, false); } let Ok(value) = initializer.value() else { return; @@ -359,16 +386,16 @@ fn emit_plain_jsx_attribute(printer: &mut Printer, attribute: &JsxAttribute, bas match &value { AnyJsxAttributeValue::JsxString(string) => emit_jsx_string(printer, string, base), AnyJsxAttributeValue::JsxExpressionAttributeValue(expression) => { - emit_node(printer, expression.syntax(), base); + emit_node(printer, expression.syntax(), base, false); } AnyJsxAttributeValue::AnyJsxTag(tag) => { - emit_node(printer, tag.syntax(), base); + emit_node(printer, tag.syntax(), base, false); } // Astro's `attr=`t${x}`` needs braces to be a TSX attribute value. AnyJsxAttributeValue::JsTemplateExpression(template) => { printer.map_nil(); printer.write("{"); - emit_node(printer, template.syntax(), base); + emit_node(printer, template.syntax(), base, false); printer.map_nil(); printer.write("}"); } @@ -382,11 +409,11 @@ fn emit_jsx_string(printer: &mut Printer, string: &JsxString, base: u32) { }; let text = token.text_trimmed(); if text.starts_with('"') || text.starts_with('\'') { - emit_token(printer, &token, base); + emit_token(printer, &token, base, false); return; } for piece in token.leading_trivia().pieces() { - emit_trivia(printer, &piece, base); + emit_trivia(printer, &piece, base, false); } let start = abs(base, token.text_trimmed_range().start()); printer.map_to_offset(start); @@ -400,7 +427,7 @@ fn emit_jsx_string(printer: &mut Printer, string: &JsxString, base: u32) { printer.map_nil(); printer.write("\""); for piece in token.trailing_trivia().pieces() { - emit_trivia(printer, &piece, base); + emit_trivia(printer, &piece, base, false); } } @@ -451,7 +478,7 @@ fn emit_invalid_jsx_attribute( printer.map_nil(); printer.write("("); if let Ok(inner) = expression.expression() { - emit_node(printer, inner.syntax(), base); + emit_node(printer, inner.syntax(), base, false); } else { printer.write("void 0"); } diff --git a/crates/astro2tsx/tests/fixtures/expression_comment_only.astro b/crates/astro2tsx/tests/fixtures/expression_comment_only.astro index 018cc2a2..e0d83469 100644 --- a/crates/astro2tsx/tests/fixtures/expression_comment_only.astro +++ b/crates/astro2tsx/tests/fixtures/expression_comment_only.astro @@ -1 +1 @@ -
    {/* keep me */}
    +{} diff --git a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap index 0d24ae6e..a0845567 100644 --- a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap +++ b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap @@ -7,7 +7,7 @@ info: end: 0 body: start: 41 - end: 69 + end: 63 scripts: [] styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_comment_only.astro @@ -15,9 +15,9 @@ input_file: crates/astro2tsx/tests/fixtures/expression_comment_only.astro /* @jsxImportSource astro */ -
    {/* keep me */}
    +{/** just a note */}
    export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Lyoga2VlcCBtZSAqL308L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUMxQjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiezwhLS0ganVzdCBhIG5vdGUgLS0+fVxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLEMsR0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUksQ0FBQztBQUN0QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_comment_trailing.astro b/crates/astro2tsx/tests/fixtures/expression_comment_trailing.astro new file mode 100644 index 00000000..67864e6b --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/expression_comment_trailing.astro @@ -0,0 +1 @@ +{x && hi } diff --git a/crates/astro2tsx/tests/fixtures/expression_comment_trailing.snap b/crates/astro2tsx/tests/fixtures/expression_comment_trailing.snap new file mode 100644 index 00000000..5d033889 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/expression_comment_trailing.snap @@ -0,0 +1,23 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 80 + scripts: [] + styles: [] +input_file: crates/astro2tsx/tests/fixtures/expression_comment_trailing.astro +--- +/* @jsxImportSource astro */ + + +{x && hi /** trailing note */} + + +export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie3ggJiYgPGE+aGk8L2E+IDwhLS0gdHJhaWxpbmcgbm90ZSAtLT59XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxHQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUksQ0FBQztBQUN2QztBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.astro b/crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.astro new file mode 100644 index 00000000..ff454fa4 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.astro @@ -0,0 +1 @@ +{cond &&
    if (a < b) { weird } text
    } diff --git a/crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.snap b/crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.snap new file mode 100644 index 00000000..d618c375 --- /dev/null +++ b/crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.snap @@ -0,0 +1,23 @@ +--- +source: crates/astro2tsx/tests/snapshots.rs +info: + has_parse_errors: false + frontmatter: + start: 0 + end: 0 + body: + start: 41 + end: 100 + scripts: [] + styles: [] +input_file: crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.astro +--- +/* @jsxImportSource astro */ + + +{cond &&
    {`if (a < b) { weird } text`}
    } + +
    +export default function __AstroComponent_(_props: Record): any {} + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPGRpdiBpczpyYXc+aWYgKGEgPCBiKSB7IHdlaXJkIH0gdGV4dDwvZGl2Pn1cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxFQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsRUFBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3JEO0EifQ== From 620718f5344bd1aef3dd14b3fc2642d97f8bc190 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 22:10:03 +0200 Subject: [PATCH 38/50] perf(astro2tsx): emit run-length mappings instead of per-character pairs --- crates/astro2tsx/index.d.ts | 3 +- crates/astro2tsx/package.json | 3 +- crates/astro2tsx/src/lib.rs | 3 +- crates/astro2tsx/src/napi.rs | 3 +- crates/astro2tsx/src/printer.rs | 38 +++-- crates/astro2tsx/src/sourcemap.rs | 25 ++- crates/astro2tsx/test/astro2tsx.test.ts | 43 +++++ .../fixtures/adjacent_siblings_top_level.snap | 2 +- .../fixtures/attribute_event_and_style.snap | 2 +- .../fixtures/attribute_expression_jsx.snap | 2 +- .../fixtures/attribute_expression_value.snap | 2 +- .../fixtures/attribute_invalid_names.snap | 2 +- .../fixtures/attribute_quoted_forms.snap | 2 +- .../tests/fixtures/attribute_shorthand.snap | 2 +- .../tests/fixtures/attribute_spread.snap | 2 +- .../fixtures/attribute_template_literal.snap | 2 +- .../comment_between_frontmatter_and_body.snap | 2 +- .../tests/fixtures/crlf_frontmatter.snap | 2 +- .../astro2tsx/tests/fixtures/directives.snap | 2 +- .../tests/fixtures/escape_comment_bodies.snap | 2 +- .../expression_adjacent_siblings.snap | 2 +- .../tests/fixtures/expression_bare_gt.snap | 2 +- .../fixtures/expression_comment_only.snap | 2 +- .../fixtures/expression_comment_trailing.snap | 2 +- .../tests/fixtures/expression_empty.snap | 2 +- .../tests/fixtures/expression_generics.snap | 2 +- .../fixtures/expression_html_comment.snap | 2 +- .../tests/fixtures/expression_identifier.snap | 2 +- .../tests/fixtures/expression_is_raw.snap | 2 +- .../expression_is_raw_unparseable.snap | 2 +- .../tests/fixtures/expression_map.snap | 2 +- .../tests/fixtures/expression_nested.snap | 2 +- .../fixtures/expression_object_literal.snap | 2 +- .../fixtures/expression_script_exclusion.snap | 2 +- .../fixtures/expression_shorthand_attr.snap | 2 +- .../fixtures/expression_single_element.snap | 2 +- .../expression_special_attr_names.snap | 2 +- .../fixtures/expression_spread_child.snap | 4 +- .../expression_string_with_markup.snap | 2 +- .../fixtures/expression_style_exclusion.snap | 2 +- .../fixtures/expression_template_attr.snap | 2 +- .../expression_template_with_markup.snap | 2 +- .../fixtures/expression_ternary_markup.snap | 2 +- .../fixtures/expression_unquoted_attr.snap | 2 +- .../fixtures/expression_void_element.snap | 2 +- .../tests/fixtures/fragment_shorthand.snap | 2 +- .../tests/fixtures/frontmatter_absent.snap | 2 +- .../tests/fixtures/frontmatter_and_body.snap | 2 +- .../tests/fixtures/frontmatter_empty.snap | 2 +- .../tests/fixtures/frontmatter_imports.snap | 2 +- .../tests/fixtures/frontmatter_only.snap | 2 +- .../frontmatter_top_level_return.snap | 2 +- .../fixtures/get_static_paths_export.snap | 2 +- .../fixtures/get_static_paths_with_props.snap | 2 +- .../tests/fixtures/html_comment_body.snap | 2 +- .../fixtures/html_comment_top_level.snap | 2 +- .../astro2tsx/tests/fixtures/multibyte.snap | 2 +- .../tests/fixtures/multibyte_astral.snap | 2 +- .../fixtures/named_component_export.snap | 2 +- .../fixtures/props_exported_alias_union.snap | 2 +- .../tests/fixtures/props_generic.snap | 2 +- .../tests/fixtures/props_generic_invalid.snap | 2 +- .../tests/fixtures/props_imported.snap | 2 +- .../tests/fixtures/props_interface.snap | 2 +- .../tests/fixtures/props_polymorphic.snap | 2 +- .../tests/fixtures/props_type_alias.snap | 2 +- .../tests/fixtures/raw_text_is_raw.snap | 2 +- .../tests/fixtures/raw_text_script_json.snap | 2 +- .../fixtures/raw_text_script_module.snap | 2 +- .../tests/fixtures/raw_text_style.snap | 2 +- .../tests/fixtures/script_type_labels.snap | 2 +- .../tests/fixtures/slot_element.snap | 2 +- crates/astro2tsx/tests/fixtures/slots.snap | 2 +- .../tests/fixtures/style_lang_label.snap | 2 +- .../fixtures/tag_whitespace_collapsing.snap | 2 +- .../fixtures/top_level_returns_nested.snap | 2 +- .../tests/fixtures/unclosed_member_tag.snap | 2 +- .../tests/fixtures/unclosed_tag.snap | 2 +- .../tests/fixtures/void_elements.snap | 2 +- crates/astro2tsx/tests/ported_parity.rs | 55 ++++--- crates/astro2tsx/tests/source_map.rs | 152 ++++++++++++------ pnpm-lock.yaml | 36 ++++- 82 files changed, 345 insertions(+), 162 deletions(-) diff --git a/crates/astro2tsx/index.d.ts b/crates/astro2tsx/index.d.ts index 46be3200..1e1e3e00 100644 --- a/crates/astro2tsx/index.d.ts +++ b/crates/astro2tsx/index.d.ts @@ -23,7 +23,8 @@ export interface ConvertToTsxResult { code: string /** * Flat `(generated, original)` byte-offset pairs, ascending by generated - * offset; an original of `0xFFFF_FFFF` marks synthetic output. + * offset. Each pair opens a run: both offsets advance in lockstep until + * the next pair. An original of `0xFFFF_FFFF` opens an unmapped run. */ mappings: Uint32Array /** Source Map v3 JSON for `code`, with `sourcesContent` embedded. */ diff --git a/crates/astro2tsx/package.json b/crates/astro2tsx/package.json index 5034a98e..fbfafd43 100644 --- a/crates/astro2tsx/package.json +++ b/crates/astro2tsx/package.json @@ -26,7 +26,8 @@ }, "devDependencies": { "@napi-rs/cli": "^3", - "@types/node": "^22" + "@types/node": "^22", + "typescript": "^5.9.3" }, "engines": { "node": "^20.19.0 || >=22.12.0" diff --git a/crates/astro2tsx/src/lib.rs b/crates/astro2tsx/src/lib.rs index 88eb043b..f5fb9d7d 100644 --- a/crates/astro2tsx/src/lib.rs +++ b/crates/astro2tsx/src/lib.rs @@ -35,7 +35,8 @@ pub struct ConvertOptions { #[derive(Debug, Default)] pub struct ConvertResult { pub code: String, - /// `(generated_offset, original_offset)` pairs. + /// Run starts, ascending: each mapping holds until the next one, with + /// generated and original offsets advancing in lockstep. pub mappings: Vec, /// Generated byte range covering the printed frontmatter section. pub frontmatter: GeneratedRange, diff --git a/crates/astro2tsx/src/napi.rs b/crates/astro2tsx/src/napi.rs index 28ba9c98..290683c4 100644 --- a/crates/astro2tsx/src/napi.rs +++ b/crates/astro2tsx/src/napi.rs @@ -49,7 +49,8 @@ pub struct ConvertToTsxOptions { pub struct ConvertToTsxResult { pub code: String, /// Flat `(generated, original)` byte-offset pairs, ascending by generated - /// offset; an original of `0xFFFF_FFFF` marks synthetic output. + /// offset. Each pair opens a run: both offsets advance in lockstep until + /// the next pair. An original of `0xFFFF_FFFF` opens an unmapped run. pub mappings: Uint32Array, /// Source Map v3 JSON for `code`, with `sourcesContent` embedded. pub map: String, diff --git a/crates/astro2tsx/src/printer.rs b/crates/astro2tsx/src/printer.rs index f25c4392..4b774180 100644 --- a/crates/astro2tsx/src/printer.rs +++ b/crates/astro2tsx/src/printer.rs @@ -44,23 +44,43 @@ impl<'a> Printer<'a> { pub(crate) fn map_to_offset(&mut self, original: u32) { let generated = self.position(); - self.mappings - .push(Mapping::original_at(generated, original)); + self.push_mapping(Mapping::original_at(generated, original)); } pub(crate) fn map_nil(&mut self) { let generated = self.position(); - self.mappings.push(Mapping::nil(generated)); + self.push_mapping(Mapping::nil(generated)); } - /// Emits `text` with per-character mappings starting at `original_start`. + /// A mapping opens a run: generated and original advance in lockstep until + /// the next mapping. Pairs that merely continue the current run are dropped. + fn push_mapping(&mut self, mapping: Mapping) { + if let Some(last) = self.mappings.last_mut() { + if last.generated == mapping.generated { + *last = mapping; + return; + } + let continues = match (last.original, mapping.original) { + (None, None) => true, + (Some(last_original), Some(original)) => { + original.wrapping_sub(last_original) == mapping.generated - last.generated + } + _ => false, + }; + if continues { + return; + } + } + self.mappings.push(mapping); + } + + /// Emits `text` as one lockstep run starting at `original_start`. pub(crate) fn write_with_mapping(&mut self, text: &str, original_start: u32) { - let mut original = original_start; - for ch in text.chars() { - self.map_to_offset(original); - self.output.push(ch); - original += ch.len_utf8() as u32; + if text.is_empty() { + return; } + self.map_to_offset(original_start); + self.output.push_str(text); } /// JSX text cannot contain raw `>` or `}`; they emit as `{\`>\`}`. diff --git a/crates/astro2tsx/src/sourcemap.rs b/crates/astro2tsx/src/sourcemap.rs index b00cadfb..cb7d2a26 100644 --- a/crates/astro2tsx/src/sourcemap.rs +++ b/crates/astro2tsx/src/sourcemap.rs @@ -120,8 +120,9 @@ impl<'a> LineIndex<'a> { } } -/// `mappings` must ascend by generated offset; `source` is embedded as -/// `sourcesContent` so the map stands alone. +/// `mappings` must ascend by generated offset. Each mapping opens a run that +/// lasts until the next one; mapped runs re-emit a segment at every generated +/// line start they span, since source-map columns reset per line. pub(crate) fn encode( source: &str, generated: &str, @@ -132,13 +133,31 @@ pub(crate) fn encode( let source_id = builder.add_source_and_content(source_name, source); let mut source_lines = LineIndex::new(source); let mut generated_lines = LineIndex::new(generated); + let line_starts = generated_lines.line_starts.clone(); + + for (index, mapping) in mappings.iter().enumerate() { + let run_end = mappings + .get(index + 1) + .map(|next| next.generated) + .unwrap_or(generated.len() as u32); - for mapping in mappings { let (dst_line, dst_col) = generated_lines.locate(mapping.generated); match mapping.original { Some(original) => { let (src_line, src_col) = source_lines.locate(original); builder.add_token(dst_line, dst_col, src_line, src_col, Some(source_id), None); + + let first_line_start = + line_starts.partition_point(|&start| start <= mapping.generated as usize); + for &line_start in &line_starts[first_line_start..] { + if line_start as u32 >= run_end { + break; + } + let advanced = original + (line_start as u32 - mapping.generated); + let (dst_line, dst_col) = generated_lines.locate(line_start as u32); + let (src_line, src_col) = source_lines.locate(advanced); + builder.add_token(dst_line, dst_col, src_line, src_col, Some(source_id), None); + } } None => builder.add_token(dst_line, dst_col, 0, 0, None, None), } diff --git a/crates/astro2tsx/test/astro2tsx.test.ts b/crates/astro2tsx/test/astro2tsx.test.ts index 115d3abe..26fe3011 100644 --- a/crates/astro2tsx/test/astro2tsx.test.ts +++ b/crates/astro2tsx/test/astro2tsx.test.ts @@ -1,4 +1,7 @@ +import { readdirSync, readFileSync } from 'node:fs'; +import { join } from 'node:path'; import { strict as assert } from 'node:assert'; +import ts from 'typescript'; import { test } from 'node:test'; import { NO_ORIGINAL, convertToTsx } from '../index.js'; @@ -85,3 +88,43 @@ test("sourcemap: 'external' leaves the code without the comment", () => { assert.equal(external.map, inline.map); assert.ok(inline.code.startsWith(external.code)); }); + +test('every clean-parse fixture emits syntactically valid TSX', async () => { + // Frontmatter is user JS emitted verbatim, so a fixture whose frontmatter is + // itself invalid TS legitimately produces invalid output. + const invalidUserCode = new Set(['props_generic_invalid']); + + const dir = join(import.meta.dirname, '../tests/fixtures'); + let checked = 0; + for (const file of readdirSync(dir)) { + if (!file.endsWith('.astro')) continue; + const name = file.slice(0, -'.astro'.length); + if (invalidUserCode.has(name)) continue; + + let source = readFileSync(join(dir, file), 'utf8'); + while (source.startsWith('// @config ')) { + source = source.slice(source.indexOf('\n') + 1); + } + + const result = convertToTsx(source, { filename: `${name}.astro` }); + if (result.hasParseErrors) continue; + + const sourceFile = ts.createSourceFile( + `${name}.tsx`, + result.code, + ts.ScriptTarget.Latest, + false, + ts.ScriptKind.TSX, + ); + const diagnostics = ( + sourceFile as unknown as { parseDiagnostics: { messageText: unknown; start: number }[] } + ).parseDiagnostics; + assert.deepEqual( + diagnostics.map((d) => `${name}: ${JSON.stringify(d.messageText)} at ${d.start}`), + [], + `invalid TSX emitted for ${name}:\n${result.code}`, + ); + checked++; + } + assert.ok(checked > 50, `expected to check most fixtures, checked ${checked}`); +}); diff --git a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap index fadec325..de96ec07 100644 --- a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap @@ -21,4 +21,4 @@ input_file: crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.astro
    export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHNwYW4+YTwvc3Bhbj5cbjxzcGFuPmI8L3NwYW4+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLElBQUksQ0FBQztBQUNkLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUM7QUFDZDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHNwYW4+YTwvc3Bhbj5cbjxzcGFuPmI8L3NwYW4+XG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQTtBQUNBO0FBQ0E7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap index f7a78f97..97010ed7 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap @@ -32,4 +32,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_event_and_style.astro
    export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBvbmNsaWNrPVwiZ28oKVwiIHN0eWxlPVwiY29sb3I6cmVkXCI+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHLENBQUksT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQzVDO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBvbmNsaWNrPVwiZ28oKVwiIHN0eWxlPVwiY29sb3I6cmVkXCI+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQSxJLENBQUssYyxDQUFlO0FBQ3BCO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/attribute_expression_jsx.snap b/crates/astro2tsx/tests/fixtures/attribute_expression_jsx.snap index 90808285..6ca0f29b 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_expression_jsx.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_expression_jsx.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_expression_jsx.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBkYXRhLW91dD17aXRlbXMubWFwKGkgPT4gPGI+e2l9PC9iPil9IGVtcHR5PXt9PjwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFJLFFBQVEsQyxDQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDLENBQUcsS0FBSyxDLEMsUSxDQUFHLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDMUQ7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBkYXRhLW91dD17aXRlbXMubWFwKGkgPT4gPGI+e2l9PC9iPil9IGVtcHR5PXt9PjwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUEsSSxDQUFLLFMsQ0FBVSwwQixFQUE0QixNLFVBQVE7QUFDbkQ7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap index 35c8d9a2..addea560 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_expression_value.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBjbGFzcz17Y2xzfSBhcmlhLWxhYmVsPXtsYWJlbH0+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHLENBQUksS0FBSyxDLENBQUUsQ0FBQyxDQUFDLEMsQyxDQUFHLFVBQVUsQyxDQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDMUM7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBjbGFzcz17Y2xzfSBhcmlhLWxhYmVsPXtsYWJlbH0+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQSxJLENBQUssTSxDQUFPLEcsRUFBSyxXLENBQVksSyxDQUFNO0FBQ25DO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap index ac3d2f25..1615773e 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_invalid_names.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBAY2xpY2s9e2hhbmRsZXJ9IDpjbGFzcz1cInhcIiBuYW1lPVwib2tcIj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBZ0MsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsTSxDQUFwQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDLEVBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDLEMsQ0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDLEMsRyxFQUFlLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDakQ7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBAY2xpY2s9e2hhbmRsZXJ9IDpjbGFzcz1cInhcIiBuYW1lPVwib2tcIj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBLEksQ0FBaUMsUyxPQUE1QixNLEdBQVEsTyxHQUFTLE0sT0FBb0I7QUFDMUM7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap index 626752eb..e3cb258c 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_quoted_forms.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBpZD0nc2luZ2xlJyBjbGFzcz1cImRvdWJsZVwiIGRhdGEtbj0zIGhpZGRlbj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBSSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLE1BQU0sQ0FBQyxDQUFDLENBQUMsQyxDQUFBLE1BQU0sQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN0RDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBpZD0nc2luZ2xlJyBjbGFzcz1cImRvdWJsZVwiIGRhdGEtbj0zIGhpZGRlbj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBLEksQ0FBSyxXLENBQVksYyxDQUFlLFUsQ0FBUztBQUN6QztBIn0= diff --git a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap index 52a6efbf..f2c02162 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_shorthand.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPEZvbyB7YmFyfSAvPlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFLLENBQUMsQ0FBQyxDLEMsQ0FBRixDQUFDLENBQUMsQyxDQUFFLENBQUUsRUFBQztBQUNiO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPEZvbyB7YmFyfSAvPlxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUEsSSxDQUFNLEcsRUFBQSxHLENBQUksQ0FBRSxFQUFDO0FBQ2I7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/attribute_spread.snap b/crates/astro2tsx/tests/fixtures/attribute_spread.snap index d53a53d3..fff99ccc 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_spread.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_spread.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_spread.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPEZvbyB7Li4ucmVzdH0gbmFtZT1cInhcIiAvPlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxFLEdBQVEsQ0FBQyxDQUFDLENBQUMsQyxDLENBQUcsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsRUFBQztBQUMxQjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPEZvbyB7Li4ucmVzdH0gbmFtZT1cInhcIiAvPlxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUEsSSxLQUFTLEksRUFBTSxTQUFVLEVBQUM7QUFDMUI7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap index 9ecff752..65944743 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/attribute_template_literal.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPFRhZyBzcmM9e2BiYXIke2Zvb31gfSAvPlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFJLEdBQUcsQyxDQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLENBQUUsRUFBQztBQUN6QjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPFRhZyBzcmM9e2BiYXIke2Zvb31gfSAvPlxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUEsSSxDQUFLLEksQ0FBSyxXLENBQVksQ0FBRSxFQUFDO0FBQ3pCO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.snap b/crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.snap index 3cad0256..88938d57 100644 --- a/crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.snap +++ b/crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.snap @@ -25,4 +25,4 @@ const a = 1; export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5jb25zdCBhID0gMTtcbi0tLVxuPCEtLSBiZXR3ZWVuIC0tPlxuPGRpdj54PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0EsRztBQUNUO0EsSUFDQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxHQUFJO0FBQ2hCLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5jb25zdCBhID0gMTtcbi0tLVxuPCEtLSBiZXR3ZWVuIC0tPlxuPGRpdj54PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFHO0FBQ0g7QTs7QUFDRztBLElBQ0MsUyxHQUFZO0FBQ2hCO0FBQ0E7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap index 69f6e43f..f00bdeea 100644 --- a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap +++ b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap @@ -26,4 +26,4 @@ import { Meta } from './Meta.astro'; export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXHJcbmltcG9ydCB7IE1ldGEgfSBmcm9tICcuL01ldGEuYXN0cm8nO1xyXG4tLS1cclxuPGRpdj5cclxuPHNwYW4+YTwvc3Bhbj5cclxuPC9kaXY+XHJcbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRyxDQUFDO0FBQ0osQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0EsRztBQUNsQyxDQUFDO0FBQ0osQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNOLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUMsQ0FBQztBQUNmLEVBQUUsR0FBRyxDQUFDLENBQUM7QUFDUDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXHJcbmltcG9ydCB7IE1ldGEgfSBmcm9tICcuL01ldGEuYXN0cm8nO1xyXG4tLS1cclxuPGRpdj5cclxuPHNwYW4+YTwvc3Bhbj5cclxuPC9kaXY+XHJcbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUc7QUFDSDtBOztBQUNHO0FBQ0g7QUFDQTtBQUNBO0FBQ0E7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/directives.snap b/crates/astro2tsx/tests/fixtures/directives.snap index a2b4aa9d..05c9d107 100644 --- a/crates/astro2tsx/tests/fixtures/directives.snap +++ b/crates/astro2tsx/tests/fixtures/directives.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/directives.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPENvbXAgY2xpZW50OmxvYWQgc2V0Omh0bWw9e2h0bWx9IGNsYXNzOmxpc3Q9e2Nsc30gdHJhbnNpdGlvbjpuYW1lPVwiblwiIC8+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxJLENBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsQ0FBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUUsZUFBZSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUUsRUFBQztBQUN6RTtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPENvbXAgY2xpZW50OmxvYWQgc2V0Omh0bWw9e2h0bWx9IGNsYXNzOmxpc3Q9e2Nsc30gdHJhbnNpdGlvbjpuYW1lPVwiblwiIC8+XG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQSxLLENBQU0sVyxDQUFZLGUsQ0FBZ0IsZ0IsQ0FBaUIsb0JBQXFCLEVBQUM7QUFDekU7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/escape_comment_bodies.snap b/crates/astro2tsx/tests/fixtures/escape_comment_bodies.snap index 9812133b..f1c7e0dd 100644 --- a/crates/astro2tsx/tests/fixtures/escape_comment_bodies.snap +++ b/crates/astro2tsx/tests/fixtures/escape_comment_bodies.snap @@ -21,4 +21,4 @@ input_file: crates/astro2tsx/tests/fixtures/escape_comment_bodies.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPCEtLSBvdXRlciB7IGJyYWNlcyB9IGFuZCAqLyBzdGFyLXNsYXNoIC0tPlxuPGRpdj48IS0tdGlnaHQtLT48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQSxDQUFBLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUEsQ0FBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxHQUFJO0FBQzNDLENBQUMsR0FBRyxDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEdBQUksRUFBRSxHQUFHLENBQUM7QUFDdkI7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPCEtLSBvdXRlciB7IGJyYWNlcyB9IGFuZCAqLyBzdGFyLXNsYXNoIC0tPlxuPGRpdj48IS0tdGlnaHQtLT48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7OztJQUFJLFFBQU8sQ0FBQSxVQUFTLENBQUEsUUFBTyxhLEdBQWdCO0FBQzNDLEssS0FBUyxLLEdBQVE7QUFDakI7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap index 83ae1814..b175be37 100644 --- a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap +++ b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Y29uZCAmJiA8c3Bhbj5hPC9zcGFuPiA8c3Bhbj5iPC9zcGFuPn08L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxVQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxXQUFDLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDbEQ7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Y29uZCAmJiA8c3Bhbj5hPC9zcGFuPiA8c3Bhbj5iPC9zcGFuPn08L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBLGMsVUFBYyw2QixXQUE2QjtBQUMzQztBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_bare_gt.snap b/crates/astro2tsx/tests/fixtures/expression_bare_gt.snap index 98433168..962128ff 100644 --- a/crates/astro2tsx/tests/fixtures/expression_bare_gt.snap +++ b/crates/astro2tsx/tests/fixtures/expression_bare_gt.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_bare_gt.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie3ggJiYgPGRpdj5hID4gYjwvZGl2Pn1cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsQyxFQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3ZCO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie3ggJiYgPGRpdj5hID4gYjwvZGl2Pn1cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBLGEsRUFBYSxDLEVBQUM7QUFDZDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap index a0845567..bfdacccd 100644 --- a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap +++ b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_comment_only.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiezwhLS0ganVzdCBhIG5vdGUgLS0+fVxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLEMsR0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUksQ0FBQztBQUN0QjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiezwhLS0ganVzdCBhIG5vdGUgLS0+fVxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUEsQyxHQUFLLGEsRUFBZ0I7QUFDckI7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/expression_comment_trailing.snap b/crates/astro2tsx/tests/fixtures/expression_comment_trailing.snap index 5d033889..8aaab897 100644 --- a/crates/astro2tsx/tests/fixtures/expression_comment_trailing.snap +++ b/crates/astro2tsx/tests/fixtures/expression_comment_trailing.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_comment_trailing.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie3ggJiYgPGE+aGk8L2E+IDwhLS0gdHJhaWxpbmcgbm90ZSAtLT59XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxHQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUksQ0FBQztBQUN2QztBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie3ggJiYgPGE+aGk8L2E+IDwhLS0gdHJhaWxpbmcgbm90ZSAtLT59XG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQSxnQixHQUFvQixlLEVBQWtCO0FBQ3RDO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/expression_empty.snap b/crates/astro2tsx/tests/fixtures/expression_empty.snap index bfd2f803..a6929b22 100644 --- a/crates/astro2tsx/tests/fixtures/expression_empty.snap +++ b/crates/astro2tsx/tests/fixtures/expression_empty.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_empty.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57fTwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFHLEVBQUUsR0FBRyxDQUFDO0FBQ2I7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57fTwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUEsS0FBTztBQUNQO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/expression_generics.snap b/crates/astro2tsx/tests/fixtures/expression_generics.snap index b423e53c..3bf05f95 100644 --- a/crates/astro2tsx/tests/fixtures/expression_generics.snap +++ b/crates/astro2tsx/tests/fixtures/expression_generics.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_generics.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Zm9vPEJhcj4oeCl9PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN4QjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Zm9vPEJhcj4oeCl9PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQTtBQUNBO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap index 48b511b3..d838a4d2 100644 --- a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap +++ b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_html_comment.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2xpc3QubWFwKCgpID0+IDxDb21wb25lbnQ+PCEtLUhpLS0+PC9Db21wb25lbnQ+KX1cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxLQUFLLENBQUMsQyxHQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsRDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2xpc3QubWFwKCgpID0+IDxDb21wb25lbnQ+PCEtLUhpLS0+PC9Db21wb25lbnQ+KX1cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBLDJCLEtBQStCLEUsR0FBSztBQUNwQztBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_identifier.snap b/crates/astro2tsx/tests/fixtures/expression_identifier.snap index 9cc45200..0837797a 100644 --- a/crates/astro2tsx/tests/fixtures/expression_identifier.snap +++ b/crates/astro2tsx/tests/fixtures/expression_identifier.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_identifier.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57dmFsdWV9PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNsQjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57dmFsdWV9PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQTtBQUNBO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/expression_is_raw.snap b/crates/astro2tsx/tests/fixtures/expression_is_raw.snap index 4eab8476..38055742 100644 --- a/crates/astro2tsx/tests/fixtures/expression_is_raw.snap +++ b/crates/astro2tsx/tests/fixtures/expression_is_raw.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_is_raw.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPGRpdiBpczpyYXc+bm90IHtqc30gaGVyZTwvZGl2Pn1cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxFQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsRUFBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3pDO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPGRpdiBpczpyYXc+bm90IHtqc30gaGVyZTwvZGl2Pn1cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBLHFCLEVBQXFCLGEsRUFBYTtBQUNsQztBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.snap b/crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.snap index d618c375..c26aa3bb 100644 --- a/crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.snap +++ b/crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPGRpdiBpczpyYXc+aWYgKGEgPCBiKSB7IHdlaXJkIH0gdGV4dDwvZGl2Pn1cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxFQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsRUFBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3JEO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPGRpdiBpczpyYXc+aWYgKGEgPCBiKSB7IHdlaXJkIH0gdGV4dDwvZGl2Pn1cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBLHFCLEVBQXFCLHlCLEVBQXlCO0FBQzlDO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/expression_map.snap b/crates/astro2tsx/tests/fixtures/expression_map.snap index 4016e0f3..9d5b2a66 100644 --- a/crates/astro2tsx/tests/fixtures/expression_map.snap +++ b/crates/astro2tsx/tests/fixtures/expression_map.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_map.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHVsPntpdGVtcy5tYXAoKGkpID0+IDxsaT57aS5uYW1lfTwvbGk+KX08L3VsPlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUM7QUFDOUM7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHVsPntpdGVtcy5tYXAoKGkpID0+IDxsaT57aS5uYW1lfTwvbGk+KX08L3VsPlxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUE7QUFDQTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_nested.snap b/crates/astro2tsx/tests/fixtures/expression_nested.snap index adab918d..942b537c 100644 --- a/crates/astro2tsx/tests/fixtures/expression_nested.snap +++ b/crates/astro2tsx/tests/fixtures/expression_nested.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_nested.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57b3V0ZXIgJiYgPHNwYW4+e2lubmVyfTwvc3Bhbj59PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUMxQztBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57b3V0ZXIgJiYgPHNwYW4+e2lubmVyfTwvc3Bhbj59PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQTtBQUNBO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap index da6cd20b..57882ebd 100644 --- a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap +++ b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_object_literal.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57IHsgZHVyYXRpb246IDEgfSB9PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUM5QjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57IHsgZHVyYXRpb246IDEgfSB9PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQTtBQUNBO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/expression_script_exclusion.snap b/crates/astro2tsx/tests/fixtures/expression_script_exclusion.snap index d8e3fc6e..15f18592 100644 --- a/crates/astro2tsx/tests/fixtures/expression_script_exclusion.snap +++ b/crates/astro2tsx/tests/fixtures/expression_script_exclusion.snap @@ -26,4 +26,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_script_exclusion.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPHNjcmlwdD5pZiAoYSA8IGIpIHsgZ28oKTsgfTwvc2NyaXB0Pn1cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQXFCLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDL0M7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPHNjcmlwdD5pZiAoYSA8IGIpIHsgZ28oKTsgfTwvc2NyaXB0Pn1cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBLGlCQUFxQztBQUNyQztBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_shorthand_attr.snap b/crates/astro2tsx/tests/fixtures/expression_shorthand_attr.snap index 6f300d52..3306aaf5 100644 --- a/crates/astro2tsx/tests/fixtures/expression_shorthand_attr.snap +++ b/crates/astro2tsx/tests/fixtures/expression_shorthand_attr.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_shorthand_attr.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPENhcmQge3RpdGxlfSAvPn1cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLEMsRUFBSixDQUFDLENBQUMsQ0FBQyxDQUFDLEMsQ0FBRyxDQUFDLENBQUMsQ0FBQztBQUMxQjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPENhcmQge3RpdGxlfSAvPn1cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBLGVBQWdCLEssRUFBQSxLLENBQU87QUFDdkI7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/expression_single_element.snap b/crates/astro2tsx/tests/fixtures/expression_single_element.snap index 034ae37a..d3074cce 100644 --- a/crates/astro2tsx/tests/fixtures/expression_single_element.snap +++ b/crates/astro2tsx/tests/fixtures/expression_single_element.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_single_element.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Y29uZCAmJiA8c3Bhbj5hPC9zcGFuPn08L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNuQztBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Y29uZCAmJiA8c3Bhbj5hPC9zcGFuPn08L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBO0FBQ0E7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/expression_special_attr_names.snap b/crates/astro2tsx/tests/fixtures/expression_special_attr_names.snap index a1d4737e..e6a16831 100644 --- a/crates/astro2tsx/tests/fixtures/expression_special_attr_names.snap +++ b/crates/astro2tsx/tests/fixtures/expression_special_attr_names.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_special_attr_names.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPGRpdiBAY2xpY2s9XCJ4XCIgY2xpZW50OmxvYWQuZm9vIHYtaWY9XCJ5XCIgeC1vbjprZXl1cC5lbnRlcj1cIndcIj48L2Rpdj59XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUE0QixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxNLENBQW5DLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEMsQyxHLEMsQ0FBTSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDLEMsSSxDLENBQVcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDLEMsRyxFQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUM5RTtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPGRpdiBAY2xpY2s9XCJ4XCIgY2xpZW50OmxvYWQuZm9vIHYtaWY9XCJ5XCIgeC1vbjprZXl1cC5lbnRlcj1cIndcIj48L2Rpdj59XG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQSxjQUF5QyxTLE9BQTNCLE0sT0FBVyxlLFFBQXlCLGdCLE9BQW9CO0FBQ3RFO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap index 958bad86..95c6044d 100644 --- a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap +++ b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap @@ -1,7 +1,7 @@ --- source: crates/astro2tsx/tests/snapshots.rs info: - has_parse_errors: false + has_parse_errors: true frontmatter: start: 0 end: 0 @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_spread_child.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Li4ucmVzdH08L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNwQjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Li4ucmVzdH08L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBO0FBQ0E7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap index 0ec33457..3dcf8087 100644 --- a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_string_with_markup.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57XCI8YnIvPlwifTwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ3BCO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57XCI8YnIvPlwifTwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUE7QUFDQTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_style_exclusion.snap b/crates/astro2tsx/tests/fixtures/expression_style_exclusion.snap index 10309cfd..6d1bf468 100644 --- a/crates/astro2tsx/tests/fixtures/expression_style_exclusion.snap +++ b/crates/astro2tsx/tests/fixtures/expression_style_exclusion.snap @@ -26,4 +26,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_style_exclusion.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPHN0eWxlPi5he2NvbG9yOnJlZH08L3N0eWxlPn1cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFjLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3RDO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPHN0eWxlPi5he2NvbG9yOnJlZH08L3N0eWxlPn1cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBLGdCQUE2QjtBQUM3QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_template_attr.snap b/crates/astro2tsx/tests/fixtures/expression_template_attr.snap index 45e30446..da10a73e 100644 --- a/crates/astro2tsx/tests/fixtures/expression_template_attr.snap +++ b/crates/astro2tsx/tests/fixtures/expression_template_attr.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_template_attr.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPFRhZyBkYXRhLXg9YHQke3h9YCAvPn1cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ2hDO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPFRhZyBkYXRhLXg9YHQke3h9YCAvPn1cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBLHFCLENBQXFCLFEsQ0FBUTtBQUM3QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap index 317e47c6..c26f7bd4 100644 --- a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_template_with_markup.astr export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57YDxiPnk8L2I+YH08L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUN2QjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57YDxiPnk8L2I+YH08L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBO0FBQ0E7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap index 87ff1f27..9658a273 100644 --- a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_ternary_markup.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Y29uZCA/IDxhIGhyZWY9Jy94Jz55ZXM8L2E+IDogPGI+bm88L2I+fTwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNwRDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj57Y29uZCA/IDxhIGhyZWY9Jy94Jz55ZXM8L2E+IDogPGI+bm88L2I+fTwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUE7QUFDQTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_unquoted_attr.snap b/crates/astro2tsx/tests/fixtures/expression_unquoted_attr.snap index 2a10a656..042c7c3b 100644 --- a/crates/astro2tsx/tests/fixtures/expression_unquoted_attr.snap +++ b/crates/astro2tsx/tests/fixtures/expression_unquoted_attr.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_unquoted_attr.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPGRpdiBjbGFzcz1mb28gbWF4bGVuZ3RoPTI1NSBocmVmPS9hYm91dD54PC9kaXY+fVxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFBLENBQUMsQ0FBQyxDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUEsQ0FBQyxDQUFDLEMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFBLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDMUQ7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2NvbmQgJiYgPGRpdiBjbGFzcz1mb28gbWF4bGVuZ3RoPTI1NSBocmVmPS9hYm91dD54PC9kaXY+fVxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUEscUJBQW9CLEcsQ0FBRyxZQUFXLEcsQ0FBRyxPQUFNLE0sQ0FBTTtBQUNqRDtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/expression_void_element.snap b/crates/astro2tsx/tests/fixtures/expression_void_element.snap index ddd7ccf3..fa2c5e32 100644 --- a/crates/astro2tsx/tests/fixtures/expression_void_element.snap +++ b/crates/astro2tsx/tests/fixtures/expression_void_element.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/expression_void_element.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2l0ZW1zLm1hcChpID0+IDxsaT57aX08YnI+PC9saT4pfVxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsQztBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsie2l0ZW1zLm1hcChpID0+IDxsaT57aX08YnI+PC9saT4pfVxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUEsMEIsQ0FBMEI7QUFDMUI7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/fragment_shorthand.snap b/crates/astro2tsx/tests/fixtures/fragment_shorthand.snap index 2dd2c356..f49d2703 100644 --- a/crates/astro2tsx/tests/fixtures/fragment_shorthand.snap +++ b/crates/astro2tsx/tests/fixtures/fragment_shorthand.snap @@ -23,4 +23,4 @@ input_file: crates/astro2tsx/tests/fixtures/fragment_shorthand.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPD5cbjxkaXY+YTwvZGl2PlxuPGRpdj5iPC9kaXY+XG48Lz5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLENBQUM7QUFDRixDQUFDLEdBQUcsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO0FBQ1osQ0FBQyxHQUFHLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNaLEVBQUUsQ0FBQztBQUNIO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPD5cbjxkaXY+YTwvZGl2PlxuPGRpdj5iPC9kaXY+XG48Lz5cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap index 1d071b77..00249d06 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/frontmatter_absent.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj5wbGFpbjwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNoQjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj5wbGFpbjwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUE7QUFDQTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap index cc4c8b60..889f7b6d 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap @@ -25,4 +25,4 @@ let value = 'world'; export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5sZXQgdmFsdWUgPSAnd29ybGQnO1xuLS0tXG5cbjxoMT5IZWxsbyB7dmFsdWV9PC9oMT5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0EsRztBQUNqQjtBQUNIO0FBQ0EsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQztBQUN0QjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5sZXQgdmFsdWUgPSAnd29ybGQnO1xuLS0tXG5cbjxoMT5IZWxsbyB7dmFsdWV9PC9oMT5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUc7QUFDSDtBOztBQUNHO0FBQ0g7QUFDQTtBQUNBO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap index 5fce6eda..9a913b27 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap @@ -22,4 +22,4 @@ input_file: crates/astro2tsx/tests/fixtures/frontmatter_empty.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFBLEE7QTtBQUNHO0FBQ0gsQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBOztBQUNHO0FBQ0g7QUFDQTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap index 68463b5b..1e0cc16e 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap @@ -25,4 +25,4 @@ import type { Foo } from './types'; export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbXBvcnQgQ2FyZCBmcm9tICcuL0NhcmQuYXN0cm8nO1xuaW1wb3J0IHR5cGUgeyBGb28gfSBmcm9tICcuL3R5cGVzJztcbi0tLVxuPENhcmQgLz5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNoQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBLEc7QUFDaEM7QUFDSCxDQUFDLElBQUksQ0FBRSxFQUFDO0FBQ1I7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbXBvcnQgQ2FyZCBmcm9tICcuL0NhcmQuYXN0cm8nO1xuaW1wb3J0IHR5cGUgeyBGb28gfSBmcm9tICcuL3R5cGVzJztcbi0tLVxuPENhcmQgLz5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUc7QUFDSDtBQUNBO0E7O0FBQ0c7QUFDSCxNQUFPLEVBQUM7QUFDUjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap index 344dec17..f4af2b46 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap @@ -20,4 +20,4 @@ const a = 1; export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5jb25zdCBhID0gMTtcbi0tLVxuIl0sIm1hcHBpbmdzIjoiQTs7QUFBQSxBQUFHO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5jb25zdCBhID0gMTtcbi0tLVxuIl0sIm1hcHBpbmdzIjoiQTs7QUFBRztBQUNIO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap index 10046596..3d482ae7 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap @@ -26,4 +26,4 @@ if (cond) { export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pZiAoY29uZCkge1xuXHRyZXR1cm4gQXN0cm8ucmVkaXJlY3QoJy94Jyk7XG59XG4tLS1cbjxwPng8L3A+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDWCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDN0IsQ0FBQztBO0EsRztBQUNFO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQztBQUNSO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pZiAoY29uZCkge1xuXHRyZXR1cm4gQXN0cm8ucmVkaXJlY3QoJy94Jyk7XG59XG4tLS1cbjxwPng8L3A+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFHO0FBQ0g7QUFDQTtBQUNBO0E7O0FBQ0c7QUFDSDtBQUNBO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap b/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap index cb108068..05874f79 100644 --- a/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap +++ b/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap @@ -34,4 +34,4 @@ type ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[ * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly>, typeof __AstroComponent_, ASTRO__Get>> -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5leHBvcnQgY29uc3QgZ2V0U3RhdGljUGF0aHMgPSBhc3luYyAoKSA9PiBbXTtcbi0tLVxuPGRpdj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QSxHO0FBQzFDO0FBQ0gsQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5leHBvcnQgY29uc3QgZ2V0U3RhdGljUGF0aHMgPSBhc3luYyAoKSA9PiBbXTtcbi0tLVxuPGRpdj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUc7QUFDSDtBOztBQUNHO0FBQ0g7QUFDQTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap b/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap index 32aacb61..270abb86 100644 --- a/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap +++ b/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap @@ -35,4 +35,4 @@ type ASTRO__Get = T extends undefined ? undefined : K extends keyof T ? T[ * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly>> -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHMgeyBzbHVnOiBzdHJpbmcgfVxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGdldFN0YXRpY1BhdGhzKCkgeyByZXR1cm4gW107IH1cbi0tLVxuPGRpdj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNoQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBLEc7QUFDbEQ7QUFDSCxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHMgeyBzbHVnOiBzdHJpbmcgfVxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGdldFN0YXRpY1BhdGhzKCkgeyByZXR1cm4gW107IH1cbi0tLVxuPGRpdj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUc7QUFDSDtBQUNBO0E7O0FBQ0c7QUFDSDtBQUNBO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/html_comment_body.snap b/crates/astro2tsx/tests/fixtures/html_comment_body.snap index 4fc38a36..fb6a5c6e 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_body.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_body.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/html_comment_body.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj48IS0tIGhpIC0tPjxwPng8L3A+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxHQUFHLEMsSUFBSyxDQUFDLENBQUMsQ0FBQyxDLEdBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUM5QjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj48IS0tIGhpIC0tPjxwPng8L3A+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQSxLLElBQVMsSSxHQUFPO0FBQ2hCO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap index 82cd3f15..795c20aa 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap @@ -21,4 +21,4 @@ input_file: crates/astro2tsx/tests/fixtures/html_comment_top_level.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPCEtLSBsZWFkaW5nIC0tPlxuPGRpdj54PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBO0EsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxHQUFJO0FBQ2hCLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPCEtLSBsZWFkaW5nIC0tPlxuPGRpdj54PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOzs7SUFBSSxTLEdBQVk7QUFDaEI7QUFDQTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/multibyte.snap b/crates/astro2tsx/tests/fixtures/multibyte.snap index 60547b02..477bf1bb 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/multibyte.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGgxPuODhDwvaDE+PHA+Zm9vYmFyPC9wPlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDdkI7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGgxPuODhDwvaDE+PHA+Zm9vYmFyPC9wPlxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUE7QUFDQTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap index 0a3e43e3..e0118766 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap @@ -24,4 +24,4 @@ const π = Math.PI; export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5jb25zdCDPgCA9IE1hdGguUEk7XG4tLS1cbjxwPvCfpoQge8+AfTwvcD5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QSxHO0FBQ2Y7QUFDSCxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUM7QUFDYjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5jb25zdCDPgCA9IE1hdGguUEk7XG4tLS1cbjxwPvCfpoQge8+AfTwvcD5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUc7QUFDSDtBOztBQUNHO0FBQ0g7QUFDQTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/named_component_export.snap b/crates/astro2tsx/tests/fixtures/named_component_export.snap index feed2689..bec4339d 100644 --- a/crates/astro2tsx/tests/fixtures/named_component_export.snap +++ b/crates/astro2tsx/tests/fixtures/named_component_export.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/named_component_export.astro export default function MyPage__AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiL3NyYy9wYWdlcy9NeVBhZ2UuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQztBQUNYO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiL3NyYy9wYWdlcy9NeVBhZ2UuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBO0FBQ0E7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/props_exported_alias_union.snap b/crates/astro2tsx/tests/fixtures/props_exported_alias_union.snap index 755d1aff..b7a23d4e 100644 --- a/crates/astro2tsx/tests/fixtures/props_exported_alias_union.snap +++ b/crates/astro2tsx/tests/fixtures/props_exported_alias_union.snap @@ -31,4 +31,4 @@ export default function __AstroComponent_(_props: Props): any {} * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgTG9jYWxQcm9wcyB7IGE6IHN0cmluZyB9XG5pbnRlcmZhY2UgUmVtb3RlUHJvcHMgeyBiOiBzdHJpbmcgfVxuZXhwb3J0IHR5cGUgUHJvcHMgPSBMb2NhbFByb3BzIHwgUmVtb3RlUHJvcHM7XG4tLS1cbjxkaXYvPlxuIl0sIm1hcHBpbmdzIjoiQTs7QUFBQSxBQUFHO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbkMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QTtBLEc7QUFDMUM7QUFDSCxDQUFDLEdBQUksRUFBQztBQUNOO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgTG9jYWxQcm9wcyB7IGE6IHN0cmluZyB9XG5pbnRlcmZhY2UgUmVtb3RlUHJvcHMgeyBiOiBzdHJpbmcgfVxuZXhwb3J0IHR5cGUgUHJvcHMgPSBMb2NhbFByb3BzIHwgUmVtb3RlUHJvcHM7XG4tLS1cbjxkaXYvPlxuIl0sIm1hcHBpbmdzIjoiQTs7QUFBRztBQUNIO0FBQ0E7QUFDQTtBOztBQUNHO0FBQ0gsSUFBSyxFQUFDO0FBQ047QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/props_generic.snap b/crates/astro2tsx/tests/fixtures/props_generic.snap index 42cf183d..1985abc9 100644 --- a/crates/astro2tsx/tests/fixtures/props_generic.snap +++ b/crates/astro2tsx/tests/fixtures/props_generic.snap @@ -31,4 +31,4 @@ export default function __AstroComponent_(_props: Props): a * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHM8VCBleHRlbmRzIHN0cmluZz4ge1xuXHRpdGVtOiBUO1xufVxuLS0tXG48ZGl2PjwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QUFBQSxBQUFHO0FBQ0gsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ25DLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ1QsQ0FBQztBO0EsRztBQUNFO0FBQ0gsQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHM8VCBleHRlbmRzIHN0cmluZz4ge1xuXHRpdGVtOiBUO1xufVxuLS0tXG48ZGl2PjwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QUFBRztBQUNIO0FBQ0E7QUFDQTtBOztBQUNHO0FBQ0g7QUFDQTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/props_generic_invalid.snap b/crates/astro2tsx/tests/fixtures/props_generic_invalid.snap index 3d4b4e15..0536ffcb 100644 --- a/crates/astro2tsx/tests/fixtures/props_generic_invalid.snap +++ b/crates/astro2tsx/tests/fixtures/props_generic_invalid.snap @@ -24,4 +24,4 @@ interface Props export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHM8VCBleHRlbmRzIHsgW2tleTogc3RyaW5nXTogYW55IH0sIFAgZXh0ZW5kcyBzdHJpbmcgPyB7IFtrZXk6IHN0cmluZ106IGFueSB9OiBuZXZlcj4ge31cbi0tLVxuPGRpdi8+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0EsRztBQUNuRztBQUNILENBQUMsR0FBSSxFQUFDO0FBQ047QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHM8VCBleHRlbmRzIHsgW2tleTogc3RyaW5nXTogYW55IH0sIFAgZXh0ZW5kcyBzdHJpbmcgPyB7IFtrZXk6IHN0cmluZ106IGFueSB9OiBuZXZlcj4ge31cbi0tLVxuPGRpdi8+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFHO0FBQ0g7QTs7QUFDRztBQUNILElBQUssRUFBQztBQUNOO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/props_imported.snap b/crates/astro2tsx/tests/fixtures/props_imported.snap index 5ccefb05..dee0dab2 100644 --- a/crates/astro2tsx/tests/fixtures/props_imported.snap +++ b/crates/astro2tsx/tests/fixtures/props_imported.snap @@ -29,4 +29,4 @@ export default function __AstroComponent_(_props: Props): any {} * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbXBvcnQgdHlwZSB7IFByb3BzIH0gZnJvbSAnLi90eXBlcyc7XG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QSxHO0FBQ2xDO0FBQ0gsQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbXBvcnQgdHlwZSB7IFByb3BzIH0gZnJvbSAnLi90eXBlcyc7XG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFHO0FBQ0g7QTs7QUFDRztBQUNIO0FBQ0E7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/props_interface.snap b/crates/astro2tsx/tests/fixtures/props_interface.snap index 78b4de7b..9e7b6975 100644 --- a/crates/astro2tsx/tests/fixtures/props_interface.snap +++ b/crates/astro2tsx/tests/fixtures/props_interface.snap @@ -32,4 +32,4 @@ export default function __AstroComponent_(_props: Props): any {} * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHMge1xuXHR0aXRsZTogc3RyaW5nO1xufVxuY29uc3QgeyB0aXRsZSB9ID0gQXN0cm8ucHJvcHM7XG4tLS1cbjxoMT57dGl0bGV9PC9oMT5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNqQixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNmLENBQUM7QUFDRCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBO0EsRztBQUMzQjtBQUNILENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUM7QUFDaEI7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHMge1xuXHR0aXRsZTogc3RyaW5nO1xufVxuY29uc3QgeyB0aXRsZSB9ID0gQXN0cm8ucHJvcHM7XG4tLS1cbjxoMT57dGl0bGV9PC9oMT5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUc7QUFDSDtBQUNBO0FBQ0E7QUFDQTtBOztBQUNHO0FBQ0g7QUFDQTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/props_polymorphic.snap b/crates/astro2tsx/tests/fixtures/props_polymorphic.snap index 47d55ca5..2598f82f 100644 --- a/crates/astro2tsx/tests/fixtures/props_polymorphic.snap +++ b/crates/astro2tsx/tests/fixtures/props_polymorphic.snap @@ -31,4 +31,4 @@ export default function __AstroComponent_> -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHM8VGFnIGV4dGVuZHMga2V5b2YgSlNYLkludHJpbnNpY0VsZW1lbnRzPiBleHRlbmRzIEhUTUxBdHRyaWJ1dGVzPFRhZz4ge1xuICBhcz86IFRhZztcbn1cbi0tLVxuPGRpdi8+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDdEYsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ1gsQ0FBQztBO0EsRztBQUNFO0FBQ0gsQ0FBQyxHQUFJLEVBQUM7QUFDTjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pbnRlcmZhY2UgUHJvcHM8VGFnIGV4dGVuZHMga2V5b2YgSlNYLkludHJpbnNpY0VsZW1lbnRzPiBleHRlbmRzIEhUTUxBdHRyaWJ1dGVzPFRhZz4ge1xuICBhcz86IFRhZztcbn1cbi0tLVxuPGRpdi8+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFHO0FBQ0g7QUFDQTtBQUNBO0E7O0FBQ0c7QUFDSCxJQUFLLEVBQUM7QUFDTjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/props_type_alias.snap b/crates/astro2tsx/tests/fixtures/props_type_alias.snap index 7038f86d..cc889cd2 100644 --- a/crates/astro2tsx/tests/fixtures/props_type_alias.snap +++ b/crates/astro2tsx/tests/fixtures/props_type_alias.snap @@ -29,4 +29,4 @@ export default function __AstroComponent_(_props: Props): any {} * [Astro documentation](https://docs.astro.build/reference/api-reference/#astro-global) */ declare const Astro: Readonly> -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG50eXBlIFByb3BzID0geyB0aXRsZTogc3RyaW5nIH07XG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFBLEFBQUc7QUFDSCxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QSxHO0FBQzVCO0FBQ0gsQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG50eXBlIFByb3BzID0geyB0aXRsZTogc3RyaW5nIH07XG4tLS1cbjxkaXY+PC9kaXY+XG4iXSwibWFwcGluZ3MiOiJBOztBQUFHO0FBQ0g7QTs7QUFDRztBQUNIO0FBQ0E7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap index f5b5e673..f6473f9c 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_is_raw.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBpczpyYXc+PGI+bm90IG1hcmt1cDwvYj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEcsQ0FBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDLEVBQUMsRUFBRSxHQUFHLENBQUM7QUFDbkM7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiBpczpyYXc+PGI+bm90IG1hcmt1cDwvYj48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBLEksQ0FBSyxPLEVBQU8saUIsRUFBaUI7QUFDN0I7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap index b2ed40dd..7a6089ea 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap @@ -26,4 +26,4 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_script_json.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHNjcmlwdCB0eXBlPVwiYXBwbGljYXRpb24vanNvblwiPntcImFcIjoxfTwvc2NyaXB0PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsTSxDQUFPLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFRLEVBQUUsTUFBTSxDQUFDO0FBQ2hEO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHNjcmlwdCB0eXBlPVwiYXBwbGljYXRpb24vanNvblwiPntcImFcIjoxfTwvc2NyaXB0PlxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUEsTyxDQUFRLHdCQUErQjtBQUN2QztBIn0= diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap index 0459c985..8745be08 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap @@ -26,4 +26,4 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_script_module.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHNjcmlwdCB0eXBlPVwibW9kdWxlXCI+Y29uc3QgYSA9IDE7PC9zY3JpcHQ+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxNLENBQU8sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFhLEVBQUUsTUFBTSxDQUFDO0FBQzNDO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHNjcmlwdCB0eXBlPVwibW9kdWxlXCI+Y29uc3QgYSA9IDE7PC9zY3JpcHQ+XG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQSxPLENBQVEsY0FBMEI7QUFDbEM7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/raw_text_style.snap b/crates/astro2tsx/tests/fixtures/raw_text_style.snap index 0d2a9a75..b06d0226 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_style.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_style.snap @@ -26,4 +26,4 @@ input_file: crates/astro2tsx/tests/fixtures/raw_text_style.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHN0eWxlPi5hIHsgY29sb3I6IHJlZDsgfTwvc3R5bGU+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxLQUFLLENBQW1CLEVBQUUsS0FBSyxDQUFDO0FBQ2pDO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHN0eWxlPi5hIHsgY29sb3I6IHJlZDsgfTwvc3R5bGU+XG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQSxPQUF5QjtBQUN6QjtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/script_type_labels.snap b/crates/astro2tsx/tests/fixtures/script_type_labels.snap index ee45dbdf..63174386 100644 --- a/crates/astro2tsx/tests/fixtures/script_type_labels.snap +++ b/crates/astro2tsx/tests/fixtures/script_type_labels.snap @@ -40,4 +40,4 @@ input_file: crates/astro2tsx/tests/fixtures/script_type_labels.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHNjcmlwdCB0eXBlPVwidGV4dC9wYXJ0eXRvd25cIj5nbygpOzwvc2NyaXB0PlxuPHNjcmlwdCB0eXBlPVwic3BlY3VsYXRpb25ydWxlc1wiPntcImFcIjoxfTwvc2NyaXB0PlxuPHNjcmlwdCBpczppbmxpbmUgdHlwZT1cInRleHQveC11bmtub3duXCI+d2F0PC9zY3JpcHQ+XG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxNLENBQU8sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBTSxFQUFFLE1BQU0sQ0FBQztBQUM1QyxDQUFDLE0sQ0FBTyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBUSxFQUFFLE1BQU0sQ0FBQztBQUNoRCxDQUFDLE0sQ0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQyxDQUFFLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUksRUFBRSxNQUFNLENBQUM7QUFDcEQ7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHNjcmlwdCB0eXBlPVwidGV4dC9wYXJ0eXRvd25cIj5nbygpOzwvc2NyaXB0PlxuPHNjcmlwdCB0eXBlPVwic3BlY3VsYXRpb25ydWxlc1wiPntcImFcIjoxfTwvc2NyaXB0PlxuPHNjcmlwdCBpczppbmxpbmUgdHlwZT1cInRleHQveC11bmtub3duXCI+d2F0PC9zY3JpcHQ+XG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQSxPLENBQVEsc0JBQTJCO0FBQ25DLE8sQ0FBUSx3QkFBK0I7QUFDdkMsTyxDQUFRLFMsQ0FBVSxzQkFBeUI7QUFDM0M7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/slot_element.snap b/crates/astro2tsx/tests/fixtures/slot_element.snap index 5ce75c6b..8f14010c 100644 --- a/crates/astro2tsx/tests/fixtures/slot_element.snap +++ b/crates/astro2tsx/tests/fixtures/slot_element.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/slot_element.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj48c2xvdCBuYW1lPVwiYVwiIC8+PHNsb3QgLz48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEksQ0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBRSxFQUFDLENBQUMsSUFBSSxDQUFFLEVBQUMsRUFBRSxHQUFHLENBQUM7QUFDcEM7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj48c2xvdCBuYW1lPVwiYVwiIC8+PHNsb3QgLz48L2Rpdj5cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBLFUsQ0FBVyxTQUFVLEVBQUMsTUFBTyxFQUFDO0FBQzlCO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/slots.snap b/crates/astro2tsx/tests/fixtures/slots.snap index 681aa1a3..1a960206 100644 --- a/crates/astro2tsx/tests/fixtures/slots.snap +++ b/crates/astro2tsx/tests/fixtures/slots.snap @@ -23,4 +23,4 @@ input_file: crates/astro2tsx/tests/fixtures/slots.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPExheW91dD5cblx0PHNwYW4gc2xvdD1cImhlYWRlclwiPkg8L3NwYW4+XG5cdDxwPmJvZHk8L3A+XG48L0xheW91dD5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLE1BQU0sQ0FBQztBQUNSLENBQUMsQ0FBQyxJLENBQUssSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUM7QUFDN0IsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQ1osRUFBRSxNQUFNLENBQUM7QUFDVDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPExheW91dD5cblx0PHNwYW4gc2xvdD1cImhlYWRlclwiPkg8L3NwYW4+XG5cdDxwPmJvZHk8L3A+XG48L0xheW91dD5cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBO0FBQ0EsTSxDQUFPO0FBQ1A7QUFDQTtBQUNBO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/style_lang_label.snap b/crates/astro2tsx/tests/fixtures/style_lang_label.snap index 1af2c300..c41b3f0e 100644 --- a/crates/astro2tsx/tests/fixtures/style_lang_label.snap +++ b/crates/astro2tsx/tests/fixtures/style_lang_label.snap @@ -26,4 +26,4 @@ input_file: crates/astro2tsx/tests/fixtures/style_lang_label.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHN0eWxlIGxhbmc9XCJzY3NzXCI+LmEgeyBjb2xvcjogcmVkOyB9PC9zdHlsZT5cbiJdLCJtYXBwaW5ncyI6IkE7O0E7QUFBQSxDQUFDLEssQ0FBTSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBbUIsRUFBRSxLQUFLLENBQUM7QUFDN0M7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPHN0eWxlIGxhbmc9XCJzY3NzXCI+LmEgeyBjb2xvcjogcmVkOyB9PC9zdHlsZT5cbiJdLCJtYXBwaW5ncyI6IkE7OztBQUFBLE0sQ0FBTyxZQUE4QjtBQUNyQztBIn0= diff --git a/crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.snap b/crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.snap index 5ec45f39..dc1bcf83 100644 --- a/crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.snap +++ b/crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiAgIGNsYXNzPVwiYVwiXG5cdGlkPVwiYlwiICAgPnNwYWNlZDwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsRyxDQUFNLEtBQUssQ0FBQyxDQUFDLENBQUMsQyxDQUNkLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDdkI7QSJ9 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdiAgIGNsYXNzPVwiYVwiXG5cdGlkPVwiYlwiICAgPnNwYWNlZDwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUEsSSxDQUFPLFMsQ0FDTixPQUFTO0FBQ1Y7QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/top_level_returns_nested.snap b/crates/astro2tsx/tests/fixtures/top_level_returns_nested.snap index 286c5fd4..8331f06a 100644 --- a/crates/astro2tsx/tests/fixtures/top_level_returns_nested.snap +++ b/crates/astro2tsx/tests/fixtures/top_level_returns_nested.snap @@ -30,4 +30,4 @@ throw "top"; export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pZiAoYnJva2VuKSB7XG4gIHJldHVybiBBc3Ryby5yZWRpcmVjdChcIi9cIik7XG59XG5jb25zdCBmbiA9ICgpID0+IHsgcmV0dXJuIDE7IH07XG5mdW5jdGlvbiBpbm5lcigpIHsgcmV0dXJuIDI7IH1cbmNsYXNzIEMgeyBtZXRob2QoKSB7IHJldHVybiAzOyB9IH1cbnJldHVybiBcInRvcFwiO1xuLS0tXG48ZGl2Lz5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDYixDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDN0IsQ0FBQztBQUNELENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDL0IsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDOUIsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUNsQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QSxHO0FBQ1Y7QUFDSCxDQUFDLEdBQUksRUFBQztBQUNOO0EifQ== +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5pZiAoYnJva2VuKSB7XG4gIHJldHVybiBBc3Ryby5yZWRpcmVjdChcIi9cIik7XG59XG5jb25zdCBmbiA9ICgpID0+IHsgcmV0dXJuIDE7IH07XG5mdW5jdGlvbiBpbm5lcigpIHsgcmV0dXJuIDI7IH1cbmNsYXNzIEMgeyBtZXRob2QoKSB7IHJldHVybiAzOyB9IH1cbnJldHVybiBcInRvcFwiO1xuLS0tXG48ZGl2Lz5cbiJdLCJtYXBwaW5ncyI6IkE7O0FBQUc7QUFDSDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBOztBQUNHO0FBQ0gsSUFBSyxFQUFDO0FBQ047QSJ9 diff --git a/crates/astro2tsx/tests/fixtures/unclosed_member_tag.snap b/crates/astro2tsx/tests/fixtures/unclosed_member_tag.snap index af46ce2b..4089a752 100644 --- a/crates/astro2tsx/tests/fixtures/unclosed_member_tag.snap +++ b/crates/astro2tsx/tests/fixtures/unclosed_member_tag.snap @@ -24,4 +24,4 @@ const myMarkdown = await import("../content/post.md"); export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5jb25zdCBteU1hcmtkb3duID0gYXdhaXQgaW1wb3J0KFwiLi4vY29udGVudC9wb3N0Lm1kXCIpO1xuLS0tXG5cbjxteU1hcmtkb3duLiJdLCJtYXBwaW5ncyI6IkE7O0FBQUEsQUFBRztBQUNILENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0E7QSxHO0FBQ25EO0FBQ0g7QUFDQSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiLS0tXG5jb25zdCBteU1hcmtkb3duID0gYXdhaXQgaW1wb3J0KFwiLi4vY29udGVudC9wb3N0Lm1kXCIpO1xuLS0tXG5cbjxteU1hcmtkb3duLiJdLCJtYXBwaW5ncyI6IkE7O0FBQUc7QUFDSDtBOztBQUNHO0FBQ0g7QUFDQTtBIn0= diff --git a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap index b9e03c5f..ab472592 100644 --- a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap +++ b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/unclosed_tag.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGNvbXBvbmVudHMuXG4iXSwibWFwcGluZ3MiOiJBOztBO0FBQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDWjtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGNvbXBvbmVudHMuXG4iXSwibWFwcGluZ3MiOiJBOzs7QUFBQTtBQUNBO0EifQ== diff --git a/crates/astro2tsx/tests/fixtures/void_elements.snap b/crates/astro2tsx/tests/fixtures/void_elements.snap index 12d6eb10..7897fbc0 100644 --- a/crates/astro2tsx/tests/fixtures/void_elements.snap +++ b/crates/astro2tsx/tests/fixtures/void_elements.snap @@ -20,4 +20,4 @@ input_file: crates/astro2tsx/tests/fixtures/void_elements.astro export default function __AstroComponent_(_props: Record): any {} -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj48YnI+PGhyIC8+PGltZyBzcmM9XCJhLnBuZ1wiPjxpbnB1dCB0eXBlPVwidGV4dFwiPjwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7QTtBQUFBLENBQUMsR0FBRyxDQUFDLENBQUMsRUFBRSxFQUFDLENBQUMsRUFBRSxDQUFFLEVBQUMsQ0FBQyxHLENBQUksR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBQyxDQUFDLEssQ0FBTSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBQyxFQUFFLEdBQUcsQ0FBQztBQUN6RDtBIn0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiaW5wdXQuYXN0cm8iXSwic291cmNlc0NvbnRlbnQiOlsiPGRpdj48YnI+PGhyIC8+PGltZyBzcmM9XCJhLnBuZ1wiPjxpbnB1dCB0eXBlPVwidGV4dFwiPjwvZGl2PlxuIl0sIm1hcHBpbmdzIjoiQTs7O0FBQUEsVUFBUyxJQUFLLEVBQUMsSSxDQUFLLGFBQVksTSxDQUFPLGFBQVk7QUFDbkQ7QSJ9 diff --git a/crates/astro2tsx/tests/ported_parity.rs b/crates/astro2tsx/tests/ported_parity.rs index a8398a84..392341e2 100644 --- a/crates/astro2tsx/tests/ported_parity.rs +++ b/crates/astro2tsx/tests/ported_parity.rs @@ -36,13 +36,24 @@ fn snippet_offset(source: &str, snippet: &str) -> usize { .unwrap_or_else(|| panic!("snippet {snippet:?} not found in input")) } -/// Greatest mapping whose `original` is at or before `byte`. -fn original_to_generated(mappings: &[Mapping], byte: u32) -> Option { - mappings - .iter() - .filter(|m| m.original.is_some_and(|o| o <= byte)) - .max_by_key(|m| m.original.unwrap()) - .map(|m| m.generated) +/// Generated positions covering `byte`: each mapping opens a lockstep run +/// that lasts until the next mapping. +fn original_to_generated(mappings: &[Mapping], code_len: u32, byte: u32) -> Vec { + let mut candidates = Vec::new(); + for (index, mapping) in mappings.iter().enumerate() { + let Some(original) = mapping.original else { + continue; + }; + let run_end = mappings + .get(index + 1) + .map(|next| next.generated) + .unwrap_or(code_len); + let run_len = run_end - mapping.generated; + if byte >= original && byte - original < run_len { + candidates.push(mapping.generated + (byte - original)); + } + } + candidates } enum Resolution { @@ -53,25 +64,27 @@ enum Resolution { Unmapped, } -/// Resolves a snippet's original offset to a generated offset and reports -/// whether the generated output actually carries the snippet there. +/// Resolves a snippet's original offset through the runs and reports whether +/// any covering run lands exactly on the snippet in the generated output. fn resolve(input: &str, snippet: &str) -> Resolution { let result = convert(input); let offset = snippet_offset(input, snippet) as u32; - let Some(generated) = original_to_generated(&result.mappings, offset) else { + let candidates = original_to_generated(&result.mappings, result.code.len() as u32, offset); + if candidates.is_empty() { return Resolution::Unmapped; - }; - let exact = result - .mappings - .iter() - .any(|m| m.original == Some(offset) && m.generated == generated); - let at = result.code.get(generated as usize..).unwrap_or(""); - if exact && at.starts_with(snippet) { - Resolution::Exact - } else { - let found: String = at.chars().take(snippet.chars().count().max(12)).collect(); - Resolution::Wrong(found) } + for generated in &candidates { + if result + .code + .get(*generated as usize..) + .is_some_and(|at| at.starts_with(snippet)) + { + return Resolution::Exact; + } + } + let at = result.code.get(candidates[0] as usize..).unwrap_or(""); + let found: String = at.chars().take(snippet.chars().count().max(12)).collect(); + Resolution::Wrong(found) } const SOURCEMAP_CASES: &[(&str, &str, &str)] = &[ diff --git a/crates/astro2tsx/tests/source_map.rs b/crates/astro2tsx/tests/source_map.rs index dcaf4aeb..53e52deb 100644 --- a/crates/astro2tsx/tests/source_map.rs +++ b/crates/astro2tsx/tests/source_map.rs @@ -48,6 +48,38 @@ fn byte_offset(text: &str, line: u32, column: u32) -> Option { None } +/// Zero-based line and UTF-16 column of a byte offset. +fn line_col(text: &str, byte: usize) -> (u32, u32) { + let mut line = 0u32; + let mut col = 0u32; + for (index, ch) in text.char_indices() { + if index >= byte { + break; + } + if ch == '\n' { + line += 1; + col = 0; + } else { + col += ch.len_utf16() as u32; + } + } + (line, col) +} + +/// Resolves a generated position the way an editor does: nearest token on the +/// line at or before the column, then column arithmetic within its run. +fn resolve_decoded(decoded: &DecodedMap, line: u32, column: u32) -> Option<(u32, u32)> { + let token = decoded + .get_tokens() + .filter(|token| token.get_dst_line() == line && token.get_dst_col() <= column) + .max_by_key(|token| token.get_dst_col())?; + token.get_source_id()?; + Some(( + token.get_src_line(), + token.get_src_col() + (column - token.get_dst_col()), + )) +} + #[test] fn every_fixture_round_trips_through_an_independent_decoder() { for (name, raw) in fixtures() { @@ -71,56 +103,77 @@ fn every_fixture_round_trips_through_an_independent_decoder() { "{name}: sourcesContent did not survive" ); - let tokens: Vec<_> = decoded.get_tokens().collect(); - assert_eq!( - tokens.len(), - result.mappings.len(), - "{name}: decoded {} tokens for {} mappings", - tokens.len(), - result.mappings.len() - ); + // Every run start must decode back to exactly its original position. + for (index, mapping) in result.mappings.iter().enumerate() { + let (line, column) = line_col(&result.code, mapping.generated as usize); + match mapping.original { + Some(original) => { + let resolved = resolve_decoded(&decoded, line, column).unwrap_or_else(|| { + panic!("{name}: run {index} at {line}:{column} does not resolve") + }); + assert_eq!( + resolved, + line_col(&source, original as usize), + "{name}: run {index} resolves to the wrong original position" + ); + } + None => { + let nil_token = decoded.get_tokens().any(|token| { + token.get_dst_line() == line + && token.get_dst_col() == column + && token.get_source_id().is_none() + }); + assert!( + nil_token, + "{name}: nil run {index} at {line}:{column} has no explicit end marker" + ); + } + } + } - for (index, (token, mapping)) in tokens.iter().zip(&result.mappings).enumerate() { + // Every decoded token must be consistent with the run that covers it. + for token in decoded.get_tokens() { let generated = byte_offset(&result.code, token.get_dst_line(), token.get_dst_col()) .unwrap_or_else(|| { panic!( - "{name}: mapping {index} decoded to generated {}:{}, which is off the end", + "{name}: token at {}:{} is off the end of the output", token.get_dst_line(), token.get_dst_col() ) - }); - assert_eq!( - generated as u32, mapping.generated, - "{name}: mapping {index} generated offset changed across the round trip" - ); - - match mapping.original { + }) as u32; + let run = result + .mappings + .iter() + .rev() + .find(|mapping| mapping.generated <= generated) + .unwrap_or_else(|| panic!("{name}: token at byte {generated} precedes all runs")); + match run.original { Some(original) => { + let source_byte = + byte_offset(&source, token.get_src_line(), token.get_src_col()) + .unwrap_or_else(|| { + panic!( + "{name}: token source {}:{} is off the end of the input", + token.get_src_line(), + token.get_src_col() + ) + }) as u32; + assert_eq!( + source_byte, + original + (generated - run.generated), + "{name}: token at byte {generated} breaks its run's lockstep" + ); + } + None => { assert!( - token.get_source_id().is_some(), - "{name}: mapping {index} lost its source" + token.get_source_id().is_none(), + "{name}: token inside a nil run carries a source" ); - let decoded_original = byte_offset( - &source, - token.get_src_line(), - token.get_src_col(), - ) - .unwrap_or_else(|| { - panic!( - "{name}: mapping {index} decoded to source {}:{}, which is off the end", - token.get_src_line(), - token.get_src_col() - ) - }); assert_eq!( - decoded_original as u32, original, - "{name}: mapping {index} original offset changed across the round trip" + generated, run.generated, + "{name}: nil runs must not synthesize extra tokens" ); } - None => assert!( - token.get_source_id().is_none(), - "{name}: mapping {index} gained a source it never had" - ), } } } @@ -161,20 +214,17 @@ fn astral_columns_are_utf16_code_units() { .to_json_string(); let decoded = DecodedMap::from_json_string(&json).unwrap(); - let tokens: Vec<_> = decoded.get_tokens().collect(); - - // Selecting by raw byte offset keeps the assertion off the decoded columns. - let column_of = |offset: usize| { - let index = result - .mappings - .iter() - .position(|mapping| mapping.original == Some(offset as u32)) - .unwrap_or_else(|| panic!("byte {offset} is not mapped")); - let token = tokens[index]; - (token.get_src_line(), token.get_src_col()) + let resolve_generated_snippet = |snippet: &str| { + let generated = result + .code + .find(snippet) + .unwrap_or_else(|| panic!("{snippet:?} not in the output")); + let (line, column) = line_col(&result.code, generated); + resolve_decoded(&decoded, line, column) + .unwrap_or_else(|| panic!("{snippet:?} does not resolve")) }; - assert_eq!(column_of(source.find("{\u{3c0}}").unwrap()), (3, 6)); - assert_eq!(column_of(source.find("\u{3c0} = Math.PI").unwrap()), (1, 6)); - assert_eq!(column_of(source.find("

    ").unwrap()), (3, 9)); + assert_eq!(resolve_generated_snippet("{\u{3c0}}"), (3, 6)); + assert_eq!(resolve_generated_snippet("\u{3c0} = Math.PI"), (1, 6)); + assert_eq!(resolve_generated_snippet("

    "), (3, 9)); } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3ff6c299..6d3f6e07 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,10 +31,13 @@ importers: devDependencies: '@napi-rs/cli': specifier: ^3 - version: 3.5.1(@emnapi/runtime@1.8.1)(@types/node@22.19.9)(node-addon-api@7.1.1) + version: 3.5.1(@emnapi/runtime@1.11.1)(@types/node@22.19.9)(node-addon-api@7.1.1) '@types/node': specifier: ^22 version: 22.19.9 + typescript: + specifier: ^5.9.3 + version: 5.9.3 crates/astro_napi: devDependencies: @@ -2291,6 +2294,37 @@ snapshots: globby: 11.1.0 read-yaml-file: 1.1.0 + '@napi-rs/cli@3.5.1(@emnapi/runtime@1.11.1)(@types/node@22.19.9)(node-addon-api@7.1.1)': + dependencies: + '@inquirer/prompts': 8.2.0(@types/node@22.19.9) + '@napi-rs/cross-toolchain': 1.0.3 + '@napi-rs/wasm-tools': 1.0.1 + '@octokit/rest': 22.0.1 + clipanion: 4.0.0-rc.4(typanion@3.14.0) + colorette: 2.0.20 + emnapi: 1.8.1(node-addon-api@7.1.1) + es-toolkit: 1.44.0 + js-yaml: 4.1.1 + obug: 2.1.1 + semver: 7.7.3 + typanion: 3.14.0 + optionalDependencies: + '@emnapi/runtime': 1.11.1 + transitivePeerDependencies: + - '@napi-rs/cross-toolchain-arm64-target-aarch64' + - '@napi-rs/cross-toolchain-arm64-target-armv7' + - '@napi-rs/cross-toolchain-arm64-target-ppc64le' + - '@napi-rs/cross-toolchain-arm64-target-s390x' + - '@napi-rs/cross-toolchain-arm64-target-x86_64' + - '@napi-rs/cross-toolchain-x64-target-aarch64' + - '@napi-rs/cross-toolchain-x64-target-armv7' + - '@napi-rs/cross-toolchain-x64-target-ppc64le' + - '@napi-rs/cross-toolchain-x64-target-s390x' + - '@napi-rs/cross-toolchain-x64-target-x86_64' + - '@types/node' + - node-addon-api + - supports-color + '@napi-rs/cli@3.5.1(@emnapi/runtime@1.8.1)(@types/node@22.19.9)(node-addon-api@7.1.1)': dependencies: '@inquirer/prompts': 8.2.0(@types/node@22.19.9) From 66c55ceb1316498d47d0ded0676b0210750bfdc3 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 23:22:09 +0200 Subject: [PATCH 39/50] build: track the latest biome fork revision --- Cargo.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d8ef9dc4..e10d9f37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,12 +34,12 @@ oxc_transformer = { git = "https://github.com/withastro/oxc", rev = "8bb526fc0c2 oxc_sourcemap = "6.0.1" # Biome dependencies via git, all pinned to the same fork revision -biome_html_parser = { git = "https://github.com/Princesseuh/biome", rev = "0194be3fabd06a1eb1edb6abdd02f396df290eed" } -biome_html_syntax = { git = "https://github.com/Princesseuh/biome", rev = "0194be3fabd06a1eb1edb6abdd02f396df290eed" } -biome_js_parser = { git = "https://github.com/Princesseuh/biome", rev = "0194be3fabd06a1eb1edb6abdd02f396df290eed" } -biome_js_syntax = { git = "https://github.com/Princesseuh/biome", rev = "0194be3fabd06a1eb1edb6abdd02f396df290eed" } -biome_languages = { git = "https://github.com/Princesseuh/biome", rev = "0194be3fabd06a1eb1edb6abdd02f396df290eed" } -biome_rowan = { git = "https://github.com/Princesseuh/biome", rev = "0194be3fabd06a1eb1edb6abdd02f396df290eed" } +biome_html_parser = { git = "https://github.com/Princesseuh/biome", rev = "8087f81577d3ef5f37e8b676032afdf49ffc040b" } +biome_html_syntax = { git = "https://github.com/Princesseuh/biome", rev = "8087f81577d3ef5f37e8b676032afdf49ffc040b" } +biome_js_parser = { git = "https://github.com/Princesseuh/biome", rev = "8087f81577d3ef5f37e8b676032afdf49ffc040b" } +biome_js_syntax = { git = "https://github.com/Princesseuh/biome", rev = "8087f81577d3ef5f37e8b676032afdf49ffc040b" } +biome_languages = { git = "https://github.com/Princesseuh/biome", rev = "8087f81577d3ef5f37e8b676032afdf49ffc040b" } +biome_rowan = { git = "https://github.com/Princesseuh/biome", rev = "8087f81577d3ef5f37e8b676032afdf49ffc040b" } # NAPI napi = { version = "3", features = ["tokio_rt"] } From b9db75c899b7b897ff13cb5d4a0d9503fd9485b1 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Wed, 12 Aug 2026 23:38:38 +0200 Subject: [PATCH 40/50] feat(astro2tsx): expose mappings as volar-shaped run arrays --- crates/astro2tsx/index.d.ts | 14 +++--- crates/astro2tsx/index.js | 3 +- crates/astro2tsx/src/napi.rs | 38 ++++++++++------ crates/astro2tsx/test/astro2tsx.test.ts | 59 ++++++++++++++++++------- 4 files changed, 77 insertions(+), 37 deletions(-) diff --git a/crates/astro2tsx/index.d.ts b/crates/astro2tsx/index.d.ts index 1e1e3e00..ef58ecf7 100644 --- a/crates/astro2tsx/index.d.ts +++ b/crates/astro2tsx/index.d.ts @@ -22,11 +22,14 @@ export interface ConvertToTsxOptions { export interface ConvertToTsxResult { code: string /** - * Flat `(generated, original)` byte-offset pairs, ascending by generated - * offset. Each pair opens a run: both offsets advance in lockstep until - * the next pair. An original of `0xFFFF_FFFF` opens an unmapped run. + * Byte offsets into `code` where each mapped run starts, ascending. + * Positions inside a run resolve as `sourceOffsets[i] + (offset - + * generatedOffsets[i])` while within `lengths[i]` — the shape Volar + * mappings use. Generated bytes outside every run are synthetic. */ - mappings: Uint32Array + generatedOffsets: Uint32Array + sourceOffsets: Uint32Array + lengths: Uint32Array /** Source Map v3 JSON for `code`, with `sourcesContent` embedded. */ map: string frontmatter: GeneratedRange @@ -55,6 +58,3 @@ export interface GeneratedRange { start: number end: number } - -/** Sentinel in the odd slots of `mappings`: that output has no original position. */ -export const NO_ORIGINAL: number diff --git a/crates/astro2tsx/index.js b/crates/astro2tsx/index.js index 726348cb..148b96da 100644 --- a/crates/astro2tsx/index.js +++ b/crates/astro2tsx/index.js @@ -579,7 +579,6 @@ if (!nativeBinding) { throw new Error(`Failed to load native binding`) } -const { convertToTsx, ExtractedTagKind, NO_ORIGINAL } = nativeBinding +const { convertToTsx, ExtractedTagKind } = nativeBinding export { convertToTsx } export { ExtractedTagKind } -export { NO_ORIGINAL } diff --git a/crates/astro2tsx/src/napi.rs b/crates/astro2tsx/src/napi.rs index 290683c4..fd02ada7 100644 --- a/crates/astro2tsx/src/napi.rs +++ b/crates/astro2tsx/src/napi.rs @@ -8,10 +8,6 @@ use crate::{ ConvertOptions, DEFAULT_SOURCE_NAME, ExtractedKind, SourceMapMode, convert_to_tsx as convert_rs, }; -/// Sentinel in the odd slots of `mappings`: that output has no original position. -#[napi] -pub const NO_ORIGINAL: u32 = u32::MAX; - /// Byte range inside the generated TSX. #[napi(object)] pub struct GeneratedRange { @@ -48,10 +44,13 @@ pub struct ConvertToTsxOptions { #[napi(object)] pub struct ConvertToTsxResult { pub code: String, - /// Flat `(generated, original)` byte-offset pairs, ascending by generated - /// offset. Each pair opens a run: both offsets advance in lockstep until - /// the next pair. An original of `0xFFFF_FFFF` opens an unmapped run. - pub mappings: Uint32Array, + /// Byte offsets into `code` where each mapped run starts, ascending. + /// Positions inside a run resolve as `sourceOffsets[i] + (offset - + /// generatedOffsets[i])` while within `lengths[i]` — the shape Volar + /// mappings use. Generated bytes outside every run are synthetic. + pub generated_offsets: Uint32Array, + pub source_offsets: Uint32Array, + pub lengths: Uint32Array, /// Source Map v3 JSON for `code`, with `sourcesContent` embedded. pub map: String, pub frontmatter: GeneratedRange, @@ -85,16 +84,29 @@ pub fn convert_to_tsx(source: String, options: Option) -> C ); let map = result.source_map(&source, &source_name).to_json_string(); - let mut mappings = Vec::with_capacity(result.mappings.len() * 2); - for mapping in &result.mappings { - mappings.push(mapping.generated); - mappings.push(mapping.original.unwrap_or(NO_ORIGINAL)); + let mut generated_offsets = Vec::new(); + let mut source_offsets = Vec::new(); + let mut lengths = Vec::new(); + for (index, mapping) in result.mappings.iter().enumerate() { + let Some(original) = mapping.original else { + continue; + }; + let run_end = result + .mappings + .get(index + 1) + .map(|next| next.generated) + .unwrap_or(result.code.len() as u32); + generated_offsets.push(mapping.generated); + source_offsets.push(original); + lengths.push(run_end - mapping.generated); } ConvertToTsxResult { code: result.code, map, - mappings: Uint32Array::new(mappings), + generated_offsets: Uint32Array::new(generated_offsets), + source_offsets: Uint32Array::new(source_offsets), + lengths: Uint32Array::new(lengths), frontmatter: GeneratedRange { start: result.frontmatter.start, end: result.frontmatter.end, diff --git a/crates/astro2tsx/test/astro2tsx.test.ts b/crates/astro2tsx/test/astro2tsx.test.ts index 26fe3011..1b23e191 100644 --- a/crates/astro2tsx/test/astro2tsx.test.ts +++ b/crates/astro2tsx/test/astro2tsx.test.ts @@ -3,7 +3,7 @@ import { join } from 'node:path'; import { strict as assert } from 'node:assert'; import ts from 'typescript'; import { test } from 'node:test'; -import { NO_ORIGINAL, convertToTsx } from '../index.js'; +import { convertToTsx } from '../index.js'; test('emits the TSX prefix and a Fragment-wrapped body', () => { const result = convertToTsx('

    Hello {value}

    '); @@ -41,21 +41,50 @@ test('records frontmatter and body byte ranges', () => { assert.match(frontmatterSlice, /let x = 1;/); }); -test('mappings are packed pairs ascending by generated offset', () => { - const result = convertToTsx('

    Hi

    '); - assert.ok(result.mappings instanceof Uint32Array); - assert.equal(result.mappings.length % 2, 0); - let mapped = 0; - for (let i = 0; i < result.mappings.length; i += 2) { - if (i > 0) assert.ok(result.mappings[i] >= result.mappings[i - 2], 'generated offsets ascend'); - if (result.mappings[i + 1] !== NO_ORIGINAL) mapped++; +test('mapped runs interpolate to exact source positions, Volar-style', () => { + const source = + '---\nconst x = 1;\n---\n
    hello world
    '; + const result = convertToTsx(source, { sourcemap: 'external' }); + const { generatedOffsets, sourceOffsets, lengths } = result; + + assert.ok(generatedOffsets instanceof Uint32Array); + assert.equal(generatedOffsets.length, sourceOffsets.length); + assert.equal(generatedOffsets.length, lengths.length); + assert.ok(generatedOffsets.length > 0); + for (let i = 0; i < generatedOffsets.length; i++) { + assert.ok(lengths[i] > 0, `run ${i} is empty`); + if (i > 0) { + assert.ok( + generatedOffsets[i] >= generatedOffsets[i - 1] + lengths[i - 1], + `run ${i} overlaps its predecessor`, + ); + } } - assert.ok(mapped > 0, 'expected at least one mapped byte'); - const h1 = result.code.indexOf('

    '); - const pair = [...Array(result.mappings.length / 2).keys()].find( - (n) => result.mappings[2 * n] === h1, - ); - assert.notEqual(result.mappings[2 * pair + 1], NO_ORIGINAL, '

    maps back to the source'); + + const originalAt = (generated) => { + for (let i = generatedOffsets.length - 1; i >= 0; i--) { + const delta = generated - generatedOffsets[i]; + if (delta >= 0 && delta < lengths[i]) return sourceOffsets[i] + delta; + } + return null; + }; + + // Hover-style probes, deliberately mid-run rather than at run starts. + for (const probe of ['id="main"', 'data-thing', 'hello', 'world', 'const x = 1;']) { + const generated = result.code.indexOf(probe); + assert.notEqual(generated, -1, `${probe} not in output`); + const original = originalAt(generated); + assert.notEqual(original, null, `${probe} is unmapped`); + assert.equal( + source.slice(original, original + probe.length), + probe, + `${probe} resolves to the wrong source text`, + ); + } + + // Synthetic output stays unmapped instead of resolving somewhere misleading. + assert.equal(originalAt(result.code.indexOf('')), null); + assert.equal(originalAt(result.code.indexOf('export default function')), null); }); test('returns a self-contained source map v3', () => { From 0770f3fa822b599333ff1737c098363f082d513d Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Thu, 13 Aug 2026 00:58:14 +0200 Subject: [PATCH 41/50] chore(astro2tsx): add conversion benchmarks --- Cargo.toml | 2 +- benches/astro2tsx/Cargo.toml | 13 ++ benches/astro2tsx/benches/convert.rs | 114 ++++++++++++++++++ .../astro2tsx/fixtures/ExpressionHeavy.astro | 45 +++++++ benches/astro2tsx/fixtures/Favicon.astro | 9 ++ .../astro2tsx/fixtures/HeaderDropDown.astro | 86 +++++++++++++ benches/astro2tsx/fixtures/PillLink.astro | 35 ++++++ benches/astro2tsx/fixtures/SEO.astro | 100 +++++++++++++++ benches/astro2tsx/fixtures/SocialLinks.astro | 21 ++++ benches/astro2tsx/src/lib.rs | 1 + 10 files changed, 425 insertions(+), 1 deletion(-) create mode 100644 benches/astro2tsx/Cargo.toml create mode 100644 benches/astro2tsx/benches/convert.rs create mode 100644 benches/astro2tsx/fixtures/ExpressionHeavy.astro create mode 100644 benches/astro2tsx/fixtures/Favicon.astro create mode 100644 benches/astro2tsx/fixtures/HeaderDropDown.astro create mode 100644 benches/astro2tsx/fixtures/PillLink.astro create mode 100644 benches/astro2tsx/fixtures/SEO.astro create mode 100644 benches/astro2tsx/fixtures/SocialLinks.astro create mode 100644 benches/astro2tsx/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index e10d9f37..97354383 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] resolver = "3" -members = ["crates/*"] +members = ["crates/*", "benches/*"] [workspace.package] authors = ["Astro contributors"] diff --git a/benches/astro2tsx/Cargo.toml b/benches/astro2tsx/Cargo.toml new file mode 100644 index 00000000..ac206a08 --- /dev/null +++ b/benches/astro2tsx/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "astro2tsx_benches" +version = "0.0.0" +edition.workspace = true +publish = false + +[dependencies] +astro2tsx = { path = "../../crates/astro2tsx" } +divan = { workspace = true } + +[[bench]] +name = "convert" +harness = false diff --git a/benches/astro2tsx/benches/convert.rs b/benches/astro2tsx/benches/convert.rs new file mode 100644 index 00000000..a0b51714 --- /dev/null +++ b/benches/astro2tsx/benches/convert.rs @@ -0,0 +1,114 @@ +use astro2tsx::{ConvertOptions, SourceMapMode, convert_to_tsx}; +use divan::counter::BytesCount; + +fn main() { + divan::main(); +} + +fn options() -> ConvertOptions { + ConvertOptions { + filename: Some("Component.astro".to_string()), + sourcemap: SourceMapMode::External, + } +} + +fn bench_convert(bencher: divan::Bencher<'_, '_>, source: &str) { + bencher + .counter(BytesCount::of_str(source)) + .bench_local(|| convert_to_tsx(divan::black_box(source), options())); +} + +mod components { + use super::*; + + #[divan::bench] + fn favicon(bencher: divan::Bencher<'_, '_>) { + bench_convert(bencher, include_str!("../fixtures/Favicon.astro")); + } + + #[divan::bench] + fn pill_link(bencher: divan::Bencher<'_, '_>) { + bench_convert(bencher, include_str!("../fixtures/PillLink.astro")); + } + + #[divan::bench] + fn social_links(bencher: divan::Bencher<'_, '_>) { + bench_convert(bencher, include_str!("../fixtures/SocialLinks.astro")); + } + + #[divan::bench] + fn header_drop_down(bencher: divan::Bencher<'_, '_>) { + bench_convert(bencher, include_str!("../fixtures/HeaderDropDown.astro")); + } + + #[divan::bench] + fn seo(bencher: divan::Bencher<'_, '_>) { + bench_convert(bencher, include_str!("../fixtures/SEO.astro")); + } + + #[divan::bench] + fn expression_heavy(bencher: divan::Bencher<'_, '_>) { + bench_convert(bencher, include_str!("../fixtures/ExpressionHeavy.astro")); + } +} + +/// Repeats the section so the input grows without its shape changing. +fn build_page(sections: usize) -> String { + let fixture = include_str!("../fixtures/ExpressionHeavy.astro"); + let (frontmatter, body) = fixture + .rsplit_once("---\n") + .expect("fixture has a frontmatter fence"); + let mut source = String::with_capacity(frontmatter.len() + 4 + body.len() * sections); + source.push_str(frontmatter); + source.push_str("---\n"); + for _ in 0..sections { + source.push_str(body); + } + source +} + +#[divan::bench(args = [8, 64, 256])] +fn large_page(bencher: divan::Bencher<'_, '_>, sections: usize) { + let source = build_page(sections); + bencher + .counter(BytesCount::of_str(&source)) + .bench_local(|| convert_to_tsx(divan::black_box(&source), options())); +} + +mod phases { + use super::*; + + #[divan::bench] + fn convert_only(bencher: divan::Bencher<'_, '_>) { + let source = build_page(64); + bencher + .counter(BytesCount::of_str(&source)) + .bench_local(|| convert_to_tsx(divan::black_box(&source), options())); + } + + #[divan::bench] + fn sourcemap_encode(bencher: divan::Bencher<'_, '_>) { + let source = build_page(64); + let result = convert_to_tsx(&source, options()); + bencher + .counter(BytesCount::of_str(&result.code)) + .bench_local(|| result.source_map(divan::black_box(&source), "Component.astro")); + } + + /// Inline is the napi binding's default, so this is the production path. + #[divan::bench] + fn convert_with_inline_map(bencher: divan::Bencher<'_, '_>) { + let source = build_page(64); + bencher + .counter(BytesCount::of_str(&source)) + .bench_local(|| { + convert_to_tsx( + divan::black_box(&source), + ConvertOptions { + filename: Some("Component.astro".to_string()), + sourcemap: SourceMapMode::Inline, + }, + ) + }); + } +} diff --git a/benches/astro2tsx/fixtures/ExpressionHeavy.astro b/benches/astro2tsx/fixtures/ExpressionHeavy.astro new file mode 100644 index 00000000..36402415 --- /dev/null +++ b/benches/astro2tsx/fixtures/ExpressionHeavy.astro @@ -0,0 +1,45 @@ +--- +interface Item { + href: string; + title: string; + tags: string[]; + draft?: boolean; +} + +interface Props { + items: Item[]; + heading?: string; +} + +const { items, heading = 'Latest posts' } = Astro.props; +const published = items.filter((item) => !item.draft); +--- + +
    +

    {heading}

    + {published.length === 0 &&

    Nothing here yet.

    } +
      + { + published.map((item, index) => ( +
    • + + {index === 0 ? ( + + {item.title} + + ) : ( + {item.title} + )} + {item.tags.length > 0 && ( + + {item.tags.map((tag) => ( + #{tag} + ))} + + )} +
    • + )) + } +
    + {published.length > 10 && See all {published.length} posts} +
    diff --git a/benches/astro2tsx/fixtures/Favicon.astro b/benches/astro2tsx/fixtures/Favicon.astro new file mode 100644 index 00000000..db43d5dc --- /dev/null +++ b/benches/astro2tsx/fixtures/Favicon.astro @@ -0,0 +1,9 @@ + + + diff --git a/benches/astro2tsx/fixtures/HeaderDropDown.astro b/benches/astro2tsx/fixtures/HeaderDropDown.astro new file mode 100644 index 00000000..8fed5859 --- /dev/null +++ b/benches/astro2tsx/fixtures/HeaderDropDown.astro @@ -0,0 +1,86 @@ +--- +import { Icon } from 'astro-icon/components'; + +interface Props { + label: string; + items: Array<{ + href: string; + icon: string; + label: string; + prefetch?: boolean; + badge?: string; + }>; +} +--- + + +
    + + {Astro.props.label} + + +
    +
    + + diff --git a/benches/astro2tsx/fixtures/PillLink.astro b/benches/astro2tsx/fixtures/PillLink.astro new file mode 100644 index 00000000..15e9d04b --- /dev/null +++ b/benches/astro2tsx/fixtures/PillLink.astro @@ -0,0 +1,35 @@ +--- +import { Icon } from 'astro-icon/components'; + +type Props = { + href: string; + title: string; + class?: string; + subtitle?: string; +}; + +const { title, subtitle, href, class: className } = Astro.props; +--- + + +
    + {title} +
    + { + subtitle && ( + + ) + } +
    diff --git a/benches/astro2tsx/fixtures/SEO.astro b/benches/astro2tsx/fixtures/SEO.astro new file mode 100644 index 00000000..bf642f11 --- /dev/null +++ b/benches/astro2tsx/fixtures/SEO.astro @@ -0,0 +1,100 @@ +--- +export type Image = { + src: string; + alt: string; +}; +export type SEOMetadata = { + name: string; + title: string; + description: string; + image: Image; + canonicalURL?: URL | string | null; + locale?: string; +}; +export type OpenGraph = Partial & { + type?: string; +}; +export type Twitter = Partial & { + handle?: string; + card?: 'summary' | 'summary_large_image'; +}; +export type Props = SEOMetadata & { + og?: OpenGraph; + twitter?: Twitter; +}; +const { + name, + title, + description, + image, + locale = 'en', + canonicalURL = new URL(Astro.url.pathname, Astro.site), +} = Astro.props; + +const og = { + name, + title, + description, + canonicalURL, + image, + locale, + type: 'website', + ...Astro.props.og, +} satisfies OpenGraph; + +const twitter = { + name, + title, + description, + canonicalURL, + image, + locale, + card: 'summary_large_image', + ...Astro.props.twitter, +} satisfies Twitter; + +/** + * Enforce some standard canonical URL formatting across the site. + */ +function formatCanonicalURL(url: string | URL) { + const path = url.toString(); + const hasQueryParams = path.includes('?'); + // If there are query params, make sure the URL has no trailing slash + if (hasQueryParams) { + path.replace(/\/?$/, ''); + } + // otherwise, canonical URL always has a trailing slash + return path.replace(/\/?$/, hasQueryParams ? '' : '/'); +} +--- + +{/* Page Metadata */} +{canonicalURL && } + + +{/* OpenGraph Tags */} + + +{og.canonicalURL && } + + + +{og.image && } +{og.image && } + +{/* Twitter Tags */} +{twitter.card && } +{twitter.handle && } + + +{twitter.image && } +{twitter.image && } + +{ + /* + Robots meta tag for Google Search. + Enables a large image preview in Google search results, most pertinently in Chrome’s “Discover” view on mobile. + See: https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag#max-image-preview +*/ +} + diff --git a/benches/astro2tsx/fixtures/SocialLinks.astro b/benches/astro2tsx/fixtures/SocialLinks.astro new file mode 100644 index 00000000..02d94f0c --- /dev/null +++ b/benches/astro2tsx/fixtures/SocialLinks.astro @@ -0,0 +1,21 @@ +--- +import { Icon } from 'astro-icon/components'; +import type { SocialLink } from '~/data/site-info.js'; + +export type Props = { + links: SocialLink[]; +}; + +const { links } = Astro.props; +--- + +
    + { + links.map((link) => ( + + {link.text} + + )) + } +
    diff --git a/benches/astro2tsx/src/lib.rs b/benches/astro2tsx/src/lib.rs new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/benches/astro2tsx/src/lib.rs @@ -0,0 +1 @@ + From a44d7c8f3f9f707d4f84cb9511a13de68e5c8a11 Mon Sep 17 00:00:00 2001 From: Princesseuh <3019731+Princesseuh@users.noreply.github.com> Date: Thu, 13 Aug 2026 01:27:38 +0200 Subject: [PATCH 42/50] feat(astro2tsx): expose source ranges, diagnostics, and utf16 offsets to node --- Cargo.toml | 2 + crates/astro2tsx/Cargo.toml | 2 + crates/astro2tsx/index.d.ts | 44 ++++-- crates/astro2tsx/index.js | 3 +- crates/astro2tsx/src/expression.rs | 11 +- crates/astro2tsx/src/lib.rs | 30 +++- crates/astro2tsx/src/napi.rs | 136 +++++++++++++----- crates/astro2tsx/src/printer.rs | 35 ++++- crates/astro2tsx/src/render.rs | 58 +++++++- crates/astro2tsx/src/sourcemap.rs | 48 +++++++ crates/astro2tsx/src/utf16.rs | 84 +++++++++++ crates/astro2tsx/test/astro2tsx.test.ts | 37 +++++ .../fixtures/adjacent_siblings_top_level.snap | 4 + .../fixtures/attribute_event_and_style.snap | 10 ++ .../fixtures/attribute_expression_jsx.snap | 4 + .../fixtures/attribute_expression_value.snap | 4 + .../fixtures/attribute_invalid_names.snap | 4 + .../fixtures/attribute_quoted_forms.snap | 4 + .../tests/fixtures/attribute_shorthand.snap | 4 + .../tests/fixtures/attribute_spread.snap | 4 + .../fixtures/attribute_template_literal.snap | 4 + .../comment_between_frontmatter_and_body.snap | 4 + .../tests/fixtures/crlf_frontmatter.snap | 4 + .../astro2tsx/tests/fixtures/directives.snap | 4 + .../tests/fixtures/escape_comment_bodies.snap | 4 + .../expression_adjacent_siblings.snap | 4 + .../tests/fixtures/expression_bare_gt.snap | 4 + .../fixtures/expression_comment_only.snap | 4 + .../fixtures/expression_comment_trailing.snap | 4 + .../tests/fixtures/expression_empty.snap | 4 + .../tests/fixtures/expression_generics.snap | 4 + .../fixtures/expression_html_comment.snap | 4 + .../tests/fixtures/expression_identifier.snap | 4 + .../tests/fixtures/expression_is_raw.snap | 4 + .../expression_is_raw_unparseable.snap | 4 + .../tests/fixtures/expression_map.snap | 4 + .../tests/fixtures/expression_nested.snap | 4 + .../fixtures/expression_object_literal.snap | 4 + .../fixtures/expression_script_exclusion.snap | 7 + .../fixtures/expression_shorthand_attr.snap | 4 + .../fixtures/expression_single_element.snap | 4 + .../expression_special_attr_names.snap | 4 + .../fixtures/expression_spread_child.snap | 4 + .../expression_string_with_markup.snap | 4 + .../fixtures/expression_style_exclusion.snap | 7 + .../fixtures/expression_template_attr.snap | 4 + .../expression_template_with_markup.snap | 4 + .../fixtures/expression_ternary_markup.snap | 4 + .../fixtures/expression_unquoted_attr.snap | 4 + .../fixtures/expression_void_element.snap | 4 + .../tests/fixtures/fragment_shorthand.snap | 4 + .../tests/fixtures/frontmatter_absent.snap | 4 + .../tests/fixtures/frontmatter_and_body.snap | 4 + .../tests/fixtures/frontmatter_empty.snap | 4 + .../tests/fixtures/frontmatter_imports.snap | 4 + .../tests/fixtures/frontmatter_only.snap | 4 + .../frontmatter_top_level_return.snap | 4 + .../fixtures/get_static_paths_export.snap | 4 + .../fixtures/get_static_paths_with_props.snap | 4 + .../tests/fixtures/html_comment_body.snap | 4 + .../fixtures/html_comment_top_level.snap | 4 + .../astro2tsx/tests/fixtures/multibyte.snap | 4 + .../tests/fixtures/multibyte_astral.snap | 4 + .../fixtures/named_component_export.snap | 4 + .../fixtures/props_exported_alias_union.snap | 4 + .../tests/fixtures/props_generic.snap | 4 + .../tests/fixtures/props_generic_invalid.snap | 4 + .../tests/fixtures/props_imported.snap | 4 + .../tests/fixtures/props_interface.snap | 4 + .../tests/fixtures/props_polymorphic.snap | 4 + .../tests/fixtures/props_type_alias.snap | 4 + .../tests/fixtures/raw_text_is_raw.snap | 4 + .../tests/fixtures/raw_text_script_json.snap | 7 + .../fixtures/raw_text_script_module.snap | 7 + .../tests/fixtures/raw_text_style.snap | 7 + .../tests/fixtures/script_type_labels.snap | 13 ++ .../tests/fixtures/slot_element.snap | 4 + crates/astro2tsx/tests/fixtures/slots.snap | 4 + .../tests/fixtures/style_lang_label.snap | 7 + .../fixtures/tag_whitespace_collapsing.snap | 4 + .../fixtures/top_level_returns_nested.snap | 4 + .../tests/fixtures/unclosed_member_tag.snap | 4 + .../tests/fixtures/unclosed_tag.snap | 4 + .../tests/fixtures/void_elements.snap | 4 + crates/astro2tsx/tests/regressions.rs | 49 ++++++- crates/astro2tsx/tests/snapshots.rs | 16 ++- 86 files changed, 809 insertions(+), 67 deletions(-) create mode 100644 crates/astro2tsx/src/utf16.rs diff --git a/Cargo.toml b/Cargo.toml index 97354383..dcd6b6e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,9 +34,11 @@ oxc_transformer = { git = "https://github.com/withastro/oxc", rev = "8bb526fc0c2 oxc_sourcemap = "6.0.1" # Biome dependencies via git, all pinned to the same fork revision +biome_diagnostics = { git = "https://github.com/Princesseuh/biome", rev = "8087f81577d3ef5f37e8b676032afdf49ffc040b" } biome_html_parser = { git = "https://github.com/Princesseuh/biome", rev = "8087f81577d3ef5f37e8b676032afdf49ffc040b" } biome_html_syntax = { git = "https://github.com/Princesseuh/biome", rev = "8087f81577d3ef5f37e8b676032afdf49ffc040b" } biome_js_parser = { git = "https://github.com/Princesseuh/biome", rev = "8087f81577d3ef5f37e8b676032afdf49ffc040b" } +biome_parser = { git = "https://github.com/Princesseuh/biome", rev = "8087f81577d3ef5f37e8b676032afdf49ffc040b" } biome_js_syntax = { git = "https://github.com/Princesseuh/biome", rev = "8087f81577d3ef5f37e8b676032afdf49ffc040b" } biome_languages = { git = "https://github.com/Princesseuh/biome", rev = "8087f81577d3ef5f37e8b676032afdf49ffc040b" } biome_rowan = { git = "https://github.com/Princesseuh/biome", rev = "8087f81577d3ef5f37e8b676032afdf49ffc040b" } diff --git a/crates/astro2tsx/Cargo.toml b/crates/astro2tsx/Cargo.toml index 0481be63..d41360bb 100644 --- a/crates/astro2tsx/Cargo.toml +++ b/crates/astro2tsx/Cargo.toml @@ -15,9 +15,11 @@ test = true doctest = false [dependencies] +biome_diagnostics = { workspace = true } biome_html_parser = { workspace = true } biome_html_syntax = { workspace = true } biome_js_parser = { workspace = true } +biome_parser = { workspace = true } biome_js_syntax = { workspace = true } biome_languages = { workspace = true } biome_rowan = { workspace = true } diff --git a/crates/astro2tsx/index.d.ts b/crates/astro2tsx/index.d.ts index ef58ecf7..d902d66b 100644 --- a/crates/astro2tsx/index.d.ts +++ b/crates/astro2tsx/index.d.ts @@ -1,5 +1,18 @@ /* auto-generated by NAPI-RS */ /* eslint-disable */ +export interface AstroDiagnostic { + message: string + /** 1 = error, 2 = warning, 3 = information, 4 = hint. */ + severity: number + position: Range +} + +export declare const enum AstroFrontmatterStatus { + DoesntExist = 'doesnt-exist', + Open = 'open', + Closed = 'closed' +} + /** * Convert an Astro source file to TSX for tsserver intellisense. * @@ -22,39 +35,46 @@ export interface ConvertToTsxOptions { export interface ConvertToTsxResult { code: string /** - * Byte offsets into `code` where each mapped run starts, ascending. - * Positions inside a run resolve as `sourceOffsets[i] + (offset - + * Offsets into `code` where each mapped run starts, ascending. Positions + * inside a run resolve as `sourceOffsets[i] + (offset - * generatedOffsets[i])` while within `lengths[i]` — the shape Volar - * mappings use. Generated bytes outside every run are synthetic. + * mappings use. Output outside every run is synthetic. */ generatedOffsets: Uint32Array sourceOffsets: Uint32Array lengths: Uint32Array /** Source Map v3 JSON for `code`, with `sourcesContent` embedded. */ map: string - frontmatter: GeneratedRange - body: GeneratedRange + /** Range of the frontmatter section within `code`. */ + frontmatter: Range + /** Range of the `` body within `code`. */ + body: Range + frontmatterStatus: AstroFrontmatterStatus + /** Range of the frontmatter in the original source, fences included. */ + frontmatterSource: Range scripts: Array styles: Array + diagnostics: Array hasParseErrors: boolean } export interface ExtractedTag { - range: GeneratedRange + /** Range of `content` in the original source. */ + position: Range kind: ExtractedTagKind content: string + /** Script family (`module`, `json`, …) or style language (`css`, `scss`, …). */ lang?: string } export declare const enum ExtractedTagKind { - Script = 'Script', - Style = 'Style', - StyleAttribute = 'StyleAttribute', - EventAttribute = 'EventAttribute' + Script = 'script', + Style = 'style', + StyleAttribute = 'style-attribute', + EventAttribute = 'event-attribute' } -/** Byte range inside the generated TSX. */ -export interface GeneratedRange { +export interface Range { start: number end: number } diff --git a/crates/astro2tsx/index.js b/crates/astro2tsx/index.js index 148b96da..c0630dc9 100644 --- a/crates/astro2tsx/index.js +++ b/crates/astro2tsx/index.js @@ -579,6 +579,7 @@ if (!nativeBinding) { throw new Error(`Failed to load native binding`) } -const { convertToTsx, ExtractedTagKind } = nativeBinding +const { AstroFrontmatterStatus, convertToTsx, ExtractedTagKind } = nativeBinding +export { AstroFrontmatterStatus } export { convertToTsx } export { ExtractedTagKind } diff --git a/crates/astro2tsx/src/expression.rs b/crates/astro2tsx/src/expression.rs index 193bfd9c..7494bb97 100644 --- a/crates/astro2tsx/src/expression.rs +++ b/crates/astro2tsx/src/expression.rs @@ -7,7 +7,7 @@ use biome_js_syntax::{ use biome_rowan::{AstNode, AstNodeList, SyntaxNode, SyntaxToken, SyntaxTriviaPiece, TextSize}; use crate::printer::Printer; -use crate::sourcemap::GeneratedRange; +use crate::sourcemap::{GeneratedRange, SourceRange}; use crate::utils::{ classify_script_type, comment_needs_leading_space, encode_double_quote, is_valid_tsx_attribute_name, @@ -213,16 +213,17 @@ fn emit_jsx_element(printer: &mut Printer, element: &JsxElement, base: u32) { } ChildrenMode::ExcludedScript | ChildrenMode::ExcludedStyle => { if let Some((from, to)) = children_source_span(element) { - let content = - printer.source[abs(base, from) as usize..abs(base, to) as usize].to_string(); + let (from, to) = (abs(base, from), abs(base, to)); + let content = printer.source[from as usize..to as usize].to_string(); let range = GeneratedRange::new(body_start, printer.position()); + let source = SourceRange::new(from, to); if matches!(mode, ChildrenMode::ExcludedScript) { let label = script_label(&opening.attributes()); - printer.add_script_block(range, content, label); + printer.add_script_block(range, source, content, label); } else { let lang = jsx_attribute_string(&opening.attributes(), "lang") .unwrap_or_else(|| "css".to_string()); - printer.add_style_block(range, content, lang); + printer.add_style_block(range, source, content, lang); } } } diff --git a/crates/astro2tsx/src/lib.rs b/crates/astro2tsx/src/lib.rs index f5fb9d7d..d6dca55c 100644 --- a/crates/astro2tsx/src/lib.rs +++ b/crates/astro2tsx/src/lib.rs @@ -14,14 +14,16 @@ mod printer; mod props; mod render; pub mod sourcemap; +mod utf16; mod utils; use biome_html_parser::parse_html; use biome_languages::HtmlFileSource; pub use crate::sourcemap::{ - DEFAULT_SOURCE_NAME, ExtractedKind, ExtractedTag, GeneratedRange, Mapping, SourceMap, - SourceMapMode, + DEFAULT_SOURCE_NAME, Diagnostic, DiagnosticSeverity, ExtractedKind, ExtractedTag, + FrontmatterInfo, FrontmatterStatus, GeneratedRange, Mapping, SourceMap, SourceMapMode, + SourceRange, }; #[derive(Clone, Debug, Default)] @@ -39,7 +41,7 @@ pub struct ConvertResult { /// generated and original offsets advancing in lockstep. pub mappings: Vec, /// Generated byte range covering the printed frontmatter section. - pub frontmatter: GeneratedRange, + pub frontmatter_range: GeneratedRange, /// Generated byte range covering the printed body section /// (`...`). pub body: GeneratedRange, @@ -49,6 +51,9 @@ pub struct ConvertResult { pub styles: Vec, /// Conversion still runs to completion when this is `true`. pub has_parse_errors: bool, + /// Parse diagnostics from the document and its expression bodies. + pub diagnostics: Vec, + pub frontmatter: FrontmatterInfo, } impl ConvertResult { @@ -67,14 +72,31 @@ pub fn convert_to_tsx(source: &str, options: ConvertOptions) -> ConvertResult { let mut printer = printer::Printer::new(source); render::render_root(&mut printer, root, &options); + let mut diagnostics: Vec = parse + .diagnostics() + .iter() + .map(|diagnostic| Diagnostic { + message: diagnostic.message.to_string(), + severity: DiagnosticSeverity::Error, + source: match biome_diagnostics::Diagnostic::location(diagnostic).span { + Some(span) => SourceRange::new(u32::from(span.start()), u32::from(span.end())), + None => SourceRange::new(0, source.len() as u32), + }, + }) + .collect(); + diagnostics.extend(printer.diagnostics); + diagnostics.sort_by_key(|diagnostic| (diagnostic.source.start, diagnostic.source.end)); + let mut result = ConvertResult { code: printer.output, mappings: printer.mappings, - frontmatter: printer.frontmatter_range, + frontmatter_range: printer.frontmatter_range, body: printer.body_range, scripts: printer.scripts, styles: printer.styles, has_parse_errors: html_has_errors || printer.has_expression_errors, + diagnostics, + frontmatter: printer.frontmatter_info, }; if options.sourcemap == SourceMapMode::Inline { diff --git a/crates/astro2tsx/src/napi.rs b/crates/astro2tsx/src/napi.rs index fd02ada7..f69c1ee4 100644 --- a/crates/astro2tsx/src/napi.rs +++ b/crates/astro2tsx/src/napi.rs @@ -1,21 +1,25 @@ //! Node.js bindings for `astro2tsx`. Excluded from `cfg(test)` builds, where //! napi-derive emits no registration and every item here looks dead. +//! +//! Every offset crossing this boundary is in UTF-16 code units, because JS +//! consumers index strings that way. use napi::bindgen_prelude::Uint32Array; use napi_derive::napi; +use crate::utf16::Utf16Index; use crate::{ - ConvertOptions, DEFAULT_SOURCE_NAME, ExtractedKind, SourceMapMode, convert_to_tsx as convert_rs, + ConvertOptions, DEFAULT_SOURCE_NAME, DiagnosticSeverity, ExtractedKind, FrontmatterStatus, + SourceMapMode, convert_to_tsx as convert_rs, }; -/// Byte range inside the generated TSX. #[napi(object)] -pub struct GeneratedRange { +pub struct Range { pub start: u32, pub end: u32, } -#[napi(string_enum)] +#[napi(string_enum = "kebab-case")] pub enum ExtractedTagKind { Script, Style, @@ -25,12 +29,29 @@ pub enum ExtractedTagKind { #[napi(object)] pub struct ExtractedTag { - pub range: GeneratedRange, + /// Range of `content` in the original source. + pub position: Range, pub kind: ExtractedTagKind, pub content: String, + /// Script family (`module`, `json`, …) or style language (`css`, `scss`, …). pub lang: Option, } +#[napi(string_enum = "kebab-case")] +pub enum AstroFrontmatterStatus { + DoesntExist, + Open, + Closed, +} + +#[napi(object)] +pub struct AstroDiagnostic { + pub message: String, + /// 1 = error, 2 = warning, 3 = information, 4 = hint. + pub severity: u32, + pub position: Range, +} + #[napi(object)] #[derive(Default)] pub struct ConvertToTsxOptions { @@ -44,19 +65,25 @@ pub struct ConvertToTsxOptions { #[napi(object)] pub struct ConvertToTsxResult { pub code: String, - /// Byte offsets into `code` where each mapped run starts, ascending. - /// Positions inside a run resolve as `sourceOffsets[i] + (offset - + /// Offsets into `code` where each mapped run starts, ascending. Positions + /// inside a run resolve as `sourceOffsets[i] + (offset - /// generatedOffsets[i])` while within `lengths[i]` — the shape Volar - /// mappings use. Generated bytes outside every run are synthetic. + /// mappings use. Output outside every run is synthetic. pub generated_offsets: Uint32Array, pub source_offsets: Uint32Array, pub lengths: Uint32Array, /// Source Map v3 JSON for `code`, with `sourcesContent` embedded. pub map: String, - pub frontmatter: GeneratedRange, - pub body: GeneratedRange, + /// Range of the frontmatter section within `code`. + pub frontmatter: Range, + /// Range of the `` body within `code`. + pub body: Range, + pub frontmatter_status: AstroFrontmatterStatus, + /// Range of the frontmatter in the original source, fences included. + pub frontmatter_source: Range, pub scripts: Vec, pub styles: Vec, + pub diagnostics: Vec, pub has_parse_errors: bool, } @@ -84,6 +111,11 @@ pub fn convert_to_tsx(source: String, options: Option) -> C ); let map = result.source_map(&source, &source_name).to_json_string(); + let source_index = Utf16Index::new(&source); + let generated_index = Utf16Index::new(&result.code); + let code_len = result.code.len() as u32; + let source_len = source_index.convert(source.len() as u32); + let mut generated_offsets = Vec::new(); let mut source_offsets = Vec::new(); let mut lengths = Vec::new(); @@ -95,45 +127,79 @@ pub fn convert_to_tsx(source: String, options: Option) -> C .mappings .get(index + 1) .map(|next| next.generated) - .unwrap_or(result.code.len() as u32); - generated_offsets.push(mapping.generated); - source_offsets.push(original); - lengths.push(run_end - mapping.generated); + .unwrap_or(code_len); + let generated = generated_index.convert(mapping.generated); + let source = source_index.convert(original); + // Runs are verbatim copies, so one UTF-16 length serves both sides. + // The printer maps trailing output one past EOF, so clamp to the source. + let length = (generated_index.convert(run_end) - generated).min(source_len - source); + if length == 0 { + continue; + } + generated_offsets.push(generated); + source_offsets.push(source); + lengths.push(length); } ConvertToTsxResult { - code: result.code, - map, - generated_offsets: Uint32Array::new(generated_offsets), - source_offsets: Uint32Array::new(source_offsets), - lengths: Uint32Array::new(lengths), - frontmatter: GeneratedRange { - start: result.frontmatter.start, - end: result.frontmatter.end, + frontmatter: Range { + start: generated_index.convert(result.frontmatter_range.start), + end: generated_index.convert(result.frontmatter_range.end), + }, + body: Range { + start: generated_index.convert(result.body.start), + end: generated_index.convert(result.body.end), }, - body: GeneratedRange { - start: result.body.start, - end: result.body.end, + frontmatter_status: match result.frontmatter.status { + FrontmatterStatus::DoesntExist => AstroFrontmatterStatus::DoesntExist, + FrontmatterStatus::Open => AstroFrontmatterStatus::Open, + FrontmatterStatus::Closed => AstroFrontmatterStatus::Closed, + }, + frontmatter_source: Range { + start: source_index.convert(result.frontmatter.source.start), + end: source_index.convert(result.frontmatter.source.end), }, scripts: result .scripts - .into_iter() - .map(extracted_tag_to_napi) + .iter() + .map(|tag| extracted_tag_to_napi(tag, &source_index)) .collect(), styles: result .styles - .into_iter() - .map(extracted_tag_to_napi) + .iter() + .map(|tag| extracted_tag_to_napi(tag, &source_index)) + .collect(), + diagnostics: result + .diagnostics + .iter() + .map(|diagnostic| AstroDiagnostic { + message: diagnostic.message.clone(), + severity: match diagnostic.severity { + DiagnosticSeverity::Error => 1, + DiagnosticSeverity::Warning => 2, + DiagnosticSeverity::Information => 3, + DiagnosticSeverity::Hint => 4, + }, + position: Range { + start: source_index.convert(diagnostic.source.start), + end: source_index.convert(diagnostic.source.end), + }, + }) .collect(), + code: result.code, + map, + generated_offsets: Uint32Array::new(generated_offsets), + source_offsets: Uint32Array::new(source_offsets), + lengths: Uint32Array::new(lengths), has_parse_errors: result.has_parse_errors, } } -fn extracted_tag_to_napi(tag: crate::ExtractedTag) -> ExtractedTag { +fn extracted_tag_to_napi(tag: &crate::ExtractedTag, source_index: &Utf16Index) -> ExtractedTag { ExtractedTag { - range: GeneratedRange { - start: tag.range.start, - end: tag.range.end, + position: Range { + start: source_index.convert(tag.source.start), + end: source_index.convert(tag.source.end), }, kind: match tag.kind { ExtractedKind::Script => ExtractedTagKind::Script, @@ -141,7 +207,7 @@ fn extracted_tag_to_napi(tag: crate::ExtractedTag) -> ExtractedTag { ExtractedKind::StyleAttribute => ExtractedTagKind::StyleAttribute, ExtractedKind::EventAttribute => ExtractedTagKind::EventAttribute, }, - content: tag.content, - lang: tag.lang, + content: tag.content.clone(), + lang: tag.lang.clone(), } } diff --git a/crates/astro2tsx/src/printer.rs b/crates/astro2tsx/src/printer.rs index 4b774180..74e16c34 100644 --- a/crates/astro2tsx/src/printer.rs +++ b/crates/astro2tsx/src/printer.rs @@ -2,7 +2,9 @@ use biome_rowan::TextRange; -use crate::sourcemap::{ExtractedKind, ExtractedTag, GeneratedRange, Mapping}; +use crate::sourcemap::{ + Diagnostic, ExtractedKind, ExtractedTag, FrontmatterInfo, GeneratedRange, Mapping, SourceRange, +}; use crate::utils::{comment_body_escape, template_text_escape}; pub(crate) struct Printer<'a> { @@ -15,6 +17,8 @@ pub(crate) struct Printer<'a> { pub(crate) body_range: GeneratedRange, pub(crate) scripts: Vec, pub(crate) styles: Vec, + pub(crate) diagnostics: Vec, + pub(crate) frontmatter_info: FrontmatterInfo, /// An expression body failed to parse and was emitted verbatim. pub(crate) has_expression_errors: bool, } @@ -30,6 +34,8 @@ impl<'a> Printer<'a> { body_range: GeneratedRange::default(), scripts: Vec::new(), styles: Vec::new(), + diagnostics: Vec::new(), + frontmatter_info: FrontmatterInfo::default(), has_expression_errors: false, } } @@ -146,38 +152,59 @@ impl<'a> Printer<'a> { pub(crate) fn add_script_block( &mut self, range: GeneratedRange, + source: SourceRange, content: String, kind_label: &str, ) { self.scripts.push(ExtractedTag { range, + source, kind: ExtractedKind::Script, content, lang: Some(kind_label.to_string()), }); } - pub(crate) fn add_style_block(&mut self, range: GeneratedRange, content: String, lang: String) { + pub(crate) fn add_style_block( + &mut self, + range: GeneratedRange, + source: SourceRange, + content: String, + lang: String, + ) { self.styles.push(ExtractedTag { range, + source, kind: ExtractedKind::Style, content, lang: Some(lang), }); } - pub(crate) fn add_event_attribute(&mut self, range: GeneratedRange, content: String) { + pub(crate) fn add_event_attribute( + &mut self, + range: GeneratedRange, + source: SourceRange, + content: String, + ) { self.scripts.push(ExtractedTag { range, + source, kind: ExtractedKind::EventAttribute, content, lang: Some("event-attribute".to_string()), }); } - pub(crate) fn add_style_attribute(&mut self, range: GeneratedRange, content: String) { + pub(crate) fn add_style_attribute( + &mut self, + range: GeneratedRange, + source: SourceRange, + content: String, + ) { self.styles.push(ExtractedTag { range, + source, kind: ExtractedKind::StyleAttribute, content, lang: Some("css".to_string()), diff --git a/crates/astro2tsx/src/render.rs b/crates/astro2tsx/src/render.rs index 500b82f5..4279bedf 100644 --- a/crates/astro2tsx/src/render.rs +++ b/crates/astro2tsx/src/render.rs @@ -16,7 +16,9 @@ use crate::expression::emit_expression_tree; use crate::frontmatter::rewrite_top_level_returns; use crate::printer::{Printer, range_start}; use crate::props::{PropsAnalysis, analyze as analyze_props}; -use crate::sourcemap::GeneratedRange; +use crate::sourcemap::{ + Diagnostic, DiagnosticSeverity, FrontmatterInfo, FrontmatterStatus, GeneratedRange, SourceRange, +}; use crate::utils::{ ScriptKind, classify_script_type, comment_needs_leading_space, encode_double_quote, is_html_event_attribute, is_valid_tsx_attribute_name, tsx_component_name, @@ -48,6 +50,7 @@ pub(crate) fn render_root(printer: &mut Printer, root: HtmlRoot, options: &Conve emit_frontmatter(printer, node, rewritten.as_ref()); } + printer.frontmatter_info = frontmatter_info(&frontmatter, printer.source.len() as u32); let body_text_start = body_text_start_offset(&frontmatter); // A childless body still needs its `` when comment trivia remains. let has_body_children = body.iter().next().is_some() @@ -116,6 +119,35 @@ fn body_text_start_offset(frontmatter: &Option) -> u 0 } +fn frontmatter_info( + frontmatter: &Option, + source_len: u32, +) -> FrontmatterInfo { + match frontmatter { + None => FrontmatterInfo::default(), + Some(AnyAstroFrontmatterElement::AstroBogusFrontmatter(node)) => FrontmatterInfo { + status: FrontmatterStatus::Open, + source: SourceRange::new(range_start(node.range()), source_len), + }, + Some(AnyAstroFrontmatterElement::AstroFrontmatterElement(node)) => { + let start = node + .l_fence_token() + .map(|token| range_start(token.text_trimmed_range())) + .unwrap_or_else(|_| range_start(node.range())); + match node.r_fence_token() { + Ok(r_fence) => FrontmatterInfo { + status: FrontmatterStatus::Closed, + source: SourceRange::new(start, u32::from(r_fence.text_trimmed_range().end())), + }, + Err(_) => FrontmatterInfo { + status: FrontmatterStatus::Open, + source: SourceRange::new(start, source_len), + }, + } + } + } +} + /// The frontmatter's JS text (trivia included) and its source offset. fn frontmatter_content(node: &AnyAstroFrontmatterElement) -> Option<(String, u32)> { if let AnyAstroFrontmatterElement::AstroFrontmatterElement(frontmatter) = node @@ -348,9 +380,29 @@ fn emit_expression_body(printer: &mut Printer, raw: &str, original_start: u32) { return; } printer.has_expression_errors = true; + for diagnostic in parse.diagnostics() { + printer.diagnostics.push(Diagnostic { + message: diagnostic.message.to_string(), + severity: DiagnosticSeverity::Error, + source: diagnostic_source_range(diagnostic, original_start, raw.len() as u32), + }); + } printer.write_with_mapping(raw, original_start); } +/// Expression-body diagnostics already carry document offsets thanks to the +/// parse offset, but a spanless one falls back to the whole body. +fn diagnostic_source_range( + diagnostic: &biome_parser::diagnostic::ParseDiagnostic, + start: u32, + len: u32, +) -> SourceRange { + match biome_diagnostics::Diagnostic::location(diagnostic).span { + Some(span) => SourceRange::new(u32::from(span.start()), u32::from(span.end())), + None => SourceRange::new(start, start + len), + } +} + fn render_html_element(printer: &mut Printer, node: HtmlElement) { let Ok(opening) = node.opening_element() else { return; @@ -456,12 +508,14 @@ fn render_html_element(printer: &mut Printer, node: HtmlElement) { if is_script { printer.add_script_block( GeneratedRange::new(body_start, body_end), + SourceRange::new(start, end), content, classify_script_label(&attributes), ); } else { printer.add_style_block( GeneratedRange::new(body_start, body_end), + SourceRange::new(start, end), content, style_lang_label(&attributes), ); @@ -849,12 +903,14 @@ fn emit_html_attribute(printer: &mut Printer, attr_node: &HtmlAttribute) { if is_html_event_attribute(&key_text) { printer.add_event_attribute( GeneratedRange::new(generated_start, generated_end), + SourceRange::new(value_start, inner_end), inner.to_string(), ); } if key_text == "style" { printer.add_style_attribute( GeneratedRange::new(generated_start, generated_end), + SourceRange::new(value_start, inner_end), inner.to_string(), ); } diff --git a/crates/astro2tsx/src/sourcemap.rs b/crates/astro2tsx/src/sourcemap.rs index cb7d2a26..3ab412e3 100644 --- a/crates/astro2tsx/src/sourcemap.rs +++ b/crates/astro2tsx/src/sourcemap.rs @@ -54,10 +54,58 @@ impl GeneratedRange { } } +/// Byte range inside the original `.astro` source. Distinct from +/// [`GeneratedRange`] so the two coordinate spaces cannot be mixed up. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub struct SourceRange { + pub start: u32, + pub end: u32, +} + +impl SourceRange { + pub(crate) fn new(start: u32, end: u32) -> Self { + Self { start, end } + } +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum DiagnosticSeverity { + Error = 1, + Warning = 2, + Information = 3, + Hint = 4, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct Diagnostic { + pub message: String, + pub severity: DiagnosticSeverity, + pub source: SourceRange, +} + +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum FrontmatterStatus { + #[default] + DoesntExist, + /// An opening fence with no closing one. + Open, + Closed, +} + +/// `source` spans the opening fence through the end of the closing fence, +/// so it doubles as the offset where body content starts. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub struct FrontmatterInfo { + pub status: FrontmatterStatus, + pub source: SourceRange, +} + #[derive(Clone, Debug, PartialEq, Eq)] pub struct ExtractedTag { /// Range of `content` within the generated TSX, for every kind. pub range: GeneratedRange, + /// Range of `content` within the original source. + pub source: SourceRange, pub kind: ExtractedKind, pub content: String, pub lang: Option, diff --git a/crates/astro2tsx/src/utf16.rs b/crates/astro2tsx/src/utf16.rs new file mode 100644 index 00000000..df4a1131 --- /dev/null +++ b/crates/astro2tsx/src/utf16.rs @@ -0,0 +1,84 @@ +//! Byte offsets to UTF-16 code units, the unit JS consumers index strings in. + +/// Records only the multibyte characters, so ASCII documents cost nothing. +pub(crate) struct Utf16Index { + marks: Vec, +} + +struct Mark { + byte: u32, + utf16: u32, + len_utf8: u32, + len_utf16: u32, +} + +impl Utf16Index { + pub(crate) fn new(text: &str) -> Self { + let mut marks = Vec::new(); + if text.is_ascii() { + return Self { marks }; + } + let mut utf16 = 0u32; + for (byte, ch) in text.char_indices() { + let len_utf8 = ch.len_utf8() as u32; + let len_utf16 = ch.len_utf16() as u32; + if len_utf8 > 1 { + marks.push(Mark { + byte: byte as u32, + utf16, + len_utf8, + len_utf16, + }); + } + utf16 += len_utf16; + } + Self { marks } + } + + pub(crate) fn convert(&self, byte: u32) -> u32 { + if self.marks.is_empty() { + return byte; + } + let index = self.marks.partition_point(|mark| mark.byte <= byte); + if index == 0 { + return byte; + } + let mark = &self.marks[index - 1]; + if byte < mark.byte + mark.len_utf8 { + // Inside a character: clamp to its start rather than splitting it. + return mark.utf16; + } + mark.utf16 + mark.len_utf16 + (byte - mark.byte - mark.len_utf8) + } +} + +#[cfg(test)] +mod tests { + use super::Utf16Index; + + #[test] + fn ascii_offsets_are_unchanged() { + let index = Utf16Index::new("

    hi

    "); + assert_eq!(index.convert(0), 0); + assert_eq!(index.convert(5), 5); + assert_eq!(index.convert(9), 9); + } + + #[test] + fn multibyte_characters_shrink_offsets() { + // "π" is two bytes and one code unit; "🦄" is four bytes and two. + let index = Utf16Index::new("aπb🦄c"); + assert_eq!(index.convert(0), 0); + assert_eq!(index.convert(1), 1); + assert_eq!(index.convert(3), 2); + assert_eq!(index.convert(4), 3); + assert_eq!(index.convert(8), 5); + assert_eq!(index.convert(9), 6); + } + + #[test] + fn offsets_inside_a_character_clamp_to_its_start() { + let index = Utf16Index::new("aπb"); + assert_eq!(index.convert(2), 1); + } +} diff --git a/crates/astro2tsx/test/astro2tsx.test.ts b/crates/astro2tsx/test/astro2tsx.test.ts index 1b23e191..3ddcdbc4 100644 --- a/crates/astro2tsx/test/astro2tsx.test.ts +++ b/crates/astro2tsx/test/astro2tsx.test.ts @@ -157,3 +157,40 @@ test('every clean-parse fixture emits syntactically valid TSX', async () => { } assert.ok(checked > 50, `expected to check most fixtures, checked ${checked}`); }); + +test('offsets are UTF-16 code units, not bytes', () => { + const source = '---\nconst \u{1f984} = 1;\n---\n'; + const result = convertToTsx(source, { sourcemap: 'external' }); + + // The unicorn is four bytes but two UTF-16 units, so a byte offset would overshoot. + const style = result.styles[0]; + assert.equal(source.slice(style.position.start, style.position.end), '.a{color:red}'); + assert.equal( + source.slice(result.frontmatterSource.start, result.frontmatterSource.end).at(-1), + '-', + ); + + const { generatedOffsets, sourceOffsets, lengths } = result; + for (let i = 0; i < generatedOffsets.length; i++) { + assert.equal( + result.code.slice(generatedOffsets[i], generatedOffsets[i] + lengths[i]), + source.slice(sourceOffsets[i], sourceOffsets[i] + lengths[i]), + `run ${i} is not verbatim`, + ); + } +}); + +test('reports frontmatter status and positioned diagnostics', () => { + assert.equal(convertToTsx('---\nlet x = 1;\n---\n

    ').frontmatterStatus, 'closed'); + assert.equal(convertToTsx('---\nlet x = 1;\n').frontmatterStatus, 'open'); + assert.equal(convertToTsx('

    ').frontmatterStatus, 'doesnt-exist'); + + const broken = convertToTsx('

    {x ==}
    '); + assert.ok(broken.hasParseErrors); + assert.ok(broken.diagnostics.length > 0); + for (const diagnostic of broken.diagnostics) { + assert.ok(diagnostic.message.length > 0); + assert.equal(diagnostic.severity, 1); + assert.ok(diagnostic.position.end >= diagnostic.position.start); + } +}); diff --git a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap index de96ec07..28be411f 100644 --- a/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/adjacent_siblings_top_level.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap index 97010ed7..aadc6c30 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_event_and_style.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 @@ -14,6 +18,9 @@ info: generated: start: 55 end: 59 + source: + start: 14 + end: 18 content: go() styles: - kind: StyleAttribute @@ -21,6 +28,9 @@ info: generated: start: 68 end: 77 + source: + start: 27 + end: 36 content: "color:red" input_file: crates/astro2tsx/tests/fixtures/attribute_event_and_style.astro --- diff --git a/crates/astro2tsx/tests/fixtures/attribute_expression_jsx.snap b/crates/astro2tsx/tests/fixtures/attribute_expression_jsx.snap index 6ca0f29b..513fd147 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_expression_jsx.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_expression_jsx.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap index addea560..0a93855b 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_expression_value.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap index 1615773e..1635c42d 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_invalid_names.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap index e3cb258c..a17d1816 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_quoted_forms.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap index f2c02162..c16f3e4e 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_shorthand.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/attribute_spread.snap b/crates/astro2tsx/tests/fixtures/attribute_spread.snap index fff99ccc..216e72e2 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_spread.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_spread.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap index 65944743..d2ac8717 100644 --- a/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap +++ b/crates/astro2tsx/tests/fixtures/attribute_template_literal.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.snap b/crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.snap index 88938d57..e99a258d 100644 --- a/crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.snap +++ b/crates/astro2tsx/tests/fixtures/comment_between_frontmatter_and_body.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 20 frontmatter: start: 30 end: 45 diff --git a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap index f00bdeea..a2cb1ddb 100644 --- a/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap +++ b/crates/astro2tsx/tests/fixtures/crlf_frontmatter.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 46 frontmatter: start: 30 end: 71 diff --git a/crates/astro2tsx/tests/fixtures/directives.snap b/crates/astro2tsx/tests/fixtures/directives.snap index 05c9d107..b55f6ae1 100644 --- a/crates/astro2tsx/tests/fixtures/directives.snap +++ b/crates/astro2tsx/tests/fixtures/directives.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/escape_comment_bodies.snap b/crates/astro2tsx/tests/fixtures/escape_comment_bodies.snap index f1c7e0dd..4a581a70 100644 --- a/crates/astro2tsx/tests/fixtures/escape_comment_bodies.snap +++ b/crates/astro2tsx/tests/fixtures/escape_comment_bodies.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap index b175be37..d968e1c9 100644 --- a/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap +++ b/crates/astro2tsx/tests/fixtures/expression_adjacent_siblings.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_bare_gt.snap b/crates/astro2tsx/tests/fixtures/expression_bare_gt.snap index 962128ff..d1348a90 100644 --- a/crates/astro2tsx/tests/fixtures/expression_bare_gt.snap +++ b/crates/astro2tsx/tests/fixtures/expression_bare_gt.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap index bfdacccd..087853a8 100644 --- a/crates/astro2tsx/tests/fixtures/expression_comment_only.snap +++ b/crates/astro2tsx/tests/fixtures/expression_comment_only.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_comment_trailing.snap b/crates/astro2tsx/tests/fixtures/expression_comment_trailing.snap index 8aaab897..7731ba5d 100644 --- a/crates/astro2tsx/tests/fixtures/expression_comment_trailing.snap +++ b/crates/astro2tsx/tests/fixtures/expression_comment_trailing.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_empty.snap b/crates/astro2tsx/tests/fixtures/expression_empty.snap index a6929b22..a2b9b436 100644 --- a/crates/astro2tsx/tests/fixtures/expression_empty.snap +++ b/crates/astro2tsx/tests/fixtures/expression_empty.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_generics.snap b/crates/astro2tsx/tests/fixtures/expression_generics.snap index 3bf05f95..75d6a7e2 100644 --- a/crates/astro2tsx/tests/fixtures/expression_generics.snap +++ b/crates/astro2tsx/tests/fixtures/expression_generics.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap index d838a4d2..2a8799a8 100644 --- a/crates/astro2tsx/tests/fixtures/expression_html_comment.snap +++ b/crates/astro2tsx/tests/fixtures/expression_html_comment.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_identifier.snap b/crates/astro2tsx/tests/fixtures/expression_identifier.snap index 0837797a..c7ee8ada 100644 --- a/crates/astro2tsx/tests/fixtures/expression_identifier.snap +++ b/crates/astro2tsx/tests/fixtures/expression_identifier.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_is_raw.snap b/crates/astro2tsx/tests/fixtures/expression_is_raw.snap index 38055742..46808732 100644 --- a/crates/astro2tsx/tests/fixtures/expression_is_raw.snap +++ b/crates/astro2tsx/tests/fixtures/expression_is_raw.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.snap b/crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.snap index c26aa3bb..a80a7ac4 100644 --- a/crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.snap +++ b/crates/astro2tsx/tests/fixtures/expression_is_raw_unparseable.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_map.snap b/crates/astro2tsx/tests/fixtures/expression_map.snap index 9d5b2a66..04ef8368 100644 --- a/crates/astro2tsx/tests/fixtures/expression_map.snap +++ b/crates/astro2tsx/tests/fixtures/expression_map.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_nested.snap b/crates/astro2tsx/tests/fixtures/expression_nested.snap index 942b537c..7ec2894f 100644 --- a/crates/astro2tsx/tests/fixtures/expression_nested.snap +++ b/crates/astro2tsx/tests/fixtures/expression_nested.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap index 57882ebd..e544cc03 100644 --- a/crates/astro2tsx/tests/fixtures/expression_object_literal.snap +++ b/crates/astro2tsx/tests/fixtures/expression_object_literal.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_script_exclusion.snap b/crates/astro2tsx/tests/fixtures/expression_script_exclusion.snap index 15f18592..aa9961f1 100644 --- a/crates/astro2tsx/tests/fixtures/expression_script_exclusion.snap +++ b/crates/astro2tsx/tests/fixtures/expression_script_exclusion.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 @@ -14,6 +18,9 @@ info: generated: start: 58 end: 58 + source: + start: 17 + end: 37 content: "if (a < b) { go(); }" styles: [] input_file: crates/astro2tsx/tests/fixtures/expression_script_exclusion.astro diff --git a/crates/astro2tsx/tests/fixtures/expression_shorthand_attr.snap b/crates/astro2tsx/tests/fixtures/expression_shorthand_attr.snap index 3306aaf5..3b258391 100644 --- a/crates/astro2tsx/tests/fixtures/expression_shorthand_attr.snap +++ b/crates/astro2tsx/tests/fixtures/expression_shorthand_attr.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_single_element.snap b/crates/astro2tsx/tests/fixtures/expression_single_element.snap index d3074cce..145d47e7 100644 --- a/crates/astro2tsx/tests/fixtures/expression_single_element.snap +++ b/crates/astro2tsx/tests/fixtures/expression_single_element.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_special_attr_names.snap b/crates/astro2tsx/tests/fixtures/expression_special_attr_names.snap index e6a16831..2a91b3bb 100644 --- a/crates/astro2tsx/tests/fixtures/expression_special_attr_names.snap +++ b/crates/astro2tsx/tests/fixtures/expression_special_attr_names.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap index 95c6044d..c2959485 100644 --- a/crates/astro2tsx/tests/fixtures/expression_spread_child.snap +++ b/crates/astro2tsx/tests/fixtures/expression_spread_child.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: true + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap index 3dcf8087..955a5d1f 100644 --- a/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_string_with_markup.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_style_exclusion.snap b/crates/astro2tsx/tests/fixtures/expression_style_exclusion.snap index 6d1bf468..b2f334d3 100644 --- a/crates/astro2tsx/tests/fixtures/expression_style_exclusion.snap +++ b/crates/astro2tsx/tests/fixtures/expression_style_exclusion.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 @@ -15,6 +19,9 @@ info: generated: start: 57 end: 57 + source: + start: 16 + end: 29 content: ".a{color:red}" input_file: crates/astro2tsx/tests/fixtures/expression_style_exclusion.astro --- diff --git a/crates/astro2tsx/tests/fixtures/expression_template_attr.snap b/crates/astro2tsx/tests/fixtures/expression_template_attr.snap index da10a73e..a221102c 100644 --- a/crates/astro2tsx/tests/fixtures/expression_template_attr.snap +++ b/crates/astro2tsx/tests/fixtures/expression_template_attr.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap index c26f7bd4..d9239fbc 100644 --- a/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_template_with_markup.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap index 9658a273..f1149322 100644 --- a/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap +++ b/crates/astro2tsx/tests/fixtures/expression_ternary_markup.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_unquoted_attr.snap b/crates/astro2tsx/tests/fixtures/expression_unquoted_attr.snap index 042c7c3b..34c24ee4 100644 --- a/crates/astro2tsx/tests/fixtures/expression_unquoted_attr.snap +++ b/crates/astro2tsx/tests/fixtures/expression_unquoted_attr.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/expression_void_element.snap b/crates/astro2tsx/tests/fixtures/expression_void_element.snap index fa2c5e32..2cee95b5 100644 --- a/crates/astro2tsx/tests/fixtures/expression_void_element.snap +++ b/crates/astro2tsx/tests/fixtures/expression_void_element.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/fragment_shorthand.snap b/crates/astro2tsx/tests/fixtures/fragment_shorthand.snap index f49d2703..b49519f7 100644 --- a/crates/astro2tsx/tests/fixtures/fragment_shorthand.snap +++ b/crates/astro2tsx/tests/fixtures/fragment_shorthand.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap index 00249d06..66e5f363 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_absent.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap index 889f7b6d..246ba47d 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_and_body.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 28 frontmatter: start: 30 end: 53 diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap index 9a913b27..eaf95b5c 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_empty.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 7 frontmatter: start: 30 end: 31 diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap index 1e0cc16e..89274ab7 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_imports.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 76 frontmatter: start: 30 end: 101 diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap index f4af2b46..884b67ca 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_only.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_only.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 20 frontmatter: start: 30 end: 45 diff --git a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap index 3d482ae7..209e0cf2 100644 --- a/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap +++ b/crates/astro2tsx/tests/fixtures/frontmatter_top_level_return.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 51 frontmatter: start: 30 end: 76 diff --git a/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap b/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap index 05874f79..3a6d9d89 100644 --- a/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap +++ b/crates/astro2tsx/tests/fixtures/get_static_paths_export.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 53 frontmatter: start: 30 end: 78 diff --git a/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap b/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap index 270abb86..f4b8d3a1 100644 --- a/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap +++ b/crates/astro2tsx/tests/fixtures/get_static_paths_with_props.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 94 frontmatter: start: 30 end: 119 diff --git a/crates/astro2tsx/tests/fixtures/html_comment_body.snap b/crates/astro2tsx/tests/fixtures/html_comment_body.snap index fb6a5c6e..6e56c537 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_body.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_body.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap index 795c20aa..19cdfec8 100644 --- a/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap +++ b/crates/astro2tsx/tests/fixtures/html_comment_top_level.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/multibyte.snap b/crates/astro2tsx/tests/fixtures/multibyte.snap index 477bf1bb..7ce74be3 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap index e0118766..e7c55cbe 100644 --- a/crates/astro2tsx/tests/fixtures/multibyte_astral.snap +++ b/crates/astro2tsx/tests/fixtures/multibyte_astral.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 27 frontmatter: start: 30 end: 52 diff --git a/crates/astro2tsx/tests/fixtures/named_component_export.snap b/crates/astro2tsx/tests/fixtures/named_component_export.snap index bec4339d..1653609e 100644 --- a/crates/astro2tsx/tests/fixtures/named_component_export.snap +++ b/crates/astro2tsx/tests/fixtures/named_component_export.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/props_exported_alias_union.snap b/crates/astro2tsx/tests/fixtures/props_exported_alias_union.snap index b7a23d4e..e453fe20 100644 --- a/crates/astro2tsx/tests/fixtures/props_exported_alias_union.snap +++ b/crates/astro2tsx/tests/fixtures/props_exported_alias_union.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 124 frontmatter: start: 30 end: 149 diff --git a/crates/astro2tsx/tests/fixtures/props_generic.snap b/crates/astro2tsx/tests/fixtures/props_generic.snap index 1985abc9..6a2ce28e 100644 --- a/crates/astro2tsx/tests/fixtures/props_generic.snap +++ b/crates/astro2tsx/tests/fixtures/props_generic.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 55 frontmatter: start: 30 end: 80 diff --git a/crates/astro2tsx/tests/fixtures/props_generic_invalid.snap b/crates/astro2tsx/tests/fixtures/props_generic_invalid.snap index 0536ffcb..8052e5d8 100644 --- a/crates/astro2tsx/tests/fixtures/props_generic_invalid.snap +++ b/crates/astro2tsx/tests/fixtures/props_generic_invalid.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 110 frontmatter: start: 30 end: 135 diff --git a/crates/astro2tsx/tests/fixtures/props_imported.snap b/crates/astro2tsx/tests/fixtures/props_imported.snap index dee0dab2..1527b755 100644 --- a/crates/astro2tsx/tests/fixtures/props_imported.snap +++ b/crates/astro2tsx/tests/fixtures/props_imported.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 45 frontmatter: start: 30 end: 70 diff --git a/crates/astro2tsx/tests/fixtures/props_interface.snap b/crates/astro2tsx/tests/fixtures/props_interface.snap index 9e7b6975..c9972321 100644 --- a/crates/astro2tsx/tests/fixtures/props_interface.snap +++ b/crates/astro2tsx/tests/fixtures/props_interface.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 74 frontmatter: start: 30 end: 99 diff --git a/crates/astro2tsx/tests/fixtures/props_polymorphic.snap b/crates/astro2tsx/tests/fixtures/props_polymorphic.snap index 2598f82f..eeae9848 100644 --- a/crates/astro2tsx/tests/fixtures/props_polymorphic.snap +++ b/crates/astro2tsx/tests/fixtures/props_polymorphic.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 108 frontmatter: start: 30 end: 133 diff --git a/crates/astro2tsx/tests/fixtures/props_type_alias.snap b/crates/astro2tsx/tests/fixtures/props_type_alias.snap index cc889cd2..e0195621 100644 --- a/crates/astro2tsx/tests/fixtures/props_type_alias.snap +++ b/crates/astro2tsx/tests/fixtures/props_type_alias.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 39 frontmatter: start: 30 end: 64 diff --git a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap index f6473f9c..e8629ef2 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_is_raw.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap index 7a6089ea..d94d40a8 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_json.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 @@ -14,6 +18,9 @@ info: generated: start: 73 end: 73 + source: + start: 32 + end: 39 content: "{\"a\":1}" styles: [] input_file: crates/astro2tsx/tests/fixtures/raw_text_script_json.astro diff --git a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap index 8745be08..961eaafd 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_script_module.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 @@ -14,6 +18,9 @@ info: generated: start: 63 end: 63 + source: + start: 22 + end: 34 content: const a = 1; styles: [] input_file: crates/astro2tsx/tests/fixtures/raw_text_script_module.astro diff --git a/crates/astro2tsx/tests/fixtures/raw_text_style.snap b/crates/astro2tsx/tests/fixtures/raw_text_style.snap index b06d0226..09face2f 100644 --- a/crates/astro2tsx/tests/fixtures/raw_text_style.snap +++ b/crates/astro2tsx/tests/fixtures/raw_text_style.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 @@ -15,6 +19,9 @@ info: generated: start: 48 end: 48 + source: + start: 7 + end: 25 content: ".a { color: red; }" input_file: crates/astro2tsx/tests/fixtures/raw_text_style.astro --- diff --git a/crates/astro2tsx/tests/fixtures/script_type_labels.snap b/crates/astro2tsx/tests/fixtures/script_type_labels.snap index 63174386..52553b69 100644 --- a/crates/astro2tsx/tests/fixtures/script_type_labels.snap +++ b/crates/astro2tsx/tests/fixtures/script_type_labels.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 @@ -14,18 +18,27 @@ info: generated: start: 71 end: 71 + source: + start: 30 + end: 35 content: go(); - kind: Script lang: json generated: start: 113 end: 113 + source: + start: 77 + end: 84 content: "{\"a\":1}" - kind: Script lang: unknown generated: start: 163 end: 163 + source: + start: 134 + end: 137 content: wat styles: [] input_file: crates/astro2tsx/tests/fixtures/script_type_labels.astro diff --git a/crates/astro2tsx/tests/fixtures/slot_element.snap b/crates/astro2tsx/tests/fixtures/slot_element.snap index 8f14010c..861b81ef 100644 --- a/crates/astro2tsx/tests/fixtures/slot_element.snap +++ b/crates/astro2tsx/tests/fixtures/slot_element.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/slots.snap b/crates/astro2tsx/tests/fixtures/slots.snap index 1a960206..b17e00c8 100644 --- a/crates/astro2tsx/tests/fixtures/slots.snap +++ b/crates/astro2tsx/tests/fixtures/slots.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/style_lang_label.snap b/crates/astro2tsx/tests/fixtures/style_lang_label.snap index c41b3f0e..d9dd51e9 100644 --- a/crates/astro2tsx/tests/fixtures/style_lang_label.snap +++ b/crates/astro2tsx/tests/fixtures/style_lang_label.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 @@ -15,6 +19,9 @@ info: generated: start: 60 end: 60 + source: + start: 19 + end: 37 content: ".a { color: red; }" input_file: crates/astro2tsx/tests/fixtures/style_lang_label.astro --- diff --git a/crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.snap b/crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.snap index dc1bcf83..8362786b 100644 --- a/crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.snap +++ b/crates/astro2tsx/tests/fixtures/tag_whitespace_collapsing.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/top_level_returns_nested.snap b/crates/astro2tsx/tests/fixtures/top_level_returns_nested.snap index 8331f06a..957580d9 100644 --- a/crates/astro2tsx/tests/fixtures/top_level_returns_nested.snap +++ b/crates/astro2tsx/tests/fixtures/top_level_returns_nested.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 165 frontmatter: start: 30 end: 190 diff --git a/crates/astro2tsx/tests/fixtures/unclosed_member_tag.snap b/crates/astro2tsx/tests/fixtures/unclosed_member_tag.snap index 4089a752..e575e44d 100644 --- a/crates/astro2tsx/tests/fixtures/unclosed_member_tag.snap +++ b/crates/astro2tsx/tests/fixtures/unclosed_member_tag.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: true + frontmatter_status: Closed + frontmatter_source: + start: 0 + end: 62 frontmatter: start: 30 end: 87 diff --git a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap index ab472592..fc3ad914 100644 --- a/crates/astro2tsx/tests/fixtures/unclosed_tag.snap +++ b/crates/astro2tsx/tests/fixtures/unclosed_tag.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: true + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/fixtures/void_elements.snap b/crates/astro2tsx/tests/fixtures/void_elements.snap index 7897fbc0..40700373 100644 --- a/crates/astro2tsx/tests/fixtures/void_elements.snap +++ b/crates/astro2tsx/tests/fixtures/void_elements.snap @@ -2,6 +2,10 @@ source: crates/astro2tsx/tests/snapshots.rs info: has_parse_errors: false + frontmatter_status: DoesntExist + frontmatter_source: + start: 0 + end: 0 frontmatter: start: 0 end: 0 diff --git a/crates/astro2tsx/tests/regressions.rs b/crates/astro2tsx/tests/regressions.rs index 330e3a12..21434f45 100644 --- a/crates/astro2tsx/tests/regressions.rs +++ b/crates/astro2tsx/tests/regressions.rs @@ -14,9 +14,9 @@ fn frontmatter_range_is_recorded() { "---\nlet x = 1;\n---\n
    ", ConvertOptions::default(), ); - assert!(result.frontmatter.end > result.frontmatter.start); - let frontmatter_slice = - &result.code[result.frontmatter.start as usize..result.frontmatter.end as usize]; + assert!(result.frontmatter_range.end > result.frontmatter_range.start); + let frontmatter_slice = &result.code + [result.frontmatter_range.start as usize..result.frontmatter_range.end as usize]; assert!(frontmatter_slice.contains("let x = 1;")); } @@ -287,3 +287,46 @@ fn comments_before_the_first_element_survive() { assert!(!actual.contains("")) { Some(body) => emit_html_comment(printer, body, start as u32 + 4), - // An unterminated comment passes through so no content is dropped. - None => printer.write_with_mapping(text, start as u32), + // An unterminated comment runs to the end of the file, as in HTML. + None => { + let body = text.strip_prefix("