diff --git a/package.json b/package.json index 0aeaea18..5d01b29a 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@sveltejs/eslint-config": "^8.1.0", "@svitejs/changesets-changelog-github-compact": "^1.2.0", "@types/node": "^22.10.2", - "@vitest/ui": "^3.0.3", + "@vitest/ui": "^3.0.5", "eslint": "^9.17.0", "magic-string": "^0.30.15", "prettier": "^3.4.2", @@ -39,5 +39,5 @@ "unplugin-isolated-decl": "^0.8.3", "vitest": "^3.0.5" }, - "packageManager": "pnpm@10.1.0" + "packageManager": "pnpm@10.2.0" } diff --git a/packages/addons/drizzle/index.ts b/packages/addons/drizzle/index.ts index 0cf8fa69..540d70a8 100644 --- a/packages/addons/drizzle/index.ts +++ b/packages/addons/drizzle/index.ts @@ -191,8 +191,8 @@ export default defineAddon({ url: common.expressionFromString('process.env.DATABASE_URL'), authToken }), - verbose: { type: 'BooleanLiteral', value: true }, - strict: { type: 'BooleanLiteral', value: true } + verbose: { type: 'Literal', value: true }, + strict: { type: 'Literal', value: true } }); const dialect = options.sqlite === 'turso' ? 'turso' : options.database; diff --git a/packages/addons/eslint/index.ts b/packages/addons/eslint/index.ts index 1d540192..29035c8f 100644 --- a/packages/addons/eslint/index.ts +++ b/packages/addons/eslint/index.ts @@ -7,7 +7,6 @@ import { functions, imports, object, - type AstKinds, type AstTypes } from '@sveltejs/cli-core/js'; import { parseJson, parseScript } from '@sveltejs/cli-core/parsers'; @@ -55,7 +54,7 @@ export default defineAddon({ const { ast, generateCode } = parseScript(content); const eslintConfigs: Array< - AstKinds.ExpressionKind | AstTypes.SpreadElement | AstTypes.ObjectExpression + AstTypes.Expression | AstTypes.SpreadElement | AstTypes.ObjectExpression > = []; const gitIgnorePathStatement = common.statementFromString( diff --git a/packages/addons/lucia/index.ts b/packages/addons/lucia/index.ts index bf559e4b..ed91ec43 100644 --- a/packages/addons/lucia/index.ts +++ b/packages/addons/lucia/index.ts @@ -55,17 +55,17 @@ export default defineAddon({ sv.file(`drizzle.config.${ext}`, (content) => { const { ast, generateCode } = parseScript(content); - const isProp = (name: string, node: AstTypes.ObjectProperty) => + const isProp = (name: string, node: AstTypes.Property) => node.key.type === 'Identifier' && node.key.name === name; // prettier-ignore - Walker.walk(ast as AstTypes.ASTNode, {}, { - ObjectProperty(node) { - if (isProp('dialect', node) && node.value.type === 'StringLiteral') { + Walker.walk(ast as AstTypes.Node, {}, { + Property(node) { + if (isProp('dialect', node) && node.value.type === 'Literal' && typeof node.value.type === 'string') { drizzleDialect = node.value.value as Dialect; } - if (isProp('schema', node) && node.value.type === 'StringLiteral') { - schemaPath = node.value.value; + if (isProp('schema', node) && node.value.type === 'Literal' && typeof node.value.type === 'string') { + schemaPath = node.value.value as string; } } }) @@ -601,13 +601,14 @@ function createLuciaType(name: string): AstTypes.TSInterfaceBody['body'][number] type: 'Identifier', name }, + computed: false, typeAnnotation: { type: 'TSTypeAnnotation', typeAnnotation: { type: 'TSIndexedAccessType', objectType: { type: 'TSImportType', - argument: { type: 'StringLiteral', value: '$lib/server/auth' }, + argument: { type: 'Literal', value: '$lib/server/auth' }, qualifier: { type: 'Identifier', name: 'SessionValidationResult' @@ -616,7 +617,7 @@ function createLuciaType(name: string): AstTypes.TSInterfaceBody['body'][number] indexType: { type: 'TSLiteralType', literal: { - type: 'StringLiteral', + type: 'Literal', value: name } } @@ -649,7 +650,7 @@ function getAuthHandleContent() { };`; } -function getCallExpression(ast: AstTypes.ASTNode): AstTypes.CallExpression | undefined { +function getCallExpression(ast: AstTypes.Node): AstTypes.CallExpression | undefined { let callExpression; // prettier-ignore diff --git a/packages/addons/sveltekit-adapter/index.ts b/packages/addons/sveltekit-adapter/index.ts index f79d9e25..b2ebe841 100644 --- a/packages/addons/sveltekit-adapter/index.ts +++ b/packages/addons/sveltekit-adapter/index.ts @@ -70,6 +70,9 @@ export default defineAddon({ if (adapterImportDecl) { // replaces the import's source with the new adapter adapterImportDecl.source.value = adapter.package; + // reset raw value, so that the string is re-generated + adapterImportDecl.source.raw = undefined; + adapterName = adapterImportDecl.specifiers?.find((s) => s.type === 'ImportDefaultSpecifier') ?.local?.name as string; } else { @@ -78,16 +81,15 @@ export default defineAddon({ const { value: config } = exports.defaultExport(ast, object.createEmpty()); const kitConfig = config.properties.find( - (p) => p.type === 'ObjectProperty' && p.key.type === 'Identifier' && p.key.name === 'kit' - ) as AstTypes.ObjectProperty | undefined; + (p) => p.type === 'Property' && p.key.type === 'Identifier' && p.key.name === 'kit' + ) as AstTypes.Property | undefined; if (kitConfig && kitConfig.value.type === 'ObjectExpression') { const adapterProp = kitConfig.value.properties.find( - (p) => - p.type === 'ObjectProperty' && p.key.type === 'Identifier' && p.key.name === 'adapter' + (p) => p.type === 'Property' && p.key.type === 'Identifier' && p.key.name === 'adapter' ); if (adapterProp) { - adapterProp.comments = []; + adapterProp.leadingComments = []; } // only overrides the `adapter` property so we can reset it's args diff --git a/packages/ast-tooling/index.ts b/packages/ast-tooling/index.ts index c1e353be..c77f7463 100644 --- a/packages/ast-tooling/index.ts +++ b/packages/ast-tooling/index.ts @@ -1,8 +1,5 @@ -import { parse as tsParse } from 'recast/parsers/typescript.js'; -import { parse as recastParse, print as recastPrint, type Options as RecastOptions } from 'recast'; import { Document, Element, type ChildNode } from 'domhandler'; import { ElementType, parseDocument } from 'htmlparser2'; -import { removeElement, textContent } from 'domutils'; import serializeDom from 'dom-serializer'; import { Root as CssAst, @@ -15,8 +12,10 @@ import { } from 'postcss'; import * as fleece from 'silver-fleece'; import * as Walker from 'zimmerframe'; -import type { namedTypes as AstTypes } from 'ast-types'; -import type * as AstKinds from 'ast-types/gen/kinds'; +import type { TsEstree } from './ts-estree.ts'; +import { print as esrapPrint } from 'esrap'; +import * as acorn from 'acorn'; +import { tsPlugin } from 'acorn-typescript'; /** * Most of the AST tooling is pretty big in bundle size and bundling takes forever. @@ -48,34 +47,72 @@ export type { ChildNode as HtmlChildNode, // js - AstTypes, - AstKinds, + TsEstree as AstTypes, //css CssChildNode }; -export function parseScript(content: string): AstTypes.Program { - const recastOutput: { program: AstTypes.Program } = recastParse(content, { - parser: { - parse: tsParse +export function parseScript(content: string): TsEstree.Program { + const comments: any[] = []; + + // @ts-expect-error + const acornTs = acorn.Parser.extend(tsPlugin({ allowSatisfies: true })); + + const ast = acornTs.parse(content, { + ecmaVersion: 'latest', + sourceType: 'module', + locations: true, + onComment: (block, value, start, end) => { + if (block && /\n/.test(value)) { + let a = start; + while (a > 0 && content[a - 1] !== '\n') a -= 1; + + let b = a; + while (/[ \t]/.test(content[b])) b += 1; + + const indentation = content.slice(a, b); + value = value.replace(new RegExp(`^${indentation}`, 'gm'), ''); + } + + comments.push({ type: block ? 'Block' : 'Line', value, start, end }); } }); - return recastOutput.program; -} + Walker.walk(ast, null, { + _(node, { next }) { + const commentNode /** @type {import('../../src/types').NodeWithComments} */ = + /** @type {any} */ node; + let comment; -export function serializeScript(ast: AstTypes.ASTNode, previousContent?: string): string { - let options: RecastOptions | undefined; - if (!previousContent) { - // provide sensible defaults if we generate a new file - options = { - quote: 'single', - useTabs: true - }; - } + while (comments[0] && comments[0].start < node.start) { + comment = comments.shift(); + // @ts-expect-error + (commentNode.leadingComments ||= []).push(comment); + } + + next(); + + if (comments[0]) { + const slice = content.slice(node.end, comments[0].start); + + if (/^[,) \t]*$/.test(slice)) { + // @ts-expect-error + commentNode.trailingComments = [comments.shift()]; + } + } + } + }); + + return ast as TsEstree.Program; +} - return recastPrint(ast, options).code; +export function serializeScript(ast: TsEstree.Node): string { + const { code } = esrapPrint(ast, { + indent: '\t', + quotes: 'single' + }); + return code; } export function parseCss(content: string): CssAst { @@ -117,41 +154,11 @@ export function stripAst(node: T, propToRemove: string): T { } export type SvelteAst = { - jsAst: AstTypes.Program; + jsAst: TsEstree.Program; htmlAst: Document; cssAst: CssAst; }; -export function parseSvelte(content: string): SvelteAst { - const htmlAst = parseHtml(content); - - let scriptTag, styleTag; - for (const node of htmlAst.childNodes) { - if (node.type === ElementType.Script) { - scriptTag = node; - removeElement(scriptTag); - } else if (node.type === ElementType.Style) { - styleTag = node; - removeElement(styleTag); - } - } - - if (!scriptTag) { - scriptTag = new Element('script', {}, undefined, ElementType.ElementType.Script); - } - if (!styleTag) { - styleTag = new Element('style', {}, undefined, ElementType.ElementType.Style); - } - - const css = textContent(styleTag); - const cssAst = parseCss(css); - - const scriptValue = textContent(scriptTag); - const jsAst = parseScript(scriptValue); - - return { jsAst, htmlAst, cssAst }; -} - export function parseJson(content: string): any { // some of the files we need to process contain comments. The default // node JSON.parse fails parsing those comments. diff --git a/packages/ast-tooling/package.json b/packages/ast-tooling/package.json index 6e32db22..7843a518 100644 --- a/packages/ast-tooling/package.json +++ b/packages/ast-tooling/package.json @@ -24,14 +24,15 @@ } }, "devDependencies": { - "@babel/parser": "^7.26.3", - "ast-types": "^0.16.1", + "@types/estree": "^1.0.6", + "acorn": "^8.14.0", + "acorn-typescript": "^1.4.13", "dom-serializer": "^2.0.0", "domhandler": "^5.0.3", "domutils": "^3.1.0", + "esrap": "^1.4.4", "htmlparser2": "^9.1.0", "postcss": "^8.4.49", - "recast": "^0.23.9", "silver-fleece": "^1.2.1", "zimmerframe": "^1.1.2" } diff --git a/packages/ast-tooling/ts-estree.ts b/packages/ast-tooling/ts-estree.ts new file mode 100644 index 00000000..347b53f7 --- /dev/null +++ b/packages/ast-tooling/ts-estree.ts @@ -0,0 +1,94 @@ +import type * as estree from 'estree'; + +declare module 'estree' { + // new types + interface TSTypeAnnotation { + type: 'TSTypeAnnotation'; + typeAnnotation: TSStringKeyword | TSTypeReference | TSUnionType | TSIndexedAccessType; + } + interface TSStringKeyword { + type: 'TSStringKeyword'; + } + interface TSNullKeyword { + type: 'TSNullKeyword'; + } + interface TSTypeReference { + type: 'TSTypeReference'; + typeName: Identifier; + } + interface TSAsExpression extends BaseNode { + type: 'TSAsExpression'; + expression: Expression; + typeAnnotation: TSTypeAnnotation['typeAnnotation']; + } + interface TSModuleDeclaration extends BaseNode { + type: 'TSModuleDeclaration'; + global: boolean; + declare: boolean; + id: Identifier; + body: TSModuleBlock; + } + interface TSModuleBlock extends BaseNode { + type: 'TSModuleBlock'; + body: Array; + } + interface TSInterfaceDeclaration extends BaseNode { + type: 'TSInterfaceDeclaration'; + id: Identifier; + body: TSInterfaceBody; + } + interface TSInterfaceBody extends BaseNode { + type: 'TSInterfaceBody'; + body: TSPropertySignature[]; + } + interface TSPropertySignature extends BaseNode { + type: 'TSPropertySignature'; + computed: boolean; + key: Identifier; + typeAnnotation: TSTypeAnnotation; + } + interface TSProgram extends Omit { + body: Array; + } + interface TSUnionType { + type: 'TSUnionType'; + types: Array; + } + interface TSImportType { + type: 'TSImportType'; + argument: Literal; + qualifier: Identifier; + } + interface TSIndexedAccessType { + type: 'TSIndexedAccessType'; + objectType: TSImportType; + indexType: TSLiteralType; + } + interface TSLiteralType { + type: 'TSLiteralType'; + literal: Literal; + } + interface TSSatisfiesExpression extends BaseNode { + type: 'TSSatisfiesExpression'; + expression: Expression; + typeAnnotation: TSTypeAnnotation['typeAnnotation']; + } + + // enhanced types + interface Identifier { + typeAnnotation?: TSTypeAnnotation; + } + interface ExpressionMap { + TSAsExpression: TSAsExpression; + TSSatisfiesExpression: TSSatisfiesExpression; + } + interface NodeMap { + TSModuleDeclaration: TSModuleDeclaration; + TSInterfaceDeclaration: TSInterfaceDeclaration; + } + interface ImportDeclaration { + importKind: 'type' | 'value'; + } +} + +export type { estree as TsEstree }; diff --git a/packages/core/tests/css/common/add-at-rule/run.ts b/packages/core/tests/css/common/add-at-rule/run.ts index fd53c285..11de1450 100644 --- a/packages/core/tests/css/common/add-at-rule/run.ts +++ b/packages/core/tests/css/common/add-at-rule/run.ts @@ -1,7 +1,7 @@ import { addAtRule } from '@sveltejs/cli-core/css'; -import type { CssFileEditor } from '@sveltejs/cli-core'; +import type { CssAst } from '@sveltejs/ast-tooling'; -export function run({ ast }: CssFileEditor): void { +export function run(ast: CssAst): void { addAtRule(ast, 'tailwind', "'lib/path/file.ext'", false); addAtRule(ast, 'tailwind', "'lib/path/file1.ext'", true); } diff --git a/packages/core/tests/css/common/add-comment/run.ts b/packages/core/tests/css/common/add-comment/run.ts index b8481ab4..5f8d4999 100644 --- a/packages/core/tests/css/common/add-comment/run.ts +++ b/packages/core/tests/css/common/add-comment/run.ts @@ -1,6 +1,6 @@ import { addComment } from '@sveltejs/cli-core/css'; -import type { CssFileEditor } from '@sveltejs/cli-core'; +import type { CssAst } from '@sveltejs/ast-tooling'; -export function run({ ast }: CssFileEditor): void { +export function run(ast: CssAst): void { addComment(ast, 'foo comment'); } diff --git a/packages/core/tests/css/common/add-imports/run.ts b/packages/core/tests/css/common/add-imports/run.ts index 12b0033a..18ccb618 100644 --- a/packages/core/tests/css/common/add-imports/run.ts +++ b/packages/core/tests/css/common/add-imports/run.ts @@ -1,6 +1,6 @@ import { addImports } from '@sveltejs/cli-core/css'; -import type { CssFileEditor } from '@sveltejs/cli-core'; +import type { CssAst } from '@sveltejs/ast-tooling'; -export function run({ ast }: CssFileEditor): void { +export function run(ast: CssAst): void { addImports(ast, ["'lib/path/file.css'"]); } diff --git a/packages/core/tests/css/common/add-rule/run.ts b/packages/core/tests/css/common/add-rule/run.ts index 7639c5c4..57c83df3 100644 --- a/packages/core/tests/css/common/add-rule/run.ts +++ b/packages/core/tests/css/common/add-rule/run.ts @@ -1,7 +1,7 @@ import { addDeclaration, addRule } from '@sveltejs/cli-core/css'; -import type { CssFileEditor } from '@sveltejs/cli-core'; +import type { CssAst } from '@sveltejs/ast-tooling'; -export function run({ ast }: CssFileEditor): void { +export function run(ast: CssAst): void { const barSelectorRule = addRule(ast, '.bar'); addDeclaration(barSelectorRule, 'color', 'blue'); } diff --git a/packages/core/tests/css/index.ts b/packages/core/tests/css/index.ts index 77a89d83..d9d20386 100644 --- a/packages/core/tests/css/index.ts +++ b/packages/core/tests/css/index.ts @@ -25,7 +25,7 @@ for (const categoryDirectory of categoryDirectories) { // dynamic imports always need to provide the path inline for static analysis const module = await import(`./${categoryDirectory}/${testName}/run.ts`); - module.run({ ast }); + module.run(ast); const output = serializeCss(ast); const formattedOutput = await prettier.format(output, prettierConfig); diff --git a/packages/core/tests/html/common/create-div/run.ts b/packages/core/tests/html/common/create-div/run.ts index 36a582bd..4e4d9642 100644 --- a/packages/core/tests/html/common/create-div/run.ts +++ b/packages/core/tests/html/common/create-div/run.ts @@ -1,7 +1,6 @@ -import { div, appendElement, insertElement } from '@sveltejs/cli-core/html'; -import type { HtmlFileEditor } from '@sveltejs/cli-core'; +import { div, appendElement, insertElement, type HtmlDocument } from '@sveltejs/cli-core/html'; -export function run({ ast }: HtmlFileEditor): void { +export function run(ast: HtmlDocument): void { const emptyDiv = div(); insertElement(ast.childNodes, emptyDiv); appendElement(ast.childNodes, emptyDiv); diff --git a/packages/core/tests/html/common/create-element/run.ts b/packages/core/tests/html/common/create-element/run.ts index 12658d28..99205f4d 100644 --- a/packages/core/tests/html/common/create-element/run.ts +++ b/packages/core/tests/html/common/create-element/run.ts @@ -1,7 +1,6 @@ -import { element, appendElement, insertElement } from '@sveltejs/cli-core/html'; -import type { HtmlFileEditor } from '@sveltejs/cli-core'; +import { element, appendElement, insertElement, type HtmlDocument } from '@sveltejs/cli-core/html'; -export function run({ ast }: HtmlFileEditor): void { +export function run(ast: HtmlDocument): void { const emptySpan = element('span'); insertElement(ast.childNodes, emptySpan); appendElement(ast.childNodes, emptySpan); diff --git a/packages/core/tests/html/common/from-raw/run.ts b/packages/core/tests/html/common/from-raw/run.ts index d1cfa163..3270c972 100644 --- a/packages/core/tests/html/common/from-raw/run.ts +++ b/packages/core/tests/html/common/from-raw/run.ts @@ -1,6 +1,5 @@ -import { addFromRawHtml } from '@sveltejs/cli-core/html'; -import type { HtmlFileEditor } from '@sveltejs/cli-core'; +import { addFromRawHtml, type HtmlDocument } from '@sveltejs/cli-core/html'; -export function run({ ast }: HtmlFileEditor): void { +export function run(ast: HtmlDocument): void { addFromRawHtml(ast.childNodes, '
foo
'); } diff --git a/packages/core/tests/html/index.ts b/packages/core/tests/html/index.ts index dfad1d0d..b5e33cd3 100644 --- a/packages/core/tests/html/index.ts +++ b/packages/core/tests/html/index.ts @@ -25,7 +25,7 @@ for (const categoryDirectory of categoryDirectories) { // dynamic imports always need to provide the path inline for static analysis const module = await import(`./${categoryDirectory}/${testName}/run.ts`); - module.run({ ast }); + module.run(ast); const output = serializeHtml(ast); const formattedOutput = await prettier.format(output, prettierConfig); diff --git a/packages/core/tests/js/arrays/empty-array/run.ts b/packages/core/tests/js/arrays/empty-array/run.ts index d3b4a0b1..0d4241da 100644 --- a/packages/core/tests/js/arrays/empty-array/run.ts +++ b/packages/core/tests/js/arrays/empty-array/run.ts @@ -1,7 +1,6 @@ -import { array, variables } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { array, variables, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const emptyArray = array.createEmpty(); // create declaration so that we serialize everything diff --git a/packages/core/tests/js/arrays/object-array/output.ts b/packages/core/tests/js/arrays/object-array/output.ts index 1fa08802..0042b760 100644 --- a/packages/core/tests/js/arrays/object-array/output.ts +++ b/packages/core/tests/js/arrays/object-array/output.ts @@ -1,8 +1 @@ -const array = [ - { - test: true - }, - { - test2: 'string' - } -]; +const array = [{ test: true }, { test2: 'string' }]; diff --git a/packages/core/tests/js/arrays/object-array/run.ts b/packages/core/tests/js/arrays/object-array/run.ts index 622cc377..26ba00e8 100644 --- a/packages/core/tests/js/arrays/object-array/run.ts +++ b/packages/core/tests/js/arrays/object-array/run.ts @@ -1,7 +1,6 @@ -import { array, object, common, variables } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { array, object, common, variables, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const array1 = array.createEmpty(); const object1 = object.create({ test: common.expressionFromString('true') }); diff --git a/packages/core/tests/js/arrays/string-array/run.ts b/packages/core/tests/js/arrays/string-array/run.ts index 9d779482..80d5ea12 100644 --- a/packages/core/tests/js/arrays/string-array/run.ts +++ b/packages/core/tests/js/arrays/string-array/run.ts @@ -1,7 +1,6 @@ -import { array, variables } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { array, variables, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const array1 = array.createEmpty(); array.push(array1, 'test'); array.push(array1, 'test2'); diff --git a/packages/core/tests/js/common/jsdoc-comment/output.ts b/packages/core/tests/js/common/jsdoc-comment/output.ts index c762d4d8..c43264a0 100644 --- a/packages/core/tests/js/common/jsdoc-comment/output.ts +++ b/packages/core/tests/js/common/jsdoc-comment/output.ts @@ -4,5 +4,6 @@ function switchToLanguage(newLanguage) { const canonicalPath = i18n.route(page.url.pathname); const localisedPath = i18n.resolveRoute(canonicalPath, newLanguage); + goto(localisedPath); } diff --git a/packages/core/tests/js/common/jsdoc-comment/run.ts b/packages/core/tests/js/common/jsdoc-comment/run.ts index 0dc71cf2..169d6682 100644 --- a/packages/core/tests/js/common/jsdoc-comment/run.ts +++ b/packages/core/tests/js/common/jsdoc-comment/run.ts @@ -1,6 +1,6 @@ import { common, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: { ast: AstTypes.Program }): void { +export function run(ast: AstTypes.Program): void { const functionDeclaration = ast.body[0] as AstTypes.FunctionDeclaration; common.addJsDocComment(functionDeclaration, { diff --git a/packages/core/tests/js/exports/default-export-with-variable/output.ts b/packages/core/tests/js/exports/default-export-with-variable/output.ts index 920afac1..6fb3d6a8 100644 --- a/packages/core/tests/js/exports/default-export-with-variable/output.ts +++ b/packages/core/tests/js/exports/default-export-with-variable/output.ts @@ -1,5 +1,3 @@ -const object = { - test: 'string' -}; +const object = { test: 'string' }; export default object; diff --git a/packages/core/tests/js/exports/default-export-with-variable/run.ts b/packages/core/tests/js/exports/default-export-with-variable/run.ts index 89137ad3..6515509e 100644 --- a/packages/core/tests/js/exports/default-export-with-variable/run.ts +++ b/packages/core/tests/js/exports/default-export-with-variable/run.ts @@ -1,7 +1,6 @@ -import { object, common, variables, exports } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { object, common, variables, exports, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const object1 = object.create({ test: common.createLiteral('string') }); diff --git a/packages/core/tests/js/exports/default-export/output.ts b/packages/core/tests/js/exports/default-export/output.ts index d2516b3e..e1a8f21a 100644 --- a/packages/core/tests/js/exports/default-export/output.ts +++ b/packages/core/tests/js/exports/default-export/output.ts @@ -1,3 +1 @@ -export default { - test: 'string' -}; +export default { test: 'string' }; diff --git a/packages/core/tests/js/exports/default-export/run.ts b/packages/core/tests/js/exports/default-export/run.ts index 7e350fb2..8e0d9fc1 100644 --- a/packages/core/tests/js/exports/default-export/run.ts +++ b/packages/core/tests/js/exports/default-export/run.ts @@ -1,7 +1,6 @@ -import { object, common, exports } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { object, common, exports, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const object1 = object.create({ test: common.createLiteral('string') }); diff --git a/packages/core/tests/js/exports/named-export-with-existing/output.ts b/packages/core/tests/js/exports/named-export-with-existing/output.ts index 3cc72fee..c252cd00 100644 --- a/packages/core/tests/js/exports/named-export-with-existing/output.ts +++ b/packages/core/tests/js/exports/named-export-with-existing/output.ts @@ -1,4 +1 @@ -export const named = { - test: 'string', - test2: 'string2' -}; +export const named = { test: 'string', test2: 'string2' }; diff --git a/packages/core/tests/js/exports/named-export-with-existing/run.ts b/packages/core/tests/js/exports/named-export-with-existing/run.ts index 6f8b8c1c..fc0609f2 100644 --- a/packages/core/tests/js/exports/named-export-with-existing/run.ts +++ b/packages/core/tests/js/exports/named-export-with-existing/run.ts @@ -1,7 +1,6 @@ import { common, variables, object, exports, type AstTypes } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const variableFallback = variables.declaration(ast, 'const', 'variable', object.createEmpty()); const existingExport = exports.namedExport(ast, 'named', variableFallback); diff --git a/packages/core/tests/js/exports/named-export/output.ts b/packages/core/tests/js/exports/named-export/output.ts index fec3056c..c978b2f0 100644 --- a/packages/core/tests/js/exports/named-export/output.ts +++ b/packages/core/tests/js/exports/named-export/output.ts @@ -1,7 +1,2 @@ -export const variable = { - test: 'string' -}; - -export const variable2 = { - test2: 'string2' -}; +export const variable = { test: 'string' }; +export const variable2 = { test2: 'string2' }; diff --git a/packages/core/tests/js/exports/named-export/run.ts b/packages/core/tests/js/exports/named-export/run.ts index ead2b2d5..67d468df 100644 --- a/packages/core/tests/js/exports/named-export/run.ts +++ b/packages/core/tests/js/exports/named-export/run.ts @@ -1,7 +1,6 @@ -import { common, variables, object, exports } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { common, variables, object, exports, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const object1 = object.create({ test: common.createLiteral('string') }); diff --git a/packages/core/tests/js/functions/arrow-function/run.ts b/packages/core/tests/js/functions/arrow-function/run.ts index 56250235..5856f8bb 100644 --- a/packages/core/tests/js/functions/arrow-function/run.ts +++ b/packages/core/tests/js/functions/arrow-function/run.ts @@ -1,7 +1,6 @@ -import { functions, common } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { functions, common, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const insideExpression = common.expressionFromString("console.log('foo')"); const functionCall = functions.arrowFunction(false, insideExpression); const expression = common.expressionStatement(functionCall); diff --git a/packages/core/tests/js/functions/function-call-by-identifier/output.ts b/packages/core/tests/js/functions/function-call-by-identifier/output.ts index 8b54d5a3..448dad44 100644 --- a/packages/core/tests/js/functions/function-call-by-identifier/output.ts +++ b/packages/core/tests/js/functions/function-call-by-identifier/output.ts @@ -3,4 +3,5 @@ function foo(bar: string) { } const a = 'bar'; + foo(a); diff --git a/packages/core/tests/js/functions/function-call-by-identifier/run.ts b/packages/core/tests/js/functions/function-call-by-identifier/run.ts index 28ef6ceb..ebbb3734 100644 --- a/packages/core/tests/js/functions/function-call-by-identifier/run.ts +++ b/packages/core/tests/js/functions/function-call-by-identifier/run.ts @@ -1,7 +1,6 @@ -import { functions, common } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { functions, common, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const functionCall = functions.callByIdentifier('foo', ['a']); const expression = common.expressionStatement(functionCall); ast.body.push(expression); diff --git a/packages/core/tests/js/functions/function-call/output.ts b/packages/core/tests/js/functions/function-call/output.ts index 69b852d5..590e7538 100644 --- a/packages/core/tests/js/functions/function-call/output.ts +++ b/packages/core/tests/js/functions/function-call/output.ts @@ -1,4 +1,5 @@ function foo(bar: string) { console.log(bar); } + foo('bar'); diff --git a/packages/core/tests/js/functions/function-call/run.ts b/packages/core/tests/js/functions/function-call/run.ts index acce02d3..41fe064e 100644 --- a/packages/core/tests/js/functions/function-call/run.ts +++ b/packages/core/tests/js/functions/function-call/run.ts @@ -1,7 +1,6 @@ -import { functions, common } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { functions, common, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const functionCall = functions.call('foo', ['bar']); const expression = common.expressionStatement(functionCall); ast.body.push(expression); diff --git a/packages/core/tests/js/imports/avoid-duplicating-imports/run.ts b/packages/core/tests/js/imports/avoid-duplicating-imports/run.ts index 496abb10..faacdcda 100644 --- a/packages/core/tests/js/imports/avoid-duplicating-imports/run.ts +++ b/packages/core/tests/js/imports/avoid-duplicating-imports/run.ts @@ -1,7 +1,6 @@ -import { imports } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { imports, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { imports.addEmpty(ast, 'package/file.js'); imports.addDefault(ast, 'package', 'MyPackage'); imports.addNamed(ast, 'package2', { Named: 'Named' }); diff --git a/packages/core/tests/js/imports/default-import/run.ts b/packages/core/tests/js/imports/default-import/run.ts index 003f65bd..7f50dd3b 100644 --- a/packages/core/tests/js/imports/default-import/run.ts +++ b/packages/core/tests/js/imports/default-import/run.ts @@ -1,6 +1,5 @@ -import { imports } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { imports, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { imports.addDefault(ast, 'package', 'MyPackage'); } diff --git a/packages/core/tests/js/imports/empty-import/run.ts b/packages/core/tests/js/imports/empty-import/run.ts index 4d89d304..505bce37 100644 --- a/packages/core/tests/js/imports/empty-import/run.ts +++ b/packages/core/tests/js/imports/empty-import/run.ts @@ -1,7 +1,6 @@ -import { imports } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { imports, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { imports.addEmpty(ast, './relativ/file.css'); // allow importing from npm packages diff --git a/packages/core/tests/js/imports/named-import-merging/run.ts b/packages/core/tests/js/imports/named-import-merging/run.ts index 29aeac9b..c6cb2c65 100644 --- a/packages/core/tests/js/imports/named-import-merging/run.ts +++ b/packages/core/tests/js/imports/named-import-merging/run.ts @@ -1,6 +1,5 @@ -import { imports } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { imports, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { imports.addNamed(ast, 'package', { namedTwo: 'namedTwo' }, false); } diff --git a/packages/core/tests/js/imports/named-import/run.ts b/packages/core/tests/js/imports/named-import/run.ts index 163c9c42..f16bd0e9 100644 --- a/packages/core/tests/js/imports/named-import/run.ts +++ b/packages/core/tests/js/imports/named-import/run.ts @@ -1,7 +1,6 @@ -import { imports } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { imports, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { imports.addNamed(ast, 'package', { namedOne: 'namedOne' }, false); imports.addNamed(ast, '@sveltejs/kit', { Handle: 'Handle' }, false); diff --git a/packages/core/tests/js/imports/namespaced-import/run.ts b/packages/core/tests/js/imports/namespaced-import/run.ts index f46a38af..7cf39897 100644 --- a/packages/core/tests/js/imports/namespaced-import/run.ts +++ b/packages/core/tests/js/imports/namespaced-import/run.ts @@ -1,6 +1,6 @@ import { imports, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: { ast: AstTypes.Program }): void { +export function run(ast: AstTypes.Program): void { imports.addNamespace(ast, 'package', 'foo'); imports.addNamespace(ast, './some-file', 'bar'); diff --git a/packages/core/tests/js/index.ts b/packages/core/tests/js/index.ts index 8cf489a4..6bcfda9f 100644 --- a/packages/core/tests/js/index.ts +++ b/packages/core/tests/js/index.ts @@ -25,7 +25,7 @@ for (const categoryDirectory of categoryDirectories) { // dynamic imports always need to provide the path inline for static analysis const module = await import(`./${categoryDirectory}/${testName}/run.ts`); - module.run({ ast }); + module.run(ast); const output = serializeScript(ast, input); const formattedOutput = await prettier.format(output, prettierConfig); diff --git a/packages/core/tests/js/object/create/output.ts b/packages/core/tests/js/object/create/output.ts index b8a403ca..a633f4a0 100644 --- a/packages/core/tests/js/object/create/output.ts +++ b/packages/core/tests/js/object/create/output.ts @@ -1,6 +1,2 @@ const empty = {}; - -const created = { - foo: 1, - bar: 'string' -}; +const created = { foo: 1, bar: 'string' }; diff --git a/packages/core/tests/js/object/create/run.ts b/packages/core/tests/js/object/create/run.ts index 8bd864b4..f5b51c32 100644 --- a/packages/core/tests/js/object/create/run.ts +++ b/packages/core/tests/js/object/create/run.ts @@ -1,7 +1,6 @@ -import { variables, object, common } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { variables, object, common, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const emptyObject = object.createEmpty(); const emptyVariable = variables.declaration(ast, 'const', 'empty', emptyObject); ast.body.push(emptyVariable); diff --git a/packages/core/tests/js/object/override-property/output.ts b/packages/core/tests/js/object/override-property/output.ts index 0069e775..c9790a5a 100644 --- a/packages/core/tests/js/object/override-property/output.ts +++ b/packages/core/tests/js/object/override-property/output.ts @@ -1,5 +1 @@ -const test = { - foo: 2, - bar: 'string2', - lorem: false -}; +const test = { foo: 2, bar: 'string2', lorem: false }; diff --git a/packages/core/tests/js/object/override-property/run.ts b/packages/core/tests/js/object/override-property/run.ts index 8ab3425c..9f284df3 100644 --- a/packages/core/tests/js/object/override-property/run.ts +++ b/packages/core/tests/js/object/override-property/run.ts @@ -1,7 +1,6 @@ import { variables, object, common, type AstTypes } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const variable = variables.declaration(ast, 'const', 'test', object.createEmpty()); const objectDeclarator = variable.declarations[0] as AstTypes.VariableDeclarator; const objectExpression = objectDeclarator.init as AstTypes.ObjectExpression; diff --git a/packages/core/tests/js/object/property/output.ts b/packages/core/tests/js/object/property/output.ts index 3967f063..e0bd5000 100644 --- a/packages/core/tests/js/object/property/output.ts +++ b/packages/core/tests/js/object/property/output.ts @@ -1,4 +1 @@ -const test = { - foo: 1, - bar: 'string' -}; +const test = { foo: 1, bar: 'string' }; diff --git a/packages/core/tests/js/object/property/run.ts b/packages/core/tests/js/object/property/run.ts index c288c301..59866dfe 100644 --- a/packages/core/tests/js/object/property/run.ts +++ b/packages/core/tests/js/object/property/run.ts @@ -1,7 +1,6 @@ import { variables, object, common, type AstTypes } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const variable = variables.declaration(ast, 'const', 'test', object.createEmpty()); const objectDeclarator = variable.declarations[0] as AstTypes.VariableDeclarator; const objectExpression = objectDeclarator.init as AstTypes.ObjectExpression; diff --git a/packages/core/tests/js/object/remove-property/run.ts b/packages/core/tests/js/object/remove-property/run.ts index 0971c07a..d5c38e04 100644 --- a/packages/core/tests/js/object/remove-property/run.ts +++ b/packages/core/tests/js/object/remove-property/run.ts @@ -1,7 +1,6 @@ import { variables, object, type AstTypes } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const variable = variables.declaration(ast, 'const', 'test', object.createEmpty()); const objectDeclarator = variable.declarations[0] as AstTypes.VariableDeclarator; const objectExpression = objectDeclarator.init as AstTypes.ObjectExpression; diff --git a/packages/core/tests/js/variables/declaration/output.ts b/packages/core/tests/js/variables/declaration/output.ts index e96c602e..60f98ba1 100644 --- a/packages/core/tests/js/variables/declaration/output.ts +++ b/packages/core/tests/js/variables/declaration/output.ts @@ -1,5 +1,2 @@ const testNumber = 2; - -const testObject = { - foo: 'bar' -}; +const testObject = { foo: 'bar' }; diff --git a/packages/core/tests/js/variables/declaration/run.ts b/packages/core/tests/js/variables/declaration/run.ts index ba1880e7..01b7a047 100644 --- a/packages/core/tests/js/variables/declaration/run.ts +++ b/packages/core/tests/js/variables/declaration/run.ts @@ -1,7 +1,6 @@ -import { variables, common, object } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { variables, common, object, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const testNumberVariable = variables.declaration( ast, 'const', diff --git a/packages/core/tests/js/variables/identifier/run.ts b/packages/core/tests/js/variables/identifier/run.ts index a5870f4d..5ab8962e 100644 --- a/packages/core/tests/js/variables/identifier/run.ts +++ b/packages/core/tests/js/variables/identifier/run.ts @@ -1,7 +1,6 @@ -import { variables } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { variables, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const barVariable = variables.declaration(ast, 'const', 'bar', variables.identifier('foo')); ast.body.push(barVariable); } diff --git a/packages/core/tests/js/variables/type-annotate-declarator/run.ts b/packages/core/tests/js/variables/type-annotate-declarator/run.ts index 4a0de3af..fc074609 100644 --- a/packages/core/tests/js/variables/type-annotate-declarator/run.ts +++ b/packages/core/tests/js/variables/type-annotate-declarator/run.ts @@ -1,7 +1,6 @@ -import { variables } from '@sveltejs/cli-core/js'; -import type { ScriptFileEditor } from '@sveltejs/cli-core'; +import { variables, type AstTypes } from '@sveltejs/cli-core/js'; -export function run({ ast }: ScriptFileEditor): void { +export function run(ast: AstTypes.Program): void { const decl = ast.body[0] as any; const annotatedDecl = variables.typeAnnotateDeclarator(decl.declarations[0], 'string'); decl.declarations[0] = annotatedDecl; diff --git a/packages/core/tooling/js/array.ts b/packages/core/tooling/js/array.ts index 7b43cd91..eb947020 100644 --- a/packages/core/tooling/js/array.ts +++ b/packages/core/tooling/js/array.ts @@ -1,5 +1,5 @@ import { areNodesEqual } from './common.ts'; -import type { AstKinds, AstTypes } from '@sveltejs/ast-tooling'; +import type { AstTypes } from '@sveltejs/ast-tooling'; export function createEmpty(): AstTypes.ArrayExpression { const arrayExpression: AstTypes.ArrayExpression = { @@ -11,24 +11,24 @@ export function createEmpty(): AstTypes.ArrayExpression { export function push( ast: AstTypes.ArrayExpression, - data: string | AstKinds.ExpressionKind | AstKinds.SpreadElementKind + data: string | AstTypes.Expression | AstTypes.SpreadElement ): void { if (typeof data === 'string') { const existingLiterals = ast.elements.filter( - (x): x is AstTypes.StringLiteral => x?.type == 'StringLiteral' + (x): x is AstTypes.Literal => x?.type == 'Literal' ); let literal = existingLiterals.find((x) => x.value == data); if (!literal) { literal = { - type: 'StringLiteral', + type: 'Literal', value: data }; ast.elements.push(literal); } } else { let anyNodeEquals = false; - const elements = ast.elements as AstTypes.ASTNode[]; + const elements = ast.elements as AstTypes.Node[]; for (const node of elements) { if (areNodesEqual(data, node)) { anyNodeEquals = true; diff --git a/packages/core/tooling/js/common.ts b/packages/core/tooling/js/common.ts index 218cfb17..79c4b6bd 100644 --- a/packages/core/tooling/js/common.ts +++ b/packages/core/tooling/js/common.ts @@ -1,5 +1,4 @@ import { - type AstKinds, type AstTypes, Walker, parseScript, @@ -10,10 +9,9 @@ import decircular from 'decircular'; import dedent from 'dedent'; export function addJsDocTypeComment(node: AstTypes.Node, type: string): void { - const comment: AstTypes.CommentBlock = { - type: 'CommentBlock', - value: `* @type {${type}} `, - leading: true + const comment: AstTypes.Comment = { + type: 'Line', + value: `* @type {${type}} ` }; addComment(node, comment); @@ -25,24 +23,23 @@ export function addJsDocComment(node: AstTypes.Node, params: Record n.type === 'CommentBlock' && n.value === comment.value); - if (!found) node.comments.push(comment); + const found = node.leadingComments.find((n) => n.type === 'Block' && n.value === comment.value); + if (!found) node.leadingComments.push(comment); } export function typeAnnotateExpression( - node: AstKinds.ExpressionKind, + node: AstTypes.Expression, type: string ): AstTypes.TSAsExpression { const expression: AstTypes.TSAsExpression = { @@ -55,7 +52,7 @@ export function typeAnnotateExpression( } export function satisfiesExpression( - node: AstKinds.ExpressionKind, + node: AstTypes.Expression, type: string ): AstTypes.TSSatisfiesExpression { const expression: AstTypes.TSSatisfiesExpression = { @@ -67,7 +64,7 @@ export function satisfiesExpression( return expression; } -export function createSpreadElement(expression: AstKinds.ExpressionKind): AstTypes.SpreadElement { +export function createSpreadElement(expression: AstTypes.Expression): AstTypes.SpreadElement { return { type: 'SpreadElement', argument: expression @@ -83,13 +80,15 @@ export function createLiteral(value: string | number | boolean | null = null): A return literal; } -export function areNodesEqual(ast1: AstTypes.ASTNode, ast2: AstTypes.ASTNode): boolean { +export function areNodesEqual(ast1: AstTypes.Node, ast2: AstTypes.Node): boolean { // We're deep cloning these trees so that we can strip the locations off of them for comparisons. // Without this, we'd be getting false negatives due to slight differences in formatting style. // These ASTs are also filled to the brim with circular references, which prevents // us from using `structuredCloned` directly - const ast1Clone = stripAst(decircular(ast1), 'loc'); - const ast2Clone = stripAst(decircular(ast2), 'loc'); + + // todo: can we simplify this duplicated call? + const ast1Clone = stripAst(stripAst(decircular(ast1), 'loc'), 'raw'); + const ast2Clone = stripAst(stripAst(decircular(ast2), 'loc'), 'raw'); return serializeScript(ast1Clone) === serializeScript(ast2Clone); } @@ -101,9 +100,7 @@ export function blockStatement(): AstTypes.BlockStatement { return statement; } -export function expressionStatement( - expression: AstKinds.ExpressionKind -): AstTypes.ExpressionStatement { +export function expressionStatement(expression: AstTypes.Expression): AstTypes.ExpressionStatement { const statement: AstTypes.ExpressionStatement = { type: 'ExpressionStatement', expression @@ -118,11 +115,12 @@ export function addFromString( const program = parseScript(dedent(value)); for (const childNode of program.body) { + // @ts-expect-error ast.body.push(childNode); } } -export function expressionFromString(value: string): AstKinds.ExpressionKind { +export function expressionFromString(value: string): AstTypes.Expression { const program = parseScript(dedent(value)); const statement = program.body[0]!; if (statement.type !== 'ExpressionStatement') { @@ -132,23 +130,27 @@ export function expressionFromString(value: string): AstKinds.ExpressionKind { return statement.expression; } -export function statementFromString(value: string): AstKinds.StatementKind { +export function statementFromString(value: string): AstTypes.Statement { + return fromString(value); +} + +export function fromString(value: string): T { const program = parseScript(dedent(value)); const statement = program.body[0]!; - return statement; + return statement as T; } /** Appends the statement to body of the block if it doesn't already exist */ export function addStatement( ast: AstTypes.BlockStatement | AstTypes.Program, - statement: AstKinds.StatementKind + statement: AstTypes.Statement ): void { if (!hasNode(ast, statement)) ast.body.push(statement); } /** Returns `true` if the provided node exists in the AST */ -export function hasNode(ast: AstTypes.ASTNode, nodeToMatch: AstTypes.ASTNode): boolean { +export function hasNode(ast: AstTypes.Node, nodeToMatch: AstTypes.Node): boolean { let found = false; // prettier-ignore // this gets needlessly butchered by prettier diff --git a/packages/core/tooling/js/exports.ts b/packages/core/tooling/js/exports.ts index 92543660..2839a0fc 100644 --- a/packages/core/tooling/js/exports.ts +++ b/packages/core/tooling/js/exports.ts @@ -1,11 +1,11 @@ -import type { AstKinds, AstTypes } from '@sveltejs/ast-tooling'; +import type { AstTypes } from '@sveltejs/ast-tooling'; export type ExportDefaultReturn = { astNode: AstTypes.ExportDefaultDeclaration; value: T; }; -export function defaultExport( +export function defaultExport( ast: AstTypes.Program, fallbackDeclaration: T ): ExportDefaultReturn { @@ -72,7 +72,8 @@ export function namedExport( namedExport = { type: 'ExportNamedDeclaration', - declaration: fallback + declaration: fallback, + specifiers: [] }; ast.body.push(namedExport); return namedExport; diff --git a/packages/core/tooling/js/function.ts b/packages/core/tooling/js/function.ts index 84445a7c..56040113 100644 --- a/packages/core/tooling/js/function.ts +++ b/packages/core/tooling/js/function.ts @@ -1,4 +1,4 @@ -import type { AstKinds, AstTypes } from '@sveltejs/ast-tooling'; +import type { AstTypes } from '@sveltejs/ast-tooling'; export function call(name: string, args: string[]): AstTypes.CallExpression { const callExpression: AstTypes.CallExpression = { @@ -7,7 +7,8 @@ export function call(name: string, args: string[]): AstTypes.CallExpression { type: 'Identifier', name }, - arguments: [] + arguments: [], + optional: false }; for (const argument of args) { @@ -27,7 +28,8 @@ export function callByIdentifier(name: string, args: string[]): AstTypes.CallExp type: 'Identifier', name }, - arguments: [] + arguments: [], + optional: false }; for (const argument of args) { @@ -43,19 +45,20 @@ export function callByIdentifier(name: string, args: string[]): AstTypes.CallExp export function arrowFunction( async: boolean, - body: AstKinds.ExpressionKind | AstTypes.BlockStatement + body: AstTypes.Expression | AstTypes.BlockStatement ): AstTypes.ArrowFunctionExpression { const arrowFunction: AstTypes.ArrowFunctionExpression = { type: 'ArrowFunctionExpression', async, body, - params: [] + params: [], + expression: true }; return arrowFunction; } -export function argumentByIndex( +export function argumentByIndex( ast: AstTypes.CallExpression, i: number, fallback: T diff --git a/packages/core/tooling/js/imports.ts b/packages/core/tooling/js/imports.ts index a0dd0fcf..f8eb4435 100644 --- a/packages/core/tooling/js/imports.ts +++ b/packages/core/tooling/js/imports.ts @@ -8,7 +8,8 @@ export function addEmpty(ast: AstTypes.Program, importFrom: string): void { type: 'Literal', value: importFrom }, - specifiers: [] + specifiers: [], + importKind: 'value' }; addImportIfNecessary(ast, expectedImportDeclaration); @@ -17,6 +18,7 @@ export function addEmpty(ast: AstTypes.Program, importFrom: string): void { export function addNamespace(ast: AstTypes.Program, importFrom: string, importAs: string): void { const expectedImportDeclaration: AstTypes.ImportDeclaration = { type: 'ImportDeclaration', + importKind: 'value', source: { type: 'Literal', value: importFrom }, specifiers: [ { @@ -44,7 +46,8 @@ export function addDefault(ast: AstTypes.Program, importFrom: string, importAs: name: importAs } } - ] + ], + importKind: 'value' }; addImportIfNecessary(ast, expectedImportDeclaration); @@ -73,7 +76,7 @@ export function addNamed( let importDecl: AstTypes.ImportDeclaration | undefined; // prettier-ignore - Walker.walk(ast as AstTypes.ASTNode, {}, { + Walker.walk(ast as AstTypes.Node, {}, { ImportDeclaration(node) { if (node.source.value === importFrom && node.specifiers) { importDecl = node; @@ -89,6 +92,8 @@ export function addNamed( (existingSpecifier) => existingSpecifier.type === 'ImportSpecifier' && existingSpecifier.local?.name !== specifierToAdd.local?.name && + existingSpecifier.imported.type == 'Identifier' && + specifierToAdd.imported.type == 'Identifier' && existingSpecifier.imported.name !== specifierToAdd.imported.name ) ) { @@ -105,7 +110,7 @@ export function addNamed( value: importFrom }, specifiers, - importKind: isType ? 'type' : undefined + importKind: isType ? 'type' : 'value' }; ast.body.unshift(expectedImportDeclaration); diff --git a/packages/core/tooling/js/index.ts b/packages/core/tooling/js/index.ts index 5e252626..7e556569 100644 --- a/packages/core/tooling/js/index.ts +++ b/packages/core/tooling/js/index.ts @@ -6,4 +6,4 @@ export * as imports from './imports.ts'; export * as variables from './variables.ts'; export * as exports from './exports.ts'; export * as kit from './kit.ts'; -export type { AstTypes, AstKinds } from '@sveltejs/ast-tooling'; +export type { AstTypes } from '@sveltejs/ast-tooling'; diff --git a/packages/core/tooling/js/kit.ts b/packages/core/tooling/js/kit.ts index 84c799c0..2cbf8838 100644 --- a/packages/core/tooling/js/kit.ts +++ b/packages/core/tooling/js/kit.ts @@ -1,8 +1,8 @@ -import { Walker, type AstKinds } from '@sveltejs/ast-tooling'; -import { common, functions, imports, variables, exports, type AstTypes } from '../js/index.ts'; +import { Walker } from '@sveltejs/ast-tooling'; +import { type AstTypes, common, functions, imports, variables, exports } from '../js/index.ts'; export function addGlobalAppInterface( - ast: AstTypes.Program, + ast: AstTypes.TSProgram, name: 'Error' | 'Locals' | 'PageData' | 'PageState' | 'Platform' ): AstTypes.TSInterfaceDeclaration { let globalDecl = ast.body @@ -10,7 +10,7 @@ export function addGlobalAppInterface( .find((m) => m.global && m.declare); if (!globalDecl) { - globalDecl = common.statementFromString('declare global {}') as AstTypes.TSModuleDeclaration; + globalDecl = common.fromString('declare global {}'); ast.body.push(globalDecl); } @@ -22,7 +22,7 @@ export function addGlobalAppInterface( let interfaceNode: AstTypes.TSInterfaceDeclaration | undefined; // prettier-ignore - Walker.walk(globalDecl as AstTypes.ASTNode, {}, { + Walker.walk(globalDecl as AstTypes.Node, {}, { TSModuleDeclaration(node, { next }) { if (node.id.type === 'Identifier' && node.id.name === 'App') { app = node; @@ -37,7 +37,7 @@ export function addGlobalAppInterface( }); if (!app) { - app = common.statementFromString('namespace App {}') as AstTypes.TSModuleDeclaration; + app = common.fromString('namespace App {}'); globalDecl.body.body.push(app); } @@ -47,9 +47,7 @@ export function addGlobalAppInterface( if (!interfaceNode) { // add the interface if it's missing - interfaceNode = common.statementFromString( - `interface ${name} {}` - ) as AstTypes.TSInterfaceDeclaration; + interfaceNode = common.fromString(`interface ${name} {}`); app.body.body.push(interfaceNode); } @@ -69,20 +67,20 @@ export function addHooksHandle( let isSpecifier: boolean = false; let handleName = 'handle'; let exportDecl: AstTypes.ExportNamedDeclaration | undefined; - let originalHandleDecl: AstKinds.DeclarationKind | undefined; + let originalHandleDecl: AstTypes.Declaration | undefined; // We'll first visit all of the named exports and grab their references if they export `handle`. // This will grab export references for: // `export { handle }` & `export { foo as handle }` // `export const handle = ...`, & `export function handle() {...}` // prettier-ignore - Walker.walk(ast as AstTypes.ASTNode, {}, { + Walker.walk(ast as AstTypes.Node, {}, { ExportNamedDeclaration(node) { - let maybeHandleDecl: AstKinds.DeclarationKind | undefined; + let maybeHandleDecl: AstTypes.Declaration | undefined; // `export { handle }` & `export { foo as handle }` - const handleSpecifier = node.specifiers?.find((s) => s.exported.name === 'handle'); - if (handleSpecifier) { + const handleSpecifier = node.specifiers?.find((s) => s.exported.type == 'Identifier' && s.exported.name === 'handle'); + if (handleSpecifier && handleSpecifier.local.type == 'Identifier' && handleSpecifier.exported.type == 'Identifier') { isSpecifier = true; // we'll search for the local name in case it's aliased (e.g. `export { foo as handle }`) handleName = (handleSpecifier.local?.name ?? handleSpecifier.exported.name) as string; @@ -246,7 +244,7 @@ function usingSequence(node: AstTypes.VariableDeclarator, handleName: string) { } function isVariableDeclaration( - node: AstTypes.ASTNode, + node: AstTypes.Node, variableName: string ): node is AstTypes.VariableDeclaration { return ( @@ -264,7 +262,7 @@ function getVariableDeclarator( } function isFunctionDeclaration( - node: AstTypes.ASTNode, + node: AstTypes.Node, funcName: string ): node is AstTypes.FunctionDeclaration { return node.type === 'FunctionDeclaration' && node.id?.name === funcName; diff --git a/packages/core/tooling/js/object.ts b/packages/core/tooling/js/object.ts index e0a5fb63..4163921f 100644 --- a/packages/core/tooling/js/object.ts +++ b/packages/core/tooling/js/object.ts @@ -1,13 +1,13 @@ -import type { AstKinds, AstTypes } from '@sveltejs/ast-tooling'; +import type { AstTypes } from '@sveltejs/ast-tooling'; -export function property( +export function property( ast: AstTypes.ObjectExpression, name: string, fallback: T ): T { const objectExpression = ast; const properties = objectExpression.properties.filter( - (x): x is AstTypes.ObjectProperty => x.type == 'ObjectProperty' + (x): x is AstTypes.Property => x.type == 'Property' ); let property = properties.find((x) => (x.key as AstTypes.Identifier).name == name); let propertyValue: T; @@ -23,13 +23,16 @@ export function property( +export function overrideProperty( ast: AstTypes.ObjectExpression, name: string, value: T ): T { const objectExpression = ast; const properties = objectExpression.properties.filter( - (x): x is AstTypes.ObjectProperty => x.type == 'ObjectProperty' + (x): x is AstTypes.Property => x.type == 'Property' ); const prop = properties.find((x) => (x.key as AstTypes.Identifier).name == name); @@ -58,7 +61,7 @@ export function overrideProperty( return value; } -export function overrideProperties( +export function overrideProperties( ast: AstTypes.ObjectExpression, obj: Record ): void { @@ -68,7 +71,7 @@ export function overrideProperties( } } -export function properties( +export function properties( ast: AstTypes.ObjectExpression, obj: Record ): void { @@ -79,9 +82,7 @@ export function properties( } export function removeProperty(ast: AstTypes.ObjectExpression, property: string): void { - const properties = ast.properties.filter( - (x): x is AstTypes.ObjectProperty => x.type === 'ObjectProperty' - ); + const properties = ast.properties.filter((x): x is AstTypes.Property => x.type === 'Property'); const propIdx = properties.findIndex((x) => (x.key as AstTypes.Identifier).name === property); if (propIdx !== -1) { @@ -89,7 +90,7 @@ export function removeProperty(ast: AstTypes.ObjectExpression, property: string) } } -export function create( +export function create( obj: Record ): AstTypes.ObjectExpression { const objExpression = createEmpty(); diff --git a/packages/core/tooling/js/variables.ts b/packages/core/tooling/js/variables.ts index 968ea9a4..7818b548 100644 --- a/packages/core/tooling/js/variables.ts +++ b/packages/core/tooling/js/variables.ts @@ -1,10 +1,10 @@ -import type { AstKinds, AstTypes } from '@sveltejs/ast-tooling'; +import type { AstTypes } from '@sveltejs/ast-tooling'; export function declaration( - ast: AstTypes.Program | AstKinds.DeclarationKind, + ast: AstTypes.Program | AstTypes.Declaration, kind: 'const' | 'let' | 'var', name: string, - value: AstKinds.ExpressionKind + value: AstTypes.Expression ): AstTypes.VariableDeclaration { const declarations = ast.type == 'Program' diff --git a/packages/core/tooling/parsers.ts b/packages/core/tooling/parsers.ts index 846cb8ea..2bfe4b85 100644 --- a/packages/core/tooling/parsers.ts +++ b/packages/core/tooling/parsers.ts @@ -8,7 +8,7 @@ type ParseBase = { export function parseScript(source: string): { ast: tools.AstTypes.Program } & ParseBase { const ast = tools.parseScript(source); - const generateCode = () => tools.serializeScript(ast, source); + const generateCode = () => tools.serializeScript(ast); return { ast, source, generateCode }; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8fab2796..00c33ab9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: devDependencies: '@changesets/cli': specifier: ^2.27.10 - version: 2.27.10 + version: 2.27.11 '@playwright/test': specifier: ^1.49.1 version: 1.49.1 @@ -19,7 +19,7 @@ importers: version: link:packages/create '@sveltejs/eslint-config': specifier: ^8.1.0 - version: 8.1.0(@stylistic/eslint-plugin-js@2.10.1(eslint@9.17.0))(eslint-config-prettier@9.1.0(eslint@9.17.0))(eslint-plugin-n@17.13.1(eslint@9.17.0))(eslint-plugin-svelte@2.46.0(eslint@9.17.0)(svelte@5.12.0))(eslint@9.17.0)(typescript-eslint@8.18.0(eslint@9.17.0)(typescript@5.7.2))(typescript@5.7.2) + version: 8.1.0(@stylistic/eslint-plugin-js@2.12.1(eslint@9.17.0))(eslint-config-prettier@9.1.0(eslint@9.17.0))(eslint-plugin-n@17.15.1(eslint@9.17.0))(eslint-plugin-svelte@2.46.1(eslint@9.17.0)(svelte@5.16.0))(eslint@9.17.0)(typescript-eslint@8.18.2(eslint@9.17.0)(typescript@5.7.2))(typescript@5.7.2) '@svitejs/changesets-changelog-github-compact': specifier: ^1.2.0 version: 1.2.0 @@ -27,8 +27,8 @@ importers: specifier: ^22.10.2 version: 22.10.2 '@vitest/ui': - specifier: ^3.0.3 - version: 3.0.3(vitest@3.0.5) + specifier: ^3.0.5 + version: 3.0.5(vitest@3.0.5) eslint: specifier: ^9.17.0 version: 9.17.0 @@ -43,7 +43,7 @@ importers: version: 2.5.6(prettier@3.4.2) prettier-plugin-svelte: specifier: ^3.3.2 - version: 3.3.2(prettier@3.4.2)(svelte@5.12.0) + version: 3.3.2(prettier@3.4.2)(svelte@5.16.0) rolldown: specifier: 1.0.0-beta.1 version: 1.0.0-beta.1(@babel/runtime@7.26.0) @@ -52,19 +52,19 @@ importers: version: link:packages/cli svelte: specifier: ^5.12.0 - version: 5.12.0 + version: 5.16.0 typescript: specifier: ^5.6.2 version: 5.7.2 typescript-eslint: specifier: ^8.18.0 - version: 8.18.0(eslint@9.17.0)(typescript@5.7.2) + version: 8.18.2(eslint@9.17.0)(typescript@5.7.2) unplugin-isolated-decl: specifier: ^0.8.3 version: 0.8.3(rollup@4.34.5)(typescript@5.7.2) vitest: specifier: ^3.0.5 - version: 3.0.5(@types/node@22.10.2)(@vitest/ui@3.0.3(vitest@3.0.5)) + version: 3.0.5(@types/node@22.10.2)(@vitest/ui@3.0.5) community-addon-template: dependencies: @@ -80,7 +80,7 @@ importers: version: link:../packages/cli vitest: specifier: ^3.0.5 - version: 3.0.5(@types/node@22.10.2)(@vitest/ui@3.0.3(vitest@3.0.5)) + version: 3.0.5(@types/node@22.10.2)(@vitest/ui@3.0.5) packages/addons: dependencies: @@ -90,12 +90,15 @@ importers: packages/ast-tooling: devDependencies: - '@babel/parser': - specifier: ^7.26.3 - version: 7.26.3 - ast-types: - specifier: ^0.16.1 - version: 0.16.1 + '@types/estree': + specifier: ^1.0.6 + version: 1.0.6 + acorn: + specifier: ^8.14.0 + version: 8.14.0 + acorn-typescript: + specifier: ^1.4.13 + version: 1.4.13(acorn@8.14.0) dom-serializer: specifier: ^2.0.0 version: 2.0.0 @@ -104,16 +107,16 @@ importers: version: 5.0.3 domutils: specifier: ^3.1.0 - version: 3.1.0 + version: 3.2.1 + esrap: + specifier: ^1.4.4 + version: 1.4.4 htmlparser2: specifier: ^9.1.0 version: 9.1.0 postcss: specifier: ^8.4.49 version: 8.5.1 - recast: - specifier: ^0.23.9 - version: 0.23.9 silver-fleece: specifier: ^1.2.1 version: 1.2.1 @@ -182,7 +185,7 @@ importers: version: 1.0.0 package-manager-detector: specifier: ^0.2.7 - version: 0.2.7 + version: 0.2.8 picocolors: specifier: ^1.1.1 version: 1.1.1 @@ -285,29 +288,12 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@babel/helper-string-parser@7.25.9': - resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-identifier@7.25.9': - resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} - engines: {node: '>=6.9.0'} - - '@babel/parser@7.26.3': - resolution: {integrity: sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==} - engines: {node: '>=6.0.0'} - hasBin: true - '@babel/runtime@7.26.0': resolution: {integrity: sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==} engines: {node: '>=6.9.0'} - '@babel/types@7.26.3': - resolution: {integrity: sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==} - engines: {node: '>=6.9.0'} - - '@changesets/apply-release-plan@7.0.6': - resolution: {integrity: sha512-TKhVLtiwtQOgMAC0fCJfmv93faiViKSDqr8oMEqrnNs99gtSC1sZh/aEMS9a+dseU1ESZRCK+ofLgGY7o0fw/Q==} + '@changesets/apply-release-plan@7.0.7': + resolution: {integrity: sha512-qnPOcmmmnD0MfMg9DjU1/onORFyRpDXkMMl2IJg9mECY6RnxL3wN0TCCc92b2sXt1jt8DgjAUUsZYGUGTdYIXA==} '@changesets/assemble-release-plan@6.0.5': resolution: {integrity: sha512-IgvBWLNKZd6k4t72MBTBK3nkygi0j3t3zdC1zrfusYo0KpdsvnDjrMM9vPnTCLCMlfNs55jRL4gIMybxa64FCQ==} @@ -315,12 +301,12 @@ packages: '@changesets/changelog-git@0.2.0': resolution: {integrity: sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ==} - '@changesets/cli@2.27.10': - resolution: {integrity: sha512-PfeXjvs9OfQJV8QSFFHjwHX3QnUL9elPEQ47SgkiwzLgtKGyuikWjrdM+lO9MXzOE22FO9jEGkcs4b+B6D6X0Q==} + '@changesets/cli@2.27.11': + resolution: {integrity: sha512-1QislpE+nvJgSZZo9+Lj3Lno5pKBgN46dAV8IVxKJy9wX8AOrs9nn5pYVZuDpoxWJJCALmbfOsHkyxujgetQSg==} hasBin: true - '@changesets/config@3.0.4': - resolution: {integrity: sha512-+DiIwtEBpvvv1z30f8bbOsUQGuccnZl9KRKMM/LxUHuDu5oEjmN+bJQ1RIBKNJjfYMQn8RZzoPiX0UgPaLQyXw==} + '@changesets/config@3.0.5': + resolution: {integrity: sha512-QyXLSSd10GquX7hY0Mt4yQFMEeqnO5z/XLpbIr4PAkNNoQNKwDyiSrx4yd749WddusH1v3OSiA0NRAYmH/APpQ==} '@changesets/errors@0.2.0': resolution: {integrity: sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==} @@ -331,8 +317,8 @@ packages: '@changesets/get-github-info@0.6.0': resolution: {integrity: sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA==} - '@changesets/get-release-plan@4.0.5': - resolution: {integrity: sha512-E6wW7JoSMcctdVakut0UB76FrrN3KIeJSXvB+DHMFo99CnC3ZVnNYDCVNClMlqAhYGmLmAj77QfApaI3ca4Fkw==} + '@changesets/get-release-plan@4.0.6': + resolution: {integrity: sha512-FHRwBkY7Eili04Y5YMOZb0ezQzKikTka4wL753vfUA5COSebt7KThqiuCN9BewE4/qFGgF/5t3AuzXx1/UAY4w==} '@changesets/get-version-range-type@0.4.0': resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==} @@ -849,8 +835,8 @@ packages: cpu: [x64] os: [win32] - '@stylistic/eslint-plugin-js@2.10.1': - resolution: {integrity: sha512-IikL/RKy9Sk2UMDUUpqrEcwDeYzUEt6SaL2/UVCFuVQxKACHSgStT0NxXkxZmBOUforaU52FPf2Su07FYH5s5g==} + '@stylistic/eslint-plugin-js@2.12.1': + resolution: {integrity: sha512-5ybogtEgWIGCR6dMnaabztbWyVdAPDsf/5XOk6jBonWug875Q9/a6gm9QxnU3rhdyDEnckWKX7dduwYJMOWrVA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: '>=8.40.0' @@ -912,51 +898,51 @@ packages: '@types/tar-stream@3.1.3': resolution: {integrity: sha512-Zbnx4wpkWBMBSu5CytMbrT5ZpMiF55qgM+EpHzR4yIDu7mv52cej8hTkOc6K+LzpkOAbxwn/m7j3iO+/l42YkQ==} - '@typescript-eslint/eslint-plugin@8.18.0': - resolution: {integrity: sha512-NR2yS7qUqCL7AIxdJUQf2MKKNDVNaig/dEB0GBLU7D+ZdHgK1NoH/3wsgO3OnPVipn51tG3MAwaODEGil70WEw==} + '@typescript-eslint/eslint-plugin@8.18.2': + resolution: {integrity: sha512-adig4SzPLjeQ0Tm+jvsozSGiCliI2ajeURDGHjZ2llnA+A67HihCQ+a3amtPhUakd1GlwHxSRvzOZktbEvhPPg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/parser@8.18.0': - resolution: {integrity: sha512-hgUZ3kTEpVzKaK3uNibExUYm6SKKOmTU2BOxBSvOYwtJEPdVQ70kZJpPjstlnhCHcuc2WGfSbpKlb/69ttyN5Q==} + '@typescript-eslint/parser@8.18.2': + resolution: {integrity: sha512-y7tcq4StgxQD4mDr9+Jb26dZ+HTZ/SkfqpXSiqeUXZHxOUyjWDKsmwKhJ0/tApR08DgOhrFAoAhyB80/p3ViuA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/scope-manager@8.18.0': - resolution: {integrity: sha512-PNGcHop0jkK2WVYGotk/hxj+UFLhXtGPiGtiaWgVBVP1jhMoMCHlTyJA+hEj4rszoSdLTK3fN4oOatrL0Cp+Xw==} + '@typescript-eslint/scope-manager@8.18.2': + resolution: {integrity: sha512-YJFSfbd0CJjy14r/EvWapYgV4R5CHzptssoag2M7y3Ra7XNta6GPAJPPP5KGB9j14viYXyrzRO5GkX7CRfo8/g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@8.18.0': - resolution: {integrity: sha512-er224jRepVAVLnMF2Q7MZJCq5CsdH2oqjP4dT7K6ij09Kyd+R21r7UVJrF0buMVdZS5QRhDzpvzAxHxabQadow==} + '@typescript-eslint/type-utils@8.18.2': + resolution: {integrity: sha512-AB/Wr1Lz31bzHfGm/jgbFR0VB0SML/hd2P1yxzKDM48YmP7vbyJNHRExUE/wZsQj2wUCvbWH8poNHFuxLqCTnA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/types@8.18.0': - resolution: {integrity: sha512-FNYxgyTCAnFwTrzpBGq+zrnoTO4x0c1CKYY5MuUTzpScqmY5fmsh2o3+57lqdI3NZucBDCzDgdEbIaNfAjAHQA==} + '@typescript-eslint/types@8.18.2': + resolution: {integrity: sha512-Z/zblEPp8cIvmEn6+tPDIHUbRu/0z5lqZ+NvolL5SvXWT5rQy7+Nch83M0++XzO0XrWRFWECgOAyE8bsJTl1GQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.18.0': - resolution: {integrity: sha512-rqQgFRu6yPkauz+ms3nQpohwejS8bvgbPyIDq13cgEDbkXt4LH4OkDMT0/fN1RUtzG8e8AKJyDBoocuQh8qNeg==} + '@typescript-eslint/typescript-estree@8.18.2': + resolution: {integrity: sha512-WXAVt595HjpmlfH4crSdM/1bcsqh+1weFRWIa9XMTx/XHZ9TCKMcr725tLYqWOgzKdeDrqVHxFotrvWcEsk2Tg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/utils@8.18.0': - resolution: {integrity: sha512-p6GLdY383i7h5b0Qrfbix3Vc3+J2k6QWw6UMUeY5JGfm3C5LbZ4QIZzJNoNOfgyRe0uuYKjvVOsO/jD4SJO+xg==} + '@typescript-eslint/utils@8.18.2': + resolution: {integrity: sha512-Cr4A0H7DtVIPkauj4sTSXVl+VBWewE9/o40KcF3TV9aqDEOWoXF3/+oRXNby3DYzZeCATvbdksYsGZzplwnK/Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.8.0' - '@typescript-eslint/visitor-keys@8.18.0': - resolution: {integrity: sha512-pCh/qEA8Lb1wVIqNvBke8UaRjJ6wrAWkJO5yyIbs8Yx6TNGYyfNjOo61tLv+WwLvoLPp4BQ8B7AHKijl8NGUfw==} + '@typescript-eslint/visitor-keys@8.18.2': + resolution: {integrity: sha512-zORcwn4C3trOWiCqFQP1x6G3xTRyZ1LYydnj51cRnJ6hxBlr/cKPckk+PKPUw/fXmvfKTcw7bwY3w9izgx5jZw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@vitest/expect@3.0.5': @@ -973,9 +959,6 @@ packages: vite: optional: true - '@vitest/pretty-format@3.0.3': - resolution: {integrity: sha512-gCrM9F7STYdsDoNjGgYXKPq4SkSxwwIU5nkaQvdUxiQ0EcNlez+PdKOVIsUJvh9P9IeIFmjn4IIREWblOBpP2Q==} - '@vitest/pretty-format@3.0.5': resolution: {integrity: sha512-CjUtdmpOcm4RVtB+up8r2vVDLR16Mgm/bYdkGFe3Yj/scRfCpbSi2W/BDSDcFK7ohw8UXvjMbOp9H4fByd/cOA==} @@ -988,13 +971,10 @@ packages: '@vitest/spy@3.0.5': resolution: {integrity: sha512-5fOzHj0WbUNqPK6blI/8VzZdkBlQLnT25knX0r4dbZI9qoZDf3qAdjoMmDcLG5A83W6oUUFJgUd0EYBc2P5xqg==} - '@vitest/ui@3.0.3': - resolution: {integrity: sha512-kGavHxFA3dETa61mgzdvxc3u/JSCiHR2o/0Z99IE8EAwtFxSLZeb2MofPKNVCPY3IAIcTx4blH57BJ1GuiRAUA==} + '@vitest/ui@3.0.5': + resolution: {integrity: sha512-gw2noso6WI+2PeMVCZFntdATS6xl9qhQcbhkPQ9sOmx/Xn0f4Bx4KDSbD90jpJPF0l5wOzSoGCmKyVR3W612mg==} peerDependencies: - vitest: 3.0.3 - - '@vitest/utils@3.0.3': - resolution: {integrity: sha512-f+s8CvyzPtMFY1eZKkIHGhPsQgYo5qCm6O8KZoim9qm1/jT64qBgGpO5tHscNH6BzRHM+edLNOP+3vO8+8pE/A==} + vitest: 3.0.5 '@vitest/utils@3.0.5': resolution: {integrity: sha512-N9AX0NUoUtVwKwy21JtwzaqR5L5R5A99GAbrHfCCXK1lp593i/3AZAXhSP43wRQuxYsflrdzEfXZFo1reR1Nkg==} @@ -1058,10 +1038,6 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - ast-types@0.16.1: - resolution: {integrity: sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==} - engines: {node: '>=4'} - axobject-query@4.1.0: resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} @@ -1128,6 +1104,10 @@ packages: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} + clsx@2.1.1: + resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} + engines: {node: '>=6'} + code-block-writer@13.0.3: resolution: {integrity: sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==} @@ -1227,8 +1207,8 @@ packages: resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} engines: {node: '>= 4'} - domutils@3.1.0: - resolution: {integrity: sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==} + domutils@3.2.1: + resolution: {integrity: sha512-xWXmuRnN9OMP6ptPd2+H0cCbcYBULa5YDTbMm/2lvkWvNA3O4wcW+GvzooqBuNM8yy6pl3VIAeJTUUWUbfI5Fw==} dotenv@16.4.7: resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==} @@ -1295,14 +1275,14 @@ packages: peerDependencies: eslint: '>=8' - eslint-plugin-n@17.13.1: - resolution: {integrity: sha512-97qzhk1z3DdSJNCqT45EslwCu5+LB9GDadSyBItgKUfGsXAmN/aa7LRQ0ZxHffUxUzvgbTPJL27/pE9ZQWHy7A==} + eslint-plugin-n@17.15.1: + resolution: {integrity: sha512-KFw7x02hZZkBdbZEFQduRGH4VkIH4MW97ClsbAM4Y4E6KguBJWGfWG1P4HEIpZk2bkoWf0bojpnjNAhYQP8beA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: '>=8.23.0' - eslint-plugin-svelte@2.46.0: - resolution: {integrity: sha512-1A7iEMkzmCZ9/Iz+EAfOGYL8IoIG6zeKEq1SmpxGeM5SXmoQq+ZNnCpXFVJpsxPWYx8jIVGMerQMzX20cqUl0g==} + eslint-plugin-svelte@2.46.1: + resolution: {integrity: sha512-7xYr2o4NID/f9OEYMqxsEQsCsj4KaMy4q5sANaKkAb6/QeCjYFxRmDm2S3YC3A3pl1kyPZ/syOx/i7LcWYSbIw==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0-0 || ^9.0.0-0 @@ -1357,8 +1337,11 @@ packages: resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} engines: {node: '>=0.10'} - esrap@1.2.3: - resolution: {integrity: sha512-ZlQmCCK+n7SGoqo7DnfKaP1sJZa49P01/dXzmjCASSo04p72w8EksT2NMK8CEX8DhKsfJXANioIw8VyHNsBfvQ==} + esrap@1.4.2: + resolution: {integrity: sha512-FhVlJzvTw7ZLxYZ7RyHwQCFE64dkkpzGNNnphaGCLwjqGk1SQcqzbgdx9FowPCktx6NOSHkzvcZ3vsvdH54YXA==} + + esrap@1.4.4: + resolution: {integrity: sha512-tDN6xP/r/b3WmdpWm7LybrD252hY52IokcycPnO+WHfhFF0+n5AWtcLLK7VNV6m0uYgVRhGVs8OkZwRyfC7HzQ==} esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} @@ -1408,8 +1391,8 @@ packages: fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + fastq@1.18.0: + resolution: {integrity: sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==} fdir@6.4.3: resolution: {integrity: sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==} @@ -1648,9 +1631,6 @@ packages: lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} - loupe@3.1.2: - resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==} - loupe@3.1.3: resolution: {integrity: sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==} @@ -1768,8 +1748,8 @@ packages: package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} - package-manager-detector@0.2.7: - resolution: {integrity: sha512-g4+387DXDKlZzHkP+9FLt8yKj8+/3tOkPv7DVTJGGRm00RkEWgqbFstX1mXJ4M0VDYhUqsTOiISqNOJnhAu3PQ==} + package-manager-detector@0.2.8: + resolution: {integrity: sha512-ts9KSdroZisdvKMWVAVCXiKqnqNfXz4+IbrBG8/BWx/TR5le+jfenvoBuIZ6UWM9nz47W7AbD9qYfAwfWMIwzA==} parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} @@ -1918,10 +1898,6 @@ packages: resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} engines: {node: '>=6'} - recast@0.23.9: - resolution: {integrity: sha512-Hx/BGIbwj+Des3+xy5uAtAbdCyqK9y9wbBcDFDYanLS9JnMqf7OeF87HQwUimE87OEc72mr6tkKUKMBBL+hF9Q==} - engines: {node: '>= 4'} - regenerator-runtime@0.14.1: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} @@ -2010,10 +1986,6 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} - source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} - spawndamnit@3.0.1: resolution: {integrity: sha512-MmnduQUuHCoFckZoWnXsTg7JaiLBJrKFj9UI2MbRPGaJeVpsLcVBu6P/IGZovziM/YBsellCmsprgNA+w0CzVg==} @@ -2081,8 +2053,8 @@ packages: resolution: {integrity: sha512-IY1rnGr6izd10B0A8LqsBfmlT5OILVuZ7XsI0vdGPEvuonFV7NYEUK4dAkm9Zg2q0Um92kYjTpS1CAP3Nh/KWw==} engines: {node: '>=16'} - svelte@5.12.0: - resolution: {integrity: sha512-nOd7uj0D/4A3IrHnltaFYndVPGViYSs0s+Zi3N4uQg3owJt9RoiUdwxYx8qjorj5CtaGsx8dNYsFVbH6czrGNg==} + svelte@5.16.0: + resolution: {integrity: sha512-Ygqsiac6UogVED2ruKclU+pOeMThxWtp9LG+li7BXeDKC2paVIsRTMkNmcON4Zejerd1s5sZHWx6ZtU85xklVg==} engines: {node: '>=18'} synckit@0.9.2: @@ -2119,9 +2091,6 @@ packages: tiny-glob@0.2.9: resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} - tiny-invariant@1.3.3: - resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==} - tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} @@ -2178,8 +2147,8 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} - typescript-eslint@8.18.0: - resolution: {integrity: sha512-Xq2rRjn6tzVpAyHr3+nmSg1/9k9aIHnJ2iZeOH7cfGOWqTkXTm3kwpQglEuLGdNrYvPF+2gtAs+/KF5rjVo+WQ==} + typescript-eslint@8.18.2: + resolution: {integrity: sha512-KuXezG6jHkvC3MvizeXgupZzaG5wjhU3yE8E7e6viOvAvD9xAWYp8/vy0WULTGe9DYDWcQu7aW03YIV3mSitrQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -2361,26 +2330,13 @@ snapshots: '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 - '@babel/helper-string-parser@7.25.9': {} - - '@babel/helper-validator-identifier@7.25.9': {} - - '@babel/parser@7.26.3': - dependencies: - '@babel/types': 7.26.3 - '@babel/runtime@7.26.0': dependencies: regenerator-runtime: 0.14.1 - '@babel/types@7.26.3': - dependencies: - '@babel/helper-string-parser': 7.25.9 - '@babel/helper-validator-identifier': 7.25.9 - - '@changesets/apply-release-plan@7.0.6': + '@changesets/apply-release-plan@7.0.7': dependencies: - '@changesets/config': 3.0.4 + '@changesets/config': 3.0.5 '@changesets/get-version-range-type': 0.4.0 '@changesets/git': 3.0.2 '@changesets/should-skip-package': 0.1.1 @@ -2407,15 +2363,15 @@ snapshots: dependencies: '@changesets/types': 6.0.0 - '@changesets/cli@2.27.10': + '@changesets/cli@2.27.11': dependencies: - '@changesets/apply-release-plan': 7.0.6 + '@changesets/apply-release-plan': 7.0.7 '@changesets/assemble-release-plan': 6.0.5 '@changesets/changelog-git': 0.2.0 - '@changesets/config': 3.0.4 + '@changesets/config': 3.0.5 '@changesets/errors': 0.2.0 '@changesets/get-dependents-graph': 2.1.2 - '@changesets/get-release-plan': 4.0.5 + '@changesets/get-release-plan': 4.0.6 '@changesets/git': 3.0.2 '@changesets/logger': 0.1.1 '@changesets/pre': 2.0.1 @@ -2431,14 +2387,14 @@ snapshots: fs-extra: 7.0.1 mri: 1.2.0 p-limit: 2.3.0 - package-manager-detector: 0.2.7 + package-manager-detector: 0.2.8 picocolors: 1.1.1 resolve-from: 5.0.0 semver: 7.6.3 spawndamnit: 3.0.1 term-size: 2.2.1 - '@changesets/config@3.0.4': + '@changesets/config@3.0.5': dependencies: '@changesets/errors': 0.2.0 '@changesets/get-dependents-graph': 2.1.2 @@ -2466,10 +2422,10 @@ snapshots: transitivePeerDependencies: - encoding - '@changesets/get-release-plan@4.0.5': + '@changesets/get-release-plan@4.0.6': dependencies: '@changesets/assemble-release-plan': 6.0.5 - '@changesets/config': 3.0.4 + '@changesets/config': 3.0.5 '@changesets/pre': 2.0.1 '@changesets/read': 0.6.2 '@changesets/types': 6.0.0 @@ -2742,7 +2698,7 @@ snapshots: '@nodelib/fs.walk@1.2.8': dependencies: '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 + fastq: 1.18.0 '@oxc-parser/binding-darwin-arm64@0.37.0': optional: true @@ -2884,22 +2840,22 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.34.5': optional: true - '@stylistic/eslint-plugin-js@2.10.1(eslint@9.17.0)': + '@stylistic/eslint-plugin-js@2.12.1(eslint@9.17.0)': dependencies: eslint: 9.17.0 eslint-visitor-keys: 4.2.0 espree: 10.3.0 - '@sveltejs/eslint-config@8.1.0(@stylistic/eslint-plugin-js@2.10.1(eslint@9.17.0))(eslint-config-prettier@9.1.0(eslint@9.17.0))(eslint-plugin-n@17.13.1(eslint@9.17.0))(eslint-plugin-svelte@2.46.0(eslint@9.17.0)(svelte@5.12.0))(eslint@9.17.0)(typescript-eslint@8.18.0(eslint@9.17.0)(typescript@5.7.2))(typescript@5.7.2)': + '@sveltejs/eslint-config@8.1.0(@stylistic/eslint-plugin-js@2.12.1(eslint@9.17.0))(eslint-config-prettier@9.1.0(eslint@9.17.0))(eslint-plugin-n@17.15.1(eslint@9.17.0))(eslint-plugin-svelte@2.46.1(eslint@9.17.0)(svelte@5.16.0))(eslint@9.17.0)(typescript-eslint@8.18.2(eslint@9.17.0)(typescript@5.7.2))(typescript@5.7.2)': dependencies: - '@stylistic/eslint-plugin-js': 2.10.1(eslint@9.17.0) + '@stylistic/eslint-plugin-js': 2.12.1(eslint@9.17.0) eslint: 9.17.0 eslint-config-prettier: 9.1.0(eslint@9.17.0) - eslint-plugin-n: 17.13.1(eslint@9.17.0) - eslint-plugin-svelte: 2.46.0(eslint@9.17.0)(svelte@5.12.0) + eslint-plugin-n: 17.15.1(eslint@9.17.0) + eslint-plugin-svelte: 2.46.1(eslint@9.17.0)(svelte@5.16.0) globals: 15.14.0 typescript: 5.7.2 - typescript-eslint: 8.18.0(eslint@9.17.0)(typescript@5.7.2) + typescript-eslint: 8.18.2(eslint@9.17.0)(typescript@5.7.2) '@svitejs/changesets-changelog-github-compact@1.2.0': dependencies: @@ -2939,7 +2895,7 @@ snapshots: '@types/prompts@2.4.9': dependencies: - '@types/node': 22.10.2 + '@types/node': 18.19.68 kleur: 3.0.3 '@types/ps-tree@1.1.6': {} @@ -2955,14 +2911,14 @@ snapshots: dependencies: '@types/node': 22.10.2 - '@typescript-eslint/eslint-plugin@8.18.0(@typescript-eslint/parser@8.18.0(eslint@9.17.0)(typescript@5.7.2))(eslint@9.17.0)(typescript@5.7.2)': + '@typescript-eslint/eslint-plugin@8.18.2(@typescript-eslint/parser@8.18.2(eslint@9.17.0)(typescript@5.7.2))(eslint@9.17.0)(typescript@5.7.2)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.18.0(eslint@9.17.0)(typescript@5.7.2) - '@typescript-eslint/scope-manager': 8.18.0 - '@typescript-eslint/type-utils': 8.18.0(eslint@9.17.0)(typescript@5.7.2) - '@typescript-eslint/utils': 8.18.0(eslint@9.17.0)(typescript@5.7.2) - '@typescript-eslint/visitor-keys': 8.18.0 + '@typescript-eslint/parser': 8.18.2(eslint@9.17.0)(typescript@5.7.2) + '@typescript-eslint/scope-manager': 8.18.2 + '@typescript-eslint/type-utils': 8.18.2(eslint@9.17.0)(typescript@5.7.2) + '@typescript-eslint/utils': 8.18.2(eslint@9.17.0)(typescript@5.7.2) + '@typescript-eslint/visitor-keys': 8.18.2 eslint: 9.17.0 graphemer: 1.4.0 ignore: 5.3.2 @@ -2972,27 +2928,27 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.18.0(eslint@9.17.0)(typescript@5.7.2)': + '@typescript-eslint/parser@8.18.2(eslint@9.17.0)(typescript@5.7.2)': dependencies: - '@typescript-eslint/scope-manager': 8.18.0 - '@typescript-eslint/types': 8.18.0 - '@typescript-eslint/typescript-estree': 8.18.0(typescript@5.7.2) - '@typescript-eslint/visitor-keys': 8.18.0 + '@typescript-eslint/scope-manager': 8.18.2 + '@typescript-eslint/types': 8.18.2 + '@typescript-eslint/typescript-estree': 8.18.2(typescript@5.7.2) + '@typescript-eslint/visitor-keys': 8.18.2 debug: 4.4.0 eslint: 9.17.0 typescript: 5.7.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.18.0': + '@typescript-eslint/scope-manager@8.18.2': dependencies: - '@typescript-eslint/types': 8.18.0 - '@typescript-eslint/visitor-keys': 8.18.0 + '@typescript-eslint/types': 8.18.2 + '@typescript-eslint/visitor-keys': 8.18.2 - '@typescript-eslint/type-utils@8.18.0(eslint@9.17.0)(typescript@5.7.2)': + '@typescript-eslint/type-utils@8.18.2(eslint@9.17.0)(typescript@5.7.2)': dependencies: - '@typescript-eslint/typescript-estree': 8.18.0(typescript@5.7.2) - '@typescript-eslint/utils': 8.18.0(eslint@9.17.0)(typescript@5.7.2) + '@typescript-eslint/typescript-estree': 8.18.2(typescript@5.7.2) + '@typescript-eslint/utils': 8.18.2(eslint@9.17.0)(typescript@5.7.2) debug: 4.4.0 eslint: 9.17.0 ts-api-utils: 1.4.3(typescript@5.7.2) @@ -3000,12 +2956,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/types@8.18.0': {} + '@typescript-eslint/types@8.18.2': {} - '@typescript-eslint/typescript-estree@8.18.0(typescript@5.7.2)': + '@typescript-eslint/typescript-estree@8.18.2(typescript@5.7.2)': dependencies: - '@typescript-eslint/types': 8.18.0 - '@typescript-eslint/visitor-keys': 8.18.0 + '@typescript-eslint/types': 8.18.2 + '@typescript-eslint/visitor-keys': 8.18.2 debug: 4.4.0 fast-glob: 3.3.2 is-glob: 4.0.3 @@ -3016,20 +2972,20 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.18.0(eslint@9.17.0)(typescript@5.7.2)': + '@typescript-eslint/utils@8.18.2(eslint@9.17.0)(typescript@5.7.2)': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.17.0) - '@typescript-eslint/scope-manager': 8.18.0 - '@typescript-eslint/types': 8.18.0 - '@typescript-eslint/typescript-estree': 8.18.0(typescript@5.7.2) + '@typescript-eslint/scope-manager': 8.18.2 + '@typescript-eslint/types': 8.18.2 + '@typescript-eslint/typescript-estree': 8.18.2(typescript@5.7.2) eslint: 9.17.0 typescript: 5.7.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/visitor-keys@8.18.0': + '@typescript-eslint/visitor-keys@8.18.2': dependencies: - '@typescript-eslint/types': 8.18.0 + '@typescript-eslint/types': 8.18.2 eslint-visitor-keys: 4.2.0 '@vitest/expect@3.0.5': @@ -3047,10 +3003,6 @@ snapshots: optionalDependencies: vite: 6.1.0(@types/node@22.10.2) - '@vitest/pretty-format@3.0.3': - dependencies: - tinyrainbow: 2.0.0 - '@vitest/pretty-format@3.0.5': dependencies: tinyrainbow: 2.0.0 @@ -3070,22 +3022,16 @@ snapshots: dependencies: tinyspy: 3.0.2 - '@vitest/ui@3.0.3(vitest@3.0.5)': + '@vitest/ui@3.0.5(vitest@3.0.5)': dependencies: - '@vitest/utils': 3.0.3 + '@vitest/utils': 3.0.5 fflate: 0.8.2 flatted: 3.3.2 pathe: 2.0.2 sirv: 3.0.0 tinyglobby: 0.2.10 tinyrainbow: 2.0.0 - vitest: 3.0.5(@types/node@22.10.2)(@vitest/ui@3.0.3(vitest@3.0.5)) - - '@vitest/utils@3.0.3': - dependencies: - '@vitest/pretty-format': 3.0.3 - loupe: 3.1.2 - tinyrainbow: 2.0.0 + vitest: 3.0.5(@types/node@22.10.2)(@vitest/ui@3.0.5) '@vitest/utils@3.0.5': dependencies: @@ -3136,10 +3082,6 @@ snapshots: assertion-error@2.0.1: {} - ast-types@0.16.1: - dependencies: - tslib: 2.8.1 - axobject-query@4.1.0: {} b4a@1.6.7: {} @@ -3209,6 +3151,8 @@ snapshots: ci-info@3.9.0: {} + clsx@2.1.1: {} + code-block-writer@13.0.3: {} code-red@1.0.4: @@ -3282,7 +3226,7 @@ snapshots: dependencies: domelementtype: 2.3.0 - domutils@3.1.0: + domutils@3.2.1: dependencies: dom-serializer: 2.0.0 domelementtype: 2.3.0 @@ -3364,7 +3308,7 @@ snapshots: eslint: 9.17.0 eslint-compat-utils: 0.5.1(eslint@9.17.0) - eslint-plugin-n@17.13.1(eslint@9.17.0): + eslint-plugin-n@17.15.1(eslint@9.17.0): dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.17.0) enhanced-resolve: 5.18.1 @@ -3376,7 +3320,7 @@ snapshots: minimatch: 9.0.5 semver: 7.7.1 - eslint-plugin-svelte@2.46.0(eslint@9.17.0)(svelte@5.12.0): + eslint-plugin-svelte@2.46.1(eslint@9.17.0)(svelte@5.16.0): dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.17.0) '@jridgewell/sourcemap-codec': 1.5.0 @@ -3389,9 +3333,9 @@ snapshots: postcss-safe-parser: 6.0.0(postcss@8.5.1) postcss-selector-parser: 6.1.2 semver: 7.7.1 - svelte-eslint-parser: 0.43.0(svelte@5.12.0) + svelte-eslint-parser: 0.43.0(svelte@5.16.0) optionalDependencies: - svelte: 5.12.0 + svelte: 5.16.0 transitivePeerDependencies: - ts-node @@ -3468,10 +3412,13 @@ snapshots: dependencies: estraverse: 5.3.0 - esrap@1.2.3: + esrap@1.4.2: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.0 + + esrap@1.4.4: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 - '@types/estree': 1.0.6 esrecurse@4.3.0: dependencies: @@ -3523,7 +3470,7 @@ snapshots: fast-levenshtein@2.0.6: {} - fastq@1.17.1: + fastq@1.18.0: dependencies: reusify: 1.0.4 @@ -3637,7 +3584,7 @@ snapshots: dependencies: domelementtype: 2.3.0 domhandler: 5.0.3 - domutils: 3.1.0 + domutils: 3.2.1 entities: 4.5.0 human-id@1.0.2: {} @@ -3739,8 +3686,6 @@ snapshots: lodash.startcase@4.4.0: {} - loupe@3.1.2: {} - loupe@3.1.3: {} lru-cache@10.4.3: {} @@ -3848,7 +3793,7 @@ snapshots: package-json-from-dist@1.0.1: {} - package-manager-detector@0.2.7: {} + package-manager-detector@0.2.8: {} parent-module@1.0.1: dependencies: @@ -3934,10 +3879,10 @@ snapshots: optionalDependencies: prettier: 3.4.2 - prettier-plugin-svelte@3.3.2(prettier@3.4.2)(svelte@5.12.0): + prettier-plugin-svelte@3.3.2(prettier@3.4.2)(svelte@5.16.0): dependencies: prettier: 3.4.2 - svelte: 5.12.0 + svelte: 5.16.0 prettier@2.8.8: {} @@ -3965,14 +3910,6 @@ snapshots: pify: 4.0.1 strip-bom: 3.0.0 - recast@0.23.9: - dependencies: - ast-types: 0.16.1 - esprima: 4.0.1 - source-map: 0.6.1 - tiny-invariant: 1.3.3 - tslib: 2.8.1 - regenerator-runtime@0.14.1: {} resolve-from@4.0.0: {} @@ -4073,8 +4010,6 @@ snapshots: source-map-js@1.2.1: {} - source-map@0.6.1: {} - spawndamnit@3.0.1: dependencies: cross-spawn: 7.0.6 @@ -4140,7 +4075,7 @@ snapshots: dependencies: has-flag: 4.0.0 - svelte-eslint-parser@0.43.0(svelte@5.12.0): + svelte-eslint-parser@0.43.0(svelte@5.16.0): dependencies: eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 @@ -4148,7 +4083,7 @@ snapshots: postcss: 8.5.1 postcss-scss: 4.0.9(postcss@8.5.1) optionalDependencies: - svelte: 5.12.0 + svelte: 5.16.0 svelte@4.2.19: dependencies: @@ -4167,7 +4102,7 @@ snapshots: magic-string: 0.30.17 periscopic: 3.1.0 - svelte@5.12.0: + svelte@5.16.0: dependencies: '@ampproject/remapping': 2.3.0 '@jridgewell/sourcemap-codec': 1.5.0 @@ -4176,8 +4111,9 @@ snapshots: acorn-typescript: 1.4.13(acorn@8.14.0) aria-query: 5.3.2 axobject-query: 4.1.0 + clsx: 2.1.1 esm-env: 1.2.1 - esrap: 1.2.3 + esrap: 1.4.2 is-reference: 3.0.3 locate-character: 3.0.0 magic-string: 0.30.17 @@ -4225,8 +4161,6 @@ snapshots: globalyzer: 0.1.0 globrex: 0.1.2 - tiny-invariant@1.3.3: {} - tinybench@2.9.0: {} tinyexec@0.3.2: {} @@ -4271,11 +4205,11 @@ snapshots: dependencies: prelude-ls: 1.2.1 - typescript-eslint@8.18.0(eslint@9.17.0)(typescript@5.7.2): + typescript-eslint@8.18.2(eslint@9.17.0)(typescript@5.7.2): dependencies: - '@typescript-eslint/eslint-plugin': 8.18.0(@typescript-eslint/parser@8.18.0(eslint@9.17.0)(typescript@5.7.2))(eslint@9.17.0)(typescript@5.7.2) - '@typescript-eslint/parser': 8.18.0(eslint@9.17.0)(typescript@5.7.2) - '@typescript-eslint/utils': 8.18.0(eslint@9.17.0)(typescript@5.7.2) + '@typescript-eslint/eslint-plugin': 8.18.2(@typescript-eslint/parser@8.18.2(eslint@9.17.0)(typescript@5.7.2))(eslint@9.17.0)(typescript@5.7.2) + '@typescript-eslint/parser': 8.18.2(eslint@9.17.0)(typescript@5.7.2) + '@typescript-eslint/utils': 8.18.2(eslint@9.17.0)(typescript@5.7.2) eslint: 9.17.0 typescript: 5.7.2 transitivePeerDependencies: @@ -4347,7 +4281,7 @@ snapshots: '@types/node': 22.10.2 fsevents: 2.3.3 - vitest@3.0.5(@types/node@22.10.2)(@vitest/ui@3.0.3(vitest@3.0.5)): + vitest@3.0.5(@types/node@22.10.2)(@vitest/ui@3.0.5): dependencies: '@vitest/expect': 3.0.5 '@vitest/mocker': 3.0.5(vite@6.1.0(@types/node@22.10.2)) @@ -4371,7 +4305,7 @@ snapshots: why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.10.2 - '@vitest/ui': 3.0.3(vitest@3.0.5) + '@vitest/ui': 3.0.5(vitest@3.0.5) transitivePeerDependencies: - jiti - less