diff --git a/.github/agents/language-package.agent.md b/.github/agents/language-package.agent.md index 8807dda88..9a138e66e 100644 --- a/.github/agents/language-package.agent.md +++ b/.github/agents/language-package.agent.md @@ -49,7 +49,7 @@ Run these commands scoped to the files under review and include the results in y - **Tests**: `pnpm vitest run ` — confirm the co-located test file exists and passes. - **Type check**: `pnpm tsc --noEmit -p /tsconfig.json` — confirm no type errors. -- **Lint**: `pnpm eslint ` — confirm no lint violations. +- **Lint**: `pnpm oxlint ` — confirm no lint violations. If any of these fail, include the failure output as a finding. diff --git a/.github/workflows/changes.yml b/.github/workflows/changes.yml index cbeb7ffd1..e5b9d0008 100644 --- a/.github/workflows/changes.yml +++ b/.github/workflows/changes.yml @@ -10,7 +10,7 @@ permissions: jobs: changes: - if: ${{ github.actor != 'dependabot[bot]' && !startsWith(github.head_ref, 'publish/') }} + if: ${{ github.actor != 'dependabot[bot]' && !startsWith(github.head_ref, 'publish/') && !contains(github.event.pull_request.title, '[skip chg]') }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 000000000..20a0b8abc --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,21 @@ +{ + "$schema": "./node_modules/oxfmt/configuration_schema.json", + "printWidth": 80, + "sortImports": true, + "sortPackageJson": false, + "ignorePatterns": [ + "pnpm-lock.yaml", + "packages/babel-plugin-alloy/test/fixtures/**/*", + "packages/babel-plugin-jsx-dom-expressions/test/__*_fixtures__/**/*", + "packages/babel-plugin-jsx-dom-expressions/**", + "packages/docs/dist", + "packages/docs/dist-build", + "packages/docs/public", + "packages/docs/docs", + "packages/docs/src", + "packages/csharp/src/builtins", + ".chronus/changes/", + "CHANGELOG.md", + "*.generated.*" + ] +} diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 000000000..43659a6aa --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,96 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["typescript", "vitest"], + "categories": { + "correctness": "error" + }, + "ignorePatterns": [ + "**/*.d.ts", + "**/dist/**/*", + "**/.temp/**/*", + "packages/*/vitest.config.ts", + "packages/*/babel.config.cjs", + "packages/babel-plugin-jsx-dom-expressions/**/*", + "packages/babel-plugin-alloy/**/*", + "packages/babel-preset-alloy/**/*", + "packages/devtools/**/*", + "packages/docs/**/*", + "samples/**/*", + "**/scripts/**/*", + "**/cmd/**/*" + ], + "rules": { + "no-console": "warn", + "typescript/no-explicit-any": "off", + "typescript/no-empty-object-type": "off", + "no-unused-vars": [ + "warn", + { + "varsIgnorePattern": "^_", + "argsIgnorePattern": ".*", + "caughtErrorsIgnorePattern": ".*", + "ignoreRestSiblings": true + } + ], + "prefer-const": "warn", + "eqeqeq": ["warn", "always", { "null": "ignore" }], + + // Rules oxlint enables by default (via the `correctness` category) that + // were not enforced by the previous ESLint setup. Disabled so the + // migration does not introduce new errors. + // `no-useless-catch`: the codebase intentionally re-throws in `try/catch` + // to preserve call stacks (previously suppressed inline everywhere). + "no-useless-catch": "off", + "no-useless-rename": "off", + "vitest/expect-expect": "off", + "vitest/no-conditional-expect": "off", + "vitest/require-mock-type-parameters": "off", + "vitest/require-to-throw-message": "off", + "vitest/valid-title": "off", + + // Type-aware linting (via oxlint-tsgolint, enabled by `--type-aware`). + // We only opt into `no-floating-promises` to match the previous ESLint + // setup. The `--type-aware` flag only activates the type-aware rules that + // belong to an enabled category, so the list below is exactly the + // type-aware rules in `correctness` (minus `no-floating-promises`); all + // other type-aware rules live in categories that are off by default. + // Remove an entry here to progressively adopt more type-aware rules. + "typescript/no-floating-promises": "warn", + "typescript/await-thenable": "off", + "typescript/no-array-delete": "off", + "typescript/no-base-to-string": "off", + "typescript/no-duplicate-type-constituents": "off", + "typescript/no-for-in-array": "off", + "typescript/no-implied-eval": "off", + "typescript/no-meaningless-void-operator": "off", + "typescript/no-misused-spread": "off", + "typescript/no-redundant-type-constituents": "off", + "typescript/no-unsafe-unary-minus": "off", + "typescript/no-useless-default-assignment": "off", + "typescript/require-array-sort-compare": "off", + "typescript/restrict-template-expressions": "off", + "typescript/triple-slash-reference": "off", + "typescript/unbound-method": "off" + }, + "overrides": [ + { + "files": ["packages/trace-cli/**/*.ts"], + "rules": { + "no-console": "off" + } + }, + { + "files": ["**/*.test.ts"], + "rules": { + "vitest/no-focused-tests": "warn", + "vitest/no-identical-title": "error", + "vitest/no-commented-out-tests": "warn", + "vitest/no-import-node-test": "warn", + "vitest/require-local-test-context-for-concurrent-snapshots": "warn", + "vitest/valid-describe-callback": "warn", + "vitest/valid-expect": "warn", + "typescript/no-non-null-asserted-optional-chain": "off" + } + } + ] +} diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index ff8ac99de..000000000 --- a/.prettierignore +++ /dev/null @@ -1,20 +0,0 @@ -pnpm-lock.yaml -packages/babel-plugin-alloy/test/fixtures/**/* -packages/babel-plugin-jsx-dom-expressions/test/__*_fixtures__/**/* - -# Don't format this package for now to keep closer to original -packages/babel-plugin-jsx-dom-expressions/** - -# mostly autogenerated content -packages/docs/dist -packages/docs/dist-build -packages/docs/public -packages/docs/docs -packages/docs/src -packages/csharp/src/builtins - - -.chronus/changes/ -CHANGELOG.md - -*.generated.* \ No newline at end of file diff --git a/.prettierrc.yaml b/.prettierrc.yaml deleted file mode 100644 index 2e7fc4456..000000000 --- a/.prettierrc.yaml +++ /dev/null @@ -1,3 +0,0 @@ -experimentalTernaries: true -plugins: - - ./node_modules/prettier-plugin-organize-imports/index.js diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..99e2f7ddf --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["oxc.oxc-vscode"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index d57c73ffd..274b90775 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { - "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.defaultFormatter": "oxc.oxc-vscode", "editor.formatOnSave": true, + "oxc.fmt.experimental": true, "search.exclude": { "**/node_modules": true, "**/.temp": true, diff --git a/eng/pkg-pr-new.ts b/eng/pkg-pr-new.ts index 9a50a8bcb..14529e0ba 100644 --- a/eng/pkg-pr-new.ts +++ b/eng/pkg-pr-new.ts @@ -1,5 +1,6 @@ import { execSync } from "child_process"; import { readdir } from "fs/promises"; + import { repoRoot } from "./utils/constants.ts"; import { listChangedFilesSince } from "./utils/git.ts"; diff --git a/eng/prepare-release-pr.ts b/eng/prepare-release-pr.ts index 94fa23d26..956b72611 100644 --- a/eng/prepare-release-pr.ts +++ b/eng/prepare-release-pr.ts @@ -1,3 +1,5 @@ +import { execSync } from "child_process"; + /* eslint-disable no-console */ // @ts-check import { context, getOctokit } from "@actions/github"; @@ -6,7 +8,6 @@ import { renderReleasePlanAsMarkdown, resolveCurrentReleasePlan, } from "@chronus/chronus"; -import { execSync } from "child_process"; const branchName = "publish/auto-release"; const plan = await resolveCurrentReleasePlan(NodeChronusHost, process.cwd()); diff --git a/eng/sync-publish-config.ts b/eng/sync-publish-config.ts index b370bfbd1..519e99b1e 100644 --- a/eng/sync-publish-config.ts +++ b/eng/sync-publish-config.ts @@ -12,7 +12,9 @@ // node eng/sync-publish-config.ts --check # exit non-zero if anything is stale /* eslint-disable no-console */ import { existsSync, readdirSync, readFileSync, writeFileSync } from "fs"; + import { join } from "pathe"; + import { repoRoot } from "./utils/constants.ts"; type Json = string | number | boolean | null | Json[] | { [key: string]: Json }; @@ -130,8 +132,8 @@ if (check && stale.length > 0) { if (!check) { console.log( - stale.length === 0 ? - "publishConfig already in sync." - : `Synced publishConfig for ${stale.length} package(s).`, + stale.length === 0 + ? "publishConfig already in sync." + : `Synced publishConfig for ${stale.length} package(s).`, ); } diff --git a/eslint.config.js b/eslint.config.js deleted file mode 100644 index 891003677..000000000 --- a/eslint.config.js +++ /dev/null @@ -1,83 +0,0 @@ -// @ts-check -import eslint from "@eslint/js"; -import vitest from "@vitest/eslint-plugin"; -import { dirname } from "path"; -import tsEslint from "typescript-eslint"; -import { fileURLToPath } from "url"; - -export default tsEslint.config( - { - ignores: [ - "**/*.d.ts", - "**/dist/**/*", - "**/.temp/**/*", - "eslint.config.js", - "packages/*/vitest.config.ts", - "packages/*/babel.config.cjs", - "packages/babel-plugin-jsx-dom-expressions/**/*", - "packages/babel-plugin-alloy/**/*", - "packages/babel-preset-alloy/**/*", - "packages/devtools/**/*", - "packages/docs/**/*", - "samples/**/*", // for some reason eslint is unhappy with some files in here - "**/scripts/**/*", - "**/cmd/**/*", - ], - }, - eslint.configs.recommended, - ...tsEslint.configs.recommended, - { - languageOptions: { - parserOptions: { - projectService: { - allowDefaultProject: [], - defaultProject: "./tsconfig.json", - }, - tsconfigRootDir: dirname(fileURLToPath(import.meta.url)), - }, - }, - rules: { - "no-console": "warn", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-empty-object-type": "off", - "@typescript-eslint/no-unused-vars": [ - "warn", - { - varsIgnorePattern: "^_", - argsIgnorePattern: ".*", - caughtErrorsIgnorePattern: ".*", - ignoreRestSiblings: true, - }, - ], - "prefer-const": "warn", - "@typescript-eslint/no-floating-promises": "warn", - eqeqeq: ["warn", "always", { null: "ignore" }], - }, - }, - { - /** - * CLI packages — console.log is the primary output mechanism. - */ - files: ["packages/trace-cli/**/*.ts"], - rules: { - "no-console": "off", - }, - }, - { - /** - * Test files specific rules - */ - files: ["**/*.test.ts"], - plugins: { vitest }, - rules: { - "vitest/no-focused-tests": "warn", - "vitest/no-identical-title": "error", - "vitest/no-commented-out-tests": "warn", - "vitest/no-import-node-test": "warn", - "vitest/require-local-test-context-for-concurrent-snapshots": "warn", - "vitest/valid-describe-callback": "warn", - "vitest/valid-expect": "warn", - "@typescript-eslint/no-non-null-asserted-optional-chain": "off", - }, - }, -); diff --git a/package.json b/package.json index bb9140238..4ee122f90 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,10 @@ "test": "vitest run", "sync-publish-config": "node eng/sync-publish-config.ts", "sync-publish-config:check": "node eng/sync-publish-config.ts --check", - "format": "prettier . --write", - "format:check": "prettier . --check", - "lint": "eslint . --max-warnings=0", - "lint:fix": "eslint --fix ." + "format": "oxfmt", + "format:check": "oxfmt --check", + "lint": "oxlint --type-aware --disable-nested-config --max-warnings=0", + "lint:fix": "oxlint --type-aware --disable-nested-config --fix" }, "devDependencies": { "@actions/github": "^9.1.1", @@ -27,18 +27,16 @@ "@chronus/chronus": "^1.1.0", "@chronus/github": "^1.0.3", "@chronus/github-pr-commenter": "^1.0.3", - "@eslint/js": "catalog:", - "@vitest/eslint-plugin": "catalog:", + "@types/node": "catalog:", "concurrently": "catalog:", - "eslint": "catalog:", "execa": "^9.6.0", + "oxfmt": "catalog:", + "oxlint": "catalog:", + "oxlint-tsgolint": "catalog:", "pathe": "^2.0.3", - "prettier": "catalog:", - "prettier-plugin-organize-imports": "catalog:", "rimraf": "catalog:", "tsx": "^4.20.3", "typedoc": "^0.28.8", - "typescript-eslint": "catalog:", "vitest": "catalog:" } } diff --git a/packages/babel-plugin-alloy/src/index.ts b/packages/babel-plugin-alloy/src/index.ts index b7e8c7295..8ac473c7b 100644 --- a/packages/babel-plugin-alloy/src/index.ts +++ b/packages/babel-plugin-alloy/src/index.ts @@ -3,6 +3,7 @@ import PrinterMod from "@babel/generator/lib/printer.js"; import SyntaxJSX from "@babel/plugin-syntax-jsx"; import { NodePath } from "@babel/traverse"; import * as t from "@babel/types"; + import { transformJSX } from "./transform.js"; // when vite runs, PrinterMod is printer, otherwise PrinterMod.default is. // esm is so much fun. diff --git a/packages/babel-plugin-alloy/test/basic.test.ts b/packages/babel-plugin-alloy/test/basic.test.ts index 11c450056..ddc0b971f 100644 --- a/packages/babel-plugin-alloy/test/basic.test.ts +++ b/packages/babel-plugin-alloy/test/basic.test.ts @@ -1,6 +1,8 @@ -import { pluginTester } from "babel-plugin-tester"; import { join } from "node:path"; + +import { pluginTester } from "babel-plugin-tester"; import "vitest"; + import plugin from "../src/index.js"; pluginTester({ diff --git a/packages/babel-plugin-alloy/test/memo-naming.test.ts b/packages/babel-plugin-alloy/test/memo-naming.test.ts index 845044873..566d92406 100644 --- a/packages/babel-plugin-alloy/test/memo-naming.test.ts +++ b/packages/babel-plugin-alloy/test/memo-naming.test.ts @@ -1,5 +1,6 @@ -import { transformSync } from "@babel/core"; import { join } from "node:path"; + +import { transformSync } from "@babel/core"; import { describe, expect, it } from "vitest"; const pluginPath = join( diff --git a/packages/cli/src/babel.ts b/packages/cli/src/babel.ts index bde986868..b2dcc93eb 100644 --- a/packages/cli/src/babel.ts +++ b/packages/cli/src/babel.ts @@ -1,11 +1,12 @@ -import * as babel from "@babel/core"; +import { mkdir, writeFile } from "node:fs/promises"; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error -import typescriptPreset from "@babel/preset-typescript"; +import alloyPreset from "@alloy-js/babel-preset"; +import * as babel from "@babel/core"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error -import alloyPreset from "@alloy-js/babel-preset"; -import { mkdir, writeFile } from "node:fs/promises"; +import typescriptPreset from "@babel/preset-typescript"; import { basename, dirname, join, relative } from "pathe"; export interface BuildOptions { diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index f212fadc6..82af08b6c 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -1,4 +1,5 @@ import pc from "picocolors"; + import { buildCommand } from "./commands/build.js"; import { installAgentsCommand } from "./commands/install-agents.js"; import { installDocsCommand } from "./commands/install-docs.js"; diff --git a/packages/cli/src/commands/build.ts b/packages/cli/src/commands/build.ts index 6ad4c66f4..b21ecefd5 100644 --- a/packages/cli/src/commands/build.ts +++ b/packages/cli/src/commands/build.ts @@ -1,7 +1,9 @@ import { parseArgs } from "node:util"; + import { join } from "pathe"; import pc from "picocolors"; import ts from "typescript"; + import { buildAllFiles } from "../babel.js"; import { getParseCommandLine } from "../typescript.js"; diff --git a/packages/cli/src/commands/install-agents.ts b/packages/cli/src/commands/install-agents.ts index 7326fe899..3f5eaea08 100644 --- a/packages/cli/src/commands/install-agents.ts +++ b/packages/cli/src/commands/install-agents.ts @@ -5,8 +5,10 @@ import { readFileSync, readdirSync, } from "node:fs"; + import { join, resolve } from "pathe"; import pc from "picocolors"; + import { collectAlloySearchDirs, findGitRoot, diff --git a/packages/cli/src/commands/install-docs.ts b/packages/cli/src/commands/install-docs.ts index 73fb366a3..0955397e6 100644 --- a/packages/cli/src/commands/install-docs.ts +++ b/packages/cli/src/commands/install-docs.ts @@ -1,7 +1,9 @@ import { existsSync, readFileSync, readdirSync, writeFileSync } from "node:fs"; import { parseArgs } from "node:util"; + import { join, relative, resolve } from "pathe"; import pc from "picocolors"; + import { collectAlloySearchDirs, findGitRoot, @@ -56,9 +58,8 @@ export async function installDocsCommand() { } // Determine where AGENTS.md should go - const outputDir = - args.values.output ? - resolve(String(args.values.output)) + const outputDir = args.values.output + ? resolve(String(args.values.output)) : (findGitRoot(cwd) ?? projectRoot); const packages = discoverAlloyPackages(cwd, outputDir); diff --git a/packages/cli/src/workspace.ts b/packages/cli/src/workspace.ts index 9f2679e7f..9d453982e 100644 --- a/packages/cli/src/workspace.ts +++ b/packages/cli/src/workspace.ts @@ -1,4 +1,5 @@ import { existsSync, readFileSync, readdirSync } from "node:fs"; + import { join, resolve } from "pathe"; /** diff --git a/packages/cli/test/build.test.ts b/packages/cli/test/build.test.ts index 3f685d5dc..832fa3c65 100644 --- a/packages/cli/test/build.test.ts +++ b/packages/cli/test/build.test.ts @@ -1,5 +1,6 @@ -import { execa } from "execa"; import { join } from "node:path"; + +import { execa } from "execa"; import { expect, it } from "vitest"; const cliPath = join(import.meta.dirname, "..", "cmd", "alloy.js"); diff --git a/packages/cli/test/install-docs.test.ts b/packages/cli/test/install-docs.test.ts index 1c1947290..b0d607492 100644 --- a/packages/cli/test/install-docs.test.ts +++ b/packages/cli/test/install-docs.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { generateDocsSection } from "../src/commands/install-docs.js"; const samplePackages = [ diff --git a/packages/core/src/binder.ts b/packages/core/src/binder.ts index 1eaf93cc8..cc8dce027 100644 --- a/packages/core/src/binder.ts +++ b/packages/core/src/binder.ts @@ -1,4 +1,5 @@ import { computed, Ref, ShallowRef, shallowRef } from "@vue/reactivity"; + import { useBinder } from "./context/binder.js"; import { useMemberContext } from "./context/member-scope.js"; import { useScope } from "./context/scope.js"; @@ -376,9 +377,9 @@ export function createOutputBinder(options: BinderOptions = {}): Binder { scopeAndMemberChain(targetDeclarationBase); let targetLexicalDeclaration = - targetMemberPath && targetMemberPath.length > 0 ? - (targetMemberPath[0].ownerSymbol! as TSymbol) - : targetDeclarationBase; + targetMemberPath && targetMemberPath.length > 0 + ? (targetMemberPath[0].ownerSymbol! as TSymbol) + : targetDeclarationBase; // when we are resolving from a scope which is a member scope and might have // member scope parents, and any symbols in the member path are members of // the member scope's owner symbol (i.e., those symbols are in scope where diff --git a/packages/core/src/code.ts b/packages/core/src/code.ts index b8ea63f16..38c1e77f4 100644 --- a/packages/core/src/code.ts +++ b/packages/core/src/code.ts @@ -102,9 +102,8 @@ export function code( function popIndent(child?: ChildToken) { // indentation level decreased (can decrease by many) - const times = - child ? - indentNodes.length - child.indentationLevel - 1 + const times = child + ? indentNodes.length - child.indentationLevel - 1 : indentNodes.length - 1; for (let i = 0; i < times; i++) { flushLines(); diff --git a/packages/core/src/components/AccessExpression.test.tsx b/packages/core/src/components/AccessExpression.test.tsx index 7d29f2749..80a75877a 100644 --- a/packages/core/src/components/AccessExpression.test.tsx +++ b/packages/core/src/components/AccessExpression.test.tsx @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { BasePartProps, createAccessExpression, diff --git a/packages/core/src/components/AccessExpression.tsx b/packages/core/src/components/AccessExpression.tsx index cbc4f84ef..0a6f239f2 100644 --- a/packages/core/src/components/AccessExpression.tsx +++ b/packages/core/src/components/AccessExpression.tsx @@ -135,8 +135,8 @@ export function createAccessExpression< }); return () => { - return isCallChain.value ? - formatCallChain(config, parts) + return isCallChain.value + ? formatCallChain(config, parts) : formatLinear(config, parts); }; } @@ -326,7 +326,9 @@ function formatCallChain( } expression.push( - ci === 0 ? chunkExpr : ( + ci === 0 ? ( + chunkExpr + ) : ( <> {chunkExpr} diff --git a/packages/core/src/components/AppendFile.tsx b/packages/core/src/components/AppendFile.tsx index 951b89780..69c40fc0b 100644 --- a/packages/core/src/components/AppendFile.tsx +++ b/packages/core/src/components/AppendFile.tsx @@ -1,5 +1,6 @@ import { computed } from "@vue/reactivity"; import { join } from "pathe"; + import { useContext } from "../context.js"; import { SourceDirectoryContext } from "../context/source-directory.js"; import { emitDiagnostic } from "../diagnostics.js"; diff --git a/packages/core/src/components/CopyFile.tsx b/packages/core/src/components/CopyFile.tsx index 31a2f49c5..43687bede 100644 --- a/packages/core/src/components/CopyFile.tsx +++ b/packages/core/src/components/CopyFile.tsx @@ -1,4 +1,5 @@ import { join } from "pathe"; + import { useContext } from "../context.js"; import { SourceDirectoryContext } from "../context/source-directory.js"; import { CopyFileContext } from "../context/source-file.js"; diff --git a/packages/core/src/components/For.tsx b/packages/core/src/components/For.tsx index 35840bd90..2300b38ff 100644 --- a/packages/core/src/components/For.tsx +++ b/packages/core/src/components/For.tsx @@ -1,17 +1,23 @@ import { isRef, Ref } from "@vue/reactivity"; + import { memo } from "../reactivity.js"; import type { Children } from "../runtime/component.js"; import { baseListPropsToMapJoinArgs, mapJoin } from "../utils.js"; import { BaseListProps } from "./List.jsx"; -export type ForCallbackArgs = - number extends keyof T ? [value: T[number]] - : T extends Ref ? ForCallbackArgs - : T extends () => infer U ? ForCallbackArgs - : T extends Map ? [key: U, value: V] - : T extends Set ? [value: U] - : T extends IterableIterator ? [value: U] - : []; +export type ForCallbackArgs = number extends keyof T + ? [value: T[number]] + : T extends Ref + ? ForCallbackArgs + : T extends () => infer U + ? ForCallbackArgs + : T extends Map + ? [key: U, value: V] + : T extends Set + ? [value: U] + : T extends IterableIterator + ? [value: U] + : []; export interface ForProps< T extends @@ -85,9 +91,9 @@ export function For< const maybeRef = props.each; return (mapJoin as any)( - typeof maybeRef === "function" ? maybeRef : ( - () => (isRef(maybeRef) ? maybeRef.value : maybeRef) - ), + typeof maybeRef === "function" + ? maybeRef + : () => (isRef(maybeRef) ? maybeRef.value : maybeRef), cb, options, ); diff --git a/packages/core/src/components/Indent.tsx b/packages/core/src/components/Indent.tsx index 834d0e5c4..d912a21bd 100644 --- a/packages/core/src/components/Indent.tsx +++ b/packages/core/src/components/Indent.tsx @@ -1,4 +1,5 @@ import { computed } from "@vue/reactivity"; + import type { Children } from "../runtime/component.js"; export interface IndentProps { @@ -42,11 +43,17 @@ export interface IndentProps { */ export function Indent(props: IndentProps) { const breakElem = computed(() => - props.nobreak ? "" - : props.hardline ? - : props.softline ? - : props.line ?
- : , + props.nobreak ? ( + "" + ) : props.hardline ? ( + + ) : props.softline ? ( + + ) : props.line ? ( +
+ ) : ( + + ), ); return ( diff --git a/packages/core/src/components/MemberDeclaration.tsx b/packages/core/src/components/MemberDeclaration.tsx index 21a4cf353..cd67eaeda 100644 --- a/packages/core/src/components/MemberDeclaration.tsx +++ b/packages/core/src/components/MemberDeclaration.tsx @@ -94,9 +94,8 @@ export function MemberDeclaration(props: MemberDeclarationProps) { `MemberDeclaration component cannot create a symbol in a non-basic scope: ${scopeContext.ownerSymbol}`, ); } - const space = - infoProps.static ? - scopeContext.ownerSymbol.staticMembers + const space = infoProps.static + ? scopeContext.ownerSymbol.staticMembers : scopeContext.ownerSymbol.instanceMembers; declaration = new BasicSymbol(infoProps.name, space, { refkeys: infoProps.refkey, diff --git a/packages/core/src/components/MemberScope.tsx b/packages/core/src/components/MemberScope.tsx index 61a424e70..d65660343 100644 --- a/packages/core/src/components/MemberScope.tsx +++ b/packages/core/src/components/MemberScope.tsx @@ -1,5 +1,4 @@ import { MemberContext } from "../context/member-scope.js"; - // eslint-disable-next-line @typescript-eslint/no-unused-vars import { ScopeContext } from "../context/scope.js"; import type { Children } from "../runtime/component.js"; diff --git a/packages/core/src/components/Output.tsx b/packages/core/src/components/Output.tsx index ad9abcec2..f9d926d37 100644 --- a/packages/core/src/components/Output.tsx +++ b/packages/core/src/components/Output.tsx @@ -11,7 +11,6 @@ import { NamePolicy } from "../name-policy.js"; import { PrintTreeOptions } from "../output-types.js"; import type { Children } from "../runtime/component.js"; import { SourceDirectory } from "./SourceDirectory.js"; - // eslint-disable-next-line @typescript-eslint/no-unused-vars import { SourceFile } from "./SourceFile.js"; @@ -73,11 +72,13 @@ export function Output(props: OutputProps) { insertFinalNewLine: props.insertFinalNewLine, }} > - {props.namePolicy ? + {props.namePolicy ? ( {dir} - : dir} + ) : ( + dir + )} ); diff --git a/packages/core/src/components/Prose.tsx b/packages/core/src/components/Prose.tsx index 68cf110a8..06901a068 100644 --- a/packages/core/src/components/Prose.tsx +++ b/packages/core/src/components/Prose.tsx @@ -1,4 +1,5 @@ import { computed } from "@vue/reactivity"; + import type { Children } from "../runtime/component.js"; import { childrenArray } from "../utils.jsx"; diff --git a/packages/core/src/components/ReferenceOrContent.tsx b/packages/core/src/components/ReferenceOrContent.tsx index e39ea6df0..1e3030d59 100644 --- a/packages/core/src/components/ReferenceOrContent.tsx +++ b/packages/core/src/components/ReferenceOrContent.tsx @@ -1,4 +1,5 @@ import { computed } from "@vue/reactivity"; + import { useContext } from "../context.js"; import { BinderContext } from "../context/binder.js"; import type { Refkey } from "../refkey.js"; diff --git a/packages/core/src/components/SourceDirectory.tsx b/packages/core/src/components/SourceDirectory.tsx index 7e530cc12..df4db423c 100644 --- a/packages/core/src/components/SourceDirectory.tsx +++ b/packages/core/src/components/SourceDirectory.tsx @@ -1,4 +1,5 @@ import { join } from "pathe"; + import { useContext } from "../context.js"; import { SourceDirectoryContext } from "../context/source-directory.js"; import { getContext, shallowReactive } from "../reactivity.js"; diff --git a/packages/core/src/components/SourceFile.tsx b/packages/core/src/components/SourceFile.tsx index 84f6c5d8c..4c65204ad 100644 --- a/packages/core/src/components/SourceFile.tsx +++ b/packages/core/src/components/SourceFile.tsx @@ -1,4 +1,5 @@ import { join } from "pathe"; + import { useContext } from "../context.js"; import { useFormatOptions } from "../context/format-options.js"; import { SourceDirectoryContext } from "../context/source-directory.js"; diff --git a/packages/core/src/components/TemplateFile.tsx b/packages/core/src/components/TemplateFile.tsx index 58c554945..434ecdc9c 100644 --- a/packages/core/src/components/TemplateFile.tsx +++ b/packages/core/src/components/TemplateFile.tsx @@ -1,4 +1,5 @@ import { computed } from "@vue/reactivity"; + import { emitDiagnostic } from "../diagnostics.js"; import { createFileResource } from "../resource.js"; import { Children, isComponentCreator } from "../runtime/component.js"; diff --git a/packages/core/src/components/UpdateFile.tsx b/packages/core/src/components/UpdateFile.tsx index c9025c2e6..837b3d4e2 100644 --- a/packages/core/src/components/UpdateFile.tsx +++ b/packages/core/src/components/UpdateFile.tsx @@ -1,5 +1,6 @@ import { computed } from "@vue/reactivity"; import { join } from "pathe"; + import { useContext } from "../context.js"; import { SourceDirectoryContext } from "../context/source-directory.js"; import { createFileResource } from "../resource.js"; diff --git a/packages/core/src/components/Wrap.tsx b/packages/core/src/components/Wrap.tsx index 099fb7e6a..f97912f33 100644 --- a/packages/core/src/components/Wrap.tsx +++ b/packages/core/src/components/Wrap.tsx @@ -23,7 +23,9 @@ export interface WrapProps { */ export function Wrap(props: WrapProps) { const Wrapper = props.with as any; - return props.when ? - {props.children} - : props.children; + return props.when ? ( + {props.children} + ) : ( + props.children + ); } diff --git a/packages/core/src/content-slot.test.tsx b/packages/core/src/content-slot.test.tsx index 9698e6cd8..8e04bc04a 100644 --- a/packages/core/src/content-slot.test.tsx +++ b/packages/core/src/content-slot.test.tsx @@ -1,5 +1,6 @@ import { ref } from "@vue/reactivity"; import { expect, it } from "vitest"; + import { Show } from "./components/Show.jsx"; import { createContentSlot } from "./content-slot.jsx"; diff --git a/packages/core/src/content-slot.tsx b/packages/core/src/content-slot.tsx index f57ccf06b..7c0ca52c3 100644 --- a/packages/core/src/content-slot.tsx +++ b/packages/core/src/content-slot.tsx @@ -1,4 +1,5 @@ import { computed, Ref, shallowRef } from "@vue/reactivity"; + import { Show } from "./components/Show.jsx"; import { ensureIsEmpty, getContext } from "./reactivity.js"; import { Children, Component } from "./runtime/component.js"; diff --git a/packages/core/src/context.ts b/packages/core/src/context.ts index 0053ee5f6..849340066 100644 --- a/packages/core/src/context.ts +++ b/packages/core/src/context.ts @@ -1,4 +1,5 @@ import { shallowRef } from "@vue/reactivity"; + import { effect, getContext } from "./reactivity.js"; import type { Children, ComponentDefinition } from "./runtime/component.js"; import type { StcSignature } from "./stc.js"; diff --git a/packages/core/src/context/binder.ts b/packages/core/src/context/binder.ts index 2e8ab67dd..b47ada387 100644 --- a/packages/core/src/context/binder.ts +++ b/packages/core/src/context/binder.ts @@ -1,11 +1,11 @@ import type { Binder } from "../binder.js"; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import type { Output } from "../components/Output.js"; import { type ComponentContext, createNamedContext, useContext, } from "../context.js"; -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import type { Output } from "../components/Output.js"; /** * The binder context provides the binder instance to all components. This diff --git a/packages/core/src/debug/cli.ts b/packages/core/src/debug/cli.ts index c9d042c67..b59b84eaa 100644 --- a/packages/core/src/debug/cli.ts +++ b/packages/core/src/debug/cli.ts @@ -1,5 +1,6 @@ import Table from "cli-table3"; import pc from "picocolors"; + import { contextsByKey } from "../context.js"; import { stdoutWrite } from "../host/node-host.js"; import { getContext, untrack } from "../reactivity.js"; @@ -153,16 +154,16 @@ export function debugStack() { table.push([ { hAlign: "right", content: "props" }, - props && Object.keys(props).length > 0 ? - dumpValue(props) - : pc.gray("(none)"), + props && Object.keys(props).length > 0 + ? dumpValue(props) + : pc.gray("(none)"), ]); table.push([ { hAlign: "right", content: "contexts" }, - foundContexts.length > 0 ? - foundContexts.map((c) => printContext(c, true)).join("\n") - : pc.gray("(none)"), + foundContexts.length > 0 + ? foundContexts.map((c) => printContext(c, true)).join("\n") + : pc.gray("(none)"), ]); stdoutWrite(table.toString() + "\n\n"); diff --git a/packages/core/src/debug/diagnostics-broadcast.test.tsx b/packages/core/src/debug/diagnostics-broadcast.test.tsx index cc3f8bb66..68d3bff5d 100644 --- a/packages/core/src/debug/diagnostics-broadcast.test.tsx +++ b/packages/core/src/debug/diagnostics-broadcast.test.tsx @@ -1,7 +1,9 @@ import { mkdtempSync, rmSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; + import { afterEach, beforeEach, expect, it } from "vitest"; + import { DiagnosticsCollector } from "../diagnostics.js"; import { closeTrace, initTrace, setChangeListener } from "./trace-writer.js"; diff --git a/packages/core/src/debug/diagnostics.test.tsx b/packages/core/src/debug/diagnostics.test.tsx index 198eb0e9b..f7efab3e6 100644 --- a/packages/core/src/debug/diagnostics.test.tsx +++ b/packages/core/src/debug/diagnostics.test.tsx @@ -1,5 +1,6 @@ import { afterEach, beforeEach, expect, it } from "vitest"; import WebSocket from "ws"; + import { createMessageCollector, type DevtoolsMessage, diff --git a/packages/core/src/debug/effects.test.tsx b/packages/core/src/debug/effects.test.tsx index c542d0cd7..60b7951f0 100644 --- a/packages/core/src/debug/effects.test.tsx +++ b/packages/core/src/debug/effects.test.tsx @@ -1,6 +1,7 @@ import { shallowReactive } from "@vue/reactivity"; import { afterEach, beforeEach, describe, expect, it } from "vitest"; import WebSocket from "ws"; + import { createMessageCollector, filterEffectsMessages, diff --git a/packages/core/src/debug/effects.ts b/packages/core/src/debug/effects.ts index 3feccf222..03d05aa7e 100644 --- a/packages/core/src/debug/effects.ts +++ b/packages/core/src/debug/effects.ts @@ -1,4 +1,5 @@ import { isReactive, isRef } from "@vue/reactivity"; + import { formatReactivePropertyLabel, getReactiveCreationLocation, diff --git a/packages/core/src/debug/files.test.tsx b/packages/core/src/debug/files.test.tsx index afb17f289..ff4da153d 100644 --- a/packages/core/src/debug/files.test.tsx +++ b/packages/core/src/debug/files.test.tsx @@ -1,5 +1,6 @@ import { afterEach, beforeEach, expect, it } from "vitest"; import WebSocket from "ws"; + import { createMessageCollector, type DevtoolsMessage, diff --git a/packages/core/src/debug/message-format.test.tsx b/packages/core/src/debug/message-format.test.tsx index a56292364..30f5f4702 100644 --- a/packages/core/src/debug/message-format.test.tsx +++ b/packages/core/src/debug/message-format.test.tsx @@ -8,6 +8,7 @@ */ import { afterEach, beforeEach, describe, expect, it } from "vitest"; import WebSocket from "ws"; + import { createMessageCollector, type DevtoolsMessage, diff --git a/packages/core/src/debug/render-tree-orphans.test.tsx b/packages/core/src/debug/render-tree-orphans.test.tsx index deecc4a7f..82cb08b72 100644 --- a/packages/core/src/debug/render-tree-orphans.test.tsx +++ b/packages/core/src/debug/render-tree-orphans.test.tsx @@ -1,5 +1,6 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest"; import WebSocket from "ws"; + import { createMessageCollector, filterRenderTreeMessages, diff --git a/packages/core/src/debug/render.test.tsx b/packages/core/src/debug/render.test.tsx index 6005b566e..7acbe0155 100644 --- a/packages/core/src/debug/render.test.tsx +++ b/packages/core/src/debug/render.test.tsx @@ -1,6 +1,7 @@ import * as devalue from "devalue"; import { afterEach, beforeEach, expect, it } from "vitest"; import WebSocket from "ws"; + import { createMessageCollector, filterRenderTreeMessages, diff --git a/packages/core/src/debug/render.ts b/packages/core/src/debug/render.ts index f9efe10b8..9e7aea0d6 100644 --- a/packages/core/src/debug/render.ts +++ b/packages/core/src/debug/render.ts @@ -47,6 +47,7 @@ import { watch } from "@vue/reactivity"; import * as devalue from "devalue"; + import type { RenderErrorStackEntry as ProtocolRenderErrorStackEntry, RenderTreeNode, diff --git a/packages/core/src/debug/serialize.ts b/packages/core/src/debug/serialize.ts index a15b3215e..d493ce3d2 100644 --- a/packages/core/src/debug/serialize.ts +++ b/packages/core/src/debug/serialize.ts @@ -6,6 +6,7 @@ * references, and non-plain objects. */ import { isReactive, isRef } from "@vue/reactivity"; + import { untrack } from "../reactivity.js"; const MAX_ENTRIES = 50; diff --git a/packages/core/src/debug/symbols.test.tsx b/packages/core/src/debug/symbols.test.tsx index 88bd1eff0..d11cbad7c 100644 --- a/packages/core/src/debug/symbols.test.tsx +++ b/packages/core/src/debug/symbols.test.tsx @@ -1,5 +1,6 @@ import { afterEach, beforeEach, expect, it } from "vitest"; import WebSocket from "ws"; + import { createMessageCollector } from "../../testing/devtools-utils.js"; import { createOutputBinder, createScope, createSymbol } from "../binder.js"; import { diff --git a/packages/core/src/debug/symbols.ts b/packages/core/src/debug/symbols.ts index 4cf76cfb9..976778510 100644 --- a/packages/core/src/debug/symbols.ts +++ b/packages/core/src/debug/symbols.ts @@ -1,4 +1,5 @@ import { watch } from "@vue/reactivity"; + import { getContext, untrack } from "../reactivity.js"; import type { OutputScope } from "../symbols/output-scope.js"; import type { OutputSymbol } from "../symbols/output-symbol.js"; diff --git a/packages/core/src/debug/trace-writer.ts b/packages/core/src/debug/trace-writer.ts index c4decfb62..4e7d23ca8 100644 --- a/packages/core/src/debug/trace-writer.ts +++ b/packages/core/src/debug/trace-writer.ts @@ -6,6 +6,7 @@ * `alloy-trace` CLI or the devtools WebSocket server. */ import type { StatementSync } from "node:sqlite"; + import { type DatabaseSync, openTraceDatabase } from "./trace-db.js"; let db: DatabaseSync | null = null; diff --git a/packages/core/src/devtools/devtools-transport.ts b/packages/core/src/devtools/devtools-transport.ts index 26f2a9561..2a18bced0 100644 --- a/packages/core/src/devtools/devtools-transport.ts +++ b/packages/core/src/devtools/devtools-transport.ts @@ -100,9 +100,9 @@ export async function createTransport( const address = httpServer.address(); const actualPort = - typeof address === "object" && address !== null ? - address.port - : options.port; + typeof address === "object" && address !== null + ? address.port + : options.port; let resolveReady: (() => void) | undefined; const ready = new Promise((resolve) => { diff --git a/packages/core/src/diagnostics.ts b/packages/core/src/diagnostics.ts index 9ea06c270..d6a3721dd 100644 --- a/packages/core/src/diagnostics.ts +++ b/packages/core/src/diagnostics.ts @@ -39,9 +39,8 @@ export interface DiagnosticHandle { function buildComponentStack(): DiagnosticStackEntry[] { return getRenderStackSnapshot().map((entry) => ({ name: entry.displayName, - renderNodeId: - entry.context?.meta?.renderNode ? - getRenderNodeId(entry.context.meta.renderNode) + renderNodeId: entry.context?.meta?.renderNode + ? getRenderNodeId(entry.context.meta.renderNode) : undefined, source: entry.source, })); @@ -79,9 +78,9 @@ export class DiagnosticsCollector { diagnostic.source?.fileName, diagnostic.source?.lineNumber, diagnostic.source?.columnNumber, - diagnostic.componentStack ? - JSON.stringify(diagnostic.componentStack) - : undefined, + diagnostic.componentStack + ? JSON.stringify(diagnostic.componentStack) + : undefined, ); if (rowId !== undefined) { this.traceRowIds.set(id, rowId); @@ -175,9 +174,8 @@ export function reportDiagnostics(collector: DiagnosticsCollector) { if (diagnostics.length === 0) return; for (const diagnostic of diagnostics) { - const location = - diagnostic.source ? - ` (${diagnostic.source.fileName}:${diagnostic.source.lineNumber}:${diagnostic.source.columnNumber})` + const location = diagnostic.source + ? ` (${diagnostic.source.fileName}:${diagnostic.source.lineNumber}:${diagnostic.source.columnNumber})` : ""; const line = `${diagnostic.message}${location}`; if (diagnostic.severity === "error") { diff --git a/packages/core/src/host/alloy-host.ts b/packages/core/src/host/alloy-host.ts index 589090f50..dc1783c57 100644 --- a/packages/core/src/host/alloy-host.ts +++ b/packages/core/src/host/alloy-host.ts @@ -1,5 +1,6 @@ import { createReadStream, createWriteStream } from "fs"; import { access, mkdir, readFile, writeFile } from "fs/promises"; + import { AlloyFileInterface, AlloyHostInterface } from "./interface.js"; export const AlloyHost: AlloyHostInterface = { diff --git a/packages/core/src/jsx-runtime.ts b/packages/core/src/jsx-runtime.ts index f71987f1b..bad8c7ae1 100644 --- a/packages/core/src/jsx-runtime.ts +++ b/packages/core/src/jsx-runtime.ts @@ -14,6 +14,7 @@ import type { ComponentDefinition, IntrinsicElements as CoreIntrinsicElements, } from "@alloy-js/core"; + import { createComponent } from "./runtime/component.js"; export type { Children } from "@alloy-js/core"; export { mergeProps } from "./props-combinators.js"; diff --git a/packages/core/src/pretty-string/pretty-string.test.ts b/packages/core/src/pretty-string/pretty-string.test.ts index 05a7a07bc..90ba7c3a3 100644 --- a/packages/core/src/pretty-string/pretty-string.test.ts +++ b/packages/core/src/pretty-string/pretty-string.test.ts @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { pret, PrettyString } from "./pretty-string.js"; function expectRender( diff --git a/packages/core/src/props-combinators.ts b/packages/core/src/props-combinators.ts index f4ad8a812..b696271c0 100644 --- a/packages/core/src/props-combinators.ts +++ b/packages/core/src/props-combinators.ts @@ -1,4 +1,5 @@ import { computed, isReactive, proxyRefs, toRefs } from "@vue/reactivity"; + import { untrack } from "./reactivity.js"; export function mergeProps(source: T, source1: U): T & U; @@ -41,9 +42,9 @@ export function mergeProps(...sources: any): any { export type SplitProps = [ ...{ - [P in keyof K]: P extends `${number}` ? - Pick[number]> - : never; + [P in keyof K]: P extends `${number}` + ? Pick[number]> + : never; }, { [P in keyof T as Exclude]: T[P] }, ]; diff --git a/packages/core/src/reactive-union-set.ts b/packages/core/src/reactive-union-set.ts index 47daf0e55..2eb68b6b4 100644 --- a/packages/core/src/reactive-union-set.ts +++ b/packages/core/src/reactive-union-set.ts @@ -7,6 +7,7 @@ import { trigger, TriggerOpTypes, } from "@vue/reactivity"; + import { effect, root, shallowReactive, untrack } from "./reactivity.js"; export interface ReactiveUnionSetOptions { diff --git a/packages/core/src/reactivity.ts b/packages/core/src/reactivity.ts index c3e559edc..c702be7b2 100644 --- a/packages/core/src/reactivity.ts +++ b/packages/core/src/reactivity.ts @@ -14,6 +14,7 @@ import { toRef as vueToRef, toRefs as vueToRefs, } from "@vue/reactivity"; + import { captureSourceLocation, debug, @@ -293,9 +294,8 @@ export function findCurrentEffectId(): number | undefined { */ export function memo(fn: () => T, equal?: boolean, name?: string): () => T { const dbg = isDebugEnabled(); - const o = - dbg ? - shallowRef(undefined as T, { label: name ? `memo:${name}` : "memo" }) + const o = dbg + ? shallowRef(undefined as T, { label: name ? `memo:${name}` : "memo" }) : shallowRef(undefined as T); effect( (prev) => { @@ -330,9 +330,8 @@ export function effect( }; const debugInfo = options?.debug; - const effectId = - isDebugEnabled() ? - debug.effect.register({ + const effectId = isDebugEnabled() + ? debug.effect.register({ name: debugInfo?.name ?? fn.name, type: debugInfo?.type, createdAt: captureSourceLocation(), @@ -415,9 +414,9 @@ export function effect( // during the mutation, so globalContext still points to the producer. const producerEffectId = findCurrentEffectId(); const causedBy = - producerEffectId !== undefined && producerEffectId !== effectId ? - producerEffectId - : undefined; + producerEffectId !== undefined && producerEffectId !== effectId + ? producerEffectId + : undefined; if (isRef(event.target)) { const id = refId(event.target); debug.effect.ensureRef({ id, kind: "ref" }); @@ -681,9 +680,9 @@ export function toRef( defaultValue?: T[K], ): Ref { const result = - defaultValue === undefined ? - (vueToRef(object, key) as Ref) - : (vueToRef(object, key, defaultValue as any) as Ref); + defaultValue === undefined + ? (vueToRef(object, key) as Ref) + : (vueToRef(object, key, defaultValue as any) as Ref); if (isDebugEnabled()) { debug.effect.registerRef({ id: refId(result), diff --git a/packages/core/src/refkey.ts b/packages/core/src/refkey.ts index 3172e919c..ed8b485e1 100644 --- a/packages/core/src/refkey.ts +++ b/packages/core/src/refkey.ts @@ -1,4 +1,5 @@ import { markRaw } from "@vue/reactivity"; + import { untrack } from "./reactivity.js"; const objectIds = new WeakMap(); @@ -220,12 +221,11 @@ export function memberRefkey( export function inspectRefkey(refkey: Refkey): string { const unwrapped = refkey[REFKEYABLE](); - const text = - isMemberRefkey(unwrapped) ? - `memberRefkey[${inspectRefkey(unwrapped.base)} -> ${ - typeof unwrapped.member === "string" ? - unwrapped.member - : inspectRefkey(unwrapped.member) + const text = isMemberRefkey(unwrapped) + ? `memberRefkey[${inspectRefkey(unwrapped.base)} -> ${ + typeof unwrapped.member === "string" + ? unwrapped.member + : inspectRefkey(unwrapped.member) }]` : `refkey[${unwrapped.key}]`; diff --git a/packages/core/src/render-stack.ts b/packages/core/src/render-stack.ts index a3d2c9327..11f8846f0 100644 --- a/packages/core/src/render-stack.ts +++ b/packages/core/src/render-stack.ts @@ -1,4 +1,5 @@ import pc from "picocolors"; + import { contextsByKey } from "./context.js"; import { SourceDirectoryContext } from "./context/source-directory.js"; import { SourceFileContext } from "./context/source-file.js"; @@ -246,8 +247,9 @@ export function printRenderStack(error?: unknown) { } const displayName = getComponentDisplayName(component, props); - const sourceStr = - source ? pc.gray(` (${formatSourceLocation(source)})`) : ""; + const sourceStr = source + ? pc.gray(` (${formatSourceLocation(source)})`) + : ""; // eslint-disable-next-line no-console console.error(` ${pc.cyan("at")} ${pc.bold(displayName)}${sourceStr}`); @@ -271,9 +273,8 @@ export function printRenderStack(error?: unknown) { providerEntry.component, providerEntry.props, ); - const providerSourceStr = - providerEntry.source ? - pc.gray(` (${formatSourceLocation(providerEntry.source)})`) + const providerSourceStr = providerEntry.source + ? pc.gray(` (${formatSourceLocation(providerEntry.source)})`) : ""; // eslint-disable-next-line no-console diff --git a/packages/core/src/render/node.ts b/packages/core/src/render/node.ts index 26225ed45..4ab99ec3e 100644 --- a/packages/core/src/render/node.ts +++ b/packages/core/src/render/node.ts @@ -291,9 +291,9 @@ function effectiveBreakCount(n: AlloyNode): number { if (nl < 0) { const s = t.data; nl = - s.length > 0 && (s.indexOf("\n") !== -1 || s.indexOf("\r") !== -1) ? - 1 - : 0; + s.length > 0 && (s.indexOf("\n") !== -1 || s.indexOf("\r") !== -1) + ? 1 + : 0; t._nl = nl; } return nl; diff --git a/packages/core/src/render/printer-support.ts b/packages/core/src/render/printer-support.ts index e20a5b05a..a70ce306a 100644 --- a/packages/core/src/render/printer-support.ts +++ b/packages/core/src/render/printer-support.ts @@ -37,9 +37,9 @@ export function textHasNewline(t: TextNode): boolean { if (nl < 0) { const s = t.data; nl = - s.length > 0 && (s.indexOf("\n") !== -1 || s.indexOf("\r") !== -1) ? - 1 - : 0; + s.length > 0 && (s.indexOf("\n") !== -1 || s.indexOf("\r") !== -1) + ? 1 + : 0; t._nl = nl; } return nl === 1; diff --git a/packages/core/src/render/printer.ts b/packages/core/src/render/printer.ts index 1befc9b4f..f0be61357 100644 --- a/packages/core/src/render/printer.ts +++ b/packages/core/src/render/printer.ts @@ -60,7 +60,8 @@ type SynthFrame = { [k in typeof SYNTH]: true; } & // Fill remaining state: re-print `node` but starting at `offset`. - (| { kind: "fill"; node: ElementNode; offset: number } + ( + | { kind: "fill"; node: ElementNode; offset: number } // Synthesize an inline list of nodes (used for fill's // [content, whitespace, secondContent] measurement and for // text-node newline expansion). Items are popped right-to-left. @@ -250,8 +251,9 @@ function fits( const data = el.data as | { flatNode?: ElementNode; flatText?: string; groupId?: symbol } | undefined; - const groupMode: Mode = - data?.groupId ? groupModeMap[data.groupId] || MODE_FLAT : mode; + const groupMode: Mode = data?.groupId + ? groupModeMap[data.groupId] || MODE_FLAT + : mode; if (groupMode === MODE_BREAK) { for (let c = el.lastChild; c !== null; c = c.previousSibling) { if (c.nodeType === COMMENT_NODE) continue; @@ -270,8 +272,9 @@ function fits( const data = el.data as | { groupId?: symbol; negate?: boolean } | undefined; - const groupMode: Mode = - data?.groupId ? groupModeMap[data.groupId] || MODE_FLAT : mode; + const groupMode: Mode = data?.groupId + ? groupModeMap[data.groupId] || MODE_FLAT + : mode; // For width measurement, indent vs no-indent doesn't matter (no // newlines emitted in the candidate group while measuring flat, // and on hardline we return true). Just descend. @@ -639,8 +642,9 @@ export function printNodeToString( const data = el.data as | { flatNode?: ElementNode; flatText?: string; groupId?: symbol } | undefined; - const groupMode: Mode | undefined = - data?.groupId ? groupModeMap[data.groupId] : mode; + const groupMode: Mode | undefined = data?.groupId + ? groupModeMap[data.groupId] + : mode; if (groupMode === MODE_BREAK) { // Push children (the breakContents). pushChildrenReversed(el, ind, mode); @@ -656,8 +660,9 @@ export function printNodeToString( function handleIndentIfBreak(el: ElementNode, ind: Indent, mode: Mode): void { const data = el.data as { groupId?: symbol; negate?: boolean } | undefined; - const groupMode: Mode | undefined = - data?.groupId ? groupModeMap[data.groupId] : mode; + const groupMode: Mode | undefined = data?.groupId + ? groupModeMap[data.groupId] + : mode; const negate = !!data?.negate; if (groupMode === MODE_BREAK) { if (negate) { diff --git a/packages/core/src/resource.ts b/packages/core/src/resource.ts index aaee4fc68..179c60352 100644 --- a/packages/core/src/resource.ts +++ b/packages/core/src/resource.ts @@ -1,4 +1,5 @@ import { isRef, reactive, Ref } from "@vue/reactivity"; + import { AlloyHost } from "./host/alloy-host.js"; import { effect } from "./reactivity.js"; import { trackPromise } from "./scheduler.js"; diff --git a/packages/core/src/runtime/component.ts b/packages/core/src/runtime/component.ts index 426e0fdca..d0038e738 100644 --- a/packages/core/src/runtime/component.ts +++ b/packages/core/src/runtime/component.ts @@ -1,4 +1,5 @@ import { Ref } from "@vue/reactivity"; + import { CustomContext } from "../reactivity.js"; import { Refkey, RefkeyableObject } from "../refkey.js"; import type { AlloyNode } from "../render/node.js"; diff --git a/packages/core/src/runtime/insert.ts b/packages/core/src/runtime/insert.ts index a72f4e5a9..534ed24d2 100644 --- a/packages/core/src/runtime/insert.ts +++ b/packages/core/src/runtime/insert.ts @@ -12,6 +12,7 @@ * rewrites the bracketed range on re-fire. */ import { isRef, type Ref } from "@vue/reactivity"; + import { useContext } from "../context.js"; import { SourceFileContext } from "../context/source-file.js"; import { debug, type RenderNodeActions } from "../debug/index.js"; @@ -262,10 +263,11 @@ function renderComponentBody( const d = meta.directory as { path: string }; session.recordDirectory(d.path); } - const localName = - meta.sourceFile ? "alloy:source-file" - : meta.directory ? "alloy:directory" - : "alloy:copy-file"; + const localName = meta.sourceFile + ? "alloy:source-file" + : meta.directory + ? "alloy:directory" + : "alloy:copy-file"; if (result instanceof ElementNode && result.localName === localName) { setContextForNode(result, ctx); insertNode(parent, result, marker); diff --git a/packages/core/src/scheduler.ts b/packages/core/src/scheduler.ts index 77675f2fe..114a64dc1 100644 --- a/packages/core/src/scheduler.ts +++ b/packages/core/src/scheduler.ts @@ -1,4 +1,5 @@ import { ReactiveEffect } from "@vue/reactivity"; + import { debug } from "./debug/index.js"; import { beginTransaction, diff --git a/packages/core/src/stc.ts b/packages/core/src/stc.ts index 485da3527..035d2f133 100644 --- a/packages/core/src/stc.ts +++ b/packages/core/src/stc.ts @@ -6,15 +6,18 @@ import { ComponentDefinition, } from "./runtime/component.js"; -export type MakeChildrenOptional = - T extends { children?: any } ? - Omit & Partial> +export type MakeChildrenOptional = T extends { + children?: any; +} + ? Omit & Partial> : T; export type StcSignature = ( - ...args: unknown extends T ? [] - : {} extends Omit ? [props?: MakeChildrenOptional] - : [props: MakeChildrenOptional] + ...args: unknown extends T + ? [] + : {} extends Omit + ? [props?: MakeChildrenOptional] + : [props: MakeChildrenOptional] ) => StcComponentCreator; export type StcComponentCreator = ComponentCreator & { diff --git a/packages/core/src/sti.ts b/packages/core/src/sti.ts index a5c193f0e..c20f38883 100644 --- a/packages/core/src/sti.ts +++ b/packages/core/src/sti.ts @@ -5,10 +5,11 @@ import { createIntrinsic } from "./runtime/create-intrinsic.js"; import { IntrinsicElements } from "./runtime/intrinsic.js"; export type StiSignature = ( - ...args: unknown extends T ? [] - : {} extends Omit ? - [props?: IntrinsicElements[T]] - : [props: IntrinsicElements[T]] + ...args: unknown extends T + ? [] + : {} extends Omit + ? [props?: IntrinsicElements[T]] + : [props: IntrinsicElements[T]] ) => StiComponentCreator; export type StiComponentCreator = (() => ElementNode) & { diff --git a/packages/core/src/symbols/decl.ts b/packages/core/src/symbols/decl.ts index 69a4b8518..d078e5ff0 100644 --- a/packages/core/src/symbols/decl.ts +++ b/packages/core/src/symbols/decl.ts @@ -1,4 +1,5 @@ import { toRef } from "@vue/reactivity"; + import { createSymbol } from "../binder.js"; import { useScope } from "../context/scope.js"; import { Namekey } from "../refkey.js"; diff --git a/packages/core/src/symbols/output-scope.ts b/packages/core/src/symbols/output-scope.ts index 572aeb66c..9b08e63f2 100644 --- a/packages/core/src/symbols/output-scope.ts +++ b/packages/core/src/symbols/output-scope.ts @@ -6,6 +6,7 @@ import { trigger, TriggerOpTypes, } from "@vue/reactivity"; + import type { Binder } from "../binder.js"; import { useBinder } from "../context/binder.js"; import { inspect } from "../inspect.js"; @@ -288,8 +289,9 @@ export abstract class OutputScope { } [inspect.custom]() { - const ownerSymbol = - this.ownerSymbol ? ` for ${inspect(this.ownerSymbol)}` : ""; + const ownerSymbol = this.ownerSymbol + ? ` for ${inspect(this.ownerSymbol)}` + : ""; return untrack( () => `${this.constructor.name} ${this.name}[${this.id}]${ownerSymbol}`, ); diff --git a/packages/core/src/symbols/output-symbol.ts b/packages/core/src/symbols/output-symbol.ts index 3edeaec97..5524d5a91 100644 --- a/packages/core/src/symbols/output-symbol.ts +++ b/packages/core/src/symbols/output-symbol.ts @@ -9,6 +9,7 @@ import { TriggerOpTypes, watch, } from "@vue/reactivity"; + import type { Binder } from "../binder.js"; import { useBinder } from "../context/binder.js"; import { debug, TracePhase } from "../debug/index.js"; @@ -206,9 +207,9 @@ export abstract class OutputSymbol { set name(name: string) { const policyApplied = - this.#namePolicy && !this.#ignoreNamePolicy ? - this.#namePolicy(name) - : name; + this.#namePolicy && !this.#ignoreNamePolicy + ? this.#namePolicy(name) + : name; if (this.#userName === policyApplied) { return; @@ -244,9 +245,9 @@ export abstract class OutputSymbol { set deconflictedName(value: string | undefined) { const policyApplied = - value !== undefined && this.#namePolicy && !this.#ignoreNamePolicy ? - this.#namePolicy(value) - : value; + value !== undefined && this.#namePolicy && !this.#ignoreNamePolicy + ? this.#namePolicy(value) + : value; if (this.#deconflictedName === policyApplied) { return; @@ -377,9 +378,7 @@ export abstract class OutputSymbol { } const spacesArray = - spaces === undefined ? [] - : Array.isArray(spaces) ? spaces - : [spaces]; + spaces === undefined ? [] : Array.isArray(spaces) ? spaces : [spaces]; this.#handleNewSpaces(spacesArray, old); this.#spaces = spacesArray; @@ -687,10 +686,11 @@ export abstract class OutputSymbol { } this.#id = symbolCount++; - this.#spaces = - Array.isArray(spaces) ? spaces - : spaces === undefined ? [] - : [spaces]; + this.#spaces = Array.isArray(spaces) + ? spaces + : spaces === undefined + ? [] + : [spaces]; this.#aliasTarget = options.aliasTarget; this.#metadata = reactive(options.metadata ?? {}); this.#isTransient = !!options.transient; @@ -852,9 +852,9 @@ function _formatRefkey(refkey: Refkey): string { if (isMemberRefkey(refkey)) { const base = _formatRefkey(toRefkey(refkey.base)); const member = - typeof refkey.member === "string" ? - refkey.member - : _formatRefkey(toRefkey(refkey.member)); + typeof refkey.member === "string" + ? refkey.member + : _formatRefkey(toRefkey(refkey.member)); return `member:${base}.${member}`; } if (isSymbolRefkey(refkey)) { diff --git a/packages/core/src/symbols/symbol-flow.ts b/packages/core/src/symbols/symbol-flow.ts index d876f5ade..8127fd4a0 100644 --- a/packages/core/src/symbols/symbol-flow.ts +++ b/packages/core/src/symbols/symbol-flow.ts @@ -1,4 +1,8 @@ import { isRef, Ref } from "@vue/reactivity"; + +import { MemberContext } from "../context/member-scope.js"; +import { ScopeContext } from "../context/scope.js"; +import { debug, TracePhase } from "../debug/index.js"; import { Context, effect, @@ -6,10 +10,6 @@ import { onCleanup, shallowReactive, } from "../reactivity.js"; - -import { MemberContext } from "../context/member-scope.js"; -import { ScopeContext } from "../context/scope.js"; -import { debug, TracePhase } from "../debug/index.js"; import { formatSymbolName } from "../tracer.js"; import { OutputSymbol } from "./output-symbol.js"; diff --git a/packages/core/src/symbols/symbol-slot.test.tsx b/packages/core/src/symbols/symbol-slot.test.tsx index f9a7cb62d..784c81128 100644 --- a/packages/core/src/symbols/symbol-slot.test.tsx +++ b/packages/core/src/symbols/symbol-slot.test.tsx @@ -1,5 +1,6 @@ import { shallowRef } from "@vue/reactivity"; import { expect, it } from "vitest"; + import { flushJobs } from "../scheduler.js"; import { getDiagnosticsForTree, renderTree } from "../test-render.js"; import { BasicSymbol } from "./basic-symbol.js"; diff --git a/packages/core/src/symbols/symbol-slot.tsx b/packages/core/src/symbols/symbol-slot.tsx index d9e0dad36..a6ad832a1 100644 --- a/packages/core/src/symbols/symbol-slot.tsx +++ b/packages/core/src/symbols/symbol-slot.tsx @@ -1,4 +1,5 @@ import { Ref, ShallowReactive, shallowRef } from "@vue/reactivity"; + import { emitDiagnostic } from "../diagnostics.js"; import { effect, onCleanup } from "../reactivity.js"; import type { Children, Component } from "../runtime/component.js"; diff --git a/packages/core/src/tap.ts b/packages/core/src/tap.ts index aa19491f0..f940e5825 100644 --- a/packages/core/src/tap.ts +++ b/packages/core/src/tap.ts @@ -1,4 +1,5 @@ import { ShallowRef, shallowRef } from "@vue/reactivity"; + import { useContext } from "./context.js"; import { DeclarationContext } from "./context/declaration.js"; import { MemberDeclarationContext } from "./context/member-declaration.js"; diff --git a/packages/core/src/tracer.ts b/packages/core/src/tracer.ts index bde7d6db8..4d3696dcb 100644 --- a/packages/core/src/tracer.ts +++ b/packages/core/src/tracer.ts @@ -1,4 +1,5 @@ import { effect } from "@vue/reactivity"; + import { debug, isConsoleTraceEnabled, @@ -128,9 +129,9 @@ export function formatScopeName(scope: OutputScope | undefined): string { export function formatSymbolTableName(table: SymbolTable): string { // avoid instance of checks here in order to not create circular module imports. const name = - "symbol" in table ? - formatSymbolName((table as OutputMemberSpace).symbol) - : formatScopeName((table as OutputDeclarationSpace).scope); + "symbol" in table + ? formatSymbolName((table as OutputMemberSpace).symbol) + : formatScopeName((table as OutputDeclarationSpace).scope); return colorText(`${name}:${table.key}`, { fg: { r: 0, diff --git a/packages/core/src/utils.tsx b/packages/core/src/utils.tsx index 4c20e7e1c..2208ed722 100644 --- a/packages/core/src/utils.tsx +++ b/packages/core/src/utils.tsx @@ -1,4 +1,5 @@ import { Ref, toRaw } from "@vue/reactivity"; + import { BaseListProps } from "./components/List.jsx"; import { OutputDirectory, OutputFile } from "./output-types.js"; import { @@ -282,8 +283,9 @@ export function mapJoin( const itemsSource = src(); // need to unpack reactives for branding checks const itemsSourceRaw = toRaw(itemsSource); - let items = - Array.isArray(itemsSourceRaw) ? (itemsSource as T[]) : [...itemsSource]; + let items = Array.isArray(itemsSourceRaw) + ? (itemsSource as T[]) + : [...itemsSource]; if (options.skipFalsy) { items = items.filter( @@ -402,19 +404,17 @@ export function mapJoin( // Chooses the equality function based on the collection type in use. function getCompareFunction(itemsSource: Map | T[] | Iterable) { - return Array.isArray(itemsSource) || isIterable(itemsSource) ? - compareArray + return Array.isArray(itemsSource) || isIterable(itemsSource) + ? compareArray : compareMap; } // Selects the mapper signature to match the collection type in use. function getMapperFunction(itemsSource: Map | T[] | Iterable) { - return ( - Array.isArray(itemsSource) || - itemsSource instanceof Set || - isIterable(itemsSource) - ) ? - mapArray + return Array.isArray(itemsSource) || + itemsSource instanceof Set || + isIterable(itemsSource) + ? mapArray : mapMap; } // Strict equality check for array-like collections. @@ -608,38 +608,39 @@ export function baseListPropsToMapJoinArgs(props: BaseListProps): JoinOptions { if ("joiner" in props) { joiner = props.joiner; } else { - punctuation = - props.comma ? "," - : props.semicolon ? ";" - : ""; + punctuation = props.comma ? "," : props.semicolon ? ";" : ""; joiner = ( <> {punctuation} - {props.softline ? + {props.softline ? ( - : props.hardline ? + ) : props.hardline ? ( - : props.literalline ? + ) : props.literalline ? ( - : props.line ? + ) : props.line ? (
- : props.space ? + ) : props.space ? ( <> - : props.doubleHardline ? + ) : props.doubleHardline ? ( <> - : } + ) : ( + + )} ); } const ender = - "ender" in props ? props.ender - : props.enderPunctuation ? punctuation - : undefined; + "ender" in props + ? props.ender + : props.enderPunctuation + ? punctuation + : undefined; return { joiner, ender }; } diff --git a/packages/core/src/write-output.ts b/packages/core/src/write-output.ts index 999b599f5..8a1e0594b 100644 --- a/packages/core/src/write-output.ts +++ b/packages/core/src/write-output.ts @@ -1,4 +1,5 @@ import { dirname, relative, resolve } from "pathe"; + import { AlloyHost } from "./host/alloy-host.js"; import { cwd } from "./host/node-host.js"; import { OutputDirectory } from "./output-types.js"; diff --git a/packages/core/test/babel-e2e.test.ts b/packages/core/test/babel-e2e.test.ts index 524f98e53..0856b4d8b 100644 --- a/packages/core/test/babel-e2e.test.ts +++ b/packages/core/test/babel-e2e.test.ts @@ -10,13 +10,14 @@ * intrinsics returning AlloyNodes eagerly). */ -// @ts-expect-error — @babel/core has no bundled types in this workspace -import { transformSync } from "@babel/core"; // @ts-expect-error — preset has no types import alloyPreset from "@alloy-js/babel-preset"; +// @ts-expect-error — @babel/core has no bundled types in this workspace +import { transformSync } from "@babel/core"; // @ts-expect-error — preset-typescript has no types import typescriptPreset from "@babel/preset-typescript"; import { describe, expect, it } from "vitest"; + import { type AlloyNode } from "../src/render/index.js"; import { createElement } from "../src/render/node.js"; import { insert } from "../src/runtime/index.js"; diff --git a/packages/core/test/browser-build.test.ts b/packages/core/test/browser-build.test.ts index 9a989371a..41d4280e9 100644 --- a/packages/core/test/browser-build.test.ts +++ b/packages/core/test/browser-build.test.ts @@ -1,5 +1,6 @@ import { existsSync, mkdirSync, rmSync, writeFileSync } from "fs"; import { join, resolve } from "path"; + import { build, type Rollup } from "vite"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; @@ -88,9 +89,9 @@ async function bundleForBrowser(): Promise<{ }, onwarn(warning) { warnings.push( - typeof warning === "string" ? warning : ( - (warning.message ?? String(warning)) - ), + typeof warning === "string" + ? warning + : (warning.message ?? String(warning)), ); }, }, @@ -98,9 +99,8 @@ async function bundleForBrowser(): Promise<{ }); const output = ( - Array.isArray(result) ? - result[0] - : result) as Rollup.RollupOutput; + Array.isArray(result) ? result[0] : result + ) as Rollup.RollupOutput; const chunks = output.output.filter( (o): o is Rollup.OutputChunk => o.type === "chunk", ); diff --git a/packages/core/test/components/append-file.test.tsx b/packages/core/test/components/append-file.test.tsx index 3789c4352..90e987bd1 100644 --- a/packages/core/test/components/append-file.test.tsx +++ b/packages/core/test/components/append-file.test.tsx @@ -1,7 +1,9 @@ import { existsSync, unlinkSync, writeFileSync } from "fs"; import { tmpdir } from "os"; import { join } from "path"; + import { afterEach, beforeEach, describe, expect, it } from "vitest"; + import { AppendFile, AppendRegion } from "../../src/components/AppendFile.jsx"; import { d } from "../../testing/render.js"; diff --git a/packages/core/test/components/block.test.tsx b/packages/core/test/components/block.test.tsx index bab523739..4b72b8aa9 100644 --- a/packages/core/test/components/block.test.tsx +++ b/packages/core/test/components/block.test.tsx @@ -1,5 +1,6 @@ import { ref } from "@vue/reactivity"; import { expect, it } from "vitest"; + import { Block } from "../../src/components/Block.jsx"; it("renders properly with no children", () => { const template = ( diff --git a/packages/core/test/components/copy-file.test.tsx b/packages/core/test/components/copy-file.test.tsx index 47d218131..ab011180d 100644 --- a/packages/core/test/components/copy-file.test.tsx +++ b/packages/core/test/components/copy-file.test.tsx @@ -1,7 +1,9 @@ import { existsSync, readFileSync, unlinkSync, writeFileSync } from "fs"; import { tmpdir } from "os"; import { join } from "path"; + import { afterEach, beforeEach, describe, expect, it } from "vitest"; + import { CopyFile } from "../../src/components/CopyFile.jsx"; import { SourceDirectory } from "../../src/components/SourceDirectory.jsx"; import type { CopyOutputFile } from "../../src/output-types.js"; diff --git a/packages/core/test/components/declaration.test.tsx b/packages/core/test/components/declaration.test.tsx index f60c93337..d521b8756 100644 --- a/packages/core/test/components/declaration.test.tsx +++ b/packages/core/test/components/declaration.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { Output } from "../../src/components/Output.jsx"; import { Declaration, ref, Scope } from "../../src/index.js"; import { flushJobs } from "../../src/scheduler.js"; @@ -10,9 +11,7 @@ it("creates and cleans up a symbol", () => { const template = ( - {doDecl.value ? - - : ""} + {doDecl.value ? : ""} ); diff --git a/packages/core/test/components/list.test.tsx b/packages/core/test/components/list.test.tsx index ed5b2b3e0..938de5029 100644 --- a/packages/core/test/components/list.test.tsx +++ b/packages/core/test/components/list.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { createContentSlot, List, ref, Show } from "../../src/index.js"; it("creates a list with default options", () => { diff --git a/packages/core/test/components/prose.test.tsx b/packages/core/test/components/prose.test.tsx index 668f167c4..ab5839795 100644 --- a/packages/core/test/components/prose.test.tsx +++ b/packages/core/test/components/prose.test.tsx @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { Prose } from "../../src/components/Prose.jsx"; import { d } from "../../testing/render.js"; diff --git a/packages/core/test/components/reference-or-content.test.tsx b/packages/core/test/components/reference-or-content.test.tsx index 4e6e31003..18d92ad1d 100644 --- a/packages/core/test/components/reference-or-content.test.tsx +++ b/packages/core/test/components/reference-or-content.test.tsx @@ -1,4 +1,5 @@ import { describe, expect, it, vi } from "vitest"; + import { Children, createTap, diff --git a/packages/core/test/components/source-file.test.tsx b/packages/core/test/components/source-file.test.tsx index 3b65bfac7..c3daf4720 100644 --- a/packages/core/test/components/source-file.test.tsx +++ b/packages/core/test/components/source-file.test.tsx @@ -12,6 +12,7 @@ import { useContext, } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { SourceDirectoryContext } from "../../src/context/source-directory.js"; import { d } from "../../testing/render.js"; diff --git a/packages/core/test/components/template-file.test.tsx b/packages/core/test/components/template-file.test.tsx index 930e3692e..bf69de74b 100644 --- a/packages/core/test/components/template-file.test.tsx +++ b/packages/core/test/components/template-file.test.tsx @@ -1,7 +1,9 @@ import { writeFileSync } from "fs"; import { tmpdir } from "os"; import { join } from "path"; + import { describe, expect, it } from "vitest"; + import { TemplateFile, TemplateVariable, diff --git a/packages/core/test/components/update-file.test.tsx b/packages/core/test/components/update-file.test.tsx index d12fd0e29..e6872806b 100644 --- a/packages/core/test/components/update-file.test.tsx +++ b/packages/core/test/components/update-file.test.tsx @@ -1,7 +1,9 @@ import { existsSync, unlinkSync, writeFileSync } from "fs"; import { tmpdir } from "os"; + import { join } from "pathe"; import { afterEach, beforeEach, describe, expect, it } from "vitest"; + import { UpdateFile } from "../../src/components/UpdateFile.jsx"; import { render } from "../../src/render-output.js"; import { d } from "../../testing/render.js"; diff --git a/packages/core/test/components/wrap.test.tsx b/packages/core/test/components/wrap.test.tsx index 53a520d53..ef9e9ff38 100644 --- a/packages/core/test/components/wrap.test.tsx +++ b/packages/core/test/components/wrap.test.tsx @@ -1,5 +1,6 @@ import { ref } from "@vue/reactivity"; import { expect, it } from "vitest"; + import { Wrap } from "../../src/components/Wrap.jsx"; function Wrapper(props: any) { diff --git a/packages/core/test/control-flow/for.test.tsx b/packages/core/test/control-flow/for.test.tsx index b04d53072..f15106186 100644 --- a/packages/core/test/control-flow/for.test.tsx +++ b/packages/core/test/control-flow/for.test.tsx @@ -1,5 +1,6 @@ import { d } from "@alloy-js/core/testing"; import { describe, expect, it } from "vitest"; + import { For } from "../../src/components/For.jsx"; import { onCleanup, reactive, ref } from "../../src/index.js"; import { flushJobs } from "../../src/scheduler.js"; diff --git a/packages/core/test/control-flow/match.test.tsx b/packages/core/test/control-flow/match.test.tsx index 101f20181..9afb42168 100644 --- a/packages/core/test/control-flow/match.test.tsx +++ b/packages/core/test/control-flow/match.test.tsx @@ -1,5 +1,6 @@ import { ref } from "@vue/reactivity"; import { expect, it } from "vitest"; + import { Match, Switch } from "../../src/components/Switch.jsx"; it("selects the true branch", () => { diff --git a/packages/core/test/control-flow/show.test.tsx b/packages/core/test/control-flow/show.test.tsx index 0a52caf1b..bca30c987 100644 --- a/packages/core/test/control-flow/show.test.tsx +++ b/packages/core/test/control-flow/show.test.tsx @@ -1,5 +1,6 @@ import { ref } from "@vue/reactivity"; import { expect, it } from "vitest"; + import { Show } from "../../src/components/Show.jsx"; it("selects the true branch", () => { diff --git a/packages/core/test/lazy-isempty.test.tsx b/packages/core/test/lazy-isempty.test.tsx index cfdbe1245..92fe8d9a7 100644 --- a/packages/core/test/lazy-isempty.test.tsx +++ b/packages/core/test/lazy-isempty.test.tsx @@ -1,5 +1,6 @@ import { ref } from "@vue/reactivity"; import { describe, expect, it } from "vitest"; + import { Show } from "../src/components/Show.jsx"; import { createContentSlot } from "../src/content-slot.jsx"; import { Context, ensureIsEmpty, getContext } from "../src/reactivity.js"; diff --git a/packages/core/test/node.test.ts b/packages/core/test/node.test.ts index 4a6b8a0b7..22c471a5e 100644 --- a/packages/core/test/node.test.ts +++ b/packages/core/test/node.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { createElement, createFragment, diff --git a/packages/core/test/output-e2e.test.ts b/packages/core/test/output-e2e.test.ts index a317612d1..dbd940414 100644 --- a/packages/core/test/output-e2e.test.ts +++ b/packages/core/test/output-e2e.test.ts @@ -10,13 +10,14 @@ * - `For` works under the runtime emitting multiple files. */ -// @ts-expect-error — @babel/core has no bundled types in this workspace -import { transformSync } from "@babel/core"; // @ts-expect-error — preset has no types import alloyPreset from "@alloy-js/babel-preset"; +// @ts-expect-error — @babel/core has no bundled types in this workspace +import { transformSync } from "@babel/core"; // @ts-expect-error — preset-typescript has no types import typescriptPreset from "@babel/preset-typescript"; import { beforeAll, describe, expect, it } from "vitest"; + import type { ContentOutputFile, OutputDirectory, diff --git a/packages/core/test/props-with-defaults.test.ts b/packages/core/test/props-with-defaults.test.ts index 222135a6c..bc36a98ff 100644 --- a/packages/core/test/props-with-defaults.test.ts +++ b/packages/core/test/props-with-defaults.test.ts @@ -1,5 +1,6 @@ import { effect, reactive } from "@vue/reactivity"; import { expect, it, vi } from "vitest"; + import { defaultProps } from "../src/props-combinators.js"; it("applies defaults to regular object props", () => { diff --git a/packages/core/test/reactive-union-set-disposers.test.tsx b/packages/core/test/reactive-union-set-disposers.test.tsx index 660f90cce..bf4837c10 100644 --- a/packages/core/test/reactive-union-set-disposers.test.tsx +++ b/packages/core/test/reactive-union-set-disposers.test.tsx @@ -1,5 +1,6 @@ import { reactive } from "@vue/reactivity"; import { describe, expect, it } from "vitest"; + import { ReactiveUnionSet } from "../src/reactive-union-set.js"; import { effect } from "../src/reactivity.js"; import { flushJobs } from "../src/scheduler.js"; diff --git a/packages/core/test/reactive-union-set.test.tsx b/packages/core/test/reactive-union-set.test.tsx index 1d12ee2e4..d8cfd97b8 100644 --- a/packages/core/test/reactive-union-set.test.tsx +++ b/packages/core/test/reactive-union-set.test.tsx @@ -1,5 +1,6 @@ import { reactive } from "@vue/reactivity"; import { describe, expect, it } from "vitest"; + import { ReactiveUnionSet } from "../src/reactive-union-set.js"; import { effect } from "../src/reactivity.js"; import { flushJobs } from "../src/scheduler.js"; diff --git a/packages/core/test/reactivity/circular-reactives.test.tsx b/packages/core/test/reactivity/circular-reactives.test.tsx index c2b8d15df..93bfcb190 100644 --- a/packages/core/test/reactivity/circular-reactives.test.tsx +++ b/packages/core/test/reactivity/circular-reactives.test.tsx @@ -1,5 +1,6 @@ import { shallowReactive } from "@vue/reactivity"; import { expect, it } from "vitest"; + import { For } from "../../src/index.js"; it("it should work with circular reactives", () => { diff --git a/packages/core/test/reactivity/cleanup.test.tsx b/packages/core/test/reactivity/cleanup.test.tsx index 7e415ed9f..ab1d1c1fa 100644 --- a/packages/core/test/reactivity/cleanup.test.tsx +++ b/packages/core/test/reactivity/cleanup.test.tsx @@ -1,5 +1,6 @@ import { ref } from "@vue/reactivity"; import { describe, expect, it } from "vitest"; + import { effect, memo, onCleanup } from "../../src/reactivity.js"; import type { Children } from "../../src/runtime/component.js"; import { flushJobs } from "../../src/scheduler.js"; diff --git a/packages/core/test/reactivity/memo.test.tsx b/packages/core/test/reactivity/memo.test.tsx index 59a0de8aa..7a395fc19 100644 --- a/packages/core/test/reactivity/memo.test.tsx +++ b/packages/core/test/reactivity/memo.test.tsx @@ -1,5 +1,6 @@ import { ref } from "@vue/reactivity"; import { expect, it } from "vitest"; + import { memo } from "../../src/reactivity.js"; it("doesn't recalculate when dependencies don't change", () => { diff --git a/packages/core/test/reactivity/shallow-reactive.test.tsx b/packages/core/test/reactivity/shallow-reactive.test.tsx index 436a043a6..780baf324 100644 --- a/packages/core/test/reactivity/shallow-reactive.test.tsx +++ b/packages/core/test/reactivity/shallow-reactive.test.tsx @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest"; + import { refreshDebugState } from "../../src/devtools/devtools-server.js"; import { getReactiveCreationLocation, diff --git a/packages/core/test/reactivity/test.test.tsx b/packages/core/test/reactivity/test.test.tsx index e22e33249..41c90ca5d 100644 --- a/packages/core/test/reactivity/test.test.tsx +++ b/packages/core/test/reactivity/test.test.tsx @@ -1,6 +1,7 @@ import { memo } from "@alloy-js/core"; import { computed, reactive, ref } from "@vue/reactivity"; import { expect, it } from "vitest"; + import { flushJobs } from "../../src/scheduler.js"; import { mapJoin } from "../../src/utils.js"; diff --git a/packages/core/test/reactivity/untrack.test.ts b/packages/core/test/reactivity/untrack.test.ts index 88f0bc6e2..9383acb82 100644 --- a/packages/core/test/reactivity/untrack.test.ts +++ b/packages/core/test/reactivity/untrack.test.ts @@ -1,5 +1,6 @@ import { ref } from "@vue/reactivity"; import { expect, it } from "vitest"; + import { memo, untrack } from "../../src/reactivity.js"; import { flushJobs } from "../../src/scheduler.js"; diff --git a/packages/core/test/refkey.test.ts b/packages/core/test/refkey.test.ts index fa0437fdb..1a4daa982 100644 --- a/packages/core/test/refkey.test.ts +++ b/packages/core/test/refkey.test.ts @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { refkey, REFKEYABLE, Refkeyable } from "../src/refkey.js"; it("is stable when called with same values", () => { diff --git a/packages/core/test/rendering/basic.test.tsx b/packages/core/test/rendering/basic.test.tsx index 1ad97fc6d..6b0150c44 100644 --- a/packages/core/test/rendering/basic.test.tsx +++ b/packages/core/test/rendering/basic.test.tsx @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { Children, RENDERABLE } from "../../src/runtime/component.js"; describe("string nodes", () => { it("renders string nodes with substitutions", () => { diff --git a/packages/core/test/rendering/code.test.tsx b/packages/core/test/rendering/code.test.tsx index d4c43bec5..25ffc3024 100644 --- a/packages/core/test/rendering/code.test.tsx +++ b/packages/core/test/rendering/code.test.tsx @@ -16,7 +16,7 @@ it("renders allows substitutions of elements", () => { return "hi"; } expect(code` - foo ${()} bar + foo ${} bar `).toRenderTo("foo hi bar"); }); @@ -30,7 +30,7 @@ it("renders has auto-indentation", () => { const template = code` if (x === 1) { - ${()} + ${} } `; diff --git a/packages/core/test/rendering/formatting.test.tsx b/packages/core/test/rendering/formatting.test.tsx index 32c2d0e22..63df60d5a 100644 --- a/packages/core/test/rendering/formatting.test.tsx +++ b/packages/core/test/rendering/formatting.test.tsx @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { For, Output, SourceFile } from "../../src/index.js"; describe("group", () => { diff --git a/packages/core/test/rendering/memoization.test.tsx b/packages/core/test/rendering/memoization.test.tsx index 84da5426f..93fc4d0eb 100644 --- a/packages/core/test/rendering/memoization.test.tsx +++ b/packages/core/test/rendering/memoization.test.tsx @@ -1,5 +1,6 @@ import { ref } from "@vue/reactivity"; import { expect, it } from "vitest"; + import { memo } from "../../src/reactivity.js"; import { flushJobs } from "../../src/scheduler.js"; diff --git a/packages/core/test/rendering/print-render-stack.test.tsx b/packages/core/test/rendering/print-render-stack.test.tsx index ba28f6e2e..764f2a724 100644 --- a/packages/core/test/rendering/print-render-stack.test.tsx +++ b/packages/core/test/rendering/print-render-stack.test.tsx @@ -6,6 +6,7 @@ import { } from "@alloy-js/core"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import WebSocket from "ws"; + import { createNamedContext } from "../../src/context.js"; import { enableDevtools, diff --git a/packages/core/test/rendering/render-output-diagnostics.test.tsx b/packages/core/test/rendering/render-output-diagnostics.test.tsx index 3c10a3800..a1629688a 100644 --- a/packages/core/test/rendering/render-output-diagnostics.test.tsx +++ b/packages/core/test/rendering/render-output-diagnostics.test.tsx @@ -1,4 +1,5 @@ import { afterEach, describe, expect, it, vi } from "vitest"; + import { emitDiagnostic, Output, diff --git a/packages/core/test/runtime.test.ts b/packages/core/test/runtime.test.ts index b152fba2b..7a2fae5ed 100644 --- a/packages/core/test/runtime.test.ts +++ b/packages/core/test/runtime.test.ts @@ -10,6 +10,7 @@ import { ref, shallowRef } from "@vue/reactivity"; import { describe, expect, it } from "vitest"; + import { createContentSlot } from "../src/content-slot.jsx"; import { createCustomContext, root } from "../src/reactivity.js"; import { diff --git a/packages/core/test/scheduler-extended.test.tsx b/packages/core/test/scheduler-extended.test.tsx index b8b0e09de..3d1c97d77 100644 --- a/packages/core/test/scheduler-extended.test.tsx +++ b/packages/core/test/scheduler-extended.test.tsx @@ -1,5 +1,6 @@ import { ref, stop, effect as vueEffect } from "@vue/reactivity"; import { describe, expect, it } from "vitest"; + import { flushJobs, flushJobsAsync, diff --git a/packages/core/test/scheduler.test.tsx b/packages/core/test/scheduler.test.tsx index bf514d6e9..8c1db6520 100644 --- a/packages/core/test/scheduler.test.tsx +++ b/packages/core/test/scheduler.test.tsx @@ -1,5 +1,6 @@ import { ref, stop, effect as vueEffect } from "@vue/reactivity"; import { describe, expect, it } from "vitest"; + import { effect } from "../src/reactivity.js"; import { flushJobs, scheduler } from "../src/scheduler.js"; diff --git a/packages/core/test/split-props.test.ts b/packages/core/test/split-props.test.ts index f01ee5ad1..e52270844 100644 --- a/packages/core/test/split-props.test.ts +++ b/packages/core/test/split-props.test.ts @@ -1,5 +1,6 @@ import { effect, reactive } from "@vue/reactivity"; import { expect, it, vi } from "vitest"; + import { splitProps } from "../src/props-combinators.js"; it("splits regular object props", () => { diff --git a/packages/core/test/symbols/deconflicted-name.test.ts b/packages/core/test/symbols/deconflicted-name.test.ts index fd05681eb..2d7c1725f 100644 --- a/packages/core/test/symbols/deconflicted-name.test.ts +++ b/packages/core/test/symbols/deconflicted-name.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { Binder, createOutputBinder } from "../../src/binder.js"; import { flushJobs } from "../../src/scheduler.js"; import { BasicScope } from "../../src/symbols/basic-scope.js"; diff --git a/packages/core/test/symbols/output-scope.test.ts b/packages/core/test/symbols/output-scope.test.ts index c926430dd..2f4508b1c 100644 --- a/packages/core/test/symbols/output-scope.test.ts +++ b/packages/core/test/symbols/output-scope.test.ts @@ -1,5 +1,6 @@ import { reactive, watch } from "@vue/reactivity"; import { describe, expect, it, vi } from "vitest"; + import { refkey } from "../../src/refkey.js"; import { flushJobs } from "../../src/scheduler.js"; import { BasicScope } from "../../src/symbols/basic-scope.js"; diff --git a/packages/core/test/symbols/output-symbol.test.ts b/packages/core/test/symbols/output-symbol.test.ts index 63ce9ba95..ca5576c06 100644 --- a/packages/core/test/symbols/output-symbol.test.ts +++ b/packages/core/test/symbols/output-symbol.test.ts @@ -1,5 +1,6 @@ import { reactive, watch } from "@vue/reactivity"; import { describe, expect, it, vi } from "vitest"; + import { namekey } from "../../src/refkey.js"; import { flushJobs } from "../../src/scheduler.js"; import { binder, createScope, createSymbol } from "./utils.js"; diff --git a/packages/core/test/symbols/resolution.test.ts b/packages/core/test/symbols/resolution.test.ts index 6edcd9097..4d484fc8e 100644 --- a/packages/core/test/symbols/resolution.test.ts +++ b/packages/core/test/symbols/resolution.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { createOutputBinder } from "../../src/binder.js"; import { memberRefkey, refkey } from "../../src/refkey.js"; import { flushJobs } from "../../src/scheduler.js"; diff --git a/packages/core/test/symbols/symbol-table.test.ts b/packages/core/test/symbols/symbol-table.test.ts index dfa0503e9..3b119ef9b 100644 --- a/packages/core/test/symbols/symbol-table.test.ts +++ b/packages/core/test/symbols/symbol-table.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { createScope, createSymbol } from "./utils.js"; describe("OutputSymbol#moveTo", () => { diff --git a/packages/core/test/symbols/utils.ts b/packages/core/test/symbols/utils.ts index 7a67475a8..b8013bf05 100644 --- a/packages/core/test/symbols/utils.ts +++ b/packages/core/test/symbols/utils.ts @@ -1,4 +1,5 @@ import { beforeEach } from "vitest"; + import { Binder, createOutputBinder } from "../../src/binder.js"; import { OutputSpace } from "../../src/index.js"; import { Namekey, refkey, Refkey } from "../../src/refkey.js"; diff --git a/packages/core/test/utils.test.tsx b/packages/core/test/utils.test.tsx index bd17d9b15..180076df4 100644 --- a/packages/core/test/utils.test.tsx +++ b/packages/core/test/utils.test.tsx @@ -1,5 +1,6 @@ import { computed, ref, triggerRef } from "@vue/reactivity"; import { describe, expect, it } from "vitest"; + import { Children } from "../src/index.js"; import { flushJobs } from "../src/scheduler.js"; import { children, join, mapJoin } from "../src/utils.js"; diff --git a/packages/core/testing/extend-expect.test.tsx b/packages/core/testing/extend-expect.test.tsx index 0f0220a65..a735063a7 100644 --- a/packages/core/testing/extend-expect.test.tsx +++ b/packages/core/testing/extend-expect.test.tsx @@ -1,5 +1,6 @@ import { Indent, Output, SourceDirectory, SourceFile } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import "./extend-expect.js"; describe("toRenderTo", () => { diff --git a/packages/core/testing/extend-expect.ts b/packages/core/testing/extend-expect.ts index c1d3976bf..b1f6f439e 100644 --- a/packages/core/testing/extend-expect.ts +++ b/packages/core/testing/extend-expect.ts @@ -1,6 +1,7 @@ import { Children, Diagnostic } from "@alloy-js/core"; import "vitest"; import { expect } from "vitest"; + import { ElementNode } from "../src/render/node.js"; import { flushJobs, flushJobsAsync } from "../src/scheduler.js"; import { @@ -154,8 +155,8 @@ function validateRender( const pass = Object.keys(actual).length === Object.keys(expected).length && Object.entries(actual).every(([key, value]) => { - return isAsymmetricMatcher(dedentExpected[key]) ? - dedentExpected[key].asymmetricMatch(value) + return isAsymmetricMatcher(dedentExpected[key]) + ? dedentExpected[key].asymmetricMatch(value) : dedentExpected[key] === value; }); return { @@ -196,9 +197,9 @@ function validateDiagnostics( const expectedDiag = expected[i]; const messageMatches = - expectedDiag.message instanceof RegExp ? - expectedDiag.message.test(actualDiag.message) - : actualDiag.message === expectedDiag.message; + expectedDiag.message instanceof RegExp + ? expectedDiag.message.test(actualDiag.message) + : actualDiag.message === expectedDiag.message; if (!messageMatches) { return { diff --git a/packages/create/scripts/gen-deps.js b/packages/create/scripts/gen-deps.js index 5e9ddb640..52bc74e2d 100644 --- a/packages/create/scripts/gen-deps.js +++ b/packages/create/scripts/gen-deps.js @@ -1,7 +1,8 @@ import fs from "fs/promises"; -import yaml from "js-yaml"; import path from "path"; +import yaml from "js-yaml"; + async function generateDepsVersions() { // Get current directory (assuming script is run from package root) const packageDir = process.cwd(); diff --git a/packages/create/src/index.tsx b/packages/create/src/index.tsx index 0551a92df..95a5c17f0 100644 --- a/packages/create/src/index.tsx +++ b/packages/create/src/index.tsx @@ -1,6 +1,10 @@ #!/usr/bin/env node /* eslint-disable no-console */ +import fs from "fs"; +import { parseArgs } from "node:util"; +import path from "path"; + import { code, Output, @@ -10,9 +14,6 @@ import { writeOutput, } from "@alloy-js/core"; import { PackageJsonFile, SourceFile } from "@alloy-js/typescript"; -import fs from "fs"; -import { parseArgs } from "node:util"; -import path from "path"; import prompts from "prompts"; const displayHelp = () => { @@ -68,20 +69,21 @@ function parseCommandLineArgs(): Partial & { version: values.version, description: values.description, repository: values.repository, - keywords: - values.keywords ? - values.keywords + keywords: values.keywords + ? values.keywords .split(",") .map((k: string) => k.trim()) .filter(Boolean) : undefined, author: values.author, license: values.license, - type: - values.library ? "library" - : values.stc ? "stc-project" - : values.project ? "project" - : "project", + type: values.library + ? "library" + : values.stc + ? "stc-project" + : values.project + ? "project" + : "project", }; } @@ -217,14 +219,14 @@ const promptForPackageInfo = async ( } const answers = - questions.length > 0 ? - await prompts(questions, { - onCancel: (p) => { - console.log("Operation canceled. No files were generated."); - process.exit(0); - }, - }) - : {}; + questions.length > 0 + ? await prompts(questions, { + onCancel: (p) => { + console.log("Operation canceled. No files were generated."); + process.exit(0); + }, + }) + : {}; return { name: cmdArgs.name || answers.name || defaultName, @@ -325,9 +327,9 @@ const main = async () => { scripts={scripts} author={packageInfo.author} repository={ - packageInfo.repository ? - { type: "git", url: packageInfo.repository } - : undefined + packageInfo.repository + ? { type: "git", url: packageInfo.repository } + : undefined } keywords={packageInfo.keywords} /> @@ -343,9 +345,9 @@ const main = async () => { // barrel file for components {code` @@ -378,9 +380,9 @@ const main = async () => { "composite": true, "incremental": true, "outDir": "dist"${ - packageInfo.type === "stc-project" ? - "" - : code` + packageInfo.type === "stc-project" + ? "" + : code` , "jsx": "preserve", "jsxImportSource": "@alloy-js/core", @@ -391,9 +393,9 @@ const main = async () => { "include": [ "src/**/*.ts", "test/**/*.ts"${ - packageInfo.type === "stc-project" ? - "" - : code` + packageInfo.type === "stc-project" + ? "" + : code` , "src/**/*.tsx", "test/**/*.tsx", diff --git a/packages/csharp/scripts/components/library-interface.tsx b/packages/csharp/scripts/components/library-interface.tsx index c9aead7d4..58fd40b33 100644 --- a/packages/csharp/scripts/components/library-interface.tsx +++ b/packages/csharp/scripts/components/library-interface.tsx @@ -1,4 +1,3 @@ -import { Descriptor } from "#createLibrary"; import { For } from "@alloy-js/core"; import { InterfaceExpression, @@ -6,6 +5,8 @@ import { TypeDeclaration, } from "@alloy-js/typescript"; +import { Descriptor } from "#createLibrary"; + export function LibraryInterfaceDeclaration(props: { name: string; types: Record; @@ -28,9 +29,11 @@ export function LibraryMembersInterface(props: { {([name, descriptor]) => { return ( - {"members" in descriptor ? + {"members" in descriptor ? ( - : "LibrarySymbolReference"} + ) : ( + "LibrarySymbolReference" + )} ); }} diff --git a/packages/csharp/scripts/components/namespace-directory.tsx b/packages/csharp/scripts/components/namespace-directory.tsx index f17e7505a..4a57d9098 100644 --- a/packages/csharp/scripts/components/namespace-directory.tsx +++ b/packages/csharp/scripts/components/namespace-directory.tsx @@ -1,4 +1,3 @@ -import { Descriptor, NamespaceDescriptor } from "#createLibrary"; import { code, For, @@ -12,6 +11,9 @@ import { SourceFile, VarDeclaration, } from "@alloy-js/typescript"; + +import { Descriptor, NamespaceDescriptor } from "#createLibrary"; + import { LibraryInterfaceDeclaration } from "./library-interface.jsx"; export function NamespaceDirectory(props: { diff --git a/packages/csharp/scripts/generate-builtins.tsx b/packages/csharp/scripts/generate-builtins.tsx index 75948e03d..35e366d82 100644 --- a/packages/csharp/scripts/generate-builtins.tsx +++ b/packages/csharp/scripts/generate-builtins.tsx @@ -8,18 +8,18 @@ * Disclaimer: coded with 🪄 vibes 🔮 */ -import { Output, renderAsync, writeOutput } from "@alloy-js/core"; - import { writeFileSync } from "node:fs"; import { dirname, join, resolve } from "node:path"; + +import { Output, renderAsync, writeOutput } from "@alloy-js/core"; + import { NamespaceDirectory } from "./components/namespace-directory.jsx"; import { walk } from "./process-docfx.jsx"; // Arg[0]=node, Arg[1]=script, Arg[2]=apiDir, Arg[3]=outputPath (unused for now) const [, , apiParam, outParam] = process.argv; -const API_DIR = - apiParam ? - resolve(apiParam) +const API_DIR = apiParam + ? resolve(apiParam) : join(dirname(new URL(import.meta.url).pathname), "api"); const OUTPUT_PATH = outParam ? resolve(outParam) : undefined; // reserved for future use diff --git a/packages/csharp/scripts/process-docfx.tsx b/packages/csharp/scripts/process-docfx.tsx index e16ba7756..198a964c6 100644 --- a/packages/csharp/scripts/process-docfx.tsx +++ b/packages/csharp/scripts/process-docfx.tsx @@ -1,9 +1,11 @@ -import { Descriptor, NamespaceDescriptor } from "#createLibrary"; +import { readdirSync, readFileSync, statSync } from "node:fs"; +import { join } from "node:path"; + import { refkey } from "@alloy-js/core"; import { ArrowFunction } from "@alloy-js/typescript"; import { load as parseYaml } from "js-yaml"; -import { readdirSync, readFileSync, statSync } from "node:fs"; -import { join } from "node:path"; + +import { Descriptor, NamespaceDescriptor } from "#createLibrary"; interface DocfxItem { uid: string; @@ -151,9 +153,8 @@ function TypeReference(props: { type: string | undefined }) { break; } } - let typeName = - namespace ? - parts.slice(namespace.split(".").length).join(".") + let typeName = namespace + ? parts.slice(namespace.split(".").length).join(".") : parts.join("."); if (!typeName) return "undefined"; diff --git a/packages/csharp/src/access.test.tsx b/packages/csharp/src/access.test.tsx index 6470389a6..81ad024e1 100644 --- a/packages/csharp/src/access.test.tsx +++ b/packages/csharp/src/access.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { access } from "./access.jsx"; it("makes a member access expression", () => { diff --git a/packages/csharp/src/access.tsx b/packages/csharp/src/access.tsx index be261d8bd..ebebc6f6f 100644 --- a/packages/csharp/src/access.tsx +++ b/packages/csharp/src/access.tsx @@ -1,4 +1,5 @@ import { Children, isRefkeyable, Refkeyable, RENDERABLE } from "@alloy-js/core"; + import { AccessExpression, AccessExpressionPartProps, diff --git a/packages/csharp/src/components/Reference.tsx b/packages/csharp/src/components/Reference.tsx index bf828ff11..3d43a3db1 100644 --- a/packages/csharp/src/components/Reference.tsx +++ b/packages/csharp/src/components/Reference.tsx @@ -1,4 +1,5 @@ import * as core from "@alloy-js/core"; + import { ref } from "../symbols/reference.js"; export interface ReferenceProps { diff --git a/packages/csharp/src/components/access-expression/access-expression.test.tsx b/packages/csharp/src/components/access-expression/access-expression.test.tsx index f97ca6745..a7701b2bd 100644 --- a/packages/csharp/src/components/access-expression/access-expression.test.tsx +++ b/packages/csharp/src/components/access-expression/access-expression.test.tsx @@ -1,8 +1,10 @@ +import { List, namekey } from "@alloy-js/core"; +import { describe, expect, it } from "vitest"; + import { ClassDeclaration } from "#components/class/declaration.jsx"; import { Method } from "#components/method/method.jsx"; import { TestNamespace } from "#test/utils.jsx"; -import { List, namekey } from "@alloy-js/core"; -import { describe, expect, it } from "vitest"; + import { CSharpSymbol } from "../../symbols/csharp.js"; import { AccessExpression } from "./access-expression.jsx"; diff --git a/packages/csharp/src/components/access-expression/access-expression.tsx b/packages/csharp/src/components/access-expression/access-expression.tsx index d52c472e6..ff4bc266c 100644 --- a/packages/csharp/src/components/access-expression/access-expression.tsx +++ b/packages/csharp/src/components/access-expression/access-expression.tsx @@ -6,6 +6,7 @@ import { Refkeyable, Show, } from "@alloy-js/core"; + import { CSharpSymbol } from "../../symbols/csharp.js"; import { normalizeAttributeName } from "./part-descriptors.js"; @@ -72,14 +73,17 @@ const { Expression, Part, registerOuterComponent } = createAccessExpression< id, indexerArgs, conditional: !!partProps.conditional, - nullable: - partProps.nullable ? true - : sym ? (sym as CSharpSymbol).isNullable - : false, + nullable: partProps.nullable + ? true + : sym + ? (sym as CSharpSymbol).isNullable + : false, args: - partProps.args === true ? [] - : Array.isArray(partProps.args) ? partProps.args - : undefined, + partProps.args === true + ? [] + : Array.isArray(partProps.args) + ? partProps.args + : undefined, typeArgs: partProps.typeArgs, }; }, diff --git a/packages/csharp/src/components/attributes/attributes.test.tsx b/packages/csharp/src/components/attributes/attributes.test.tsx index 7d0ce8539..05d25b351 100644 --- a/packages/csharp/src/components/attributes/attributes.test.tsx +++ b/packages/csharp/src/components/attributes/attributes.test.tsx @@ -1,8 +1,10 @@ +import { List, namekey } from "@alloy-js/core"; +import { describe, expect, it } from "vitest"; + import { ClassDeclaration } from "#components/class/declaration.jsx"; import { createLibrary } from "#createLibrary"; import { TestNamespace } from "#test/utils.jsx"; -import { List, namekey } from "@alloy-js/core"; -import { describe, expect, it } from "vitest"; + import { Attribute, AttributeList } from "./attributes.jsx"; it("define attribute", () => { expect().toRenderTo(` diff --git a/packages/csharp/src/components/attributes/attributes.tsx b/packages/csharp/src/components/attributes/attributes.tsx index 05aa0350d..5ba12b8f3 100644 --- a/packages/csharp/src/components/attributes/attributes.tsx +++ b/packages/csharp/src/components/attributes/attributes.tsx @@ -1,4 +1,3 @@ -import { normalizeAttributeName } from "#components/access-expression/part-descriptors.js"; import { Children, findKeyedChildren, @@ -7,6 +6,9 @@ import { Refkeyable, taggedComponent, } from "@alloy-js/core"; + +import { normalizeAttributeName } from "#components/access-expression/part-descriptors.js"; + import { ReferenceContext } from "../../contexts/reference-context.js"; export type AttributesProp = Array; @@ -99,9 +101,11 @@ export const Attribute = taggedComponent( ); function AttributeName(props: Pick) { - return typeof props.name === "string" ? - normalizeAttributeName(props.name) - : - {props.name} - ; + return typeof props.name === "string" ? ( + normalizeAttributeName(props.name) + ) : ( + + {props.name} + + ); } diff --git a/packages/csharp/src/components/class/declaration.test.tsx b/packages/csharp/src/components/class/declaration.test.tsx index 1b9eb95be..9474a27e3 100644 --- a/packages/csharp/src/components/class/declaration.test.tsx +++ b/packages/csharp/src/components/class/declaration.test.tsx @@ -1,6 +1,3 @@ -import { Constructor } from "#components/constructor/constructor.jsx"; -import { EnumDeclaration } from "#components/enum/declaration.jsx"; -import { EnumMember } from "#components/enum/member.jsx"; import { code, createNamePolicy, @@ -11,6 +8,11 @@ import { } from "@alloy-js/core"; import * as coretest from "@alloy-js/core/testing"; import { describe, expect, it } from "vitest"; + +import { Constructor } from "#components/constructor/constructor.jsx"; +import { EnumDeclaration } from "#components/enum/declaration.jsx"; +import { EnumMember } from "#components/enum/member.jsx"; + import { TestNamespace } from "../../../test/utils.jsx"; import { Attribute } from "../attributes/attributes.jsx"; import { Field } from "../field/field.jsx"; diff --git a/packages/csharp/src/components/class/declaration.tsx b/packages/csharp/src/components/class/declaration.tsx index 7006721d9..72709107b 100644 --- a/packages/csharp/src/components/class/declaration.tsx +++ b/packages/csharp/src/components/class/declaration.tsx @@ -9,6 +9,7 @@ import { Refkey, Scope, } from "@alloy-js/core"; + import { AccessModifiers, computeModifiersPrefix, diff --git a/packages/csharp/src/components/constructor/constructor.test.tsx b/packages/csharp/src/components/constructor/constructor.test.tsx index b9182bfbf..67c73269d 100644 --- a/packages/csharp/src/components/constructor/constructor.test.tsx +++ b/packages/csharp/src/components/constructor/constructor.test.tsx @@ -1,5 +1,6 @@ import { refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { TestNamespace } from "../../../test/utils.jsx"; import { ClassDeclaration } from "../class/declaration.jsx"; import { DocSummary } from "../doc/comment.jsx"; diff --git a/packages/csharp/src/components/constructor/constructor.tsx b/packages/csharp/src/components/constructor/constructor.tsx index 53b31a529..85c7ddd59 100644 --- a/packages/csharp/src/components/constructor/constructor.tsx +++ b/packages/csharp/src/components/constructor/constructor.tsx @@ -1,4 +1,3 @@ -import { MethodScope } from "#components/method-scope.jsx"; import { Block, For, @@ -8,6 +7,9 @@ import { Refkey, } from "@alloy-js/core"; import { Children } from "@alloy-js/core/jsx-runtime"; + +import { MethodScope } from "#components/method-scope.jsx"; + import { AccessModifiers, computeModifiersPrefix, @@ -86,12 +88,11 @@ export function Constructor(props: ConstructorProps) { const modifiers = computeModifiersPrefix([getAccessModifier(props)]); - const initializer = - props.baseConstructor ? - - : props.thisConstructor ? - - : null; + const initializer = props.baseConstructor ? ( + + ) : props.thisConstructor ? ( + + ) : null; return ( diff --git a/packages/csharp/src/components/csproj-file/csproj-file.test.tsx b/packages/csharp/src/components/csproj-file/csproj-file.test.tsx index dd11eab40..51e13bec1 100644 --- a/packages/csharp/src/components/csproj-file/csproj-file.test.tsx +++ b/packages/csharp/src/components/csproj-file/csproj-file.test.tsx @@ -1,5 +1,6 @@ import { Compile, ItemGroup } from "@alloy-js/msbuild/components"; import { expect, it } from "vitest"; + import { CsprojFile } from "./csproj-file.jsx"; it("create empty .csproj file", () => { diff --git a/packages/csharp/src/components/doc/comment.test.tsx b/packages/csharp/src/components/doc/comment.test.tsx index b4c837a07..3dae18fff 100644 --- a/packages/csharp/src/components/doc/comment.test.tsx +++ b/packages/csharp/src/components/doc/comment.test.tsx @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { DocC, DocCode, diff --git a/packages/csharp/src/components/doc/from-markdown.test.tsx b/packages/csharp/src/components/doc/from-markdown.test.tsx index 81fbba2d6..78361db07 100644 --- a/packages/csharp/src/components/doc/from-markdown.test.tsx +++ b/packages/csharp/src/components/doc/from-markdown.test.tsx @@ -1,5 +1,6 @@ import { d } from "@alloy-js/core/testing"; import { describe, expect, it } from "vitest"; + import { DocFromMarkdown } from "./from-markdown.jsx"; it("convert code block to ", () => { diff --git a/packages/csharp/src/components/doc/from-markdown.tsx b/packages/csharp/src/components/doc/from-markdown.tsx index 923182d0b..e06b01e31 100644 --- a/packages/csharp/src/components/doc/from-markdown.tsx +++ b/packages/csharp/src/components/doc/from-markdown.tsx @@ -1,4 +1,5 @@ import { marked, Tokens, type Token } from "marked"; + import { DocC, DocCode, DocList, DocSee } from "./comment.jsx"; export interface DocFromMarkdownProps { diff --git a/packages/csharp/src/components/enum/declaration.ref.test.tsx b/packages/csharp/src/components/enum/declaration.ref.test.tsx index 516a999c1..61b3045c9 100644 --- a/packages/csharp/src/components/enum/declaration.ref.test.tsx +++ b/packages/csharp/src/components/enum/declaration.ref.test.tsx @@ -1,8 +1,10 @@ -import { Namespace } from "#components/namespace/namespace.jsx"; -import { SourceFile } from "#components/source-file/source-file.jsx"; import { Output, refkey } from "@alloy-js/core"; import { d } from "@alloy-js/core/testing"; import { expect, it } from "vitest"; + +import { Namespace } from "#components/namespace/namespace.jsx"; +import { SourceFile } from "#components/source-file/source-file.jsx"; + import { EnumDeclaration } from "./declaration.jsx"; import { EnumMember } from "./member.jsx"; diff --git a/packages/csharp/src/components/enum/declaration.test.tsx b/packages/csharp/src/components/enum/declaration.test.tsx index 0ebbc63c0..37fd14b41 100644 --- a/packages/csharp/src/components/enum/declaration.test.tsx +++ b/packages/csharp/src/components/enum/declaration.test.tsx @@ -1,6 +1,8 @@ -import { TestNamespace } from "#test/utils.jsx"; import { namekey } from "@alloy-js/core"; import { expect, it } from "vitest"; + +import { TestNamespace } from "#test/utils.jsx"; + import { EnumDeclaration } from "./declaration.jsx"; import { EnumMember } from "./member.jsx"; diff --git a/packages/csharp/src/components/enum/declaration.tsx b/packages/csharp/src/components/enum/declaration.tsx index dd1c118c8..b14effffd 100644 --- a/packages/csharp/src/components/enum/declaration.tsx +++ b/packages/csharp/src/components/enum/declaration.tsx @@ -6,6 +6,7 @@ import { Namekey, Refkey, } from "@alloy-js/core"; + import { AccessModifiers, computeModifiersPrefix, diff --git a/packages/csharp/src/components/enum/member.test.tsx b/packages/csharp/src/components/enum/member.test.tsx index c7b541c97..2e9277cca 100644 --- a/packages/csharp/src/components/enum/member.test.tsx +++ b/packages/csharp/src/components/enum/member.test.tsx @@ -1,6 +1,8 @@ -import { TestNamespace } from "#test/utils.jsx"; import { namekey } from "@alloy-js/core"; import { expect, it } from "vitest"; + +import { TestNamespace } from "#test/utils.jsx"; + import { EnumDeclaration } from "./declaration.jsx"; import { EnumMember } from "./member.jsx"; diff --git a/packages/csharp/src/components/enum/member.tsx b/packages/csharp/src/components/enum/member.tsx index cfa801387..b977c1204 100644 --- a/packages/csharp/src/components/enum/member.tsx +++ b/packages/csharp/src/components/enum/member.tsx @@ -6,6 +6,7 @@ import { Namekey, Refkey, } from "@alloy-js/core"; + import { useCSharpNamePolicy } from "../../name-policy.js"; import { useNamedTypeScope } from "../../scopes/contexts.js"; import { CSharpSymbol } from "../../symbols/csharp.js"; diff --git a/packages/csharp/src/components/field/field.test.tsx b/packages/csharp/src/components/field/field.test.tsx index 5a671f5e4..8c601733f 100644 --- a/packages/csharp/src/components/field/field.test.tsx +++ b/packages/csharp/src/components/field/field.test.tsx @@ -1,5 +1,6 @@ import { List, namekey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { TestNamespace } from "../../../test/utils.jsx"; import { ClassDeclaration } from "../class/declaration.jsx"; import { Field } from "./field.jsx"; diff --git a/packages/csharp/src/components/field/field.tsx b/packages/csharp/src/components/field/field.tsx index 6a84aa149..98c89f607 100644 --- a/packages/csharp/src/components/field/field.tsx +++ b/packages/csharp/src/components/field/field.tsx @@ -1,4 +1,5 @@ import { Children, Declaration, Name, Namekey, Refkey } from "@alloy-js/core"; + import { AccessModifiers, computeModifiersPrefix, diff --git a/packages/csharp/src/components/if/if-statement.test.tsx b/packages/csharp/src/components/if/if-statement.test.tsx index 3edcddd81..b0ff8b93a 100644 --- a/packages/csharp/src/components/if/if-statement.test.tsx +++ b/packages/csharp/src/components/if/if-statement.test.tsx @@ -1,5 +1,6 @@ import { d } from "@alloy-js/core/testing"; import { expect, it } from "vitest"; + import { ElseClause, ElseIfClause, IfStatement } from "./if-statement.jsx"; it("works with blocks", () => { diff --git a/packages/csharp/src/components/interface/declaration.test.tsx b/packages/csharp/src/components/interface/declaration.test.tsx index 8103be073..db5491cab 100644 --- a/packages/csharp/src/components/interface/declaration.test.tsx +++ b/packages/csharp/src/components/interface/declaration.test.tsx @@ -1,5 +1,6 @@ import { List, namekey, refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { TestNamespace } from "../../../test/utils.jsx"; import { Attribute } from "../attributes/attributes.jsx"; import { TypeParameterProps } from "../type-parameters/type-parameter.jsx"; diff --git a/packages/csharp/src/components/interface/declaration.tsx b/packages/csharp/src/components/interface/declaration.tsx index d4816bd38..2758a696e 100644 --- a/packages/csharp/src/components/interface/declaration.tsx +++ b/packages/csharp/src/components/interface/declaration.tsx @@ -1,4 +1,5 @@ import * as core from "@alloy-js/core"; + import { AccessModifiers, computeModifiersPrefix, @@ -114,9 +115,11 @@ export function InterfaceDeclaration(props: InterfaceDeclarationProps) { {props.typeParameters && ( )} - {props.children ? + {props.children ? ( {props.children} - : ";"} + ) : ( + ";" + )} ); diff --git a/packages/csharp/src/components/interface/method.test.tsx b/packages/csharp/src/components/interface/method.test.tsx index 9dc5588be..67874d796 100644 --- a/packages/csharp/src/components/interface/method.test.tsx +++ b/packages/csharp/src/components/interface/method.test.tsx @@ -1,6 +1,7 @@ import { namekey, refkey } from "@alloy-js/core"; import { Children } from "@alloy-js/core/jsx-runtime"; import { describe, expect, it } from "vitest"; + import { TestNamespace } from "../../../test/utils.jsx"; import { Attribute } from "../attributes/attributes.jsx"; import { TypeParameterProps } from "../type-parameters/type-parameter.jsx"; diff --git a/packages/csharp/src/components/interface/method.tsx b/packages/csharp/src/components/interface/method.tsx index 86d294716..24bf4acbb 100644 --- a/packages/csharp/src/components/interface/method.tsx +++ b/packages/csharp/src/components/interface/method.tsx @@ -7,6 +7,7 @@ import { Refkey, Scope, } from "@alloy-js/core"; + import { AccessModifiers, computeModifiersPrefix, @@ -100,9 +101,7 @@ export function InterfaceMethod(props: InterfaceMethodProps) { {props.typeParameters && ( )} - {props.children ? - {props.children} - : ";"} + {props.children ? {props.children} : ";"} ); diff --git a/packages/csharp/src/components/interface/property.test.tsx b/packages/csharp/src/components/interface/property.test.tsx index 77da82c19..f114fce12 100644 --- a/packages/csharp/src/components/interface/property.test.tsx +++ b/packages/csharp/src/components/interface/property.test.tsx @@ -1,5 +1,6 @@ import { Children } from "@alloy-js/core/jsx-runtime"; import { describe, expect, it } from "vitest"; + import { namekey } from "../../../../core/src/refkey.js"; import { TestNamespace } from "../../../test/utils.jsx"; import { Attribute } from "../attributes/attributes.jsx"; diff --git a/packages/csharp/src/components/interface/property.tsx b/packages/csharp/src/components/interface/property.tsx index 3530296b4..65628b31f 100644 --- a/packages/csharp/src/components/interface/property.tsx +++ b/packages/csharp/src/components/interface/property.tsx @@ -7,6 +7,7 @@ import { Namekey, Refkey, } from "@alloy-js/core"; + import { AccessModifiers, computeModifiersPrefix, diff --git a/packages/csharp/src/components/invocation-expression/invocation-expression.test.tsx b/packages/csharp/src/components/invocation-expression/invocation-expression.test.tsx index 06f329cc9..4e3896ba6 100644 --- a/packages/csharp/src/components/invocation-expression/invocation-expression.test.tsx +++ b/packages/csharp/src/components/invocation-expression/invocation-expression.test.tsx @@ -1,8 +1,10 @@ +import { namekey } from "@alloy-js/core"; +import { describe, expect, it } from "vitest"; + import { ClassDeclaration } from "#components/class/declaration.jsx"; import { Method } from "#components/method/method.jsx"; import { TestNamespace } from "#test/utils.jsx"; -import { namekey } from "@alloy-js/core"; -import { describe, expect, it } from "vitest"; + import { InvocationExpression } from "./invocation-expression.jsx"; it("makes a call with no arguments", () => { diff --git a/packages/csharp/src/components/lexical-scope.tsx b/packages/csharp/src/components/lexical-scope.tsx index 43b506da7..b60b45589 100644 --- a/packages/csharp/src/components/lexical-scope.tsx +++ b/packages/csharp/src/components/lexical-scope.tsx @@ -4,6 +4,7 @@ import { ScopePropsWithValue, createScope, } from "@alloy-js/core"; + import { useCSharpScope } from "../scopes/contexts.js"; import { CSharpLexicalScope } from "../scopes/lexical.js"; diff --git a/packages/csharp/src/components/method-scope.tsx b/packages/csharp/src/components/method-scope.tsx index a4a0992dc..28d56cc63 100644 --- a/packages/csharp/src/components/method-scope.tsx +++ b/packages/csharp/src/components/method-scope.tsx @@ -4,6 +4,7 @@ import { ScopePropsWithValue, createScope, } from "@alloy-js/core"; + import { useCSharpScope } from "../scopes/contexts.js"; import { CSharpMethodScope } from "../scopes/method.js"; diff --git a/packages/csharp/src/components/method/method.test.tsx b/packages/csharp/src/components/method/method.test.tsx index 6c125f5f5..f24b854eb 100644 --- a/packages/csharp/src/components/method/method.test.tsx +++ b/packages/csharp/src/components/method/method.test.tsx @@ -1,5 +1,6 @@ import { Children } from "@alloy-js/core/jsx-runtime"; import { describe, expect, it } from "vitest"; + import { TestNamespace } from "../../../test/utils.jsx"; import { ClassDeclaration, Method } from "../../index.js"; diff --git a/packages/csharp/src/components/method/method.tsx b/packages/csharp/src/components/method/method.tsx index e97dc65f4..20bf43c26 100644 --- a/packages/csharp/src/components/method/method.tsx +++ b/packages/csharp/src/components/method/method.tsx @@ -7,6 +7,7 @@ import { Refkey, Scope, } from "@alloy-js/core"; + import { AccessModifiers, computeModifiersPrefix, @@ -142,11 +143,13 @@ export function Method(props: MethodProps) { {props.typeParameters && ( )} - {props.abstract ? + {props.abstract ? ( ";" - : props.expression ? + ) : props.expression ? ( {props.children} - : {props.children}} + ) : ( + {props.children} + )} ); diff --git a/packages/csharp/src/components/namespace-scopes.tsx b/packages/csharp/src/components/namespace-scopes.tsx index a487824a1..b18e44ebb 100644 --- a/packages/csharp/src/components/namespace-scopes.tsx +++ b/packages/csharp/src/components/namespace-scopes.tsx @@ -1,5 +1,6 @@ import { Scope } from "@alloy-js/core"; import { Children } from "@alloy-js/core/jsx-runtime"; + import { NamespaceContext } from "../contexts/namespace.js"; import { createCSharpNamespaceScope } from "../scopes/namespace.js"; import { NamespaceSymbol } from "../symbols/namespace.js"; diff --git a/packages/csharp/src/components/namespace.ref.test.tsx b/packages/csharp/src/components/namespace.ref.test.tsx index 7cf29cdf6..bc8f67b66 100644 --- a/packages/csharp/src/components/namespace.ref.test.tsx +++ b/packages/csharp/src/components/namespace.ref.test.tsx @@ -1,5 +1,6 @@ import { List, memberRefkey, namekey, Output, refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { ClassDeclaration } from "./class/declaration.jsx"; import { Namespace } from "./namespace/namespace.jsx"; import { SourceFile } from "./source-file/source-file.jsx"; diff --git a/packages/csharp/src/components/namespace/namespace.test.tsx b/packages/csharp/src/components/namespace/namespace.test.tsx index e53e57b43..153386c83 100644 --- a/packages/csharp/src/components/namespace/namespace.test.tsx +++ b/packages/csharp/src/components/namespace/namespace.test.tsx @@ -1,7 +1,9 @@ -import { TestNamespace } from "#test/utils.jsx"; import { Output, refkey } from "@alloy-js/core"; import { d } from "@alloy-js/core/testing"; import { expect, it } from "vitest"; + +import { TestNamespace } from "#test/utils.jsx"; + import { createCSharpNamePolicy } from "../../name-policy.js"; import { ClassDeclaration } from "../class/declaration.jsx"; import { Constructor } from "../constructor/constructor.jsx"; diff --git a/packages/csharp/src/components/namespace/namespace.tsx b/packages/csharp/src/components/namespace/namespace.tsx index a382945bf..2288659ec 100644 --- a/packages/csharp/src/components/namespace/namespace.tsx +++ b/packages/csharp/src/components/namespace/namespace.tsx @@ -1,5 +1,6 @@ import { Block, Namekey, Refkey } from "@alloy-js/core"; import { Children } from "@alloy-js/core/jsx-runtime"; + import { NamespaceContext, useNamespaceContext, diff --git a/packages/csharp/src/components/parameters/parameters.test.tsx b/packages/csharp/src/components/parameters/parameters.test.tsx index d69a16c8a..5bef78bfb 100644 --- a/packages/csharp/src/components/parameters/parameters.test.tsx +++ b/packages/csharp/src/components/parameters/parameters.test.tsx @@ -1,10 +1,12 @@ +import { List, memberRefkey, namekey } from "@alloy-js/core"; +import { Children } from "@alloy-js/core/jsx-runtime"; +import { expect, it } from "vitest"; + import { Attribute } from "#components/attributes/attributes.jsx"; import { ClassDeclaration } from "#components/class/declaration.jsx"; import { Method } from "#components/method/method.jsx"; import { Property } from "#components/property/property.jsx"; -import { List, memberRefkey, namekey } from "@alloy-js/core"; -import { Children } from "@alloy-js/core/jsx-runtime"; -import { expect, it } from "vitest"; + import { TestNamespace } from "../../../test/utils.jsx"; const Wrapper = (props: { children: Children }) => ( diff --git a/packages/csharp/src/components/parameters/parameters.tsx b/packages/csharp/src/components/parameters/parameters.tsx index c462361b3..d7799ead5 100644 --- a/packages/csharp/src/components/parameters/parameters.tsx +++ b/packages/csharp/src/components/parameters/parameters.tsx @@ -8,6 +8,7 @@ import { Namekey, Refkey, } from "@alloy-js/core"; + import { createParameterSymbol } from "../../symbols/factories.js"; import { AttributeList, AttributesProp } from "../attributes/attributes.jsx"; import { Name } from "../Name.jsx"; @@ -82,9 +83,11 @@ export function Parameter(props: ParameterProps) { ); } const modifier = - modifiers.length === 0 ? "" - : modifiers[0] === "refReadonly" ? "ref readonly " - : modifiers[0] + " "; + modifiers.length === 0 + ? "" + : modifiers[0] === "refReadonly" + ? "ref readonly " + : modifiers[0] + " "; return ( diff --git a/packages/csharp/src/components/property/property.test.tsx b/packages/csharp/src/components/property/property.test.tsx index c39eb6046..ebbfa46fb 100644 --- a/packages/csharp/src/components/property/property.test.tsx +++ b/packages/csharp/src/components/property/property.test.tsx @@ -1,5 +1,6 @@ import { Children } from "@alloy-js/core/jsx-runtime"; import { describe, expect, it } from "vitest"; + import { TestNamespace } from "../../../test/utils.jsx"; import { Attribute } from "../attributes/attributes.jsx"; import { ClassDeclaration } from "../class/declaration.jsx"; diff --git a/packages/csharp/src/components/property/property.tsx b/packages/csharp/src/components/property/property.tsx index 224df1c90..6871e7003 100644 --- a/packages/csharp/src/components/property/property.tsx +++ b/packages/csharp/src/components/property/property.tsx @@ -8,6 +8,7 @@ import { Namekey, Refkey, } from "@alloy-js/core"; + import { AccessModifiers, computeModifiersPrefix, @@ -183,15 +184,16 @@ export function Property(props: PropertyProps) { {modifiers} {props.type} {props.nullable && "?"} - {hasAccessorBody ? + {hasAccessorBody ? ( - : - } + )} ); } diff --git a/packages/csharp/src/components/record/declaration.test.tsx b/packages/csharp/src/components/record/declaration.test.tsx index 48fb30ce5..f6bb4fd4e 100644 --- a/packages/csharp/src/components/record/declaration.test.tsx +++ b/packages/csharp/src/components/record/declaration.test.tsx @@ -1,5 +1,6 @@ import { Children, code, namekey, refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { TestNamespace } from "../../../test/utils.jsx"; import { Property } from "../property/property.jsx"; import { RecordDeclaration } from "./declaration.jsx"; diff --git a/packages/csharp/src/components/record/declaration.tsx b/packages/csharp/src/components/record/declaration.tsx index 47b37be2e..b3170a43d 100644 --- a/packages/csharp/src/components/record/declaration.tsx +++ b/packages/csharp/src/components/record/declaration.tsx @@ -1,4 +1,5 @@ import * as core from "@alloy-js/core"; + import { AccessModifiers, computeModifiersPrefix, @@ -122,11 +123,13 @@ export function RecordDeclaration(props: RecordDeclarationProps) { )} - {props.children ? + {props.children ? ( {props.children} - : ";"} + ) : ( + ";" + )} ); } diff --git a/packages/csharp/src/components/region/region.test.tsx b/packages/csharp/src/components/region/region.test.tsx index 71b7f5da0..6b2095e1d 100644 --- a/packages/csharp/src/components/region/region.test.tsx +++ b/packages/csharp/src/components/region/region.test.tsx @@ -1,5 +1,6 @@ import { Children } from "@alloy-js/core/jsx-runtime"; import { expect, it } from "vitest"; + import { TestNamespace } from "../../../test/utils.jsx"; import { Region } from "./region.jsx"; diff --git a/packages/csharp/src/components/source-file/source-file.test.tsx b/packages/csharp/src/components/source-file/source-file.test.tsx index cf39f176d..64004fdbf 100644 --- a/packages/csharp/src/components/source-file/source-file.test.tsx +++ b/packages/csharp/src/components/source-file/source-file.test.tsx @@ -1,6 +1,3 @@ -import { Attribute } from "#components/attributes/attributes.jsx"; -import { ClassDeclaration } from "#components/class/declaration.jsx"; -import { Namespace } from "#components/namespace/namespace.jsx"; import { Children, FormatOptions, @@ -11,6 +8,11 @@ import { } from "@alloy-js/core"; import { Serialization } from "@alloy-js/csharp/global/System/Text/Json"; import { describe, expect, it } from "vitest"; + +import { Attribute } from "#components/attributes/attributes.jsx"; +import { ClassDeclaration } from "#components/class/declaration.jsx"; +import { Namespace } from "#components/namespace/namespace.jsx"; + import { CSharpFormatOptions } from "../../contexts/format-options.js"; import { SourceFile } from "./source-file.jsx"; diff --git a/packages/csharp/src/components/source-file/source-file.tsx b/packages/csharp/src/components/source-file/source-file.tsx index b04af15ff..849727a47 100644 --- a/packages/csharp/src/components/source-file/source-file.tsx +++ b/packages/csharp/src/components/source-file/source-file.tsx @@ -1,8 +1,3 @@ -import { DocComment } from "#components/doc/comment.jsx"; -import { NamespaceScopes } from "#components/namespace-scopes.jsx"; -import { NamespaceName } from "#components/namespace/namespace-name.jsx"; -import { Reference } from "#components/Reference.jsx"; -import { Usings } from "#components/using/using.jsx"; import { Block, Children, @@ -14,6 +9,13 @@ import { Show, useBinder, } from "@alloy-js/core"; + +import { DocComment } from "#components/doc/comment.jsx"; +import { NamespaceScopes } from "#components/namespace-scopes.jsx"; +import { NamespaceName } from "#components/namespace/namespace-name.jsx"; +import { Reference } from "#components/Reference.jsx"; +import { Usings } from "#components/using/using.jsx"; + import { CSharpFormatOptions, useCsharpFormatOptions, @@ -76,12 +78,12 @@ export function SourceFile(props: SourceFileProps) { }); const header = - props.header || props.headerComment ? + props.header || props.headerComment ? ( - : undefined; + ) : undefined; return ( )} - {nsSymbol === globalNs ? + {nsSymbol === globalNs ? ( content - : <> + ) : ( + <> namespace - {sourceFileScope.hasBlockNamespace ? + {sourceFileScope.hasBlockNamespace ? ( {content} - : <> + ) : ( + <> ; {content} - } + )} - } + )} ); diff --git a/packages/csharp/src/components/source-file/using.test.tsx b/packages/csharp/src/components/source-file/using.test.tsx index 91e3697fa..2dcbadd54 100644 --- a/packages/csharp/src/components/source-file/using.test.tsx +++ b/packages/csharp/src/components/source-file/using.test.tsx @@ -1,12 +1,14 @@ +import { Output, refkey } from "@alloy-js/core"; +import * as coretest from "@alloy-js/core/testing"; +import { expect, it } from "vitest"; + import { ClassDeclaration } from "#components/class/declaration.jsx"; import { EnumDeclaration } from "#components/enum/declaration.jsx"; import { EnumMember } from "#components/enum/member.jsx"; import { Method } from "#components/method/method.jsx"; import { Namespace } from "#components/namespace/namespace.jsx"; import { SourceFile } from "#components/source-file/source-file.jsx"; -import { Output, refkey } from "@alloy-js/core"; -import * as coretest from "@alloy-js/core/testing"; -import { expect, it } from "vitest"; + import { createCSharpNamePolicy } from "../../name-policy.js"; it("using on source file are placed above file namespace statement", () => { diff --git a/packages/csharp/src/components/stc/index.ts b/packages/csharp/src/components/stc/index.ts index 33be263fd..cc7c93f83 100644 --- a/packages/csharp/src/components/stc/index.ts +++ b/packages/csharp/src/components/stc/index.ts @@ -1,4 +1,5 @@ import * as core from "@alloy-js/core"; + import * as base from "../index.js"; export const ClassDeclaration = core.stc(base.ClassDeclaration); diff --git a/packages/csharp/src/components/struct/declaration.test.tsx b/packages/csharp/src/components/struct/declaration.test.tsx index b6c40736c..94ffa215e 100644 --- a/packages/csharp/src/components/struct/declaration.test.tsx +++ b/packages/csharp/src/components/struct/declaration.test.tsx @@ -1,5 +1,6 @@ import { List, namekey, refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { TestNamespace } from "../../../test/utils.jsx"; import { Attribute } from "../attributes/attributes.jsx"; import { Constructor } from "../constructor/constructor.jsx"; diff --git a/packages/csharp/src/components/struct/declaration.tsx b/packages/csharp/src/components/struct/declaration.tsx index 2454f5ada..3495d792a 100644 --- a/packages/csharp/src/components/struct/declaration.tsx +++ b/packages/csharp/src/components/struct/declaration.tsx @@ -1,5 +1,6 @@ import * as core from "@alloy-js/core"; import { join } from "@alloy-js/core"; + import { AccessModifiers, computeModifiersPrefix, @@ -112,9 +113,9 @@ export function StructDeclaration(props: StructDeclarationProps) { ]); const base = - props.interfaceTypes && props.interfaceTypes.length > 0 ? + props.interfaceTypes && props.interfaceTypes.length > 0 ? ( <> : {join(props.interfaceTypes, { joiner: ", " })} - : null; + ) : null; return ( @@ -128,11 +129,13 @@ export function StructDeclaration(props: StructDeclarationProps) { {props.typeParameters && ( )} - {props.children ? + {props.children ? ( {props.children} - : ";"} + ) : ( + ";" + )} ); } diff --git a/packages/csharp/src/components/type-parameters/type-parameter-constraints.test.tsx b/packages/csharp/src/components/type-parameters/type-parameter-constraints.test.tsx index 77af41c0e..76f067fd9 100644 --- a/packages/csharp/src/components/type-parameters/type-parameter-constraints.test.tsx +++ b/packages/csharp/src/components/type-parameters/type-parameter-constraints.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { TypeParameterConstraints } from "./type-parameter-constraints.jsx"; it("renders nothing if there is no constraints", () => { diff --git a/packages/csharp/src/components/type-parameters/type-parameter-constraints.tsx b/packages/csharp/src/components/type-parameters/type-parameter-constraints.tsx index 604c586be..79dd10a8b 100644 --- a/packages/csharp/src/components/type-parameters/type-parameter-constraints.tsx +++ b/packages/csharp/src/components/type-parameters/type-parameter-constraints.tsx @@ -1,4 +1,5 @@ import { Children, code, For, Indent } from "@alloy-js/core"; + import { TypeParameterProps } from "./type-parameter.jsx"; import { normalizeParameters } from "./type-parameters.jsx"; diff --git a/packages/csharp/src/components/type-parameters/type-parameter.tsx b/packages/csharp/src/components/type-parameters/type-parameter.tsx index 1b8a6eaef..fd1b32494 100644 --- a/packages/csharp/src/components/type-parameters/type-parameter.tsx +++ b/packages/csharp/src/components/type-parameters/type-parameter.tsx @@ -5,6 +5,7 @@ import { Namekey, Refkey, } from "@alloy-js/core"; + import { createTypeParameterSymbol } from "../../symbols/factories.js"; /** diff --git a/packages/csharp/src/components/type-parameters/type-parameters.test.tsx b/packages/csharp/src/components/type-parameters/type-parameters.test.tsx index 7120df4ce..212aa6aef 100644 --- a/packages/csharp/src/components/type-parameters/type-parameters.test.tsx +++ b/packages/csharp/src/components/type-parameters/type-parameters.test.tsx @@ -1,5 +1,6 @@ import { namekey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { TestNamespace } from "../../../test/utils.jsx"; import { TypeParameters } from "./type-parameters.jsx"; diff --git a/packages/csharp/src/components/type-parameters/type-parameters.tsx b/packages/csharp/src/components/type-parameters/type-parameters.tsx index d453d619f..2e6296a76 100644 --- a/packages/csharp/src/components/type-parameters/type-parameters.tsx +++ b/packages/csharp/src/components/type-parameters/type-parameters.tsx @@ -1,4 +1,5 @@ import { For, Indent, taggedComponent } from "@alloy-js/core"; + import { TypeParameter, TypeParameterProps } from "./type-parameter.jsx"; export const typeParametersTag = Symbol.for("csharp.type-parameters"); diff --git a/packages/csharp/src/components/using/using.test.tsx b/packages/csharp/src/components/using/using.test.tsx index f69dc4a58..4d59d2ca7 100644 --- a/packages/csharp/src/components/using/using.test.tsx +++ b/packages/csharp/src/components/using/using.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { Usings } from "./using.jsx"; it("single using", () => { diff --git a/packages/csharp/src/components/using/using.tsx b/packages/csharp/src/components/using/using.tsx index aa97039e7..b86cf6211 100644 --- a/packages/csharp/src/components/using/using.tsx +++ b/packages/csharp/src/components/using/using.tsx @@ -1,4 +1,5 @@ import { computed, For } from "@alloy-js/core"; + import { NamespaceSymbol } from "../../symbols/namespace.js"; export interface UsingsProps { @@ -46,7 +47,7 @@ export function UsingNamespaceDirective(props: UsingNamespaceDirective) { } function getNamespaceName(namespace: string | NamespaceSymbol): string { - return typeof namespace === "string" ? namespace : ( - namespace.getFullyQualifiedName({ omitGlobal: true }) - ); + return typeof namespace === "string" + ? namespace + : namespace.getFullyQualifiedName({ omitGlobal: true }); } diff --git a/packages/csharp/src/components/var/declaration.test.tsx b/packages/csharp/src/components/var/declaration.test.tsx index 1df12d566..f7ceef003 100644 --- a/packages/csharp/src/components/var/declaration.test.tsx +++ b/packages/csharp/src/components/var/declaration.test.tsx @@ -1,5 +1,6 @@ import { List, namekey, refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { TestNamespace } from "../../../test/utils.jsx"; import { VarDeclaration } from "./declaration.jsx"; diff --git a/packages/csharp/src/components/var/declaration.tsx b/packages/csharp/src/components/var/declaration.tsx index d99948187..224404cb3 100644 --- a/packages/csharp/src/components/var/declaration.tsx +++ b/packages/csharp/src/components/var/declaration.tsx @@ -7,6 +7,7 @@ import { Namekey, Refkey, } from "@alloy-js/core"; + import { computeModifiersPrefix, makeModifiers } from "../../modifiers.js"; import { createVariableSymbol } from "../../symbols/factories.js"; diff --git a/packages/csharp/src/contexts/global-namespace.ts b/packages/csharp/src/contexts/global-namespace.ts index 045739f59..bf91d4611 100644 --- a/packages/csharp/src/contexts/global-namespace.ts +++ b/packages/csharp/src/contexts/global-namespace.ts @@ -1,4 +1,5 @@ import { Binder, createSymbol, useBinder } from "@alloy-js/core"; + import { NamespaceSymbol } from "../symbols/namespace.js"; export function useGlobalNamespace() { diff --git a/packages/csharp/src/contexts/namespace.ts b/packages/csharp/src/contexts/namespace.ts index a9e77ef7e..fbedb0d97 100644 --- a/packages/csharp/src/contexts/namespace.ts +++ b/packages/csharp/src/contexts/namespace.ts @@ -1,4 +1,5 @@ import { ComponentContext, createContext, useContext } from "@alloy-js/core"; + import { NamespaceSymbol } from "../symbols/namespace.js"; export interface NamespaceContext { diff --git a/packages/csharp/src/create-library.test.tsx b/packages/csharp/src/create-library.test.tsx index 627f47697..e6414cc26 100644 --- a/packages/csharp/src/create-library.test.tsx +++ b/packages/csharp/src/create-library.test.tsx @@ -1,8 +1,10 @@ +import { List, memberRefkey, namekey, toRefkey } from "@alloy-js/core"; +import { beforeEach, expect, it } from "vitest"; + import { VarDeclaration } from "#components/index.js"; import { InvocationExpression } from "#components/invocation-expression/invocation-expression.jsx"; import { TestNamespace } from "#test/utils.jsx"; -import { List, memberRefkey, namekey, toRefkey } from "@alloy-js/core"; -import { beforeEach, expect, it } from "vitest"; + import { IO } from "./builtins/System/index.js"; import { getGlobalNamespace, diff --git a/packages/csharp/src/create-library.ts b/packages/csharp/src/create-library.ts index ae0efd894..a6dca662c 100644 --- a/packages/csharp/src/create-library.ts +++ b/packages/csharp/src/create-library.ts @@ -8,6 +8,7 @@ import { TO_SYMBOL, useBinder, } from "@alloy-js/core"; + import { getGlobalNamespace } from "./contexts/global-namespace.js"; import { MethodKinds, MethodSymbol } from "./index.js"; import { CSharpSymbol } from "./symbols/csharp.js"; @@ -89,9 +90,9 @@ export type Descriptor = | GenericDescriptor; export type ResolveDescriptor = - D extends NamedTypeDescriptor ? - LibrarySymbolReference & { [K in keyof M]: ResolveDescriptor } - : LibrarySymbolReference; + D extends NamedTypeDescriptor + ? LibrarySymbolReference & { [K in keyof M]: ResolveDescriptor } + : LibrarySymbolReference; export type LibraryFrom = { [K in keyof T]: ResolveDescriptor; @@ -263,10 +264,11 @@ function createSymbolFromDescriptor( binder, refkeys: refkey(), type: - descriptor.type === undefined ? undefined - : typeof descriptor.type === "function" ? - descriptor.type()[TO_SYMBOL]() - : descriptor.type[TO_SYMBOL](), + descriptor.type === undefined + ? undefined + : typeof descriptor.type === "function" + ? descriptor.type()[TO_SYMBOL]() + : descriptor.type[TO_SYMBOL](), isNullable: descriptor.isNullable, lazyMemberInitializer, }); diff --git a/packages/csharp/src/name-policy.test.ts b/packages/csharp/src/name-policy.test.ts index d222685c7..7d210dd45 100644 --- a/packages/csharp/src/name-policy.test.ts +++ b/packages/csharp/src/name-policy.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { isValidCSharpIdentifier, sanitizeCSharpIdentifier, diff --git a/packages/csharp/src/name-policy.ts b/packages/csharp/src/name-policy.ts index 323f1559c..166eebc6f 100644 --- a/packages/csharp/src/name-policy.ts +++ b/packages/csharp/src/name-policy.ts @@ -1,5 +1,6 @@ import * as core from "@alloy-js/core"; import * as changecase from "change-case"; + import { sanitizeCSharpIdentifier } from "./identifier-utils.js"; import { isCSharpKeyword } from "./keywords.js"; diff --git a/packages/csharp/src/scopes/class.ts b/packages/csharp/src/scopes/class.ts index b4ef02566..8bfc21997 100644 --- a/packages/csharp/src/scopes/class.ts +++ b/packages/csharp/src/scopes/class.ts @@ -1,4 +1,5 @@ import type { OutputSpace } from "@alloy-js/core"; + import { CSharpNamedTypeScope } from "./named-type.js"; export class CSharpClassScope extends CSharpNamedTypeScope { diff --git a/packages/csharp/src/scopes/contexts.ts b/packages/csharp/src/scopes/contexts.ts index 331106878..a3d6b7314 100644 --- a/packages/csharp/src/scopes/contexts.ts +++ b/packages/csharp/src/scopes/contexts.ts @@ -1,4 +1,5 @@ import { useScope } from "@alloy-js/core"; + import { CSharpScope } from "./csharp.js"; import { CSharpLexicalScope } from "./lexical.js"; import { CSharpMethodScope } from "./method.js"; diff --git a/packages/csharp/src/scopes/csharp.ts b/packages/csharp/src/scopes/csharp.ts index 248905684..a2685d35b 100644 --- a/packages/csharp/src/scopes/csharp.ts +++ b/packages/csharp/src/scopes/csharp.ts @@ -1,4 +1,5 @@ import { OutputScope, OutputScopeOptions } from "@alloy-js/core"; + import type { CSharpSymbol } from "../symbols/csharp.js"; import { NamespaceSymbol } from "../symbols/namespace.js"; diff --git a/packages/csharp/src/scopes/factories.ts b/packages/csharp/src/scopes/factories.ts index ce204228c..f81a7befe 100644 --- a/packages/csharp/src/scopes/factories.ts +++ b/packages/csharp/src/scopes/factories.ts @@ -1,4 +1,5 @@ import { OutputScopeOptions, createScope } from "@alloy-js/core"; + import { NamedTypeSymbol } from "../symbols/named-type.js"; import { CSharpClassScope } from "./class.js"; import { useCSharpScope, useNamedTypeScope } from "./contexts.js"; diff --git a/packages/csharp/src/scopes/lexical.ts b/packages/csharp/src/scopes/lexical.ts index 13a461e89..55970cb92 100644 --- a/packages/csharp/src/scopes/lexical.ts +++ b/packages/csharp/src/scopes/lexical.ts @@ -1,4 +1,5 @@ import { type OutputSpace } from "@alloy-js/core"; + import { CSharpScope } from "./csharp.js"; export class CSharpLexicalScope extends CSharpScope { diff --git a/packages/csharp/src/scopes/method.ts b/packages/csharp/src/scopes/method.ts index 236650d22..bcc69ef85 100644 --- a/packages/csharp/src/scopes/method.ts +++ b/packages/csharp/src/scopes/method.ts @@ -1,4 +1,5 @@ import type { OutputSpace } from "@alloy-js/core"; + import { CSharpLexicalScope } from "./lexical.js"; export class CSharpMethodScope extends CSharpLexicalScope { diff --git a/packages/csharp/src/scopes/named-type.ts b/packages/csharp/src/scopes/named-type.ts index 14b92fb7a..2cb37f89b 100644 --- a/packages/csharp/src/scopes/named-type.ts +++ b/packages/csharp/src/scopes/named-type.ts @@ -1,4 +1,5 @@ import { type OutputScopeOptions } from "@alloy-js/core"; + import { NamedTypeSymbol } from "../symbols/named-type.js"; import { CSharpScope } from "./csharp.js"; import { CSharpSourceFileScope } from "./source-file.js"; diff --git a/packages/csharp/src/scopes/namespace.ts b/packages/csharp/src/scopes/namespace.ts index 351fa41fc..50362622d 100644 --- a/packages/csharp/src/scopes/namespace.ts +++ b/packages/csharp/src/scopes/namespace.ts @@ -1,4 +1,5 @@ import { OutputScope, createScope, useScope } from "@alloy-js/core"; + import type { NamespaceSymbol } from "../symbols/namespace.js"; import { CSharpNamedTypeScope } from "./named-type.js"; import { CSharpSourceFileScope } from "./source-file.js"; diff --git a/packages/csharp/src/scopes/source-file.ts b/packages/csharp/src/scopes/source-file.ts index dd510442a..06b15b417 100644 --- a/packages/csharp/src/scopes/source-file.ts +++ b/packages/csharp/src/scopes/source-file.ts @@ -8,6 +8,7 @@ import { TriggerOpTypes, useScope, } from "@alloy-js/core"; + import { NamespaceSymbol } from "../symbols/namespace.js"; import { CSharpLexicalScope } from "./lexical.js"; import { CSharpNamespaceScope } from "./namespace.js"; diff --git a/packages/csharp/src/symbols/csharp.ts b/packages/csharp/src/symbols/csharp.ts index 9ef8a03d3..d1b0bda43 100644 --- a/packages/csharp/src/symbols/csharp.ts +++ b/packages/csharp/src/symbols/csharp.ts @@ -12,6 +12,7 @@ import { TriggerOpTypes, watch, } from "@alloy-js/core"; + import { AccessModifiers, NonAccessModifiers } from "../modifiers.js"; import type { CSharpScope } from "../scopes/csharp.js"; import { NamespaceSymbol } from "./namespace.js"; @@ -106,8 +107,6 @@ export class CSharpSymbol extends OutputSymbol { return (firstSpace.scope as CSharpScope).enclosingNamespace; } throw new Error("No place to get namespace symbol from"); - - return undefined; } #accessibility: DeclaredAccessibility | undefined; diff --git a/packages/csharp/src/symbols/factories.ts b/packages/csharp/src/symbols/factories.ts index 62de38a45..aa1b72712 100644 --- a/packages/csharp/src/symbols/factories.ts +++ b/packages/csharp/src/symbols/factories.ts @@ -6,6 +6,7 @@ import { OutputSymbolOptions, useBinder, } from "@alloy-js/core"; + import { getGlobalNamespace } from "../contexts/global-namespace.js"; import { useNamespaceContext } from "../contexts/namespace.js"; import { CSharpElements, useCSharpNamePolicy } from "../name-policy.js"; diff --git a/packages/csharp/src/symbols/method.ts b/packages/csharp/src/symbols/method.ts index 4343ee59e..96a16313f 100644 --- a/packages/csharp/src/symbols/method.ts +++ b/packages/csharp/src/symbols/method.ts @@ -1,4 +1,5 @@ import { Namekey, OutputSpace } from "@alloy-js/core"; + import { CSharpSymbol, CSharpSymbolOptions } from "./csharp.js"; export type MethodKinds = "ordinary" | "constructor"; diff --git a/packages/csharp/src/symbols/named-type.ts b/packages/csharp/src/symbols/named-type.ts index 29f8df3ee..4de4dfd00 100644 --- a/packages/csharp/src/symbols/named-type.ts +++ b/packages/csharp/src/symbols/named-type.ts @@ -1,4 +1,5 @@ import { Namekey, OutputSpace, createSymbol } from "@alloy-js/core"; + import { CSharpSymbol, CSharpSymbolOptions } from "./csharp.js"; // represents a symbol from a .cs file. Class, enum, interface etc. diff --git a/packages/csharp/src/symbols/namespace.ts b/packages/csharp/src/symbols/namespace.ts index 049bb0754..f22835c92 100644 --- a/packages/csharp/src/symbols/namespace.ts +++ b/packages/csharp/src/symbols/namespace.ts @@ -1,4 +1,5 @@ import { Namekey, OutputSymbolOptions, createSymbol } from "@alloy-js/core"; + import { NamedTypeSymbol } from "./named-type.js"; export interface NamespaceSymbolOptions extends OutputSymbolOptions { diff --git a/packages/csharp/src/symbols/reference.tsx b/packages/csharp/src/symbols/reference.tsx index 49efdde6c..6f8acb611 100644 --- a/packages/csharp/src/symbols/reference.tsx +++ b/packages/csharp/src/symbols/reference.tsx @@ -1,4 +1,3 @@ -import { AccessExpression } from "#components/access-expression/access-expression.jsx"; import { Children, memo, @@ -7,6 +6,9 @@ import { resolve, unresolvedRefkey, } from "@alloy-js/core"; + +import { AccessExpression } from "#components/access-expression/access-expression.jsx"; + import { useReferenceContext } from "../contexts/reference-context.js"; import { CSharpScope } from "../scopes/csharp.js"; import { CSharpNamespaceScope } from "../scopes/namespace.js"; diff --git a/packages/csharp/test/utils.tsx b/packages/csharp/test/utils.tsx index 7cc1ec4d0..cfe4819a4 100644 --- a/packages/csharp/test/utils.tsx +++ b/packages/csharp/test/utils.tsx @@ -1,4 +1,5 @@ import * as core from "@alloy-js/core"; + import * as csharp from "../src/index.js"; export interface TestNamespaceProps extends csharp.CSharpFormatOptions { diff --git a/packages/csharp/testing/create-wrapper.test.tsx b/packages/csharp/testing/create-wrapper.test.tsx index db02ed086..8c8ff8d23 100644 --- a/packages/csharp/testing/create-wrapper.test.tsx +++ b/packages/csharp/testing/create-wrapper.test.tsx @@ -1,12 +1,14 @@ +import { List, Refkey } from "@alloy-js/core"; +import { d } from "@alloy-js/core/testing"; +import { expect, it } from "vitest"; + import { ClassDeclaration, Method, Property, StructDeclaration, } from "#components/index.js"; -import { List, Refkey } from "@alloy-js/core"; -import { d } from "@alloy-js/core/testing"; -import { expect, it } from "vitest"; + import { createCSharpTestWrapper } from "./create-wrapper.jsx"; it("should render defkey inline", async () => { diff --git a/packages/csharp/testing/create-wrapper.tsx b/packages/csharp/testing/create-wrapper.tsx index 8edc22bfd..5d7ee64fa 100644 --- a/packages/csharp/testing/create-wrapper.tsx +++ b/packages/csharp/testing/create-wrapper.tsx @@ -1,6 +1,8 @@ -import { SourceFile } from "#components/index.js"; import { createSymbol } from "@alloy-js/core"; import { createTestWrapper, type TestWrapper } from "@alloy-js/core/testing"; + +import { SourceFile } from "#components/index.js"; + import { CSharpSymbol, useSourceFileScope } from "../src/index.js"; export function createCSharpTestWrapper(): TestWrapper { diff --git a/packages/devtools/.oxlintrc.json b/packages/devtools/.oxlintrc.json new file mode 100644 index 000000000..714c66348 --- /dev/null +++ b/packages/devtools/.oxlintrc.json @@ -0,0 +1,26 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["typescript", "react-hooks"], + "env": { + "browser": true, + "es2020": true + }, + "categories": { + "correctness": "error" + }, + "ignorePatterns": ["dist"], + "rules": { + "typescript/no-explicit-any": "off", + "no-unused-vars": [ + "warn", + { + "varsIgnorePattern": "^_", + "argsIgnorePattern": ".*", + "caughtErrorsIgnorePattern": ".*" + } + ], + "no-useless-assignment": "off", + "react-hooks/rules-of-hooks": "error", + "react-hooks/exhaustive-deps": "warn" + } +} diff --git a/packages/devtools/eslint.config.js b/packages/devtools/eslint.config.js deleted file mode 100644 index fb5cd9b1c..000000000 --- a/packages/devtools/eslint.config.js +++ /dev/null @@ -1,43 +0,0 @@ -import js from "@eslint/js"; -import reactHooks from "eslint-plugin-react-hooks"; -import reactRefresh from "eslint-plugin-react-refresh"; -import { defineConfig, globalIgnores } from "eslint/config"; -import globals from "globals"; -import { dirname } from "path"; -import tseslint from "typescript-eslint"; -import { fileURLToPath } from "url"; - -export default defineConfig([ - globalIgnores(["dist"]), - { - files: ["**/*.{ts,tsx}"], - extends: [ - js.configs.recommended, - tseslint.configs.recommended, - reactHooks.configs.flat.recommended, - reactRefresh.configs.vite, - ], - languageOptions: { - ecmaVersion: 2020, - globals: globals.browser, - parserOptions: { - tsconfigRootDir: dirname(fileURLToPath(import.meta.url)), - }, - }, - rules: { - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unused-vars": [ - "warn", - { - varsIgnorePattern: "^_", - argsIgnorePattern: ".*", - caughtErrorsIgnorePattern: ".*", - }, - ], - "react-hooks/refs": "off", - "react-hooks/incompatible-library": "off", - "no-useless-assignment": "off", - "react-refresh/only-export-components": "off", - }, - }, -]); diff --git a/packages/devtools/package.json b/packages/devtools/package.json index b761b864a..f8e8daccc 100644 --- a/packages/devtools/package.json +++ b/packages/devtools/package.json @@ -10,7 +10,7 @@ "scripts": { "dev": "vite", "build": "tsc -b && vite build && node ../core/scripts/copy-devtools-ui.mjs", - "lint": "eslint .", + "lint": "oxlint", "preview": "vite preview" }, "dependencies": { @@ -35,19 +35,14 @@ }, "devDependencies": { "@alloy-js/core": "workspace:~", - "@eslint/js": "catalog:", "@types/diff-match-patch": "catalog:", "@types/node": "catalog:", "@types/react": "catalog:", "@types/react-dom": "catalog:", "@vitejs/plugin-react": "catalog:", - "eslint": "catalog:", - "eslint-plugin-react-hooks": "catalog:", - "eslint-plugin-react-refresh": "catalog:", - "globals": "catalog:", + "oxlint": "catalog:", "tw-animate-css": "catalog:", "typescript": "catalog:", - "typescript-eslint": "catalog:", "vite": "npm:rolldown-vite@7.3.1", "vite-plugin-singlefile": "catalog:", "vitest": "catalog:" diff --git a/packages/devtools/src/App.tsx b/packages/devtools/src/App.tsx index f3ce040ef..eb104557b 100644 --- a/packages/devtools/src/App.tsx +++ b/packages/devtools/src/App.tsx @@ -1,3 +1,5 @@ +import { useCallback, useEffect, useRef, useState } from "react"; + import { ComponentView } from "@/components/component-view"; import { DiagnosticView } from "@/components/diagnostic-view"; import { EffectDetailView } from "@/components/effect-detail-view"; @@ -27,7 +29,6 @@ import { ToastStateProvider } from "@/hooks/toast-state-provider"; import { useDebugConnection } from "@/hooks/use-debug-connection"; import { useDevtoolsAppState } from "@/hooks/use-devtools-app-state"; import { DevtoolsAppStateProvider } from "@/hooks/use-devtools-app-state-context"; -import { useCallback, useEffect, useRef, useState } from "react"; function App() { const [filesOpen, setFilesOpen] = useState(true); @@ -126,9 +127,11 @@ function App() { className="flex flex-col min-h-0" style={{ flex: - filesOpen && symbolsOpen ? `0 0 ${sidebarSplit}%` - : filesOpen ? "1 1 auto" - : "0 0 auto", + filesOpen && symbolsOpen + ? `0 0 ${sidebarSplit}%` + : filesOpen + ? "1 1 auto" + : "0 0 auto", }} > - {activeTab ? - activeTab.type === "file" ? + {activeTab ? ( + activeTab.type === "file" ? ( - : activeTab.type === "component" ? + ) : activeTab.type === "component" ? ( - : activeTab.type === "error" ? + ) : activeTab.type === "error" ? ( - : activeTab.type === "diagnostic" ? + ) : activeTab.type === "diagnostic" ? ( - : activeTab.type === "effect" ? + ) : activeTab.type === "effect" ? ( @@ -203,7 +207,7 @@ function App() { openDetailTab(`ref:${id}`, label, "ref") } /> - : activeTab.type === "ref" ? + ) : activeTab.type === "ref" ? ( @@ -217,24 +221,24 @@ function App() { openDetailTab(`ref:${id}`, label, "ref") } /> - : ( - activeTab.type === "symbol" || - activeTab.type === "scope" - ) ? + ) : activeTab.type === "symbol" || + activeTab.type === "scope" ? ( - :
+ ) : ( +

Content for {activeTab.type}: {activeTab.id}

- - :
+ ) + ) : ( +
Open a file or symbol to view its contents
- } + )}
diff --git a/packages/devtools/src/components/component-stack.tsx b/packages/devtools/src/components/component-stack.tsx index 0d09a0480..6c163242f 100644 --- a/packages/devtools/src/components/component-stack.tsx +++ b/packages/devtools/src/components/component-stack.tsx @@ -123,9 +123,8 @@ export function ComponentStack({ entries }: ComponentStackProps) { return (
{[...entries].reverse().map((entry, index) => { - const location = - entry.source ? - `${formatPath(entry.source.fileName)}:${entry.source.lineNumber}:${entry.source.columnNumber}` + const location = entry.source + ? `${formatPath(entry.source.fileName)}:${entry.source.lineNumber}:${entry.source.columnNumber}` : undefined; const canOpenNode = entry.renderNodeId !== undefined && entry.renderNodeId !== null; @@ -134,9 +133,9 @@ export function ComponentStack({ entries }: ComponentStackProps) {
{ if (canOpenNode) { @@ -145,14 +144,16 @@ export function ComponentStack({ entries }: ComponentStackProps) { }} >
- {entry.renderNodeId ? + {entry.renderNodeId ? ( - : {entry.name}} + ) : ( + {entry.name} + )} {entry.renderNodeId && ( #{entry.renderNodeId} diff --git a/packages/devtools/src/components/detail-views/component-details.tsx b/packages/devtools/src/components/detail-views/component-details.tsx index 1db8acf17..75bf2af81 100644 --- a/packages/devtools/src/components/detail-views/component-details.tsx +++ b/packages/devtools/src/components/detail-views/component-details.tsx @@ -1,6 +1,7 @@ import type { RenderTreeNode } from "@/components/render-tree"; import { SourceLocationLink } from "@/components/source-location-link"; import { useDebugConnectionContext } from "@/hooks/debug-connection-context"; + import { NoneText } from "./none-text"; export interface ComponentDetailsProps { @@ -18,45 +19,44 @@ export function ComponentDetails({ }: ComponentDetailsProps) { const { formatPath } = useDebugConnectionContext(); const source = node.source; - const title = - node.componentId ? - `Component #${node.componentId}` + const title = node.componentId + ? `Component #${node.componentId}` : `Render node #${node.id}`; const sourceLabel = - source && source.fileName ? - `${formatPath(source.fileName)}:${source.lineNumber}:${source.columnNumber}` - : undefined; + source && source.fileName + ? `${formatPath(source.fileName)}:${source.lineNumber}:${source.columnNumber}` + : undefined; return (
{title}
Source:{" "} - {sourceLabel ? + {sourceLabel ? ( {sourceLabel} - : + ) : ( + No source info available. - } + )}
Props
- {( - node.props && - (typeof node.props !== "object" || Object.keys(node.props).length > 0) - ) ? + {node.props && + (typeof node.props !== "object" || + Object.keys(node.props).length > 0) ? (
- {(typeof node.props === "string" ? - [["value", node.props]] - : Object.entries(node.props) + {(typeof node.props === "string" + ? [["value", node.props]] + : Object.entries(node.props) ).map(([key, value]) => ( @@ -74,10 +74,11 @@ export function ComponentDetails({
@@ -64,9 +64,9 @@ export function ComponentDetails({
-                        {typeof value === "string" ?
-                          value
-                        : JSON.stringify(value, null, 2)}
+                        {typeof value === "string"
+                          ? value
+                          : JSON.stringify(value, null, 2)}
                       
- :
+ ) : ( +
- } + )}
{canRerender && (
diff --git a/packages/devtools/src/components/detail-views/debug-utils.tsx b/packages/devtools/src/components/detail-views/debug-utils.tsx index 377e2c242..a4f95cf6b 100644 --- a/packages/devtools/src/components/detail-views/debug-utils.tsx +++ b/packages/devtools/src/components/detail-views/debug-utils.tsx @@ -82,10 +82,13 @@ export function renderDebugLink( } const kind = value.type ?? value.kind; const onOpen = - kind === "symbol" ? options.onOpenSymbol - : kind === "scope" ? options.onOpenScope - : kind === "renderNode" ? options.onOpenRenderNode - : undefined; + kind === "symbol" + ? options.onOpenSymbol + : kind === "scope" + ? options.onOpenScope + : kind === "renderNode" + ? options.onOpenRenderNode + : undefined; if (!onOpen) return {label}; return ( diff --git a/packages/devtools/src/components/detail-views/scope-details.tsx b/packages/devtools/src/components/detail-views/scope-details.tsx index 860682d05..53656d174 100644 --- a/packages/devtools/src/components/detail-views/scope-details.tsx +++ b/packages/devtools/src/components/detail-views/scope-details.tsx @@ -1,4 +1,5 @@ import { useDetailResolvers } from "@/hooks/use-detail-resolvers"; + import { buildDebugInfoRows, formatDebugLabel, @@ -65,9 +66,9 @@ export function ScopeDetails({ details }: ScopeDetailsProps) { id: details.renderNodeId ?? null, name: renderNodeLabel ?? - (details.renderNodeId != null ? - `Render node #${details.renderNodeId}` - : undefined), + (details.renderNodeId != null + ? `Render node #${details.renderNodeId}` + : undefined), }, options, )} @@ -84,9 +85,9 @@ export function ScopeDetails({ details }: ScopeDetailsProps) { id: details.parentId ?? null, name: parentName ?? - (details.parentId != null ? - `#${details.parentId}` - : undefined), + (details.parentId != null + ? `#${details.parentId}` + : undefined), }, options, )} @@ -103,9 +104,9 @@ export function ScopeDetails({ details }: ScopeDetailsProps) { id: details.ownerSymbolId ?? null, name: ownerName ?? - (details.ownerSymbolId != null ? - `#${details.ownerSymbolId}` - : undefined), + (details.ownerSymbolId != null + ? `#${details.ownerSymbolId}` + : undefined), }, options, )} @@ -144,9 +145,11 @@ export function ScopeDetails({ details }: ScopeDetailsProps) { {formatDebugLabel(space.key)} - {space.symbols.length > 0 ? + {space.symbols.length > 0 ? ( renderDebugValue(space.symbols, options) - : } + ) : ( + + )} ))} diff --git a/packages/devtools/src/components/detail-views/scope-table.tsx b/packages/devtools/src/components/detail-views/scope-table.tsx index 810e6fc9a..cfb4c133b 100644 --- a/packages/devtools/src/components/detail-views/scope-table.tsx +++ b/packages/devtools/src/components/detail-views/scope-table.tsx @@ -17,7 +17,7 @@ export function ScopeTable({ scopes, onOpenScope }: ScopeTableProps) { return ( - {onOpenScope ? + {onOpenScope ? ( {label} - : {label}} + ) : ( + {label} + )} ); diff --git a/packages/devtools/src/components/detail-views/symbol-details.tsx b/packages/devtools/src/components/detail-views/symbol-details.tsx index d8851b349..411ce2945 100644 --- a/packages/devtools/src/components/detail-views/symbol-details.tsx +++ b/packages/devtools/src/components/detail-views/symbol-details.tsx @@ -1,4 +1,5 @@ import { useDetailResolvers } from "@/hooks/use-detail-resolvers"; + import { buildDebugInfoRows, formatDebugLabel, @@ -75,9 +76,9 @@ export function SymbolDetails({ details }: SymbolDetailsProps) { id: details.renderNodeId ?? null, name: renderNodeLabel ?? - (details.renderNodeId != null ? - `Render node #${details.renderNodeId}` - : undefined), + (details.renderNodeId != null + ? `Render node #${details.renderNodeId}` + : undefined), }, options, )} @@ -94,9 +95,9 @@ export function SymbolDetails({ details }: SymbolDetailsProps) { id: details.scopeId ?? null, name: scopeName ?? - (details.scopeId != null ? - `#${details.scopeId}` - : undefined), + (details.scopeId != null + ? `#${details.scopeId}` + : undefined), }, options, )} @@ -113,9 +114,9 @@ export function SymbolDetails({ details }: SymbolDetailsProps) { id: details.ownerSymbolId ?? null, name: ownerName ?? - (details.ownerSymbolId != null ? - `#${details.ownerSymbolId}` - : undefined), + (details.ownerSymbolId != null + ? `#${details.ownerSymbolId}` + : undefined), }, options, )} @@ -132,9 +133,9 @@ export function SymbolDetails({ details }: SymbolDetailsProps) { id: details.movedToId ?? null, name: movedName ?? - (details.movedToId != null ? - `#${details.movedToId}` - : undefined), + (details.movedToId != null + ? `#${details.movedToId}` + : undefined), }, options, )} @@ -170,9 +171,11 @@ export function SymbolDetails({ details }: SymbolDetailsProps) { {formatDebugLabel(space.key)} - {space.symbols.length > 0 ? + {space.symbols.length > 0 ? ( renderDebugValue(space.symbols, options) - : } + ) : ( + + )} ))} diff --git a/packages/devtools/src/components/detail-views/symbol-table.tsx b/packages/devtools/src/components/detail-views/symbol-table.tsx index 46467c374..4adfeebc7 100644 --- a/packages/devtools/src/components/detail-views/symbol-table.tsx +++ b/packages/devtools/src/components/detail-views/symbol-table.tsx @@ -17,7 +17,7 @@ export function SymbolTable({ symbols, onOpenSymbol }: SymbolTableProps) { return ( - {onOpenSymbol ? + {onOpenSymbol ? ( {label} - : {label}} + ) : ( + {label} + )} ); diff --git a/packages/devtools/src/components/diagnostic-view.tsx b/packages/devtools/src/components/diagnostic-view.tsx index 22955982c..e479d4991 100644 --- a/packages/devtools/src/components/diagnostic-view.tsx +++ b/packages/devtools/src/components/diagnostic-view.tsx @@ -25,9 +25,8 @@ export function DiagnosticView({ diagnosticId }: DiagnosticViewProps) { ).map((entry) => ({ name: entry.name ?? "(anonymous)", renderNodeId: entry.renderNodeId, - source: - entry.source?.fileName ? - { + source: entry.source?.fileName + ? { fileName: entry.source.fileName, lineNumber: entry.source.lineNumber ?? 0, columnNumber: entry.source.columnNumber ?? 0, @@ -40,9 +39,8 @@ export function DiagnosticView({ diagnosticId }: DiagnosticViewProps) { .filter(Boolean) .at(-1); const locationSource = diagnostic.source ?? stackSource; - const location = - locationSource?.fileName ? - `${formatPath(locationSource.fileName)}:${locationSource.lineNumber ?? 0}:${locationSource.columnNumber ?? 0}` + const location = locationSource?.fileName + ? `${formatPath(locationSource.fileName)}:${locationSource.lineNumber ?? 0}:${locationSource.columnNumber ?? 0}` : undefined; return ( diff --git a/packages/devtools/src/components/effect-detail-view.tsx b/packages/devtools/src/components/effect-detail-view.tsx index c7093c51d..b8e115fcf 100644 --- a/packages/devtools/src/components/effect-detail-view.tsx +++ b/packages/devtools/src/components/effect-detail-view.tsx @@ -1,3 +1,5 @@ +import { useMemo } from "react"; + import { EventBadge } from "@/components/event-badge"; import { ReactiveChain } from "@/components/reactive-chain"; import { SourceLocationLink } from "@/components/source-location-link"; @@ -9,7 +11,6 @@ import type { } from "@/hooks/debug-connection-types"; import { formatEdgeTarget } from "@/lib/edge-utils"; import { formatSourceLocation } from "@/lib/format-source-location"; -import { useMemo } from "react"; export interface EffectDetailViewProps { effectId: string; @@ -156,11 +157,13 @@ export function EffectDetailView(props: EffectDetailViewProps) {
Lifecycle ({timeline.length} events)
- {timeline.length === 0 ? + {timeline.length === 0 ? (
No lifecycle events recorded.
- : } + ) : ( + + )}
); @@ -184,9 +187,9 @@ function TimelineTable(props: { {props.events.map((event, i) => { if (event._kind === "lifecycle") { const triggerLabel = - event.triggerRefId !== undefined ? - formatEdgeTarget({ refId: event.triggerRefId }, props.refs) - : undefined; + event.triggerRefId !== undefined + ? formatEdgeTarget({ refId: event.triggerRefId }, props.refs) + : undefined; return ( 0 ? - triggerEdges.length - 1 - : triggerEdges.length; + isMemo && triggerEdges.length > 0 + ? triggerEdges.length - 1 + : triggerEdges.length; // "Triggers": count of trigger edges where this effect is the producer (causedBy) const triggers = triggersByCausedBy.get(effect.id) ?? 0; return { track, triggered, triggers }; @@ -159,9 +160,9 @@ export function EffectsList(props: EffectsListProps) {
{/* Effect rows */}
- {filtered.length === 0 ? + {filtered.length === 0 ? (
No effects match.
- : <> + ) : ( + <>
Effect
Type
@@ -288,7 +290,7 @@ export function EffectsList(props: EffectsListProps) { })}
- } + )}
@@ -303,12 +305,7 @@ function SortableHeader(props: { onSort: (col: SortColumn) => void; }) { const active = props.sortCol === props.col; - const arrow = - active ? - props.sortDir === "desc" ? - " ▼" - : " ▲" - : ""; + const arrow = active ? (props.sortDir === "desc" ? " ▼" : " ▲") : ""; return (
void; @@ -31,9 +32,9 @@ export function EffectsView(props: EffectsViewProps) { ); const refList = useMemo( () => - activeTab !== "refs" ? - [] - : Array.from(refs.values()).sort((a, b) => a.id - b.id), + activeTab !== "refs" + ? [] + : Array.from(refs.values()).sort((a, b) => a.id - b.id), // eslint-disable-next-line react-hooks/exhaustive-deps [refs, refsVersion, activeTab], ); @@ -88,9 +89,9 @@ export function EffectsView(props: EffectsViewProps) { onClick={() => setActiveTab("effects")} className={cn( "px-4 py-2 text-left text-sm font-medium transition-colors", - activeTab === "effects" ? - "bg-background border-r-2 border-r-primary text-foreground" - : "text-muted-foreground hover:bg-accent/50", + activeTab === "effects" + ? "bg-background border-r-2 border-r-primary text-foreground" + : "text-muted-foreground hover:bg-accent/50", )} > Effects @@ -99,9 +100,9 @@ export function EffectsView(props: EffectsViewProps) { onClick={() => setActiveTab("refs")} className={cn( "px-4 py-2 text-left text-sm font-medium transition-colors", - activeTab === "refs" ? - "bg-background border-r-2 border-r-primary text-foreground" - : "text-muted-foreground hover:bg-accent/50", + activeTab === "refs" + ? "bg-background border-r-2 border-r-primary text-foreground" + : "text-muted-foreground hover:bg-accent/50", )} > Refs diff --git a/packages/devtools/src/components/file-tree-panel.tsx b/packages/devtools/src/components/file-tree-panel.tsx index 15aec618a..df0c7bd2c 100644 --- a/packages/devtools/src/components/file-tree-panel.tsx +++ b/packages/devtools/src/components/file-tree-panel.tsx @@ -1,3 +1,5 @@ +import { useCallback, useDeferredValue, useState } from "react"; + import { TreeView, type TreeNode } from "@/components/tree-view"; import { ContextMenu, @@ -7,7 +9,6 @@ import { } from "@/components/ui/context-menu"; import { useDebugConnectionContext } from "@/hooks/debug-connection-context"; import { useDevtoolsAppStateContext } from "@/hooks/devtools-app-state-context"; -import { useCallback, useDeferredValue, useState } from "react"; export function FileTreePanel() { const { fileTree, fileToRenderNode } = useDebugConnectionContext(); diff --git a/packages/devtools/src/components/file-view.tsx b/packages/devtools/src/components/file-view.tsx index 97af64524..04f649974 100644 --- a/packages/devtools/src/components/file-view.tsx +++ b/packages/devtools/src/components/file-view.tsx @@ -23,8 +23,9 @@ export function FileView() { collectTextNodesForNode, findLiftedRootForNode: findLiftedRootForNodeById, }); - const activeTab = - activeTabId ? openTabs.find((tab) => tab.id === activeTabId) : null; + const activeTab = activeTabId + ? openTabs.find((tab) => tab.id === activeTabId) + : null; if (!activeTab || activeTab.type !== "file") return null; const contents = fileContents.get(activeTab.id)?.contents ?? ""; const ranges = fileTextRanges.get(activeTab.id) ?? []; diff --git a/packages/devtools/src/components/problems-view.tsx b/packages/devtools/src/components/problems-view.tsx index be55de351..590c1a0cc 100644 --- a/packages/devtools/src/components/problems-view.tsx +++ b/packages/devtools/src/components/problems-view.tsx @@ -1,3 +1,5 @@ +import { useState } from "react"; + import { SourceLocationLink } from "@/components/source-location-link"; import { ContextMenu, @@ -8,7 +10,6 @@ import { import { useDebugConnectionContext } from "@/hooks/debug-connection-context"; import { useDevtoolsAppStateContext } from "@/hooks/devtools-app-state-context"; import { useRenderTreeServices } from "@/hooks/render-tree-services-context"; -import { useState } from "react"; export function ProblemsView() { const { diagnostics, renderErrors, formatPath } = useDebugConnectionContext(); @@ -49,9 +50,9 @@ export function ProblemsView() { .reverse() .find((entry) => entry.renderNodeId !== undefined); const sourceFileId = - componentEntry?.renderNodeId !== undefined ? - findFileIdForRenderNodeById(String(componentEntry.renderNodeId)) - : undefined; + componentEntry?.renderNodeId !== undefined + ? findFileIdForRenderNodeById(String(componentEntry.renderNodeId)) + : undefined; return { id: error.id, kind: "error" as const, @@ -76,9 +77,9 @@ export function ProblemsView() { .reverse() .find((entry) => entry.renderNodeId !== undefined); const sourceFileId = - componentEntry?.renderNodeId !== undefined ? - findFileIdForRenderNodeById(String(componentEntry.renderNodeId)) - : undefined; + componentEntry?.renderNodeId !== undefined + ? findFileIdForRenderNodeById(String(componentEntry.renderNodeId)) + : undefined; return { id: diagnostic.id, kind: "diagnostic" as const, @@ -101,9 +102,10 @@ export function ProblemsView() { >
- {problems.length === 0 ? + {problems.length === 0 ? (
No problems reported.
- :
+ ) : ( +
@@ -116,19 +118,19 @@ export function ProblemsView() { {problems.map((problem) => { - const location = - problem.source?.fileName ? - `${formatPath(problem.source.fileName)}:${problem.source.lineNumber ?? 0}:${problem.source.columnNumber ?? 0}` + const location = problem.source?.fileName + ? `${formatPath(problem.source.fileName)}:${problem.source.lineNumber ?? 0}:${problem.source.columnNumber ?? 0}` : ""; - const sourceFileName = - problem.sourceFileId ? - (formatPath(problem.sourceFileId).split("/").pop() ?? + const sourceFileName = problem.sourceFileId + ? (formatPath(problem.sourceFileId).split("/").pop() ?? problem.sourceFileId) : ""; const severityClass = - problem.severity === "error" ? "text-destructive" - : problem.severity === "warning" ? "text-amber-600" - : "text-muted-foreground"; + problem.severity === "error" + ? "text-destructive" + : problem.severity === "warning" + ? "text-amber-600" + : "text-muted-foreground"; return ( ); @@ -214,7 +220,7 @@ export function ProblemsView() {
- {( - problem.componentName && - problem.componentRenderNodeId !== undefined - ) ? + {problem.componentName && + problem.componentRenderNodeId !== undefined ? ( - : } + ) : ( + + )} - {problem.sourceFileId ? + {problem.sourceFileId ? ( - : } + ) : ( + + )} - {problem.source ? + {problem.source ? ( {location} - : } + ) : ( + + )}
- } + )}
diff --git a/packages/devtools/src/components/reactive-chain.tsx b/packages/devtools/src/components/reactive-chain.tsx index ea0c658cd..c41429762 100644 --- a/packages/devtools/src/components/reactive-chain.tsx +++ b/packages/devtools/src/components/reactive-chain.tsx @@ -1,3 +1,6 @@ +import dagre from "dagre"; +import { useEffect, useMemo, useState } from "react"; + import type { EffectDebugInfo, EffectEdgeDebugInfo, @@ -9,8 +12,6 @@ import { findAncestorWithIncomingTriggers, findDescendantsForTargets, } from "@/lib/graph-traversal"; -import dagre from "dagre"; -import { useEffect, useMemo, useState } from "react"; export interface ReactiveChainProps { effectId: number; @@ -504,16 +505,17 @@ function GraphEdgePath(props: { const mid = pts[Math.floor(pts.length / 2)]; const isSpawn = edge.isSpawn === true; const ref = !isSpawn && edge.refId > 0 ? refMap.get(edge.refId) : undefined; - const label = - isSpawn ? "spawns" - : ref ? formatRefLabel(ref, edge.refId) - : edge.refId > 0 ? `ref #${edge.refId}` - : ""; + const label = isSpawn + ? "spawns" + : ref + ? formatRefLabel(ref, edge.refId) + : edge.refId > 0 + ? `ref #${edge.refId}` + : ""; const clickable = !isSpawn && edge.refId > 0 && onOpenRefTab; - const handleClick = - clickable ? - () => { + const handleClick = clickable + ? () => { onOpenRefTab!(edge.refId, `${label || "ref"} #${edge.refId}`); } : undefined; @@ -554,24 +556,24 @@ function GraphNode(props: { const isClickable = node.effectId > 0 && node.type !== "focal"; const truncLen = node.type === "summary" ? 14 : 18; const displayLabel = - node.label.length > truncLen ? - node.label.slice(0, truncLen - 2) + "…" - : node.label; + node.label.length > truncLen + ? node.label.slice(0, truncLen - 2) + "…" + : node.label; return (
onOpenDetailTab(node.effectId, node.label) - : undefined + isClickable + ? () => onOpenDetailTab(node.effectId, node.label) + : undefined } title={node.label + (node.effectId > 0 ? ` #${node.effectId}` : "")} > diff --git a/packages/devtools/src/components/ref-detail-view.tsx b/packages/devtools/src/components/ref-detail-view.tsx index 0f2db7a42..5e64f7fb0 100644 --- a/packages/devtools/src/components/ref-detail-view.tsx +++ b/packages/devtools/src/components/ref-detail-view.tsx @@ -1,3 +1,5 @@ +import { useMemo } from "react"; + import { EventBadge } from "@/components/event-badge"; import { SourceLocationLink } from "@/components/source-location-link"; import { useDebugConnectionContext } from "@/hooks/debug-connection-context"; @@ -7,7 +9,6 @@ import type { } from "@/hooks/debug-connection-types"; import { formatRefLabel, resolveEdgeRefId } from "@/lib/edge-utils"; import { formatSourceLocation } from "@/lib/format-source-location"; -import { useMemo } from "react"; export interface RefDetailViewProps { refId: string; @@ -83,9 +84,8 @@ export function RefDetailView(props: RefDetailViewProps) { const kind = refInfo?.kind ?? "ref"; const displayName = formatRefLabel(refInfo, numericId); const isReactiveProp = kind === "reactive-property"; - const sourceLabel = - refInfo?.createdAt ? - formatSourceLocation(refInfo.createdAt, formatPath) + const sourceLabel = refInfo?.createdAt + ? formatSourceLocation(refInfo.createdAt, formatPath) : undefined; return ( @@ -97,10 +97,13 @@ export function RefDetailView(props: RefDetailViewProps) { #{numericId} {isReactiveProp ? "reactive" : kind} diff --git a/packages/devtools/src/components/refs-list.tsx b/packages/devtools/src/components/refs-list.tsx index 4b95b0211..3cbdd3fae 100644 --- a/packages/devtools/src/components/refs-list.tsx +++ b/packages/devtools/src/components/refs-list.tsx @@ -1,3 +1,6 @@ +import { useVirtualizer } from "@tanstack/react-virtual"; +import { useCallback, useMemo, useRef, useState } from "react"; + import { SourceLocationLink } from "@/components/source-location-link"; import type { EffectDebugInfo, @@ -6,8 +9,6 @@ import type { } from "@/hooks/debug-connection-types"; import { resolveEdgeRefId } from "@/lib/edge-utils"; import { formatSourceLocation } from "@/lib/format-source-location"; -import { useVirtualizer } from "@tanstack/react-virtual"; -import { useCallback, useMemo, useRef, useState } from "react"; export interface RefsListProps { refList: RefDebugInfo[]; @@ -138,9 +139,9 @@ export function RefsList(props: RefsListProps) {
- {filtered.length === 0 ? + {filtered.length === 0 ? (
No refs match.
- : <> + ) : ( + <>
Ref
Kind
@@ -188,9 +190,9 @@ export function RefsList(props: RefsListProps) { formatPath, ); const creator = - row.createdByEffectId !== undefined ? - effects.get(row.createdByEffectId) - : undefined; + row.createdByEffectId !== undefined + ? effects.get(row.createdByEffectId) + : undefined; return (
- {row.kind === "reactive-property" ? - "reactive" - : row.kind} + {row.kind === "reactive-property" + ? "reactive" + : row.kind}
- {sourceLabel ? + {sourceLabel ? ( <> {sourceLabel} @@ -245,12 +247,14 @@ export function RefsList(props: RefsListProps) { )} - : "—"} + ) : ( + "—" + )}
- {creator ? - `${creator.name ?? "effect"} #${creator.id}` - : "—"} + {creator + ? `${creator.name ?? "effect"} #${creator.id}` + : "—"}
{row.tracks || "—"} @@ -263,7 +267,7 @@ export function RefsList(props: RefsListProps) { })}
- } + )}
@@ -286,12 +290,7 @@ function SortableHeader(props: { onSort: (col: SortColumn) => void; }) { const active = props.sortCol === props.col; - const arrow = - active ? - props.sortDir === "desc" ? - " ▼" - : " ▲" - : ""; + const arrow = active ? (props.sortDir === "desc" ? " ▼" : " ▲") : ""; return (
Code stack
- {error.stack ? + {error.stack ? (
             {error.stack}
           
- :
+ ) : ( +
No stack available.
- } + )}
@@ -46,9 +47,8 @@ export function RenderErrorView({ errorId }: RenderErrorViewProps) { name: entry.name, renderNodeId: entry.renderNodeId, props: entry.props, - source: - entry.source?.fileName ? - { + source: entry.source?.fileName + ? { fileName: entry.source.fileName, lineNumber: entry.source.lineNumber ?? 0, columnNumber: entry.source.columnNumber ?? 0, diff --git a/packages/devtools/src/components/render-tree.tsx b/packages/devtools/src/components/render-tree.tsx index edb1b2b0b..5e71e9f31 100644 --- a/packages/devtools/src/components/render-tree.tsx +++ b/packages/devtools/src/components/render-tree.tsx @@ -1,3 +1,16 @@ +import type { SourceLocation } from "@alloy-js/core/devtools"; +import { ChevronDown, ChevronRight } from "lucide-react"; +import { + forwardRef, + memo, + useCallback, + useDeferredValue, + useImperativeHandle, + useMemo, + useRef, + useState, +} from "react"; + import { ContextMenu, ContextMenuContent, @@ -15,18 +28,6 @@ import { resolveRenderNodeId, } from "@/lib/render-tree-utils"; import { cn } from "@/lib/utils"; -import type { SourceLocation } from "@alloy-js/core/devtools"; -import { ChevronDown, ChevronRight } from "lucide-react"; -import { - forwardRef, - memo, - useCallback, - useDeferredValue, - useImperativeHandle, - useMemo, - useRef, - useState, -} from "react"; export interface RenderTreeNode { id: string; @@ -433,11 +434,13 @@ const RenderTreeNodeItem = memo(function RenderTreeNodeItem({ className="shrink-0 w-4 flex items-center justify-center mt-0.5" onClick={handleToggle} > - {hasChildren ? - isExpanded ? + {hasChildren ? ( + isExpanded ? ( - : - : null} + ) : ( + + ) + ) : null} {/* Tag content */} @@ -446,9 +449,9 @@ const RenderTreeNodeItem = memo(function RenderTreeNodeItem({ {node.name} diff --git a/packages/devtools/src/components/sidebar-section.tsx b/packages/devtools/src/components/sidebar-section.tsx index 9c68f2b8d..dc9556133 100644 --- a/packages/devtools/src/components/sidebar-section.tsx +++ b/packages/devtools/src/components/sidebar-section.tsx @@ -1,6 +1,7 @@ -import { cn } from "@/lib/utils"; import { ChevronDown, ChevronRight } from "lucide-react"; +import { cn } from "@/lib/utils"; + export interface SidebarSectionProps { title: string; children?: React.ReactNode; @@ -22,9 +23,11 @@ export function SidebarSection({ onClick={onToggle} className="flex items-center gap-1 px-2 py-1 text-xs font-semibold uppercase tracking-wide text-sidebar-foreground hover:bg-sidebar-accent w-full text-left shrink-0 border-b border-sidebar-border" > - {isOpen ? + {isOpen ? ( - : } + ) : ( + + )} {title} {isOpen &&
{children}
} diff --git a/packages/devtools/src/components/source-location-link.tsx b/packages/devtools/src/components/source-location-link.tsx index 84e289f46..789253104 100644 --- a/packages/devtools/src/components/source-location-link.tsx +++ b/packages/devtools/src/components/source-location-link.tsx @@ -19,9 +19,8 @@ export function SourceLocationLink({ const { formatPath } = useDebugConnectionContext(); const { toast } = useToast(); - const sourceLabel = - source.fileName ? - `${formatPath(source.fileName)}:${source.lineNumber ?? "?"}` + const sourceLabel = source.fileName + ? `${formatPath(source.fileName)}:${source.lineNumber ?? "?"}` : ""; const handleClick = async (event: React.MouseEvent) => { diff --git a/packages/devtools/src/components/status-bar.tsx b/packages/devtools/src/components/status-bar.tsx index ce43e1b41..7974c75ed 100644 --- a/packages/devtools/src/components/status-bar.tsx +++ b/packages/devtools/src/components/status-bar.tsx @@ -1,6 +1,7 @@ -import { cn } from "@/lib/utils"; import { Circle } from "lucide-react"; +import { cn } from "@/lib/utils"; + export type DebugStatus = "connected" | "connecting" | "error" | "disconnected"; export interface StatusBarProps { @@ -49,9 +50,7 @@ export function StatusBar({ )}
- {cwd ? - {cwd} - : null} + {cwd ? {cwd} : null} {versionLabel ?? "Alloy v0.0.0"}
diff --git a/packages/devtools/src/components/symbol-tree-panel.tsx b/packages/devtools/src/components/symbol-tree-panel.tsx index 435535851..1878fbe42 100644 --- a/packages/devtools/src/components/symbol-tree-panel.tsx +++ b/packages/devtools/src/components/symbol-tree-panel.tsx @@ -1,3 +1,5 @@ +import { useCallback, useDeferredValue, useState } from "react"; + import { TreeView, type TreeNode } from "@/components/tree-view"; import { ContextMenu, @@ -10,7 +12,6 @@ import { useDevtoolsAppStateContext } from "@/hooks/devtools-app-state-context"; import { useRenderTreeServices } from "@/hooks/render-tree-services-context"; import { useFileTextRanges } from "@/hooks/use-file-text-ranges"; import { useGoToSource } from "@/hooks/use-go-to-source"; -import { useCallback, useDeferredValue, useState } from "react"; export function SymbolTreePanel() { const { @@ -76,9 +77,9 @@ export function SymbolTreePanel() { const getRenderNodeId = (node: TreeNode) => { const details = - node.icon === "symbol" ? - symbolDetails.get(node.id) - : scopeDetails.get(node.id); + node.icon === "symbol" + ? symbolDetails.get(node.id) + : scopeDetails.get(node.id); return details?.renderNodeId as number | null | undefined; }; diff --git a/packages/devtools/src/components/tab-bar.tsx b/packages/devtools/src/components/tab-bar.tsx index b19164dcf..5d2efc7a5 100644 --- a/packages/devtools/src/components/tab-bar.tsx +++ b/packages/devtools/src/components/tab-bar.tsx @@ -1,14 +1,3 @@ -import { - ContextMenu, - ContextMenuContent, - ContextMenuItem, - ContextMenuSeparator, - ContextMenuTrigger, -} from "@/components/ui/context-menu"; -import { useDebugConnectionContext } from "@/hooks/debug-connection-context"; -import { useDevtoolsAppStateContext } from "@/hooks/devtools-app-state-context"; -import { findRenderNodeInTree } from "@/lib/render-tree-utils"; -import { cn } from "@/lib/utils"; import { AlertCircle, AlertTriangle, @@ -21,6 +10,18 @@ import { } from "lucide-react"; import { useCallback } from "react"; +import { + ContextMenu, + ContextMenuContent, + ContextMenuItem, + ContextMenuSeparator, + ContextMenuTrigger, +} from "@/components/ui/context-menu"; +import { useDebugConnectionContext } from "@/hooks/debug-connection-context"; +import { useDevtoolsAppStateContext } from "@/hooks/devtools-app-state-context"; +import { findRenderNodeInTree } from "@/lib/render-tree-utils"; +import { cn } from "@/lib/utils"; + export function TabBar() { const { renderTree, fileToRenderNode } = useDebugConnectionContext(); const { @@ -63,9 +64,8 @@ export function TabBar() { ); const handleTabMenuGoToRenderNode = useCallback(() => { - const tab = - tabMenu?.tabId ? - openTabs.find((item) => item.id === tabMenu.tabId) + const tab = tabMenu?.tabId + ? openTabs.find((item) => item.id === tabMenu.tabId) : undefined; if (tab?.type === "file") { const renderNodeId = fileToRenderNode.get(tab.id); @@ -86,11 +86,12 @@ export function TabBar() { className="flex items-center border-b border-border bg-muted/50 h-9 shrink-0 overflow-x-auto" onContextMenu={handleTabBarContextMenu} > - {openTabs.length === 0 ? + {openTabs.length === 0 ? (
No open files
- : openTabs.map((tab) => ( + ) : ( + openTabs.map((tab) => ( )) - } + )}
{(() => { - const tab = - tabMenu?.tabId ? - openTabs.find((item) => item.id === tabMenu.tabId) + const tab = tabMenu?.tabId + ? openTabs.find((item) => item.id === tabMenu.tabId) : undefined; return ( <> diff --git a/packages/devtools/src/components/tree-view.tsx b/packages/devtools/src/components/tree-view.tsx index bcbe70e70..97739971e 100644 --- a/packages/devtools/src/components/tree-view.tsx +++ b/packages/devtools/src/components/tree-view.tsx @@ -1,4 +1,3 @@ -import { cn } from "@/lib/utils"; import { Braces, ChevronDown, @@ -10,6 +9,8 @@ import { } from "lucide-react"; import { memo, useCallback, useState } from "react"; +import { cn } from "@/lib/utils"; + export interface TreeNode { id: string; label: string; @@ -91,9 +92,11 @@ const TreeNodeItem = memo(function TreeNodeItem({ const getIcon = () => { switch (node.icon) { case "folder": - return isExpanded ? - - : ; + return isExpanded ? ( + + ) : ( + + ); case "file": return ; case "scope": @@ -101,11 +104,14 @@ const TreeNodeItem = memo(function TreeNodeItem({ case "symbol": return ; default: - return ( - hasChildren ? - isExpanded ? - : - : + return hasChildren ? ( + isExpanded ? ( + + ) : ( + + ) + ) : ( + ); } }; @@ -126,11 +132,13 @@ const TreeNodeItem = memo(function TreeNodeItem({ className="shrink-0 w-4 flex items-center justify-center" onClick={handleToggle} > - {hasChildren ? - isExpanded ? + {hasChildren ? ( + isExpanded ? ( - : - : null} + ) : ( + + ) + ) : null} {getIcon()} {node.label} diff --git a/packages/devtools/src/components/ui/resizable.tsx b/packages/devtools/src/components/ui/resizable.tsx index 7a9811aeb..388862cc9 100644 --- a/packages/devtools/src/components/ui/resizable.tsx +++ b/packages/devtools/src/components/ui/resizable.tsx @@ -56,9 +56,9 @@ function ResizableHandle({ data-slot="resizable-handle" className={cn( "bg-border focus-visible:ring-ring relative flex items-center justify-center focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden", - isVertical ? - "h-px w-full cursor-row-resize after:absolute after:inset-x-0 after:h-4 after:-translate-y-1/2 after:top-1/2" - : "w-px h-full cursor-col-resize after:absolute after:inset-y-0 after:w-4 after:-translate-x-1/2 after:left-1/2", + isVertical + ? "h-px w-full cursor-row-resize after:absolute after:inset-x-0 after:h-4 after:-translate-y-1/2 after:top-1/2" + : "w-px h-full cursor-col-resize after:absolute after:inset-y-0 after:w-4 after:-translate-x-1/2 after:left-1/2", className, )} {...props} @@ -70,9 +70,11 @@ function ResizableHandle({ isVertical ? "h-3 w-4" : "h-4 w-3", )} > - {isVertical ? + {isVertical ? ( - : } + ) : ( + + )}
)} diff --git a/packages/devtools/src/hooks/debug-connection-context.ts b/packages/devtools/src/hooks/debug-connection-context.ts index a9e920052..cdc1994e3 100644 --- a/packages/devtools/src/hooks/debug-connection-context.ts +++ b/packages/devtools/src/hooks/debug-connection-context.ts @@ -1,6 +1,7 @@ -import type { DebugConnectionState } from "@/hooks/use-debug-connection"; import { createContext, useContext } from "react"; +import type { DebugConnectionState } from "@/hooks/use-debug-connection"; + export const DebugConnectionContext = createContext(null); diff --git a/packages/devtools/src/hooks/debug-connection-types.ts b/packages/devtools/src/hooks/debug-connection-types.ts index 17bb9ce31..b6c7fe5c6 100644 --- a/packages/devtools/src/hooks/debug-connection-types.ts +++ b/packages/devtools/src/hooks/debug-connection-types.ts @@ -1,11 +1,12 @@ -import type { TreeNode } from "@/components/tree-view"; -import type { ScopeRecord, SymbolRecord } from "@/hooks/debug-state"; -import type { RenderTreeViewNode } from "@/lib/debug-tree"; import type { ClientToServerMessage, SourceLocation, } from "@alloy-js/core/devtools"; +import type { TreeNode } from "@/components/tree-view"; +import type { ScopeRecord, SymbolRecord } from "@/hooks/debug-state"; +import type { RenderTreeViewNode } from "@/lib/debug-tree"; + // ── Constants ──────────────────────────────────────────────────────────────── /** Batching interval for state updates (ms) */ diff --git a/packages/devtools/src/hooks/debug-state.test.ts b/packages/devtools/src/hooks/debug-state.test.ts index 3bebefa1e..e84eedc1a 100644 --- a/packages/devtools/src/hooks/debug-state.test.ts +++ b/packages/devtools/src/hooks/debug-state.test.ts @@ -1,6 +1,8 @@ -import { buildRenderTreeView } from "@/lib/debug-tree"; import type { ServerToClientMessage } from "@alloy-js/core/devtools"; import { describe, expect, it } from "vitest"; + +import { buildRenderTreeView } from "@/lib/debug-tree"; + import { createDebugStore, processMessage, diff --git a/packages/devtools/src/hooks/debug-state.ts b/packages/devtools/src/hooks/debug-state.ts index 1ded0d37c..9fd9c2a22 100644 --- a/packages/devtools/src/hooks/debug-state.ts +++ b/packages/devtools/src/hooks/debug-state.ts @@ -1,3 +1,9 @@ +import type { + DiagnosticRow, + ServerToClientMessage, + SourceLocation, +} from "@alloy-js/core/devtools"; + import type { TreeNode } from "@/components/tree-view"; import { applyRenderTreeMessage, @@ -6,11 +12,7 @@ import { type RenderTreeState, } from "@/lib/debug-tree"; import { normalizePath } from "@/lib/utils"; -import type { - DiagnosticRow, - ServerToClientMessage, - SourceLocation, -} from "@alloy-js/core/devtools"; + import { type DebugConnectionStatus, type DiagnosticInfo, @@ -229,13 +231,13 @@ function tryParseComponentStack( name: entry.name ?? entry.component, renderNodeId: entry.renderNodeId ?? entry.render_node_id, source: - (entry.source_file ?? entry.source?.fileName) ? - { - fileName: entry.source_file ?? entry.source?.fileName, - lineNumber: entry.source_line ?? entry.source?.lineNumber, - columnNumber: entry.source_col ?? entry.source?.columnNumber, - } - : entry.source, + (entry.source_file ?? entry.source?.fileName) + ? { + fileName: entry.source_file ?? entry.source?.fileName, + lineNumber: entry.source_line ?? entry.source?.lineNumber, + columnNumber: entry.source_col ?? entry.source?.columnNumber, + } + : entry.source, })); } } catch { @@ -276,17 +278,15 @@ function handleDiagnosticsReport( id: `diag-${Date.now()}-${i}`, message: row.message, severity: row.severity ?? "info", - source: - row.source_file ? - { + source: row.source_file + ? { fileName: row.source_file, lineNumber: row.source_line, columnNumber: row.source_col, } : undefined, - componentStack: - row.component_stack ? - tryParseComponentStack(row.component_stack) + componentStack: row.component_stack + ? tryParseComponentStack(row.component_stack) : undefined, }), ); @@ -359,9 +359,8 @@ function handleEffectAddedOrUpdated( id, name: message.name, type: message.effect_type, - createdAt: - message.source_file ? - { + createdAt: message.source_file + ? { fileName: message.source_file, lineNumber: message.source_line, columnNumber: message.source_col, @@ -394,9 +393,8 @@ function handleRefAdded( id, kind: message.kind, label: message.label, - createdAt: - message.source_file ? - { + createdAt: message.source_file + ? { fileName: message.source_file, lineNumber: message.source_line, columnNumber: message.source_col, diff --git a/packages/devtools/src/hooks/debug-transport.ts b/packages/devtools/src/hooks/debug-transport.ts index 3fc12ae56..448797156 100644 --- a/packages/devtools/src/hooks/debug-transport.ts +++ b/packages/devtools/src/hooks/debug-transport.ts @@ -2,6 +2,7 @@ import type { ClientToServerMessage, ServerToClientMessage, } from "@alloy-js/core/devtools"; + import type { DebugConnectionStatus } from "./debug-connection-types"; // ── Configuration ──────────────────────────────────────────────────────────── diff --git a/packages/devtools/src/hooks/devtools-app-state-context.ts b/packages/devtools/src/hooks/devtools-app-state-context.ts index 337a10ff8..fb89d585c 100644 --- a/packages/devtools/src/hooks/devtools-app-state-context.ts +++ b/packages/devtools/src/hooks/devtools-app-state-context.ts @@ -1,6 +1,7 @@ -import { useDevtoolsAppState } from "@/hooks/use-devtools-app-state"; import { createContext, useContext } from "react"; +import { useDevtoolsAppState } from "@/hooks/use-devtools-app-state"; + export type DevtoolsAppState = ReturnType; export const DevtoolsAppStateContext = createContext( diff --git a/packages/devtools/src/hooks/render-tree-services-context.tsx b/packages/devtools/src/hooks/render-tree-services-context.tsx index 982074c35..9e244f36a 100644 --- a/packages/devtools/src/hooks/render-tree-services-context.tsx +++ b/packages/devtools/src/hooks/render-tree-services-context.tsx @@ -1,7 +1,8 @@ +import { createContext, useContext, type ReactNode } from "react"; + import type { RenderTreeNode } from "@/components/render-tree"; import { useRenderTreeIndex } from "@/hooks/use-render-tree-index"; import { useRenderTreeQueries } from "@/hooks/use-render-tree-queries"; -import { createContext, useContext, type ReactNode } from "react"; export interface RenderTreeServices { parentById: Map; diff --git a/packages/devtools/src/hooks/use-debug-connection.ts b/packages/devtools/src/hooks/use-debug-connection.ts index 90c4b3d93..dcbdc9cf3 100644 --- a/packages/devtools/src/hooks/use-debug-connection.ts +++ b/packages/devtools/src/hooks/use-debug-connection.ts @@ -1,5 +1,7 @@ -import { buildRenderTreeView } from "@/lib/debug-tree"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; + +import { buildRenderTreeView } from "@/lib/debug-tree"; + import { BATCH_FLUSH_INTERVAL, BATCH_FLUSH_INTERVAL_HEAVY, @@ -56,8 +58,9 @@ export function useDebugConnection(): DebugConnectionState { const formatPath = useCallback((rawPath: string) => { const normalized = rawPath.replace(/^\.\/?/, "").replace(/\\/g, "/"); - const cwdValue = - storeRef.current.cwd ? normalizeCwd(storeRef.current.cwd) : undefined; + const cwdValue = storeRef.current.cwd + ? normalizeCwd(storeRef.current.cwd) + : undefined; if (cwdValue) { if (normalized === cwdValue) return "."; if (normalized.startsWith(`${cwdValue}/`)) { @@ -165,8 +168,9 @@ export function useDebugConnection(): DebugConnectionState { if (batchTimerRef.current !== null) return; const isHeavy = msgCountRef.current > HEAVY_LOAD_THRESHOLD; - const interval = - isHeavy ? BATCH_FLUSH_INTERVAL_HEAVY : BATCH_FLUSH_INTERVAL; + const interval = isHeavy + ? BATCH_FLUSH_INTERVAL_HEAVY + : BATCH_FLUSH_INTERVAL; if (typeof requestIdleCallback !== "undefined") { batchTimerRef.current = requestIdleCallback( diff --git a/packages/devtools/src/hooks/use-detail-resolvers.ts b/packages/devtools/src/hooks/use-detail-resolvers.ts index d78892b6d..e14c477f1 100644 --- a/packages/devtools/src/hooks/use-detail-resolvers.ts +++ b/packages/devtools/src/hooks/use-detail-resolvers.ts @@ -1,7 +1,8 @@ +import { useCallback, useMemo } from "react"; + import { useDebugConnectionContext } from "@/hooks/debug-connection-context"; import { useDevtoolsAppStateContext } from "@/hooks/devtools-app-state-context"; import { findRenderNodeInTree } from "@/lib/render-tree-utils"; -import { useCallback, useMemo } from "react"; export interface DetailResolvers { resolveSymbolName: (id: number | null | undefined) => string | undefined; diff --git a/packages/devtools/src/hooks/use-devtools-app-state-context.tsx b/packages/devtools/src/hooks/use-devtools-app-state-context.tsx index d9021a1b8..e2068c22b 100644 --- a/packages/devtools/src/hooks/use-devtools-app-state-context.tsx +++ b/packages/devtools/src/hooks/use-devtools-app-state-context.tsx @@ -1,6 +1,7 @@ +import type { ReactNode } from "react"; + import type { DevtoolsAppState } from "@/hooks/devtools-app-state-context"; import { DevtoolsAppStateContext } from "@/hooks/devtools-app-state-context"; -import type { ReactNode } from "react"; export interface DevtoolsAppStateProviderProps { value: DevtoolsAppState; diff --git a/packages/devtools/src/hooks/use-devtools-app-state.ts b/packages/devtools/src/hooks/use-devtools-app-state.ts index 5b78bafa3..3289e1e64 100644 --- a/packages/devtools/src/hooks/use-devtools-app-state.ts +++ b/packages/devtools/src/hooks/use-devtools-app-state.ts @@ -1,8 +1,9 @@ +import type { RefObject } from "react"; +import { useState } from "react"; + import type { RenderTreeHandle } from "@/components/render-tree"; import { useRenderTreeFocus } from "@/hooks/use-render-tree-focus"; import { useTabs } from "@/hooks/use-tabs"; -import type { RefObject } from "react"; -import { useState } from "react"; export function useDevtoolsAppState( renderTreeRef: RefObject, diff --git a/packages/devtools/src/hooks/use-file-text-ranges.ts b/packages/devtools/src/hooks/use-file-text-ranges.ts index 1752e1dab..315de04ed 100644 --- a/packages/devtools/src/hooks/use-file-text-ranges.ts +++ b/packages/devtools/src/hooks/use-file-text-ranges.ts @@ -1,7 +1,8 @@ -import type { OpenTab } from "@/hooks/use-tabs"; import { DIFF_EQUAL, diff_match_patch } from "diff-match-patch"; import { useCallback, useEffect, useState } from "react"; +import type { OpenTab } from "@/hooks/use-tabs"; + export interface TextNodeSpan { id: string; text: string; diff --git a/packages/devtools/src/hooks/use-go-to-source.ts b/packages/devtools/src/hooks/use-go-to-source.ts index 90d81572e..cb1f10d3a 100644 --- a/packages/devtools/src/hooks/use-go-to-source.ts +++ b/packages/devtools/src/hooks/use-go-to-source.ts @@ -1,3 +1,5 @@ +import { useCallback } from "react"; + import type { RenderTreeNode } from "@/components/render-tree"; import type { OpenTab } from "@/hooks/use-tabs"; import { @@ -5,7 +7,6 @@ import { findFirstTextNodeId, resolveRenderNodeId, } from "@/lib/render-tree-utils"; -import { useCallback } from "react"; export interface UseGoToSourceOptions { nodeById: Map; diff --git a/packages/devtools/src/hooks/use-render-tree-focus.ts b/packages/devtools/src/hooks/use-render-tree-focus.ts index bd98c08d8..ebf6ccf3d 100644 --- a/packages/devtools/src/hooks/use-render-tree-focus.ts +++ b/packages/devtools/src/hooks/use-render-tree-focus.ts @@ -1,7 +1,8 @@ -import type { RenderTreeHandle } from "@/components/render-tree"; import type { RefObject } from "react"; import { useCallback, useEffect, useState } from "react"; +import type { RenderTreeHandle } from "@/components/render-tree"; + export function useRenderTreeFocus( renderTreeRef: RefObject, focusRefreshKey?: unknown, diff --git a/packages/devtools/src/hooks/use-render-tree-index.ts b/packages/devtools/src/hooks/use-render-tree-index.ts index 982b338c8..f789ebba4 100644 --- a/packages/devtools/src/hooks/use-render-tree-index.ts +++ b/packages/devtools/src/hooks/use-render-tree-index.ts @@ -1,3 +1,5 @@ +import { useCallback, useMemo } from "react"; + import type { RenderTreeNode } from "@/components/render-tree"; import { buildRenderTreeIndex, @@ -5,7 +7,6 @@ import { findLiftedRootForNode, invertFileToRenderNode, } from "@/lib/render-tree-utils"; -import { useCallback, useMemo } from "react"; export function useRenderTreeIndex( renderTree: RenderTreeNode[], diff --git a/packages/devtools/src/hooks/use-render-tree-queries.ts b/packages/devtools/src/hooks/use-render-tree-queries.ts index c78a50742..edd2a819b 100644 --- a/packages/devtools/src/hooks/use-render-tree-queries.ts +++ b/packages/devtools/src/hooks/use-render-tree-queries.ts @@ -1,9 +1,10 @@ +import { useCallback } from "react"; + import type { RenderTreeNode } from "@/components/render-tree"; import { collectTextNodes, findRenderNodeInTree, } from "@/lib/render-tree-utils"; -import { useCallback } from "react"; export function useRenderTreeQueries(renderTree: RenderTreeNode[]) { const findRenderNode = useCallback( diff --git a/packages/devtools/src/hooks/use-tabs.ts b/packages/devtools/src/hooks/use-tabs.ts index caf8489b6..9f5284d1d 100644 --- a/packages/devtools/src/hooks/use-tabs.ts +++ b/packages/devtools/src/hooks/use-tabs.ts @@ -1,7 +1,8 @@ -import type { TreeNode } from "@/components/tree-view"; import type { MouseEvent } from "react"; import { useCallback, useMemo, useState } from "react"; +import type { TreeNode } from "@/components/tree-view"; + export interface OpenTab { id: string; label: string; diff --git a/packages/devtools/src/lib/debug-tree.ts b/packages/devtools/src/lib/debug-tree.ts index 86e9ff730..2e0a3e339 100644 --- a/packages/devtools/src/lib/debug-tree.ts +++ b/packages/devtools/src/lib/debug-tree.ts @@ -126,9 +126,8 @@ export function applyRenderTreeMessage( props = undefined; } } - const source: SourceLocation | undefined = - message.source_file ? - { + const source: SourceLocation | undefined = message.source_file + ? { fileName: message.source_file, lineNumber: message.source_line, columnNumber: message.source_col, @@ -221,9 +220,8 @@ export function applyRenderTreeMessage( props = undefined; } } - const source: SourceLocation | undefined = - message.source_file ? - { + const source: SourceLocation | undefined = message.source_file + ? { fileName: message.source_file, lineNumber: message.source_line, columnNumber: message.source_col, diff --git a/packages/devtools/src/main.tsx b/packages/devtools/src/main.tsx index ef474bf64..4abadfee4 100644 --- a/packages/devtools/src/main.tsx +++ b/packages/devtools/src/main.tsx @@ -1,6 +1,8 @@ import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; + import App from "./App.tsx"; + import "./index.css"; createRoot(document.getElementById("root")!).render( diff --git a/packages/devtools/vite.config.ts b/packages/devtools/vite.config.ts index 266c6340c..c476d6624 100644 --- a/packages/devtools/vite.config.ts +++ b/packages/devtools/vite.config.ts @@ -1,6 +1,7 @@ +import path from "node:path"; + import tailwindcss from "@tailwindcss/vite"; import react from "@vitejs/plugin-react"; -import path from "node:path"; import { defineConfig } from "vite"; import { viteSingleFile } from "vite-plugin-singlefile"; diff --git a/packages/docs/scripts/build-json.ts b/packages/docs/scripts/build-json.ts index dfe3d5fe7..423cab9c9 100644 --- a/packages/docs/scripts/build-json.ts +++ b/packages/docs/scripts/build-json.ts @@ -1,3 +1,6 @@ +import { existsSync, mkdirSync, writeFileSync } from "node:fs"; +import { resolve } from "node:path"; + import { render, stc, @@ -18,8 +21,7 @@ import { ApiVariable, ExcerptTokenKind, } from "@microsoft/api-extractor-model"; -import { existsSync, mkdirSync, writeFileSync } from "node:fs"; -import { resolve } from "node:path"; + import { ComponentDoc, ContextDoc, diff --git a/packages/docs/scripts/components/DocDeclaration.ts b/packages/docs/scripts/components/DocDeclaration.ts index a7d04fa76..0e6787007 100644 --- a/packages/docs/scripts/components/DocDeclaration.ts +++ b/packages/docs/scripts/components/DocDeclaration.ts @@ -7,6 +7,7 @@ import { } from "@alloy-js/core"; import { Declaration } from "@alloy-js/core/stc"; import type { ApiItem } from "@microsoft/api-extractor-model"; + import { DocSymbol } from "../symbols/doc-symbol.js"; export interface DocDeclarationProps { diff --git a/packages/docs/scripts/components/DocSourceFile.ts b/packages/docs/scripts/components/DocSourceFile.ts index 13d025079..f5c643469 100644 --- a/packages/docs/scripts/components/DocSourceFile.ts +++ b/packages/docs/scripts/components/DocSourceFile.ts @@ -1,6 +1,7 @@ import { type Children } from "@alloy-js/core"; import { SourceFile } from "@alloy-js/core/stc"; import { ApiItem } from "@microsoft/api-extractor-model"; + import { Reference } from "./Reference.js"; import { DocDeclaration, Frontmatter } from "./stc/index.js"; @@ -16,9 +17,11 @@ export interface DocSourceFileProps { export function DocSourceFile(props: DocSourceFileProps) { const descriptors = - props.declares === undefined ? [] - : Array.isArray(props.declares) ? props.declares - : [props.declares]; + props.declares === undefined + ? [] + : Array.isArray(props.declares) + ? props.declares + : [props.declares]; const declarations = descriptors.map((descriptor) => { if (isApiItem(descriptor)) { diff --git a/packages/docs/scripts/components/Examples.ts b/packages/docs/scripts/components/Examples.ts index 16cb76f52..b492362f2 100644 --- a/packages/docs/scripts/components/Examples.ts +++ b/packages/docs/scripts/components/Examples.ts @@ -1,5 +1,6 @@ import type { ApiItem } from "@microsoft/api-extractor-model"; import { StandardTags, type DocBlock, type DocComment } from "@microsoft/tsdoc"; + import { MdxParagraph, MdxSection, TsDoc } from "./stc/index.js"; export interface ExamplesProps { diff --git a/packages/docs/scripts/components/Excerpt.ts b/packages/docs/scripts/components/Excerpt.ts index 5c2cd9f85..b1de365f4 100644 --- a/packages/docs/scripts/components/Excerpt.ts +++ b/packages/docs/scripts/components/Excerpt.ts @@ -4,6 +4,7 @@ import { ExcerptTokenKind, type Excerpt as AEExcerpt, } from "@microsoft/api-extractor-model"; + import { mdxEscape, resolveExcerptReference } from "../utils.js"; export interface ExcerptProps { diff --git a/packages/docs/scripts/components/InterfaceMembers.ts b/packages/docs/scripts/components/InterfaceMembers.ts index 69dc3d92f..b1bc37d42 100644 --- a/packages/docs/scripts/components/InterfaceMembers.ts +++ b/packages/docs/scripts/components/InterfaceMembers.ts @@ -12,6 +12,7 @@ import { ApiProtectedMixin, type ApiInterface, } from "@microsoft/api-extractor-model"; + import { flattenedMembers, mdxEscape } from "../utils.js"; import { Excerpt, TsDoc } from "./stc/index.js"; @@ -34,17 +35,15 @@ export function InterfaceMembers(props: InterfaceMembersProps) { const prop = member as ApiPropertySignature | ApiProperty; const isProtected = ApiProtectedMixin.isBaseClassOf(prop) && prop.isProtected; - const summary: Children = - prop.tsdocComment?.summarySection ? - TsDoc({ + const summary: Children = prop.tsdocComment?.summarySection + ? TsDoc({ node: prop.tsdocComment.summarySection, context: prop, inline: true, }) : ""; - const remarks: Children = - prop.tsdocComment?.remarksBlock ? - TsDoc({ + const remarks: Children = prop.tsdocComment?.remarksBlock + ? TsDoc({ node: prop.tsdocComment.remarksBlock, context: prop, inline: true, @@ -69,9 +68,8 @@ export function InterfaceMembers(props: InterfaceMembersProps) { .map((param) => `${param.name}: ${param.parameterTypeExcerpt.text}`) .join(", ")}) => ${method.returnTypeExcerpt.text}`, ); - const summary: Children = - method.tsdocComment?.summarySection ? - TsDoc({ + const summary: Children = method.tsdocComment?.summarySection + ? TsDoc({ node: method.tsdocComment.summarySection, context: method, inline: true, @@ -92,9 +90,8 @@ export function InterfaceMembers(props: InterfaceMembersProps) { .map((param) => `${param.name}: ${param.parameterTypeExcerpt.text}`) .join(", ")}) => ${callSig.returnTypeExcerpt.text}`, ); - const summary: Children = - callSig.tsdocComment?.summarySection ? - TsDoc({ + const summary: Children = callSig.tsdocComment?.summarySection + ? TsDoc({ node: callSig.tsdocComment.summarySection, context: callSig, inline: true, @@ -113,9 +110,8 @@ export function InterfaceMembers(props: InterfaceMembersProps) { const sig = mdxEscape( `(${ctor.parameters.map((p) => `${p.name}: ${p.parameterTypeExcerpt.text}`).join(", ")})`, ); - const summary: Children = - ctor.tsdocComment?.summarySection ? - TsDoc({ + const summary: Children = ctor.tsdocComment?.summarySection + ? TsDoc({ node: ctor.tsdocComment.summarySection, context: ctor, inline: true, @@ -131,9 +127,8 @@ export function InterfaceMembers(props: InterfaceMembersProps) { } case ApiItemKind.IndexSignature: { const indexer = member as ApiIndexSignature; - const summary: Children = - indexer.tsdocComment?.summarySection ? - TsDoc({ + const summary: Children = indexer.tsdocComment?.summarySection + ? TsDoc({ node: indexer.tsdocComment.summarySection, context: indexer, inline: true, diff --git a/packages/docs/scripts/components/MdxSection.ts b/packages/docs/scripts/components/MdxSection.ts index bbb7835ba..5bc461cbf 100644 --- a/packages/docs/scripts/components/MdxSection.ts +++ b/packages/docs/scripts/components/MdxSection.ts @@ -1,4 +1,5 @@ import type { Children } from "@alloy-js/core"; + import { SectionContext, useSectionContext } from "../contexts/section.js"; import { MdxParagraph } from "./stc/index.js"; diff --git a/packages/docs/scripts/components/MdxSourceFile.ts b/packages/docs/scripts/components/MdxSourceFile.ts index 00d777ab1..6f411a515 100644 --- a/packages/docs/scripts/components/MdxSourceFile.ts +++ b/packages/docs/scripts/components/MdxSourceFile.ts @@ -1,5 +1,6 @@ import { type Children } from "@alloy-js/core"; import { SourceFile } from "@alloy-js/core/stc"; + import { Reference } from "./Reference.js"; export interface MdxSourceFileProps { diff --git a/packages/docs/scripts/components/PackageDocs.ts b/packages/docs/scripts/components/PackageDocs.ts index 73e299c53..d42d4fe7b 100644 --- a/packages/docs/scripts/components/PackageDocs.ts +++ b/packages/docs/scripts/components/PackageDocs.ts @@ -1,5 +1,6 @@ import { stc, type Children } from "@alloy-js/core"; import { Scope, SourceDirectory } from "@alloy-js/core/stc"; + import { PackageDocContext } from "../contexts/package-docs.js"; export interface PackageDocsProps { diff --git a/packages/docs/scripts/components/Reference.ts b/packages/docs/scripts/components/Reference.ts index a6ac7cefa..d12e04f7c 100644 --- a/packages/docs/scripts/components/Reference.ts +++ b/packages/docs/scripts/components/Reference.ts @@ -1,3 +1,5 @@ +import { relative } from "node:path"; + import { memo, resolve, @@ -6,7 +8,7 @@ import { type OutputScope, type Refkey, } from "@alloy-js/core"; -import { relative } from "node:path"; + import type { DocSymbol } from "../symbols/doc-symbol.js"; export interface ReferenceProps { diff --git a/packages/docs/scripts/components/Remarks.ts b/packages/docs/scripts/components/Remarks.ts index d946d5059..1d32577e8 100644 --- a/packages/docs/scripts/components/Remarks.ts +++ b/packages/docs/scripts/components/Remarks.ts @@ -1,5 +1,6 @@ import type { ApiItem } from "@microsoft/api-extractor-model"; import type { DocComment } from "@microsoft/tsdoc"; + import { MdxSection, TsDoc } from "./stc/index.js"; export interface RemarksProps { diff --git a/packages/docs/scripts/components/SeeAlso.ts b/packages/docs/scripts/components/SeeAlso.ts index 4ecd38427..cf305be0b 100644 --- a/packages/docs/scripts/components/SeeAlso.ts +++ b/packages/docs/scripts/components/SeeAlso.ts @@ -6,6 +6,7 @@ import type { DocLinkTag, DocParagraph, } from "@microsoft/tsdoc"; + import { MdxSection, TsDoc } from "./stc/index.js"; import { resolveCodeDestination } from "./TsDoc.js"; diff --git a/packages/docs/scripts/components/Summary.ts b/packages/docs/scripts/components/Summary.ts index 7ac96e0f1..2368502e6 100644 --- a/packages/docs/scripts/components/Summary.ts +++ b/packages/docs/scripts/components/Summary.ts @@ -1,5 +1,6 @@ import type { ApiItem } from "@microsoft/api-extractor-model"; import type { DocComment } from "@microsoft/tsdoc"; + import { MdxParagraph, TsDoc } from "./stc/index.js"; export interface SummaryProps { diff --git a/packages/docs/scripts/components/TsDoc.ts b/packages/docs/scripts/components/TsDoc.ts index 9913f6ce5..c0cd7ffe4 100644 --- a/packages/docs/scripts/components/TsDoc.ts +++ b/packages/docs/scripts/components/TsDoc.ts @@ -21,6 +21,7 @@ import { DocSection, } from "@microsoft/tsdoc"; import type { DeclarationReference } from "@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference.js"; + import { ApiModelContext } from "../contexts/api-model.js"; import { TsDocContext, useTsDoccontext } from "../contexts/ts-doc.js"; import * as stc from "./stc/index.js"; diff --git a/packages/docs/scripts/components/component/ComponentDoc.ts b/packages/docs/scripts/components/component/ComponentDoc.ts index 8df244a25..a8b5ba7c9 100644 --- a/packages/docs/scripts/components/component/ComponentDoc.ts +++ b/packages/docs/scripts/components/component/ComponentDoc.ts @@ -1,5 +1,6 @@ import { mapJoin, type Children } from "@alloy-js/core"; import type { ApiItem } from "@microsoft/api-extractor-model"; + import type { ComponentApi } from "../../build-json.js"; import { ComponentProps, diff --git a/packages/docs/scripts/components/component/ComponentProps.ts b/packages/docs/scripts/components/component/ComponentProps.ts index 37d8c9d55..c34e9e3bb 100644 --- a/packages/docs/scripts/components/component/ComponentProps.ts +++ b/packages/docs/scripts/components/component/ComponentProps.ts @@ -1,4 +1,5 @@ import type { ApiInterface } from "@microsoft/api-extractor-model"; + import { InterfaceMembers, MdxSection } from "../stc/index.js"; export interface ComponentPropsProps { diff --git a/packages/docs/scripts/components/component/ComponentSignature.ts b/packages/docs/scripts/components/component/ComponentSignature.ts index b211fa847..70aac3e5d 100644 --- a/packages/docs/scripts/components/component/ComponentSignature.ts +++ b/packages/docs/scripts/components/component/ComponentSignature.ts @@ -13,6 +13,7 @@ import type { ApiInterface, ApiPropertySignature, } from "@microsoft/api-extractor-model"; + import type { ComponentApi } from "../../build-json.js"; import { ImportPathContext } from "../../contexts/import-path.js"; import { flattenedMembers } from "../../utils.js"; diff --git a/packages/docs/scripts/components/context/ContextAccessor.ts b/packages/docs/scripts/components/context/ContextAccessor.ts index 4c0bc0152..37af10c4b 100644 --- a/packages/docs/scripts/components/context/ContextAccessor.ts +++ b/packages/docs/scripts/components/context/ContextAccessor.ts @@ -1,4 +1,5 @@ import { code } from "@alloy-js/core"; + import type { ContextApi } from "../../build-json.js"; import { Code, MdxSection, Summary } from "../stc/index.js"; diff --git a/packages/docs/scripts/components/context/ContextInterface.ts b/packages/docs/scripts/components/context/ContextInterface.ts index af704c0a5..053e16329 100644 --- a/packages/docs/scripts/components/context/ContextInterface.ts +++ b/packages/docs/scripts/components/context/ContextInterface.ts @@ -1,5 +1,6 @@ import { refkey, type Children } from "@alloy-js/core"; import type { ApiInterface } from "@microsoft/api-extractor-model"; + import type { ContextApi } from "../../build-json.js"; import { InterfaceMembers, MdxSection } from "../stc/index.js"; diff --git a/packages/docs/scripts/components/context/ContextSignature.ts b/packages/docs/scripts/components/context/ContextSignature.ts index 01c46873d..0ee4d6b1d 100644 --- a/packages/docs/scripts/components/context/ContextSignature.ts +++ b/packages/docs/scripts/components/context/ContextSignature.ts @@ -1,4 +1,5 @@ import { code } from "@alloy-js/core"; + import type { ContextApi } from "../../build-json.js"; import { Code, MdxParagraph } from "../stc/index.js"; diff --git a/packages/docs/scripts/components/function/FunctionOptions.ts b/packages/docs/scripts/components/function/FunctionOptions.ts index 9db03e9f3..a37bd420a 100644 --- a/packages/docs/scripts/components/function/FunctionOptions.ts +++ b/packages/docs/scripts/components/function/FunctionOptions.ts @@ -1,4 +1,5 @@ import type { ApiFunction, ApiInterface } from "@microsoft/api-extractor-model"; + import { InterfaceMembers, MdxSection } from "../stc/index.js"; import { resolveCodeDestination } from "../TsDoc.js"; diff --git a/packages/docs/scripts/components/function/FunctionOverloadDoc.ts b/packages/docs/scripts/components/function/FunctionOverloadDoc.ts index 446ad9a03..f4a8d2651 100644 --- a/packages/docs/scripts/components/function/FunctionOverloadDoc.ts +++ b/packages/docs/scripts/components/function/FunctionOverloadDoc.ts @@ -1,4 +1,5 @@ import type { ApiFunction } from "@microsoft/api-extractor-model"; + import { Examples, FunctionOptions, @@ -18,10 +19,9 @@ export interface FunctionOverloadDocProps { } export function FunctionOverloadDoc(props: FunctionOverloadDocProps) { - const root = - props.omitOverloadIndex ? MdxParagraph() : ( - MdxSection({ title: `Overload ${props.fn.overloadIndex}` }) - ); + const root = props.omitOverloadIndex + ? MdxParagraph() + : MdxSection({ title: `Overload ${props.fn.overloadIndex}` }); return root.children( Summary({ type: props.fn }), diff --git a/packages/docs/scripts/components/function/FunctionParameters.ts b/packages/docs/scripts/components/function/FunctionParameters.ts index 451248c33..bc26b577b 100644 --- a/packages/docs/scripts/components/function/FunctionParameters.ts +++ b/packages/docs/scripts/components/function/FunctionParameters.ts @@ -1,5 +1,6 @@ import { code, mapJoin, type Children } from "@alloy-js/core"; import type { ApiFunction, Parameter } from "@microsoft/api-extractor-model"; + import { mdxEscape } from "../../utils.js"; import { MdxSection, TsDoc } from "../stc/index.js"; @@ -11,9 +12,8 @@ export function FunctionParameters(props: FunctionParametersProps) { const params = mapJoin( () => props.fn.parameters as Parameter[], (param) => { - const summary: Children = - param.tsdocParamBlock ? - TsDoc({ + const summary: Children = param.tsdocParamBlock + ? TsDoc({ node: param.tsdocParamBlock, context: props.fn, inline: true, diff --git a/packages/docs/scripts/components/function/FunctionReturn.ts b/packages/docs/scripts/components/function/FunctionReturn.ts index 818e14b93..cbc47f76e 100644 --- a/packages/docs/scripts/components/function/FunctionReturn.ts +++ b/packages/docs/scripts/components/function/FunctionReturn.ts @@ -1,4 +1,5 @@ import type { ApiFunction } from "@microsoft/api-extractor-model"; + import { Excerpt, MdxSection, TsDoc } from "../stc/index.js"; export interface FunctionReturnProps { diff --git a/packages/docs/scripts/components/function/FunctionSignature.ts b/packages/docs/scripts/components/function/FunctionSignature.ts index 4ed08c109..54c534e5f 100644 --- a/packages/docs/scripts/components/function/FunctionSignature.ts +++ b/packages/docs/scripts/components/function/FunctionSignature.ts @@ -1,5 +1,6 @@ import { code, useContext } from "@alloy-js/core"; import type { ApiFunction } from "@microsoft/api-extractor-model"; + import { ImportPathContext } from "../../contexts/import-path.js"; import { cleanExcerpt } from "../../utils.js"; import { Code, MdxParagraph } from "../stc/index.js"; diff --git a/packages/docs/scripts/components/stc/index.ts b/packages/docs/scripts/components/stc/index.ts index daa3a0ef3..393b40260 100644 --- a/packages/docs/scripts/components/stc/index.ts +++ b/packages/docs/scripts/components/stc/index.ts @@ -1,4 +1,5 @@ import { stc } from "@alloy-js/core"; + import { Code as CodeJsx } from "../Code.js"; import { ComponentDoc as ComponentDocJsx } from "../component/ComponentDoc.js"; import { ComponentProps as ComponentPropsJsx } from "../component/ComponentProps.js"; diff --git a/packages/docs/scripts/components/type/TypeDoc.ts b/packages/docs/scripts/components/type/TypeDoc.ts index 34329586d..55690bbd5 100644 --- a/packages/docs/scripts/components/type/TypeDoc.ts +++ b/packages/docs/scripts/components/type/TypeDoc.ts @@ -3,6 +3,7 @@ import { ApiInterface, ApiItemKind, } from "@microsoft/api-extractor-model"; + import type { TypeApi } from "../../build-json.js"; import { cleanExcerpt } from "../../utils.js"; import { @@ -26,11 +27,11 @@ export function TypeDoc(props: TypeDocProps) { return DocSourceFile({ title, declares: [apiType] }).children( Summary({ type: apiType }), - apiType.kind === ApiItemKind.TypeAlias ? - MdxParagraph().children( - Code({ language: "ts" }).children(cleanExcerpt(apiType.excerpt.text)), - ) - : TypeMembers({ type: apiType as ApiInterface | ApiClass }), + apiType.kind === ApiItemKind.TypeAlias + ? MdxParagraph().children( + Code({ language: "ts" }).children(cleanExcerpt(apiType.excerpt.text)), + ) + : TypeMembers({ type: apiType as ApiInterface | ApiClass }), Remarks({ type: apiType }), Examples({ type: apiType }), SeeAlso({ type: apiType }), diff --git a/packages/docs/scripts/components/type/TypeMembers.ts b/packages/docs/scripts/components/type/TypeMembers.ts index 7799badd4..1c3f5c8d5 100644 --- a/packages/docs/scripts/components/type/TypeMembers.ts +++ b/packages/docs/scripts/components/type/TypeMembers.ts @@ -5,6 +5,7 @@ import { type ApiInterface, type HeritageType, } from "@microsoft/api-extractor-model"; + import { Excerpt, InterfaceMembers, @@ -20,11 +21,11 @@ export function TypeMembers(props: TypeMembersProps) { let extendsInfo: Children = ""; const extendsTypes: HeritageType[] = - props.type.kind === ApiItemKind.Class ? - (props.type as ApiClass).extendsType ? - [(props.type as ApiClass).extendsType!] - : [] - : (props.type as ApiInterface).extendsTypes.slice(); + props.type.kind === ApiItemKind.Class + ? (props.type as ApiClass).extendsType + ? [(props.type as ApiClass).extendsType!] + : [] + : (props.type as ApiInterface).extendsTypes.slice(); if (extendsTypes.length > 0) { const extendsItems = mapJoin( diff --git a/packages/docs/scripts/utils.ts b/packages/docs/scripts/utils.ts index a44118d11..fa8d22d0d 100644 --- a/packages/docs/scripts/utils.ts +++ b/packages/docs/scripts/utils.ts @@ -5,6 +5,7 @@ import { type ApiItem, type ExcerptToken, } from "@microsoft/api-extractor-model"; + import { ApiModelContext } from "./contexts/api-model.js"; export function resolveExcerptReference( diff --git a/packages/go/src/components/ImportStatement.tsx b/packages/go/src/components/ImportStatement.tsx index bf2f2a9b5..249d136b0 100644 --- a/packages/go/src/components/ImportStatement.tsx +++ b/packages/go/src/components/ImportStatement.tsx @@ -1,5 +1,6 @@ import { computed, For, Indent, memo } from "@alloy-js/core"; import { basename, join, sep } from "pathe"; + import { useModule } from "../scopes/module.js"; import { ImportRecords } from "../scopes/source-file.js"; import { GoSymbol } from "../symbols/go.js"; diff --git a/packages/go/src/components/ModuleDirectory.tsx b/packages/go/src/components/ModuleDirectory.tsx index ca7bdfb3a..722128d53 100644 --- a/packages/go/src/components/ModuleDirectory.tsx +++ b/packages/go/src/components/ModuleDirectory.tsx @@ -1,4 +1,5 @@ import { Children, Scope, SourceDirectory } from "@alloy-js/core"; + import { createGoModuleScope } from "../scopes/module.js"; export interface ModuleDirectoryProps { diff --git a/packages/go/src/components/Reference.tsx b/packages/go/src/components/Reference.tsx index add63bf9e..0fe78e547 100644 --- a/packages/go/src/components/Reference.tsx +++ b/packages/go/src/components/Reference.tsx @@ -1,4 +1,5 @@ import { computed, emitSymbol, Refkey } from "@alloy-js/core"; + import { ref } from "../symbols/index.js"; export interface ReferenceProps { diff --git a/packages/go/src/components/SourceDirectory.tsx b/packages/go/src/components/SourceDirectory.tsx index 030f60a31..82c6fcf69 100644 --- a/packages/go/src/components/SourceDirectory.tsx +++ b/packages/go/src/components/SourceDirectory.tsx @@ -6,6 +6,7 @@ import { useContext, } from "@alloy-js/core"; import { basename, join } from "pathe"; + import { useModule } from "../scopes/module.js"; import { createGoPackageScope } from "../scopes/package.js"; import { createPackageSymbol } from "../symbols/factories.js"; diff --git a/packages/go/src/components/SourceFile.tsx b/packages/go/src/components/SourceFile.tsx index 13a1fd206..08dc3efdd 100644 --- a/packages/go/src/components/SourceFile.tsx +++ b/packages/go/src/components/SourceFile.tsx @@ -8,11 +8,12 @@ import { type Children, } from "@alloy-js/core"; import { join } from "pathe"; + import { usePackage } from "../scopes/package.js"; import { GoSourceFileScope } from "../scopes/source-file.js"; +import { LineComment } from "./doc/comment.js"; import { ImportStatements } from "./ImportStatement.js"; import { Reference } from "./Reference.js"; -import { LineComment } from "./doc/comment.js"; export interface SourceFileProps { path: string; diff --git a/packages/go/src/components/doc/comment.test.tsx b/packages/go/src/components/doc/comment.test.tsx index 1f10410ae..da69f964c 100644 --- a/packages/go/src/components/doc/comment.test.tsx +++ b/packages/go/src/components/doc/comment.test.tsx @@ -1,6 +1,7 @@ import { List, Prose } from "@alloy-js/core"; import { d } from "@alloy-js/core/testing"; import { describe, expect, it } from "vitest"; + import { BlockComment, LineComment } from "./comment.jsx"; describe("GoLineComment", () => { diff --git a/packages/go/src/components/function/function.test.tsx b/packages/go/src/components/function/function.test.tsx index e76ac05b7..a9a2788c7 100644 --- a/packages/go/src/components/function/function.test.tsx +++ b/packages/go/src/components/function/function.test.tsx @@ -1,5 +1,6 @@ import { Children, code, Output, refkey, Refkey, render } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { TestPackage } from "../../../test/utils.js"; import { ModuleDirectory } from "../ModuleDirectory.js"; import { SourceDirectory } from "../SourceDirectory.js"; diff --git a/packages/go/src/components/function/function.tsx b/packages/go/src/components/function/function.tsx index 35cafda8a..493be25bd 100644 --- a/packages/go/src/components/function/function.tsx +++ b/packages/go/src/components/function/function.tsx @@ -15,6 +15,7 @@ import { Show, useContext, } from "@alloy-js/core"; + import { useGoScope } from "../../scopes/contexts.js"; import { createFunctionScope } from "../../scopes/factories.js"; import { GoSourceFileScope } from "../../scopes/source-file.js"; @@ -86,15 +87,12 @@ export function FunctionDeclaration(props: FunctionProps) { - func{" "} - {props.receiver ? - <>({props.receiver}) - : null} + func {props.receiver ? <>({props.receiver}) : null} {" "} - {props.returns ? - Array.isArray(props.returns) && props.returns.length > 1 ? + {props.returns ? ( + Array.isArray(props.returns) && props.returns.length > 1 ? ( <> {"("} @@ -118,15 +116,19 @@ export function FunctionDeclaration(props: FunctionProps) { {")"} {" "} - : <>{props.returns} - : null} - {!props.children ? + ) : ( + <>{props.returns} + ) + ) : null} + {!props.children ? ( "{}" - : props.singleLine ? + ) : props.singleLine ? ( <> {"{"} {props.children} {"}"} - : {props.children}} + ) : ( + {props.children} + )}
); diff --git a/packages/go/src/components/interface/declaration.tsx b/packages/go/src/components/interface/declaration.tsx index d03e1ee27..be01285d4 100644 --- a/packages/go/src/components/interface/declaration.tsx +++ b/packages/go/src/components/interface/declaration.tsx @@ -14,6 +14,7 @@ import { useContext, watch, } from "@alloy-js/core"; + import { useGoScope, useNamedTypeScope } from "../../scopes/contexts.js"; import { createFunctionScope, @@ -135,9 +136,11 @@ export function InterfaceDeclaration(props: InterfaceDeclarationProps) { return ( <> interface - {interfaceScope ? + {interfaceScope ? ( {content} - : content} + ) : ( + content + )} ); } @@ -166,9 +169,7 @@ export function InterfaceFunction(props: InterfaceFunctionProps) { func - {props.returns ? - <> {props.returns} - : null} + {props.returns ? <> {props.returns} : null} ); diff --git a/packages/go/src/components/interface/interface.test.tsx b/packages/go/src/components/interface/interface.test.tsx index a74b819e9..6ce205a7c 100644 --- a/packages/go/src/components/interface/interface.test.tsx +++ b/packages/go/src/components/interface/interface.test.tsx @@ -1,5 +1,6 @@ import { List, Output, refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { TestPackage } from "../../../test/utils.js"; import { ModuleDirectory } from "../ModuleDirectory.jsx"; import { SourceDirectory } from "../SourceDirectory.jsx"; diff --git a/packages/go/src/components/package.test.tsx b/packages/go/src/components/package.test.tsx index 4e912d3e3..430d05733 100644 --- a/packages/go/src/components/package.test.tsx +++ b/packages/go/src/components/package.test.tsx @@ -1,6 +1,7 @@ import { Output } from "@alloy-js/core"; import { d } from "@alloy-js/core/testing"; import { expect, it } from "vitest"; + import { ModuleDirectory } from "./ModuleDirectory.jsx"; import { SourceDirectory } from "./SourceDirectory.jsx"; import { SourceFile } from "./SourceFile.jsx"; diff --git a/packages/go/src/components/parameters/parameters.tsx b/packages/go/src/components/parameters/parameters.tsx index c4854f3a4..45ce7b6b6 100644 --- a/packages/go/src/components/parameters/parameters.tsx +++ b/packages/go/src/components/parameters/parameters.tsx @@ -7,6 +7,7 @@ import { Namekey, Refkey, } from "@alloy-js/core"; + import { createParameterSymbol } from "../../symbols/factories.js"; import { Name } from "../Name.jsx"; diff --git a/packages/go/src/components/parameters/typeparameters.tsx b/packages/go/src/components/parameters/typeparameters.tsx index fbdfb1cb6..47035a0c4 100644 --- a/packages/go/src/components/parameters/typeparameters.tsx +++ b/packages/go/src/components/parameters/typeparameters.tsx @@ -7,6 +7,7 @@ import { Namekey, Refkey, } from "@alloy-js/core"; + import { createTypeParameterSymbol } from "../../symbols/factories.js"; /** diff --git a/packages/go/src/components/stc/index.ts b/packages/go/src/components/stc/index.ts index 23269327b..a69580883 100644 --- a/packages/go/src/components/stc/index.ts +++ b/packages/go/src/components/stc/index.ts @@ -1,4 +1,5 @@ import * as core from "@alloy-js/core"; + import * as base from "../index.js"; export const LineComment = core.stc(base.LineComment); diff --git a/packages/go/src/components/struct/declaration.tsx b/packages/go/src/components/struct/declaration.tsx index b0450bcfe..6c9951a3b 100644 --- a/packages/go/src/components/struct/declaration.tsx +++ b/packages/go/src/components/struct/declaration.tsx @@ -15,6 +15,7 @@ import { useContext, watch, } from "@alloy-js/core"; + import { useGoScope, useNamedTypeScope } from "../../scopes/contexts.js"; import { createNamedTypeScope } from "../../scopes/factories.js"; import { GoNamedTypeScope } from "../../scopes/named-type.js"; @@ -129,9 +130,7 @@ export function StructDeclaration(props: StructDeclarationProps) { return ( <> struct - {structScope ? - {content} - : content} + {structScope ? {content} : content} ); } @@ -169,11 +168,11 @@ export function StructMember(props: StructMemberProps) { {props.type} - {tagString.value === "" ? - "" - : tagString.value.includes('"') ? - ` \`${tagString.value}\`` - : ` "${tagString.value}"`} + {tagString.value === "" + ? "" + : tagString.value.includes('"') + ? ` \`${tagString.value}\`` + : ` "${tagString.value}"`} ); } diff --git a/packages/go/src/components/struct/struct.test.tsx b/packages/go/src/components/struct/struct.test.tsx index c5c4bdafc..4a3f0db01 100644 --- a/packages/go/src/components/struct/struct.test.tsx +++ b/packages/go/src/components/struct/struct.test.tsx @@ -1,11 +1,12 @@ import { List, Output, refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { TestPackage } from "../../../test/utils.js"; +import { TypeConstraint } from "../interface/declaration.jsx"; import { ModuleDirectory } from "../ModuleDirectory.js"; +import { Pointer } from "../pointer/pointer.js"; import { SourceDirectory } from "../SourceDirectory.js"; import { SourceFile } from "../SourceFile.js"; -import { TypeConstraint } from "../interface/declaration.jsx"; -import { Pointer } from "../pointer/pointer.js"; import { TypeDeclaration } from "../type/declaration.js"; import { StructDeclaration, diff --git a/packages/go/src/components/type/declaration.tsx b/packages/go/src/components/type/declaration.tsx index 7a3e2936e..cdd4eef7d 100644 --- a/packages/go/src/components/type/declaration.tsx +++ b/packages/go/src/components/type/declaration.tsx @@ -13,6 +13,7 @@ import { Show, useContext, } from "@alloy-js/core"; + import { createNamedTypeScope } from "../../scopes/factories.js"; import { createTypeSymbol } from "../../symbols/factories.js"; import { NamedTypeSymbol } from "../../symbols/named-type.js"; diff --git a/packages/go/src/components/var/declaration.tsx b/packages/go/src/components/var/declaration.tsx index a72fcc219..5682c8ecd 100644 --- a/packages/go/src/components/var/declaration.tsx +++ b/packages/go/src/components/var/declaration.tsx @@ -13,6 +13,7 @@ import { Show, useContext, } from "@alloy-js/core"; + import { useGoScope } from "../../scopes/contexts.js"; import { GoSourceFileScope } from "../../scopes/source-file.js"; import { createVariableSymbol } from "../../symbols/factories.js"; diff --git a/packages/go/src/components/var/var-declaration.test.tsx b/packages/go/src/components/var/var-declaration.test.tsx index 7cf4eb8b7..0e9018e0b 100644 --- a/packages/go/src/components/var/var-declaration.test.tsx +++ b/packages/go/src/components/var/var-declaration.test.tsx @@ -1,5 +1,6 @@ import { Output, refkey, render } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as go from "../index.js"; it("works variable", () => { diff --git a/packages/go/src/context/package.ts b/packages/go/src/context/package.ts index df1cd96e3..68f4114ea 100644 --- a/packages/go/src/context/package.ts +++ b/packages/go/src/context/package.ts @@ -1,4 +1,5 @@ import { ComponentContext, createContext, useContext } from "@alloy-js/core"; + import { PackageSymbol } from "../symbols/package.js"; interface PackageContext { diff --git a/packages/go/src/create-module.test.tsx b/packages/go/src/create-module.test.tsx index f17c716cd..d4b1c35d5 100644 --- a/packages/go/src/create-module.test.tsx +++ b/packages/go/src/create-module.test.tsx @@ -1,6 +1,8 @@ -import { TestPackage } from "#test/utils.jsx"; import { namekey, toRefkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + +import { TestPackage } from "#test/utils.jsx"; + import { fmt } from "./builtins/fmt/fmt.js"; import { VariableDeclaration } from "./components/index.js"; import { createModule, StrictDescriptor } from "./create-module.js"; diff --git a/packages/go/src/create-module.ts b/packages/go/src/create-module.ts index b4f4a8772..13e82101d 100644 --- a/packages/go/src/create-module.ts +++ b/packages/go/src/create-module.ts @@ -9,6 +9,7 @@ import { useBinder, } from "@alloy-js/core"; import { basename } from "pathe"; + import { FunctionSymbol, GoSymbol, PackageSymbol } from "./index.js"; import { NamedTypeSymbol } from "./symbols/named-type.js"; @@ -92,9 +93,9 @@ export type StrictDescriptor = | EmbedDescriptor; export type ResolveDescriptor = - D extends NamedTypeDescriptor ? - LibrarySymbolReference & { [K in keyof M]: ResolveDescriptor } - : LibrarySymbolReference; + D extends NamedTypeDescriptor + ? LibrarySymbolReference & { [K in keyof M]: ResolveDescriptor } + : LibrarySymbolReference; export type LibraryFrom = ResolveDescriptor & LibrarySymbolReference; @@ -258,17 +259,18 @@ function createSymbolFromDescriptor( NamedTypeSymbol, namekey(name), ownerSymbol.members, - ownerSymbol.typeKind === "interface" ? - "interface-member" - : "struct-member", + ownerSymbol.typeKind === "interface" + ? "interface-member" + : "struct-member", { binder, refkeys: refkey(), type: - descriptor.type === undefined ? undefined - : typeof descriptor.type === "function" ? - descriptor.type()[TO_SYMBOL]() - : descriptor.type[TO_SYMBOL](), + descriptor.type === undefined + ? undefined + : typeof descriptor.type === "function" + ? descriptor.type()[TO_SYMBOL]() + : descriptor.type[TO_SYMBOL](), lazyMemberInitializer, }, ); @@ -282,17 +284,18 @@ function createSymbolFromDescriptor( NamedTypeSymbol, namekey(name), ownerSymbol.members, - ownerSymbol.typeKind === "interface" ? - "interface-member" - : "struct-member", + ownerSymbol.typeKind === "interface" + ? "interface-member" + : "struct-member", { binder, refkeys: refkey(), type: - descriptor.type === undefined ? undefined - : typeof descriptor.type === "function" ? - descriptor.type()[TO_SYMBOL]() - : descriptor.type[TO_SYMBOL](), + descriptor.type === undefined + ? undefined + : typeof descriptor.type === "function" + ? descriptor.type()[TO_SYMBOL]() + : descriptor.type[TO_SYMBOL](), lazyMemberInitializer, }, ); @@ -309,10 +312,11 @@ function createSymbolFromDescriptor( binder, refkeys: refkey(), type: - descriptor.type === undefined ? undefined - : typeof descriptor.type === "function" ? - descriptor.type()[TO_SYMBOL]() - : descriptor.type[TO_SYMBOL](), + descriptor.type === undefined + ? undefined + : typeof descriptor.type === "function" + ? descriptor.type()[TO_SYMBOL]() + : descriptor.type[TO_SYMBOL](), }); default: throw "Unsupported"; diff --git a/packages/go/src/scopes/contexts.ts b/packages/go/src/scopes/contexts.ts index bdf062a55..0727feef0 100644 --- a/packages/go/src/scopes/contexts.ts +++ b/packages/go/src/scopes/contexts.ts @@ -1,4 +1,5 @@ import { useScope } from "@alloy-js/core"; + import { GoFunctionScope } from "./function.js"; import { GoScope } from "./go.js"; import { GoLexicalScope } from "./lexical.js"; diff --git a/packages/go/src/scopes/factories.ts b/packages/go/src/scopes/factories.ts index 9fd297655..03c71db31 100644 --- a/packages/go/src/scopes/factories.ts +++ b/packages/go/src/scopes/factories.ts @@ -1,4 +1,5 @@ import { OutputScopeOptions, createScope } from "@alloy-js/core"; + import { NamedTypeSymbol } from "../symbols/named-type.js"; import { useGoScope } from "./contexts.js"; import { GoFunctionScope } from "./function.js"; diff --git a/packages/go/src/scopes/function.ts b/packages/go/src/scopes/function.ts index 9401f5321..4c2c4d484 100644 --- a/packages/go/src/scopes/function.ts +++ b/packages/go/src/scopes/function.ts @@ -1,4 +1,5 @@ import type { OutputSpace } from "@alloy-js/core"; + import { GoLexicalScope } from "./lexical.js"; export class GoFunctionScope extends GoLexicalScope { diff --git a/packages/go/src/scopes/go.ts b/packages/go/src/scopes/go.ts index 6d818eba6..27bb318eb 100644 --- a/packages/go/src/scopes/go.ts +++ b/packages/go/src/scopes/go.ts @@ -1,4 +1,5 @@ import { OutputScope, OutputScopeOptions } from "@alloy-js/core"; + import { PackageSymbol } from "../symbols/package.js"; export class GoScope extends OutputScope { diff --git a/packages/go/src/scopes/lexical.ts b/packages/go/src/scopes/lexical.ts index 4f965a642..877fa86b4 100644 --- a/packages/go/src/scopes/lexical.ts +++ b/packages/go/src/scopes/lexical.ts @@ -1,4 +1,5 @@ import { type OutputSpace } from "@alloy-js/core"; + import { GoScope } from "./go.js"; export class GoLexicalScope extends GoScope { diff --git a/packages/go/src/scopes/module.ts b/packages/go/src/scopes/module.ts index 979b33e78..20a6ea17c 100644 --- a/packages/go/src/scopes/module.ts +++ b/packages/go/src/scopes/module.ts @@ -1,4 +1,5 @@ import { OutputScope, createScope, useScope } from "@alloy-js/core"; + import { GoScope } from "./go.js"; export class GoModuleScope extends GoScope { diff --git a/packages/go/src/scopes/named-type.ts b/packages/go/src/scopes/named-type.ts index ef686dab2..6e206575a 100644 --- a/packages/go/src/scopes/named-type.ts +++ b/packages/go/src/scopes/named-type.ts @@ -1,4 +1,5 @@ import { type OutputScopeOptions } from "@alloy-js/core"; + import { NamedTypeSymbol } from "../symbols/named-type.js"; import { GoScope } from "./go.js"; import { GoModuleScope } from "./module.js"; diff --git a/packages/go/src/scopes/package.ts b/packages/go/src/scopes/package.ts index 1997e275b..44d34396d 100644 --- a/packages/go/src/scopes/package.ts +++ b/packages/go/src/scopes/package.ts @@ -1,4 +1,5 @@ import { OutputScope, createScope, useScope } from "@alloy-js/core"; + import type { PackageSymbol } from "../symbols/package.js"; import { GoModuleScope } from "./module.js"; import { GoNamedTypeScope } from "./named-type.js"; diff --git a/packages/go/src/scopes/source-file.ts b/packages/go/src/scopes/source-file.ts index f408cd1f7..1bdcdb396 100644 --- a/packages/go/src/scopes/source-file.ts +++ b/packages/go/src/scopes/source-file.ts @@ -5,6 +5,7 @@ import { shallowReactive, useScope, } from "@alloy-js/core"; + import { GoSymbol } from "../symbols/go.js"; import { PackageSymbol } from "../symbols/package.js"; import { GoLexicalScope } from "./lexical.js"; diff --git a/packages/go/src/symbols/factories.ts b/packages/go/src/symbols/factories.ts index 2ab82d719..404ff19c3 100644 --- a/packages/go/src/symbols/factories.ts +++ b/packages/go/src/symbols/factories.ts @@ -1,5 +1,6 @@ import { createSymbol, Namekey, NamePolicyGetter } from "@alloy-js/core"; import { join } from "pathe"; + import { GoElements, useGoNamePolicy } from "../name-policy.js"; import { useGoScope, useNamedTypeScope } from "../scopes/contexts.js"; import { GoFunctionScope } from "../scopes/function.js"; diff --git a/packages/go/src/symbols/function.ts b/packages/go/src/symbols/function.ts index 0d98558d0..4b68dd33a 100644 --- a/packages/go/src/symbols/function.ts +++ b/packages/go/src/symbols/function.ts @@ -6,6 +6,7 @@ import { trigger, TriggerOpTypes, } from "@alloy-js/core"; + import { GoSymbol, GoSymbolOptions } from "./go.js"; import { NamedTypeSymbol } from "./named-type.js"; diff --git a/packages/go/src/symbols/go.ts b/packages/go/src/symbols/go.ts index 51c50b003..ac4a6d364 100644 --- a/packages/go/src/symbols/go.ts +++ b/packages/go/src/symbols/go.ts @@ -7,6 +7,7 @@ import { OutputSymbolOptions, createSymbol, } from "@alloy-js/core"; + import { GoScope } from "../scopes/go.js"; import { PackageSymbol } from "./package.js"; diff --git a/packages/go/src/symbols/named-type.ts b/packages/go/src/symbols/named-type.ts index 91d298332..f4ead3f14 100644 --- a/packages/go/src/symbols/named-type.ts +++ b/packages/go/src/symbols/named-type.ts @@ -7,6 +7,7 @@ import { trigger, TriggerOpTypes, } from "@alloy-js/core"; + import { GoSymbol, GoSymbolOptions } from "./go.js"; // represents a symbol from a .go file. Struct, interface, etc. diff --git a/packages/go/src/symbols/package.ts b/packages/go/src/symbols/package.ts index 7b2241100..1ec07eea7 100644 --- a/packages/go/src/symbols/package.ts +++ b/packages/go/src/symbols/package.ts @@ -1,5 +1,6 @@ import { OutputSymbolOptions, createSymbol } from "@alloy-js/core"; import { join } from "pathe"; + import { NamedTypeSymbol } from "./named-type.js"; export interface PackageSymbolOptions extends OutputSymbolOptions { diff --git a/packages/go/src/symbols/reference.ts b/packages/go/src/symbols/reference.ts index d15c3a1f7..86ac6650a 100644 --- a/packages/go/src/symbols/reference.ts +++ b/packages/go/src/symbols/reference.ts @@ -1,4 +1,5 @@ import { memo, OutputSymbol, Refkey, resolve } from "@alloy-js/core"; + import { GoScope } from "../scopes/go.js"; import { GoPackageScope } from "../scopes/package.js"; import { useSourceFileScope } from "../scopes/source-file.js"; diff --git a/packages/go/src/symbols/type-parameter.ts b/packages/go/src/symbols/type-parameter.ts index 0e36bf413..d3f3541c9 100644 --- a/packages/go/src/symbols/type-parameter.ts +++ b/packages/go/src/symbols/type-parameter.ts @@ -1,4 +1,5 @@ import { Children, Namekey, OutputSpace } from "@alloy-js/core"; + import { GoSymbol, GoSymbolOptions } from "./go.js"; interface TypeParameterSymbolOptions extends GoSymbolOptions { diff --git a/packages/go/test/utils.tsx b/packages/go/test/utils.tsx index da1a0e26e..73dd4de93 100644 --- a/packages/go/test/utils.tsx +++ b/packages/go/test/utils.tsx @@ -1,4 +1,5 @@ import { Children, Output } from "@alloy-js/core"; + import * as go from "../src/index.js"; export function TestPackage(props: { children: Children }): Children { diff --git a/packages/java/src/builtins/util.ts b/packages/java/src/builtins/util.ts index 62419d34e..59eec9319 100644 --- a/packages/java/src/builtins/util.ts +++ b/packages/java/src/builtins/util.ts @@ -1,4 +1,5 @@ import type { SymbolCreator } from "@alloy-js/core"; + import { createLibrary } from "../create-library.js"; // work around very strange issue where TypeScript complains that the inferred // type of the below cannot be named without a reference to ../../alloy-js/core diff --git a/packages/java/src/components/Annotation.tsx b/packages/java/src/components/Annotation.tsx index dfcbf48a3..35b76f020 100644 --- a/packages/java/src/components/Annotation.tsx +++ b/packages/java/src/components/Annotation.tsx @@ -1,5 +1,6 @@ import { Match, Switch } from "@alloy-js/core"; import { Children } from "@alloy-js/core/jsx-runtime"; + import { NamedArgumentList } from "./NamedArgumentList.jsx"; export interface AnnotationProps { diff --git a/packages/java/src/components/Class.tsx b/packages/java/src/components/Class.tsx index c8c994a9b..98ed131db 100644 --- a/packages/java/src/components/Class.tsx +++ b/packages/java/src/components/Class.tsx @@ -1,4 +1,5 @@ import { Block, Children, Show } from "@alloy-js/core"; + import { CommonDeclarationProps, Declaration } from "./Declaration.js"; import { ExtendsClause } from "./ExtendsClause.js"; import { ImplementsClause } from "./ImplementsClause.js"; diff --git a/packages/java/src/components/Constructor.tsx b/packages/java/src/components/Constructor.tsx index 329424ca9..dfcd85c2f 100644 --- a/packages/java/src/components/Constructor.tsx +++ b/packages/java/src/components/Constructor.tsx @@ -1,5 +1,6 @@ import { Block } from "@alloy-js/core"; import { Children } from "@alloy-js/core/jsx-runtime"; + import { ModifierProps, Modifiers } from "./Modifiers.jsx"; import { Name } from "./Name.js"; import { Parameters } from "./Parameters.js"; diff --git a/packages/java/src/components/Declaration.tsx b/packages/java/src/components/Declaration.tsx index b4a896766..a2b71c57b 100644 --- a/packages/java/src/components/Declaration.tsx +++ b/packages/java/src/components/Declaration.tsx @@ -5,6 +5,7 @@ import { Namekey, Refkey, } from "@alloy-js/core"; + import { JavaElements, useJavaNamePolicy } from "../name-policy.js"; import { JavaOutputSymbol } from "../symbols/java-output-symbol.js"; import { useLexicalScope } from "../utils.js"; diff --git a/packages/java/src/components/Enum.tsx b/packages/java/src/components/Enum.tsx index 6d27188cf..c3490b83c 100644 --- a/packages/java/src/components/Enum.tsx +++ b/packages/java/src/components/Enum.tsx @@ -1,4 +1,5 @@ import { Block, Children, List } from "@alloy-js/core"; + import { useJavaNamePolicy } from "../name-policy.js"; import { ArgumentList } from "./ArgumentList.jsx"; import { CommonDeclarationProps, Declaration } from "./Declaration.js"; diff --git a/packages/java/src/components/Interface.tsx b/packages/java/src/components/Interface.tsx index d8afb7db5..d808a0cf8 100644 --- a/packages/java/src/components/Interface.tsx +++ b/packages/java/src/components/Interface.tsx @@ -1,4 +1,5 @@ import { Block, Children } from "@alloy-js/core"; + import { CommonDeclarationProps, Declaration } from "./Declaration.js"; import { ExtendsClause } from "./ExtendsClause.jsx"; import { LexicalScope } from "./LexicalScope.jsx"; diff --git a/packages/java/src/components/LexicalScope.tsx b/packages/java/src/components/LexicalScope.tsx index 0f426f336..0986bf917 100644 --- a/packages/java/src/components/LexicalScope.tsx +++ b/packages/java/src/components/LexicalScope.tsx @@ -5,6 +5,7 @@ import { ScopePropsWithValue, useScope, } from "@alloy-js/core"; + import { JavaLexicalScope } from "../symbols/index.js"; export interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {} diff --git a/packages/java/src/components/MavenProject.tsx b/packages/java/src/components/MavenProject.tsx index a1d262dc0..1153c4dc7 100644 --- a/packages/java/src/components/MavenProject.tsx +++ b/packages/java/src/components/MavenProject.tsx @@ -6,6 +6,7 @@ import { Show, SourceFile, } from "@alloy-js/core"; + import { MavenProjectConfig } from "../symbols/index.js"; import { useProject } from "./ProjectDirectory.js"; @@ -163,8 +164,8 @@ export function PomFileBuild(props: PomFileProps) { return code` - ${()} - ${()} + ${} + ${} `; } @@ -268,15 +269,15 @@ function PomFileBuildResources(props: MavenProjectConfig["build"]) { ` }${ - resource.filtering !== undefined ? - ` + resource.filtering !== undefined + ? ` ${resource.filtering}` - : undefined + : undefined }${ - resource.targetPath !== undefined ? - ` + resource.targetPath !== undefined + ? ` ${resource.targetPath}` - : undefined + : undefined } `, diff --git a/packages/java/src/components/Method.tsx b/packages/java/src/components/Method.tsx index c882a283f..f364ab315 100644 --- a/packages/java/src/components/Method.tsx +++ b/packages/java/src/components/Method.tsx @@ -1,4 +1,5 @@ import { Children, code } from "@alloy-js/core"; + import { useJavaNamePolicy } from "../name-policy.js"; import { ModifierProps, Modifiers } from "./Modifiers.jsx"; import { Parameters } from "./Parameters.js"; @@ -17,18 +18,17 @@ export function Method(props: MethodProps) { const name = useJavaNamePolicy().getName(props.name, "method"); const modifiers = ; const throwsClause = props.throws ? code` throws ${props.throws}` : ""; - const generics = - props.generics ? - code`${()}${" "}` + const generics = props.generics + ? code`${}${" "}` : ""; const sBody = - props.children !== undefined ? - code` + props.children !== undefined + ? code` ${" "}{ ${props.children} } ` - : ";"; + : ";"; return code` ${modifiers}${generics}${props.return ?? "void"} ${name}(${params})${throwsClause}${sBody} `; diff --git a/packages/java/src/components/ObjectDeclaration.tsx b/packages/java/src/components/ObjectDeclaration.tsx index 6cfec57e7..b0c92d8bc 100644 --- a/packages/java/src/components/ObjectDeclaration.tsx +++ b/packages/java/src/components/ObjectDeclaration.tsx @@ -1,4 +1,5 @@ import { Children, code } from "@alloy-js/core"; + import { ArgumentList } from "./ArgumentList.jsx"; import { CommonDeclarationProps } from "./Declaration.js"; import { ModifierProps } from "./Modifiers.jsx"; diff --git a/packages/java/src/components/PackageDirectory.tsx b/packages/java/src/components/PackageDirectory.tsx index de5094ca4..ad08432fa 100644 --- a/packages/java/src/components/PackageDirectory.tsx +++ b/packages/java/src/components/PackageDirectory.tsx @@ -9,6 +9,7 @@ import { useContext, useScope, } from "@alloy-js/core"; + import { JavaPackageScope } from "../symbols/java-package-scope.js"; export interface PackageDirectoryContext { @@ -40,9 +41,8 @@ export function PackageDirectory(props: PackageDirectoryProps) { const packageNames = props.package.split("."); const packageName = packageNames[0]; - const fullyQualifiedPackageName = - parentPackage ? - parentPackage.qualifiedName + "." + packageName + const fullyQualifiedPackageName = parentPackage + ? parentPackage.qualifiedName + "." + packageName : packageName; const parentScope = useScope(); diff --git a/packages/java/src/components/ProjectDirectory.tsx b/packages/java/src/components/ProjectDirectory.tsx index 3bab65d0b..96c8c92db 100644 --- a/packages/java/src/components/ProjectDirectory.tsx +++ b/packages/java/src/components/ProjectDirectory.tsx @@ -7,6 +7,7 @@ import { SourceDirectory, useContext, } from "@alloy-js/core"; + import { GradleProjectConfig, JavaProjectScope, @@ -63,9 +64,9 @@ export function ProjectDirectory(props: ProjectDirectoryProps) { {props.children} - {scope.mavenProjectConfig ? + {scope.mavenProjectConfig ? ( - : undefined} + ) : undefined} diff --git a/packages/java/src/components/Reference.tsx b/packages/java/src/components/Reference.tsx index 8ce6bfb0e..7978e865a 100644 --- a/packages/java/src/components/Reference.tsx +++ b/packages/java/src/components/Reference.tsx @@ -1,4 +1,5 @@ import { Refkey } from "@alloy-js/core"; + import { ref } from "../symbols/index.js"; export interface ReferenceProps { diff --git a/packages/java/src/components/SourceFile.tsx b/packages/java/src/components/SourceFile.tsx index 6b0a38022..16f750213 100644 --- a/packages/java/src/components/SourceFile.tsx +++ b/packages/java/src/components/SourceFile.tsx @@ -6,6 +6,7 @@ import { reactive, } from "@alloy-js/core"; import { Children } from "@alloy-js/core/jsx-runtime"; + import { JavaOutputSymbol } from "../symbols/index.js"; import { ImportStatements, ImportSymbol } from "./ImportStatement.js"; import { LexicalScope } from "./LexicalScope.jsx"; @@ -71,13 +72,13 @@ export function SourceFile(props: SourceFileProps) { package {packageCtx.qualifiedName}; - {importRecords.length > 0 ? + {importRecords.length > 0 ? ( <> - : undefined} + ) : undefined} {props.children} diff --git a/packages/java/src/components/Variable.tsx b/packages/java/src/components/Variable.tsx index e8b3ac051..75fd3ba8d 100644 --- a/packages/java/src/components/Variable.tsx +++ b/packages/java/src/components/Variable.tsx @@ -1,4 +1,5 @@ import { Children, code, Namekey } from "@alloy-js/core"; + import { useJavaNamePolicy } from "../name-policy.js"; import { ModifierProps, Modifiers } from "./Modifiers.jsx"; diff --git a/packages/java/src/components/stc/index.ts b/packages/java/src/components/stc/index.ts index abb50006f..810ae8f85 100644 --- a/packages/java/src/components/stc/index.ts +++ b/packages/java/src/components/stc/index.ts @@ -1,4 +1,5 @@ import * as core from "@alloy-js/core"; + import * as base from "../index.js"; export const Annotation = core.stc(base.Annotation); diff --git a/packages/java/src/create-library.ts b/packages/java/src/create-library.ts index 9d4516d4f..ada18bbbf 100644 --- a/packages/java/src/create-library.ts +++ b/packages/java/src/create-library.ts @@ -10,6 +10,7 @@ import { refkey, SymbolCreator, } from "@alloy-js/core"; + import { JavaOutputSymbol, JavaPackageScope, @@ -43,8 +44,9 @@ function createSymbols( } export type LibraryRefkeys = { - [S in T[keyof T] extends readonly string[] ? T[keyof T][number] - : never]: Refkey; + [S in T[keyof T] extends readonly string[] + ? T[keyof T][number] + : never]: Refkey; }; export interface CreateLibraryProps { diff --git a/packages/java/src/symbols/java-output-symbol.ts b/packages/java/src/symbols/java-output-symbol.ts index 3e204d918..28e89059c 100644 --- a/packages/java/src/symbols/java-output-symbol.ts +++ b/packages/java/src/symbols/java-output-symbol.ts @@ -6,6 +6,7 @@ import { OutputSymbolOptions, refkey, } from "@alloy-js/core"; + import { usePackage } from "../components/PackageDirectory.jsx"; export interface JavaOutputSymbolOptions extends OutputSymbolOptions { @@ -41,9 +42,9 @@ export class JavaOutputSymbol extends OutputSymbol { } else { const parentPackage = usePackage(); this.#package = - (options.package ?? parentPackage !== null) ? - parentPackage?.qualifiedName - : ""; + (options.package ?? parentPackage !== null) + ? parentPackage?.qualifiedName + : ""; } } diff --git a/packages/java/src/symbols/reference.ts b/packages/java/src/symbols/reference.ts index b0012af2f..ace53d286 100644 --- a/packages/java/src/symbols/reference.ts +++ b/packages/java/src/symbols/reference.ts @@ -1,4 +1,5 @@ import { memo, Refkey, resolve, untrack, useContext } from "@alloy-js/core"; + import { SourceFileContext } from "../components/index.js"; import { JavaOutputSymbol } from "./java-output-symbol.js"; import { JavaOutputScope } from "./scopes.js"; diff --git a/packages/java/src/utils.ts b/packages/java/src/utils.ts index b376b279b..6aef1feea 100644 --- a/packages/java/src/utils.ts +++ b/packages/java/src/utils.ts @@ -1,4 +1,5 @@ import { useScope } from "@alloy-js/core"; + import { JavaLexicalScope } from "./symbols/java-lexical-scope.js"; export function useLexicalScope(): JavaLexicalScope | undefined { diff --git a/packages/java/test/annotation.test.tsx b/packages/java/test/annotation.test.tsx index 1c4381e8b..52daa92b3 100644 --- a/packages/java/test/annotation.test.tsx +++ b/packages/java/test/annotation.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import * as jv from "../src/components/index.js"; import { TestPackage } from "./utils.js"; diff --git a/packages/java/test/class.test.tsx b/packages/java/test/class.test.tsx index 7b5f55874..52a2ede1b 100644 --- a/packages/java/test/class.test.tsx +++ b/packages/java/test/class.test.tsx @@ -1,5 +1,6 @@ import { code, namekey, Output, refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as jv from "../src/components/index.js"; import { TestPackage } from "./utils.js"; diff --git a/packages/java/test/constructor.test.tsx b/packages/java/test/constructor.test.tsx index 3282c66cc..412ab9d88 100644 --- a/packages/java/test/constructor.test.tsx +++ b/packages/java/test/constructor.test.tsx @@ -1,5 +1,6 @@ import { code, Output, refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as jv from "../src/components/index.js"; import { TestPackage } from "./utils.js"; @@ -9,7 +10,7 @@ it("works", () => { {code` public class TestClass { - ${()} + ${} } `} @@ -29,7 +30,7 @@ it("takes name from class", () => { {code` public class TestClass { - ${()} + ${} } `} diff --git a/packages/java/test/enum.test.tsx b/packages/java/test/enum.test.tsx index 34e2202b7..63c219115 100644 --- a/packages/java/test/enum.test.tsx +++ b/packages/java/test/enum.test.tsx @@ -1,5 +1,6 @@ import { code, namekey, Output, refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as jv from "../src/components/index.js"; import { TestPackage } from "./utils.js"; diff --git a/packages/java/test/externals.test.tsx b/packages/java/test/externals.test.tsx index 4e3f43d0c..43ce3fe6c 100644 --- a/packages/java/test/externals.test.tsx +++ b/packages/java/test/externals.test.tsx @@ -1,5 +1,6 @@ import { StatementList } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as jv from "../src/components/index.js"; import { createLibrary } from "../src/index.js"; import { TestPackage } from "./utils.js"; diff --git a/packages/java/test/interface.test.tsx b/packages/java/test/interface.test.tsx index f33f54bb9..6b568c891 100644 --- a/packages/java/test/interface.test.tsx +++ b/packages/java/test/interface.test.tsx @@ -1,5 +1,6 @@ import { namekey, Output, refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as jv from "../src/components/index.js"; import { TestPackage } from "./utils.js"; diff --git a/packages/java/test/maven.test.tsx b/packages/java/test/maven.test.tsx index 2da68bdba..67413d84c 100644 --- a/packages/java/test/maven.test.tsx +++ b/packages/java/test/maven.test.tsx @@ -1,5 +1,6 @@ import { Output } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { ProjectDirectory } from "../src/components/index.js"; import { MavenProjectConfig } from "../src/index.js"; diff --git a/packages/java/test/method.test.tsx b/packages/java/test/method.test.tsx index 40093343f..89ea2d971 100644 --- a/packages/java/test/method.test.tsx +++ b/packages/java/test/method.test.tsx @@ -1,5 +1,6 @@ import { code, Output, refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import * as jv from "../src/components/index.js"; import { TestPackage } from "./utils.js"; @@ -35,7 +36,7 @@ it("declares bodyless function", () => { {code` class Test { - ${()} + ${} } `} @@ -56,7 +57,7 @@ describe("can throw errors", () => { {code` class Test { - ${()} + ${} } `} @@ -78,7 +79,7 @@ describe("can throw errors", () => { {code` class Test { - ${()} + ${} } `} diff --git a/packages/java/test/package.test.tsx b/packages/java/test/package.test.tsx index 427477816..f64dcc17c 100644 --- a/packages/java/test/package.test.tsx +++ b/packages/java/test/package.test.tsx @@ -1,5 +1,6 @@ import { Output } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as jv from "../src/components/index.js"; it("emits correct package directory", () => { diff --git a/packages/java/test/reference.test.tsx b/packages/java/test/reference.test.tsx index df180678e..19fb41cd3 100644 --- a/packages/java/test/reference.test.tsx +++ b/packages/java/test/reference.test.tsx @@ -1,5 +1,6 @@ import { Block, Output, refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as jv from "../src/components/index.js"; it("imports reference to source file", () => { diff --git a/packages/java/test/type-arguments.test.tsx b/packages/java/test/type-arguments.test.tsx index 045ebfd41..d7a08d893 100644 --- a/packages/java/test/type-arguments.test.tsx +++ b/packages/java/test/type-arguments.test.tsx @@ -1,5 +1,6 @@ import { Output, code, refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as jv from "../src/components/index.js"; it("passes types", () => { @@ -27,9 +28,9 @@ it("passes types", () => { {code` public TestGenerics() { - List${()} list = new ArrayList${()}(); - List${()} list2 = new ArrayList${()}(); - List${()} list3 = new ArrayList${()}(); + List${} list = new ArrayList${}(); + List${} list2 = new ArrayList${}(); + List${} list3 = new ArrayList${}(); } `} diff --git a/packages/java/test/utils.tsx b/packages/java/test/utils.tsx index e38c2926f..2334dcb95 100644 --- a/packages/java/test/utils.tsx +++ b/packages/java/test/utils.tsx @@ -1,4 +1,5 @@ import { Children, Output, SymbolCreator } from "@alloy-js/core"; + import * as jv from "../src/index.js"; export interface TestPackageProps { diff --git a/packages/java/test/values.test.tsx b/packages/java/test/values.test.tsx index 772c678b5..3a950b112 100644 --- a/packages/java/test/values.test.tsx +++ b/packages/java/test/values.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import * as jv from "../src/components/index.js"; it("renders string value", () => { diff --git a/packages/java/test/variables.test.tsx b/packages/java/test/variables.test.tsx index 956c64291..6b71175fd 100644 --- a/packages/java/test/variables.test.tsx +++ b/packages/java/test/variables.test.tsx @@ -1,5 +1,6 @@ import { code, namekey, Output, refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as jv from "../src/components/index.js"; import { TestPackage } from "./utils.js"; @@ -9,7 +10,7 @@ it("works", () => { {code` class Test { - ${(} />)}; + ${} />}; } `} @@ -29,7 +30,7 @@ it("takes a namekey", () => { {code` class Test { - ${(} />)}; + ${} />}; } `} @@ -60,7 +61,7 @@ it("works with external type", () => { {code` public class Test { - ${()}; + ${}; } `} @@ -99,7 +100,7 @@ it("declares new object", () => { {code` public class Test { - ${(]} />)}; + ${]} />}; } `} diff --git a/packages/json/src/components/array.test.tsx b/packages/json/src/components/array.test.tsx index 04075068f..ca8f15eaa 100644 --- a/packages/json/src/components/array.test.tsx +++ b/packages/json/src/components/array.test.tsx @@ -1,5 +1,6 @@ import { reactive } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { jsonTest } from "../../test/utils.jsx"; it("renders empty arrays", () => { diff --git a/packages/json/src/components/json-array.tsx b/packages/json/src/components/json-array.tsx index fe4a7b181..e60b17a22 100644 --- a/packages/json/src/components/json-array.tsx +++ b/packages/json/src/components/json-array.tsx @@ -12,6 +12,7 @@ import { Refkey, useMemberScope, } from "@alloy-js/core"; + import { JsonOutputSymbol } from "../symbols/json-symbol.js"; import { JsonValue } from "./json-value.jsx"; diff --git a/packages/json/src/components/json-object.tsx b/packages/json/src/components/json-object.tsx index 58876185b..bf63ec0e9 100644 --- a/packages/json/src/components/json-object.tsx +++ b/packages/json/src/components/json-object.tsx @@ -13,6 +13,7 @@ import { Refkey, useMemberScope, } from "@alloy-js/core"; + import { JsonOutputSymbol } from "../symbols/json-symbol.js"; import { JsonValue } from "./json-value.jsx"; diff --git a/packages/json/src/components/json-value.test.tsx b/packages/json/src/components/json-value.test.tsx index abfdf1e34..8e833e110 100644 --- a/packages/json/src/components/json-value.test.tsx +++ b/packages/json/src/components/json-value.test.tsx @@ -1,5 +1,6 @@ import { Output } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { JsonValue } from "./json-value.jsx"; import { SourceFile } from "./source-file.jsx"; diff --git a/packages/json/src/components/json-value.tsx b/packages/json/src/components/json-value.tsx index 15b7378ff..7a399a075 100644 --- a/packages/json/src/components/json-value.tsx +++ b/packages/json/src/components/json-value.tsx @@ -1,4 +1,5 @@ import { Children, Refkey, useMemberDeclaration } from "@alloy-js/core"; + import { JsonArray } from "./json-array.jsx"; import { JsonObject } from "./json-object.jsx"; diff --git a/packages/json/src/components/object.test.tsx b/packages/json/src/components/object.test.tsx index ddf040c5b..d972080e8 100644 --- a/packages/json/src/components/object.test.tsx +++ b/packages/json/src/components/object.test.tsx @@ -1,5 +1,6 @@ import { List, Output, reactive } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { jsonTest } from "../../test/utils.jsx"; import { JsonObject, JsonObjectProperty } from "./json-object.jsx"; import { SourceFile } from "./source-file.jsx"; diff --git a/packages/json/src/components/primitives.test.tsx b/packages/json/src/components/primitives.test.tsx index f2409065f..d771ec41f 100644 --- a/packages/json/src/components/primitives.test.tsx +++ b/packages/json/src/components/primitives.test.tsx @@ -1,6 +1,7 @@ -import { jsonTest } from "#test/utils.jsx"; import { expect, it } from "vitest"; +import { jsonTest } from "#test/utils.jsx"; + it.each([ ["boolean (true)", true, "true"], ["boolean (false)", false, "false"], diff --git a/packages/json/src/components/reference.test.tsx b/packages/json/src/components/reference.test.tsx index 26f206fc0..a7b3cccbb 100644 --- a/packages/json/src/components/reference.test.tsx +++ b/packages/json/src/components/reference.test.tsx @@ -1,5 +1,6 @@ import { Output, refkey, SourceDirectory } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { JsonArray, JsonArrayElement } from "./json-array.jsx"; import { JsonObject, JsonObjectProperty } from "./json-object.jsx"; import { JsonValue } from "./json-value.jsx"; diff --git a/packages/json/src/components/reference.tsx b/packages/json/src/components/reference.tsx index 65d8e0db1..6bb079e25 100644 --- a/packages/json/src/components/reference.tsx +++ b/packages/json/src/components/reference.tsx @@ -1,4 +1,5 @@ import { Refkey } from "@alloy-js/core"; + import { ref } from "../symbols/index.js"; export interface ReferenceProps { diff --git a/packages/json/src/components/source-file.tsx b/packages/json/src/components/source-file.tsx index 00c34b8cb..dcb8a8bf1 100644 --- a/packages/json/src/components/source-file.tsx +++ b/packages/json/src/components/source-file.tsx @@ -5,6 +5,7 @@ import { createSymbol, moveTakenMembersTo, } from "@alloy-js/core"; + import { JsonFileContext } from "../context/JsonFileContext.js"; import { JsonOutputSymbol } from "../symbols/json-symbol.js"; import { Reference } from "./reference.jsx"; diff --git a/packages/json/src/components/stc/index.ts b/packages/json/src/components/stc/index.ts index 20701c028..7c116175f 100644 --- a/packages/json/src/components/stc/index.ts +++ b/packages/json/src/components/stc/index.ts @@ -1,4 +1,5 @@ import * as core from "@alloy-js/core"; + import * as Jsx from "../index.js"; export const JsonArray = core.stc(Jsx.JsonArray); diff --git a/packages/json/src/context/JsonFileContext.ts b/packages/json/src/context/JsonFileContext.ts index 06082af86..2e01b8da0 100644 --- a/packages/json/src/context/JsonFileContext.ts +++ b/packages/json/src/context/JsonFileContext.ts @@ -3,6 +3,7 @@ import { createNamedContext, useContext, } from "@alloy-js/core"; + import { JsonOutputSymbol } from "../symbols/json-symbol.js"; export interface JsonFileContext { diff --git a/packages/json/src/symbols/index.ts b/packages/json/src/symbols/index.ts index bb0ab1cc8..134f77bc2 100644 --- a/packages/json/src/symbols/index.ts +++ b/packages/json/src/symbols/index.ts @@ -6,6 +6,7 @@ import { unresolvedRefkey, } from "@alloy-js/core"; import { dirname, relative } from "pathe"; + import { useJsonFileContext } from "../context/JsonFileContext.js"; import { JsonOutputSymbol } from "./json-symbol.js"; export * from "./json-symbol.js"; diff --git a/packages/json/test/utils.tsx b/packages/json/test/utils.tsx index a1c4a3433..9a5b33baa 100644 --- a/packages/json/test/utils.tsx +++ b/packages/json/test/utils.tsx @@ -1,4 +1,5 @@ import { Output } from "@alloy-js/core"; + import { JsonValue } from "../src/components/json-value.jsx"; import { SourceFile } from "../src/components/source-file.jsx"; diff --git a/packages/markdown/src/components/Frontmatter.tsx b/packages/markdown/src/components/Frontmatter.tsx index 2c8ec74c7..24b03d34d 100644 --- a/packages/markdown/src/components/Frontmatter.tsx +++ b/packages/markdown/src/components/Frontmatter.tsx @@ -23,9 +23,11 @@ export function Frontmatter(props: FrontmatterProps) { return ( {"---"} - {props.jsValue ? + {props.jsValue ? ( stringify(props.jsValue).trim() - : } + ) : ( + + )} {"---"} ); diff --git a/packages/markdown/src/components/Heading.tsx b/packages/markdown/src/components/Heading.tsx index 81c77be11..ef6948c3a 100644 --- a/packages/markdown/src/components/Heading.tsx +++ b/packages/markdown/src/components/Heading.tsx @@ -1,5 +1,6 @@ import { Refkey } from "@alloy-js/core"; import { Children } from "@alloy-js/core/jsx-runtime"; + import { useSectionContext } from "../context/section.js"; export interface HeadingProps { diff --git a/packages/markdown/src/components/List.tsx b/packages/markdown/src/components/List.tsx index d0713014f..c7ef34e58 100644 --- a/packages/markdown/src/components/List.tsx +++ b/packages/markdown/src/components/List.tsx @@ -37,9 +37,7 @@ export function List(props: ListProps) { return ( - {props.ordered ? - <>{index + start}. - : props.bullet}{" "} + {props.ordered ? <>{index + start}. : props.bullet}{" "} {props.tasks && "[ ] "} {child} diff --git a/packages/markdown/src/components/Section.tsx b/packages/markdown/src/components/Section.tsx index 61ba4d0ce..942473e39 100644 --- a/packages/markdown/src/components/Section.tsx +++ b/packages/markdown/src/components/Section.tsx @@ -1,5 +1,6 @@ import { List } from "@alloy-js/core"; import { Children } from "@alloy-js/core/jsx-runtime"; + import { SectionContext, useSectionContext } from "../context/section.js"; import { Heading } from "./Heading.jsx"; diff --git a/packages/markdown/src/components/SourceFile.tsx b/packages/markdown/src/components/SourceFile.tsx index 5979469e2..71781f7dc 100644 --- a/packages/markdown/src/components/SourceFile.tsx +++ b/packages/markdown/src/components/SourceFile.tsx @@ -1,4 +1,5 @@ import { Children, SourceFile as CoreSourceFile, List } from "@alloy-js/core"; + import { Link } from "./Link.jsx"; export interface SourceFileProps { diff --git a/packages/markdown/test/Code.test.tsx b/packages/markdown/test/Code.test.tsx index bd3bfa429..48b1e9eb7 100644 --- a/packages/markdown/test/Code.test.tsx +++ b/packages/markdown/test/Code.test.tsx @@ -1,6 +1,7 @@ import { List } from "@alloy-js/core"; import { d } from "@alloy-js/core/testing"; import { expect, it } from "vitest"; + import { Code } from "../src/components/Code.jsx"; import { mdTest } from "./utils.jsx"; diff --git a/packages/markdown/test/Frontmatter.test.tsx b/packages/markdown/test/Frontmatter.test.tsx index 1576e9504..48f7ea1fd 100644 --- a/packages/markdown/test/Frontmatter.test.tsx +++ b/packages/markdown/test/Frontmatter.test.tsx @@ -1,5 +1,6 @@ import { d } from "@alloy-js/core/testing"; import { expect, it } from "vitest"; + import { Frontmatter } from "../src/components/Frontmatter.jsx"; import { mdTest } from "./utils.jsx"; diff --git a/packages/markdown/test/list.test.tsx b/packages/markdown/test/list.test.tsx index ee23f3668..035fa922c 100644 --- a/packages/markdown/test/list.test.tsx +++ b/packages/markdown/test/list.test.tsx @@ -1,5 +1,6 @@ import { d } from "@alloy-js/core/testing"; import { expect, it } from "vitest"; + import { List } from "../src/components/List.jsx"; import { mdTest } from "./utils.jsx"; diff --git a/packages/markdown/test/paragraph.test.tsx b/packages/markdown/test/paragraph.test.tsx index 04b79050f..59e7263dd 100644 --- a/packages/markdown/test/paragraph.test.tsx +++ b/packages/markdown/test/paragraph.test.tsx @@ -1,5 +1,6 @@ import { Prose } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { Section } from "../src/components/Section.jsx"; import { mdTest } from "./utils.jsx"; diff --git a/packages/markdown/test/section.test.tsx b/packages/markdown/test/section.test.tsx index 2ee60fd15..5025ce648 100644 --- a/packages/markdown/test/section.test.tsx +++ b/packages/markdown/test/section.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { Section } from "../src/components/Section.jsx"; import { mdTest } from "./utils.jsx"; diff --git a/packages/markdown/test/utils.tsx b/packages/markdown/test/utils.tsx index 5c8b8b705..e33543242 100644 --- a/packages/markdown/test/utils.tsx +++ b/packages/markdown/test/utils.tsx @@ -1,4 +1,5 @@ import { Children, Output } from "@alloy-js/core"; + import { SourceFile } from "../src/components/SourceFile.jsx"; export function mdTest(children: Children) { diff --git a/packages/msbuild/scripts/components/xml-component.tsx b/packages/msbuild/scripts/components/xml-component.tsx index 66a046895..5e670a912 100644 --- a/packages/msbuild/scripts/components/xml-component.tsx +++ b/packages/msbuild/scripts/components/xml-component.tsx @@ -4,6 +4,7 @@ import { InterfaceMember, VarDeclaration, } from "@alloy-js/typescript"; + import { XmlAttribute, XmlSchema } from "../collect-schemas.js"; export function XmlComponent(props: { schema: XmlSchema }) { diff --git a/packages/msbuild/scripts/generate-msbuild-components.tsx b/packages/msbuild/scripts/generate-msbuild-components.tsx index cffd73e41..226116269 100644 --- a/packages/msbuild/scripts/generate-msbuild-components.tsx +++ b/packages/msbuild/scripts/generate-msbuild-components.tsx @@ -1,6 +1,7 @@ import { code, For, Output, renderAsync, writeOutput } from "@alloy-js/core"; import { SourceFile } from "@alloy-js/typescript"; import { resolve } from "pathe"; + import { resolveSchemas } from "./collect-schemas.js"; import { XmlComponent } from "./components/xml-component.jsx"; diff --git a/packages/msbuild/src/components/elements.test.tsx b/packages/msbuild/src/components/elements.test.tsx index d8980ded2..bf2a2a7f7 100644 --- a/packages/msbuild/src/components/elements.test.tsx +++ b/packages/msbuild/src/components/elements.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { ItemGroup, OutputType, diff --git a/packages/msbuild/src/components/utils/make-tag.test.tsx b/packages/msbuild/src/components/utils/make-tag.test.tsx index 5e2f7b1ac..be9a25349 100644 --- a/packages/msbuild/src/components/utils/make-tag.test.tsx +++ b/packages/msbuild/src/components/utils/make-tag.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { makeTag } from "./make-tag.jsx"; const ItemGroup = makeTag<{ Label?: string }>("ItemGroup"); diff --git a/packages/msbuild/src/components/utils/make-tag.tsx b/packages/msbuild/src/components/utils/make-tag.tsx index c23ad13bd..234429f89 100644 --- a/packages/msbuild/src/components/utils/make-tag.tsx +++ b/packages/msbuild/src/components/utils/make-tag.tsx @@ -8,7 +8,7 @@ export function makeTag(tag: string) { {`<`} {tag} - {children.children ? + {children.children ? ( <> {`>`} @@ -16,7 +16,9 @@ export function makeTag(tag: string) { {``} - : ` />`} + ) : ( + ` />` + )} ); }; diff --git a/packages/python/src/builtins/python.ts b/packages/python/src/builtins/python.ts index 7e6755d25..8ebb46e95 100644 --- a/packages/python/src/builtins/python.ts +++ b/packages/python/src/builtins/python.ts @@ -1,4 +1,5 @@ import { SymbolCreator } from "@alloy-js/core"; + import { createModule, type ModuleDescriptor } from "../create-module.js"; // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/packages/python/src/components/CallSignature.tsx b/packages/python/src/components/CallSignature.tsx index a6d5713a7..367db8834 100644 --- a/packages/python/src/components/CallSignature.tsx +++ b/packages/python/src/components/CallSignature.tsx @@ -6,6 +6,7 @@ import { Show, SymbolSlot, } from "@alloy-js/core"; + import { isParameterDescriptor, ParameterDescriptor, @@ -45,9 +46,9 @@ export interface CallSignatureParametersProps { export function CallSignatureParameters(props: CallSignatureParametersProps) { const parameterList = computed(() => { const params = (props.parameters ?? []).map((p) => { - return isParameterMarker(p) ? p : ( - parameter(normalizeAndDeclareParameter(p)) - ); + return isParameterMarker(p) + ? p + : parameter(normalizeAndDeclareParameter(p)); }); // Add *args if specified @@ -184,15 +185,15 @@ export function CallSignature(props: CallSignatureProps) { kwargs={props.kwargs} /> ); - const typeParams = - props.typeParameters ? `[${props.typeParameters.join(", ")}]` : ""; - const sReturnType = - props.returnType ? - <> - {" -> "} - {props.returnType} - - : undefined; + const typeParams = props.typeParameters + ? `[${props.typeParameters.join(", ")}]` + : ""; + const sReturnType = props.returnType ? ( + <> + {" -> "} + {props.returnType} + + ) : undefined; return ( <> diff --git a/packages/python/src/components/ClassDeclaration.tsx b/packages/python/src/components/ClassDeclaration.tsx index b35f4df45..b41604305 100644 --- a/packages/python/src/components/ClassDeclaration.tsx +++ b/packages/python/src/components/ClassDeclaration.tsx @@ -1,4 +1,5 @@ import { Children, List, Name, Show, createContentSlot } from "@alloy-js/core"; + import { createPythonSymbol } from "../symbol-creation.js"; import { BaseDeclarationProps, Declaration } from "./Declaration.js"; import { DecoratorList } from "./DecoratorList.jsx"; diff --git a/packages/python/src/components/ClassInstantiation.tsx b/packages/python/src/components/ClassInstantiation.tsx index fab323c32..c0e1931dd 100644 --- a/packages/python/src/components/ClassInstantiation.tsx +++ b/packages/python/src/components/ClassInstantiation.tsx @@ -3,6 +3,7 @@ import { instantiateTakenMembersTo, useContext, } from "@alloy-js/core"; + import { createPythonSymbol } from "../symbol-creation.js"; import { FunctionCallExpression, diff --git a/packages/python/src/components/ClassMethodDeclaration.tsx b/packages/python/src/components/ClassMethodDeclaration.tsx index 7423440f7..efba34b12 100644 --- a/packages/python/src/components/ClassMethodDeclaration.tsx +++ b/packages/python/src/components/ClassMethodDeclaration.tsx @@ -1,4 +1,5 @@ import { splitProps } from "@alloy-js/core"; + import { createMethodSymbol } from "../symbols/factories.js"; import { DecoratorList } from "./DecoratorList.jsx"; import type { CommonFunctionProps } from "./FunctionBase.js"; diff --git a/packages/python/src/components/ConstructorDeclaration.tsx b/packages/python/src/components/ConstructorDeclaration.tsx index 8d55bd309..cc3c329a4 100644 --- a/packages/python/src/components/ConstructorDeclaration.tsx +++ b/packages/python/src/components/ConstructorDeclaration.tsx @@ -1,4 +1,5 @@ import { namekey } from "@alloy-js/core"; + import { createMethodSymbol } from "../symbols/factories.js"; import type { CommonFunctionProps } from "./FunctionBase.js"; import { MethodDeclarationBase } from "./MethodBase.js"; diff --git a/packages/python/src/components/DataclassDeclaration.tsx b/packages/python/src/components/DataclassDeclaration.tsx index a8dbc3058..ed96b49a6 100644 --- a/packages/python/src/components/DataclassDeclaration.tsx +++ b/packages/python/src/components/DataclassDeclaration.tsx @@ -1,5 +1,6 @@ import { For, Show } from "@alloy-js/core"; import { snakeCase } from "change-case"; + import { dataclassesModule } from "../builtins/python.js"; import { usePythonScope } from "../symbols/scopes.js"; import { Atom } from "./Atom.jsx"; diff --git a/packages/python/src/components/Declaration.tsx b/packages/python/src/components/Declaration.tsx index e2bfd6fec..a1b6eeb01 100644 --- a/packages/python/src/components/Declaration.tsx +++ b/packages/python/src/components/Declaration.tsx @@ -4,6 +4,7 @@ import { Namekey, Refkey, } from "@alloy-js/core"; + import { PythonElements } from "../name-policy.js"; import { createPythonSymbol } from "../symbol-creation.js"; import { PythonOutputSymbol } from "../symbols/index.js"; diff --git a/packages/python/src/components/DunderMethodDeclaration.tsx b/packages/python/src/components/DunderMethodDeclaration.tsx index 4b80b6d00..88ea9071e 100644 --- a/packages/python/src/components/DunderMethodDeclaration.tsx +++ b/packages/python/src/components/DunderMethodDeclaration.tsx @@ -1,4 +1,5 @@ import { isNamekey, namekey } from "@alloy-js/core"; + import type { CommonFunctionProps } from "./FunctionBase.js"; import { MethodDeclaration } from "./MethodDeclaration.js"; @@ -22,9 +23,8 @@ export interface DunderMethodDeclarationProps extends CommonFunctionProps { } export function DunderMethodDeclaration(props: DunderMethodDeclarationProps) { - const finalName = - isNamekey(props.name) ? - props.name + const finalName = isNamekey(props.name) + ? props.name : namekey(props.name as string, { ignoreNamePolicy: true }); return ; } diff --git a/packages/python/src/components/EnumDeclaration.tsx b/packages/python/src/components/EnumDeclaration.tsx index e0023e5e9..655a82912 100644 --- a/packages/python/src/components/EnumDeclaration.tsx +++ b/packages/python/src/components/EnumDeclaration.tsx @@ -4,6 +4,7 @@ import { For, Show, } from "@alloy-js/core"; + import { enumModule } from "../builtins/python.js"; import { createPythonSymbol } from "../symbol-creation.js"; import { BaseDeclarationProps } from "./Declaration.js"; diff --git a/packages/python/src/components/EnumMember.tsx b/packages/python/src/components/EnumMember.tsx index 0f1161f43..aee7dd54e 100644 --- a/packages/python/src/components/EnumMember.tsx +++ b/packages/python/src/components/EnumMember.tsx @@ -1,4 +1,5 @@ import { Children, Namekey, Refkey, Show } from "@alloy-js/core"; + import { enumModule } from "../builtins/python.js"; import { createPythonSymbol } from "../symbol-creation.js"; import { PythonOutputSymbol } from "../symbols/index.js"; diff --git a/packages/python/src/components/FunctionBase.tsx b/packages/python/src/components/FunctionBase.tsx index b6e966f2b..a20a12dec 100644 --- a/packages/python/src/components/FunctionBase.tsx +++ b/packages/python/src/components/FunctionBase.tsx @@ -1,4 +1,5 @@ import { createContentSlot, Name, Show, type Children } from "@alloy-js/core"; + import { PythonOutputSymbol } from "../index.js"; import { getCallSignatureProps } from "../utils.js"; import { CallSignature, CallSignatureProps } from "./CallSignature.jsx"; diff --git a/packages/python/src/components/ImportStatement.tsx b/packages/python/src/components/ImportStatement.tsx index 09d54b242..14ca36e0c 100644 --- a/packages/python/src/components/ImportStatement.tsx +++ b/packages/python/src/components/ImportStatement.tsx @@ -1,4 +1,5 @@ import { computed, mapJoin, memo } from "@alloy-js/core"; + import { ImportedSymbol, ImportRecords } from "../symbols/index.js"; export interface ImportStatementsProps { diff --git a/packages/python/src/components/LexicalScope.tsx b/packages/python/src/components/LexicalScope.tsx index a05c52d6f..487b5c815 100644 --- a/packages/python/src/components/LexicalScope.tsx +++ b/packages/python/src/components/LexicalScope.tsx @@ -1,4 +1,5 @@ import { Scope, ScopePropsWithInfo, ScopePropsWithValue } from "@alloy-js/core"; + import { createLexicalScope } from "../symbol-creation.js"; import { PythonLexicalScope } from "../symbols/python-lexical-scope.js"; diff --git a/packages/python/src/components/MemberScope.tsx b/packages/python/src/components/MemberScope.tsx index e424fad3b..fb43efc3b 100644 --- a/packages/python/src/components/MemberScope.tsx +++ b/packages/python/src/components/MemberScope.tsx @@ -3,6 +3,7 @@ import { MemberScope as CoreMemberScope, createScope, } from "@alloy-js/core"; + import { PythonMemberScope } from "../symbols/python-member-scope.js"; import { PythonOutputSymbol } from "../symbols/python-output-symbol.js"; import { usePythonScope } from "../symbols/scopes.js"; diff --git a/packages/python/src/components/MethodBase.tsx b/packages/python/src/components/MethodBase.tsx index 996d3f779..a7d209053 100644 --- a/packages/python/src/components/MethodBase.tsx +++ b/packages/python/src/components/MethodBase.tsx @@ -39,13 +39,12 @@ export function MethodDeclarationBase( ) { const { decorators, abstract, ...rest } = props; - const abstractMethod = - abstract ? - <> - @{abcModule["."].abstractmethod} - - - : undefined; + const abstractMethod = abstract ? ( + <> + @{abcModule["."].abstractmethod} + + + ) : undefined; return ( <> diff --git a/packages/python/src/components/PropertyDeclaration.tsx b/packages/python/src/components/PropertyDeclaration.tsx index 025ce9fb0..0e6c6f77a 100644 --- a/packages/python/src/components/PropertyDeclaration.tsx +++ b/packages/python/src/components/PropertyDeclaration.tsx @@ -12,6 +12,7 @@ import { taggedComponent, useContext, } from "@alloy-js/core"; + import { PythonOutputSymbol } from "../index.js"; import { ParameterDescriptor } from "../parameter-descriptor.js"; import { createMethodSymbol } from "../symbols/factories.js"; diff --git a/packages/python/src/components/PyDoc.tsx b/packages/python/src/components/PyDoc.tsx index de05f0868..de3a53668 100644 --- a/packages/python/src/components/PyDoc.tsx +++ b/packages/python/src/components/PyDoc.tsx @@ -9,6 +9,7 @@ import { computed, isKeyedChild, } from "@alloy-js/core"; + import { ParameterDescriptor } from "../parameter-descriptor.js"; import { Atom } from "./Atom.jsx"; diff --git a/packages/python/src/components/PydanticClassDeclaration.tsx b/packages/python/src/components/PydanticClassDeclaration.tsx index de4dc8173..40bc1294e 100644 --- a/packages/python/src/components/PydanticClassDeclaration.tsx +++ b/packages/python/src/components/PydanticClassDeclaration.tsx @@ -6,6 +6,7 @@ import { type Children, } from "@alloy-js/core"; import { snakeCase } from "change-case"; + import { pydanticModule } from "../builtins/python.js"; import { Atom } from "./Atom.jsx"; import type { ClassDeclarationProps } from "./ClassDeclaration.js"; diff --git a/packages/python/src/components/Reference.tsx b/packages/python/src/components/Reference.tsx index eadd2ee08..a23d3a312 100644 --- a/packages/python/src/components/Reference.tsx +++ b/packages/python/src/components/Reference.tsx @@ -1,4 +1,5 @@ import { computed, emitSymbol, Refkey } from "@alloy-js/core"; + import { isTypeRefContext } from "../context/type-ref-context.js"; import { ref } from "../symbols/index.js"; diff --git a/packages/python/src/components/SourceFile.tsx b/packages/python/src/components/SourceFile.tsx index 5f4f4ec4d..4173df95b 100644 --- a/packages/python/src/components/SourceFile.tsx +++ b/packages/python/src/components/SourceFile.tsx @@ -15,6 +15,7 @@ import { type Children, } from "@alloy-js/core"; import { join } from "pathe"; + import { PythonModuleScope } from "../symbols/index.js"; import { categorizeImportRecords, diff --git a/packages/python/src/components/TypeRefContext.tsx b/packages/python/src/components/TypeRefContext.tsx index f7bda151a..129b5eebd 100644 --- a/packages/python/src/components/TypeRefContext.tsx +++ b/packages/python/src/components/TypeRefContext.tsx @@ -1,4 +1,5 @@ import type { Children } from "@alloy-js/core"; + import { isTypeRefContext, TypeRefContextDef, diff --git a/packages/python/src/components/TypeReference.tsx b/packages/python/src/components/TypeReference.tsx index 8b61b7415..42136010f 100644 --- a/packages/python/src/components/TypeReference.tsx +++ b/packages/python/src/components/TypeReference.tsx @@ -1,4 +1,5 @@ import { Children, Refkey, Show } from "@alloy-js/core"; + import { TypeArguments } from "./TypeArguments.js"; import { TypeRefContext } from "./TypeRefContext.js"; @@ -22,9 +23,9 @@ export interface TypeReferenceProps { export function TypeReference(props: TypeReferenceProps) { const type = props.refkey ? props.refkey : props.name; const typeArgs = - props.typeArgs && props.typeArgs.length ? + props.typeArgs && props.typeArgs.length ? ( - : undefined; + ) : undefined; return ( diff --git a/packages/python/src/components/VariableDeclaration.tsx b/packages/python/src/components/VariableDeclaration.tsx index c68234a62..1451bb4ce 100644 --- a/packages/python/src/components/VariableDeclaration.tsx +++ b/packages/python/src/components/VariableDeclaration.tsx @@ -6,6 +6,7 @@ import { createSymbolSlot, memo, } from "@alloy-js/core"; + import { createPythonSymbol } from "../symbol-creation.js"; import { Atom } from "./Atom.jsx"; import { BaseDeclarationProps } from "./Declaration.jsx"; @@ -104,9 +105,9 @@ export function VariableDeclaration(props: VariableDeclarationProps) { // If we receive a symbol, resolve it to a name const value = - typeof props.initializer === "object" ? - memo(() => props.initializer) - : props.initializer; + typeof props.initializer === "object" + ? memo(() => props.initializer) + : props.initializer; const assignmentOperator = props.callStatementVar ? "=" : " = "; const getRightSide = () => { // Early return for omitNone case diff --git a/packages/python/src/create-module.ts b/packages/python/src/create-module.ts index ce6953f96..099666a33 100644 --- a/packages/python/src/create-module.ts +++ b/packages/python/src/create-module.ts @@ -6,6 +6,7 @@ import { refkey, SymbolCreator, } from "@alloy-js/core"; + import { createPythonSymbol } from "./symbol-creation.js"; import { PythonModuleScope } from "./symbols/index.js"; diff --git a/packages/python/src/name-conflict-resolver.ts b/packages/python/src/name-conflict-resolver.ts index ffc736c63..652ba0800 100644 --- a/packages/python/src/name-conflict-resolver.ts +++ b/packages/python/src/name-conflict-resolver.ts @@ -1,4 +1,5 @@ import { OutputSymbol } from "@alloy-js/core"; + import { PythonOutputSymbol } from "./symbols/python-output-symbol.js"; export function pythonNameConflictResolver(_: string, symbols: OutputSymbol[]) { diff --git a/packages/python/src/symbol-creation.ts b/packages/python/src/symbol-creation.ts index c58936085..b6912c793 100644 --- a/packages/python/src/symbol-creation.ts +++ b/packages/python/src/symbol-creation.ts @@ -6,6 +6,7 @@ import { createSymbol, useContext, } from "@alloy-js/core"; + import { PythonSourceFileContext } from "./components/SourceFile.js"; import { PythonElements, usePythonNamePolicy } from "./name-policy.js"; import { diff --git a/packages/python/src/symbols/factories.ts b/packages/python/src/symbols/factories.ts index b39820d26..85d645365 100644 --- a/packages/python/src/symbols/factories.ts +++ b/packages/python/src/symbols/factories.ts @@ -1,4 +1,5 @@ import { Namekey } from "@alloy-js/core"; + import { createPythonSymbol } from "../symbol-creation.js"; import type { PythonOutputSymbol } from "./python-output-symbol.js"; import { usePythonScope } from "./scopes.js"; diff --git a/packages/python/src/symbols/python-member-scope.ts b/packages/python/src/symbols/python-member-scope.ts index d83cb97aa..75cdf36d1 100644 --- a/packages/python/src/symbols/python-member-scope.ts +++ b/packages/python/src/symbols/python-member-scope.ts @@ -1,4 +1,5 @@ import { OutputScope } from "@alloy-js/core"; + import { PythonOutputSymbol } from "./python-output-symbol.js"; export class PythonMemberScope extends OutputScope { diff --git a/packages/python/src/symbols/python-module-scope.ts b/packages/python/src/symbols/python-module-scope.ts index 870ea9c21..053faabea 100644 --- a/packages/python/src/symbols/python-module-scope.ts +++ b/packages/python/src/symbols/python-module-scope.ts @@ -1,4 +1,5 @@ import { createSymbol, reactive, shallowReactive } from "@alloy-js/core"; + import { PythonLexicalScope } from "./python-lexical-scope.js"; import { PythonOutputSymbol } from "./python-output-symbol.js"; diff --git a/packages/python/src/symbols/reference.tsx b/packages/python/src/symbols/reference.tsx index ca2182c83..766eef007 100644 --- a/packages/python/src/symbols/reference.tsx +++ b/packages/python/src/symbols/reference.tsx @@ -7,6 +7,7 @@ import { untrack, useContext, } from "@alloy-js/core"; + import { MemberExpression } from "../components/MemberExpression.jsx"; import { PythonSourceFileContext } from "../components/SourceFile.jsx"; import { PythonModuleScope } from "./python-module-scope.js"; diff --git a/packages/python/src/symbols/scopes.ts b/packages/python/src/symbols/scopes.ts index 395a1c17c..aaf2d3663 100644 --- a/packages/python/src/symbols/scopes.ts +++ b/packages/python/src/symbols/scopes.ts @@ -1,4 +1,5 @@ import { useScope } from "@alloy-js/core"; + import { PythonLexicalScope } from "./python-lexical-scope.js"; import { PythonMemberScope } from "./python-member-scope.js"; import { PythonModuleScope } from "./python-module-scope.js"; diff --git a/packages/python/src/utils.ts b/packages/python/src/utils.ts index 9884d7f69..fca3d3c53 100644 --- a/packages/python/src/utils.ts +++ b/packages/python/src/utils.ts @@ -1,4 +1,5 @@ import { defaultProps, splitProps } from "@alloy-js/core"; + import { CallSignatureProps } from "./components/index.js"; /** diff --git a/packages/python/test/callsignatures.test.tsx b/packages/python/test/callsignatures.test.tsx index cf7cb4881..ef2f1511a 100644 --- a/packages/python/test/callsignatures.test.tsx +++ b/packages/python/test/callsignatures.test.tsx @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { TestOutput } from "./utils.jsx"; diff --git a/packages/python/test/class-method-declaration.test.tsx b/packages/python/test/class-method-declaration.test.tsx index d21dc971e..5544cbc14 100644 --- a/packages/python/test/class-method-declaration.test.tsx +++ b/packages/python/test/class-method-declaration.test.tsx @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/classdeclarations.test.tsx b/packages/python/test/classdeclarations.test.tsx index cb195fa95..9ccb6ec4b 100644 --- a/packages/python/test/classdeclarations.test.tsx +++ b/packages/python/test/classdeclarations.test.tsx @@ -1,5 +1,6 @@ import { memberRefkey, namekey, refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { TestOutput, TestOutputDirectory } from "./utils.js"; diff --git a/packages/python/test/classinstantiations.test.tsx b/packages/python/test/classinstantiations.test.tsx index f9909f783..6f26c3cab 100644 --- a/packages/python/test/classinstantiations.test.tsx +++ b/packages/python/test/classinstantiations.test.tsx @@ -1,5 +1,6 @@ import { refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { createModule } from "../src/create-module.js"; import * as py from "../src/index.js"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/constructordeclaration.test.tsx b/packages/python/test/constructordeclaration.test.tsx index eb9ad2f15..a32143288 100644 --- a/packages/python/test/constructordeclaration.test.tsx +++ b/packages/python/test/constructordeclaration.test.tsx @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/dataclassdeclarations.test.tsx b/packages/python/test/dataclassdeclarations.test.tsx index cd58f9217..b9bc84a26 100644 --- a/packages/python/test/dataclassdeclarations.test.tsx +++ b/packages/python/test/dataclassdeclarations.test.tsx @@ -1,5 +1,6 @@ import { Prose, namekey, refkey, render } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { dataclassesModule } from "../src/builtins/python.js"; import * as py from "../src/index.js"; import { TestOutput, TestOutputDirectory } from "./utils.js"; diff --git a/packages/python/test/decoratorlist.test.tsx b/packages/python/test/decoratorlist.test.tsx index 026e63b77..a7f7a8e08 100644 --- a/packages/python/test/decoratorlist.test.tsx +++ b/packages/python/test/decoratorlist.test.tsx @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { DecoratorList } from "../src/components/DecoratorList.jsx"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/dundermethoddeclaration.test.tsx b/packages/python/test/dundermethoddeclaration.test.tsx index 2e9017fb0..b2fcfa523 100644 --- a/packages/python/test/dundermethoddeclaration.test.tsx +++ b/packages/python/test/dundermethoddeclaration.test.tsx @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/enums.test.tsx b/packages/python/test/enums.test.tsx index 41a7f78fb..68d8a9408 100644 --- a/packages/python/test/enums.test.tsx +++ b/packages/python/test/enums.test.tsx @@ -1,5 +1,6 @@ import { refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { enumModule } from "../src/builtins/python.js"; import * as py from "../src/index.js"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/externals.test.tsx b/packages/python/test/externals.test.tsx index 6f5cecc09..203202e00 100644 --- a/packages/python/test/externals.test.tsx +++ b/packages/python/test/externals.test.tsx @@ -1,5 +1,6 @@ import { code, refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as py from "../src/index.js"; import { createModule } from "../src/index.js"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/factories.test.tsx b/packages/python/test/factories.test.tsx index 484251aad..2cbda5b95 100644 --- a/packages/python/test/factories.test.tsx +++ b/packages/python/test/factories.test.tsx @@ -1,5 +1,6 @@ import { render } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/functioncallexpressions.test.tsx b/packages/python/test/functioncallexpressions.test.tsx index 1a7c1e324..c061c7ba1 100644 --- a/packages/python/test/functioncallexpressions.test.tsx +++ b/packages/python/test/functioncallexpressions.test.tsx @@ -1,5 +1,6 @@ import { refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/functiondeclaration.test.tsx b/packages/python/test/functiondeclaration.test.tsx index 153161366..05551db7b 100644 --- a/packages/python/test/functiondeclaration.test.tsx +++ b/packages/python/test/functiondeclaration.test.tsx @@ -1,5 +1,6 @@ import { code, namekey, refkey, render } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { abcModule } from "../src/index.js"; import { TestOutput, TestOutputDirectory } from "./utils.js"; diff --git a/packages/python/test/imports.test.tsx b/packages/python/test/imports.test.tsx index d6b6e3e83..417adb11a 100644 --- a/packages/python/test/imports.test.tsx +++ b/packages/python/test/imports.test.tsx @@ -1,5 +1,6 @@ import { refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { ImportStatement, ImportStatements, diff --git a/packages/python/test/memberexpressions.test.tsx b/packages/python/test/memberexpressions.test.tsx index eb9f01aea..7c9f5fb35 100644 --- a/packages/python/test/memberexpressions.test.tsx +++ b/packages/python/test/memberexpressions.test.tsx @@ -1,5 +1,6 @@ import { code, memberRefkey, refkey, render } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { ClassDeclaration, diff --git a/packages/python/test/methoddeclaration.test.tsx b/packages/python/test/methoddeclaration.test.tsx index ca830a4af..72999a0c6 100644 --- a/packages/python/test/methoddeclaration.test.tsx +++ b/packages/python/test/methoddeclaration.test.tsx @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { abcModule } from "../src/index.js"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/name-conflict.test.ts b/packages/python/test/name-conflict.test.ts index ba5b99368..2ae24728c 100644 --- a/packages/python/test/name-conflict.test.ts +++ b/packages/python/test/name-conflict.test.ts @@ -1,5 +1,6 @@ import { createOutputBinder } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { pythonNameConflictResolver } from "../src/name-conflict-resolver.js"; import { createPythonSymbol } from "../src/symbol-creation.js"; import { PythonModuleScope } from "../src/symbols/index.js"; diff --git a/packages/python/test/namepolicies.test.tsx b/packages/python/test/namepolicies.test.tsx index bb410a513..fcd5076d1 100644 --- a/packages/python/test/namepolicies.test.tsx +++ b/packages/python/test/namepolicies.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { enumModule } from "../src/builtins/python.js"; import * as py from "../src/index.js"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/propertydeclaration.test.tsx b/packages/python/test/propertydeclaration.test.tsx index a07cc9832..05c840ea7 100644 --- a/packages/python/test/propertydeclaration.test.tsx +++ b/packages/python/test/propertydeclaration.test.tsx @@ -1,5 +1,6 @@ import { Prose, code } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { abcModule } from "../src/index.js"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/pydanticclassdeclarations.test.tsx b/packages/python/test/pydanticclassdeclarations.test.tsx index 8530b3b15..7d4c54afa 100644 --- a/packages/python/test/pydanticclassdeclarations.test.tsx +++ b/packages/python/test/pydanticclassdeclarations.test.tsx @@ -1,5 +1,6 @@ import { Prose, code, refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { pydanticModule, pydanticSettingsModule, diff --git a/packages/python/test/pydocs.test.tsx b/packages/python/test/pydocs.test.tsx index 4ec59b248..21d0c425e 100644 --- a/packages/python/test/pydocs.test.tsx +++ b/packages/python/test/pydocs.test.tsx @@ -1,5 +1,6 @@ import { Prose } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { enumModule } from "../src/builtins/python.js"; import * as py from "../src/index.js"; import { TestOutput, TestOutputDirectory } from "./utils.jsx"; diff --git a/packages/python/test/references.test.tsx b/packages/python/test/references.test.tsx index 17ac5fd16..9b1a8cd5d 100644 --- a/packages/python/test/references.test.tsx +++ b/packages/python/test/references.test.tsx @@ -1,5 +1,6 @@ import { refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { TestOutputDirectory } from "./utils.js"; diff --git a/packages/python/test/sourcefiles.test.tsx b/packages/python/test/sourcefiles.test.tsx index a7233687e..e308d62ff 100644 --- a/packages/python/test/sourcefiles.test.tsx +++ b/packages/python/test/sourcefiles.test.tsx @@ -1,5 +1,6 @@ import { Prose } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as py from "../src/index.js"; import { dataclassesModule } from "../src/index.js"; import { TestOutput, TestOutputDirectory } from "./utils.jsx"; diff --git a/packages/python/test/staticmethoddeclaration.test.tsx b/packages/python/test/staticmethoddeclaration.test.tsx index 2f7b932db..9b10df621 100644 --- a/packages/python/test/staticmethoddeclaration.test.tsx +++ b/packages/python/test/staticmethoddeclaration.test.tsx @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/type-checking-imports.test.tsx b/packages/python/test/type-checking-imports.test.tsx index 0b6dbae53..8cdccc148 100644 --- a/packages/python/test/type-checking-imports.test.tsx +++ b/packages/python/test/type-checking-imports.test.tsx @@ -1,5 +1,6 @@ import { refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { createModule } from "../src/create-module.js"; import * as py from "../src/index.js"; import { TestOutputDirectory } from "./utils.js"; diff --git a/packages/python/test/typereference.test.tsx b/packages/python/test/typereference.test.tsx index 93248479f..90f2396d8 100644 --- a/packages/python/test/typereference.test.tsx +++ b/packages/python/test/typereference.test.tsx @@ -1,5 +1,6 @@ import { code, refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/uniontypeexpression.test.tsx b/packages/python/test/uniontypeexpression.test.tsx index a55c87b80..4caa2d475 100644 --- a/packages/python/test/uniontypeexpression.test.tsx +++ b/packages/python/test/uniontypeexpression.test.tsx @@ -1,5 +1,6 @@ import { refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { TestOutput, TestOutputDirectory } from "./utils.js"; diff --git a/packages/python/test/utils.tsx b/packages/python/test/utils.tsx index 65aa1e9ea..15dd4e5a2 100644 --- a/packages/python/test/utils.tsx +++ b/packages/python/test/utils.tsx @@ -6,6 +6,7 @@ import { OutputScope, SymbolCreator, } from "@alloy-js/core"; + import * as py from "../src/components/index.js"; import { pythonNameConflictResolver } from "../src/name-conflict-resolver.js"; import { createPythonNamePolicy } from "../src/name-policy.js"; diff --git a/packages/python/test/values.test.tsx b/packages/python/test/values.test.tsx index a75759a33..9345151f2 100644 --- a/packages/python/test/values.test.tsx +++ b/packages/python/test/values.test.tsx @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { TestOutput } from "./utils.js"; diff --git a/packages/python/test/variables.test.tsx b/packages/python/test/variables.test.tsx index b194065e2..86a8b1ccf 100644 --- a/packages/python/test/variables.test.tsx +++ b/packages/python/test/variables.test.tsx @@ -1,5 +1,6 @@ import { namekey, refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import * as py from "../src/index.js"; import { TestOutput, TestOutputDirectory } from "./utils.js"; diff --git a/packages/trace-cli/src/cli.ts b/packages/trace-cli/src/cli.ts index 19d9999ff..af0278fe0 100644 --- a/packages/trace-cli/src/cli.ts +++ b/packages/trace-cli/src/cli.ts @@ -1,5 +1,6 @@ #!/usr/bin/env -S node --experimental-sqlite --no-warnings=ExperimentalWarning import { parseArgs } from "node:util"; + import { componentCommand } from "./commands/component.js"; import { effectCommand } from "./commands/effect.js"; import { runErrors } from "./commands/errors.js"; @@ -48,9 +49,8 @@ const opts = { outputFile: values["output-file"] as string | undefined, name: values.name as string | undefined, type: values.type as string | undefined, - minTrackers: - values["min-trackers"] ? - parseInt(values["min-trackers"] as string, 10) + minTrackers: values["min-trackers"] + ? parseInt(values["min-trackers"] as string, 10) : undefined, unused: values.unused as boolean, framework: values.framework as boolean, diff --git a/packages/trace-cli/src/commands/component.ts b/packages/trace-cli/src/commands/component.ts index 428b6dc5d..36fcf484f 100644 --- a/packages/trace-cli/src/commands/component.ts +++ b/packages/trace-cli/src/commands/component.ts @@ -105,8 +105,9 @@ function componentList(db: Db, opts: Opts) { } for (const r of rows) { - const src = - r.source_file ? shortPath(r.source_file) + ":" + r.source_line : ""; + const src = r.source_file + ? shortPath(r.source_file) + ":" + r.source_line + : ""; console.log( ` ${String(r.id).padStart(4)} ${(r.name || "(unnamed)").padEnd(30)} ${r.roots} roots ${src}`, ); @@ -185,12 +186,11 @@ function componentForNode(db: Db, renderNodeId: number, opts: Opts) { console.log(`Components for render node ${renderNodeId}:`); for (const row of rows) { const distance = - row.distance === 0 ? - "direct" - : `ancestor root #${row.root_render_node_id}`; - const src = - row.source_file ? - ` ${shortPath(row.source_file)}:${row.source_line}` + row.distance === 0 + ? "direct" + : `ancestor root #${row.root_render_node_id}`; + const src = row.source_file + ? ` ${shortPath(row.source_file)}:${row.source_line}` : ""; console.log( ` ${String(row.id).padStart(4)} ${row.name.padEnd(30)} ${distance}${src}`, diff --git a/packages/trace-cli/src/commands/effect.ts b/packages/trace-cli/src/commands/effect.ts index 7637aeb93..3d8e13d58 100644 --- a/packages/trace-cli/src/commands/effect.ts +++ b/packages/trace-cli/src/commands/effect.ts @@ -102,8 +102,9 @@ function effectList(db: Db, opts: Opts) { } for (const r of rows) { - const src = - r.source_file ? shortPath(r.source_file) + ":" + r.source_line : ""; + const src = r.source_file + ? shortPath(r.source_file) + ":" + r.source_line + : ""; const comp = r.component ? ` [${r.component}]` : ""; const stats = `tracks ${r.tracks} refs, triggers ${r.triggers}`; console.log( @@ -220,9 +221,9 @@ function effectShow(db: Db, id: number, opts: Opts) { ); for (const e of ranEvents) { const triggerInfo = - e.trigger_ref_id != null ? - ` (triggered by ref ${e.trigger_ref_id})` - : ""; + e.trigger_ref_id != null + ? ` (triggered by ref ${e.trigger_ref_id})` + : ""; console.log(` ran at seq ${e.seq}${triggerInfo}`); } } @@ -305,8 +306,9 @@ function effectHotspots(db: Db, opts: Opts) { console.log("Effects with highest reactive activity:\n"); for (const r of rows) { - const src = - r.source_file ? shortPath(r.source_file) + ":" + r.source_line : ""; + const src = r.source_file + ? shortPath(r.source_file) + ":" + r.source_line + : ""; const comp = r.component ? ` [${r.component}]` : ""; console.log( ` ${String(r.id).padStart(5)} ${(r.name || "(anonymous)").padEnd(35)} tracks ${r.tracks}, triggers ${r.triggers}, creates ${r.refs_created} refs${comp}`, diff --git a/packages/trace-cli/src/commands/file.ts b/packages/trace-cli/src/commands/file.ts index 6b80886c4..e39c17097 100644 --- a/packages/trace-cli/src/commands/file.ts +++ b/packages/trace-cli/src/commands/file.ts @@ -1,4 +1,5 @@ import { DIFF_EQUAL, diff_match_patch } from "diff-match-patch"; + import { type Db, type Opts, formatComponentStack } from "../types.js"; export function fileCommand( @@ -325,9 +326,8 @@ function fileSearch( stack.map((c: any) => ({ name: c.name ?? "(unnamed)", renderNodeId: c.id, - source: - c.source_file ? - { + source: c.source_file + ? { fileName: c.source_file, lineNumber: c.source_line, columnNumber: c.source_col, diff --git a/packages/trace-cli/src/commands/ref.ts b/packages/trace-cli/src/commands/ref.ts index 4cda1572c..7d390a6d2 100644 --- a/packages/trace-cli/src/commands/ref.ts +++ b/packages/trace-cli/src/commands/ref.ts @@ -82,9 +82,9 @@ function refList(db: Db, opts: Opts) { conditions.length > 0 ? "WHERE " + conditions.join(" AND ") : ""; const limit = opts.limit ?? 50; const orderBy = - opts.minTrackers != null ? - "ORDER BY (SELECT COUNT(*) FROM edges WHERE ref_id = r.id AND type = 'track') DESC" - : "ORDER BY r.id"; + opts.minTrackers != null + ? "ORDER BY (SELECT COUNT(*) FROM edges WHERE ref_id = r.id AND type = 'track') DESC" + : "ORDER BY r.id"; const sql = ` SELECT r.id, r.kind, r.source_file, r.source_line, r.created_by_effect_id, (SELECT COUNT(*) FROM edges WHERE ref_id = r.id AND type = 'track') as tracked_by, @@ -106,8 +106,9 @@ function refList(db: Db, opts: Opts) { } for (const r of rows) { - const src = - r.source_file ? shortPath(r.source_file) + ":" + r.source_line : ""; + const src = r.source_file + ? shortPath(r.source_file) + ":" + r.source_line + : ""; console.log( ` ${String(r.id).padStart(4)} ${r.kind.padEnd(12)} creator: effect ${r.created_by_effect_id ?? "?"} tracked_by: ${r.tracked_by} triggered: ${r.triggered}`, ); @@ -260,12 +261,12 @@ function refHotspots(db: Db, opts: Opts) { console.log("Refs with most trackers:\n"); for (const r of rows) { - const creator = - r.creator_name ? - `${r.creator_name}${r.creator_component ? ` [${r.creator_component}]` : ""}` + const creator = r.creator_name + ? `${r.creator_name}${r.creator_component ? ` [${r.creator_component}]` : ""}` : "?"; - const src = - r.source_file ? ` ${shortPath(r.source_file)}:${r.source_line}` : ""; + const src = r.source_file + ? ` ${shortPath(r.source_file)}:${r.source_line}` + : ""; console.log( ` ${String(r.id).padStart(5)} ${r.kind.padEnd(12)} ${String(r.tracked_by).padStart(4)} trackers, ${String(r.triggered).padStart(3)} writes creator: ${creator}${src}`, ); diff --git a/packages/trace-cli/src/commands/symbol.ts b/packages/trace-cli/src/commands/symbol.ts index 834c75ae6..fa080cf46 100644 --- a/packages/trace-cli/src/commands/symbol.ts +++ b/packages/trace-cli/src/commands/symbol.ts @@ -78,9 +78,9 @@ function symbolList(db: Db, opts: Opts) { for (const r of rows) { const orig = - r.original_name && r.original_name !== r.name ? - ` (original: ${r.original_name})` - : ""; + r.original_name && r.original_name !== r.name + ? ` (original: ${r.original_name})` + : ""; const scope = r.scope_name ? ` in scope "${r.scope_name}"` : ""; const owner = r.owner_name ? ` member of "${r.owner_name}"` : ""; const flags = [ diff --git a/packages/trace-cli/src/test/component.test.ts b/packages/trace-cli/src/test/component.test.ts index 3cf1a18ea..fc4153515 100644 --- a/packages/trace-cli/src/test/component.test.ts +++ b/packages/trace-cli/src/test/component.test.ts @@ -1,5 +1,7 @@ import { DatabaseSync } from "node:sqlite"; + import { afterEach, beforeEach, describe, expect, it } from "vitest"; + import { componentCommand } from "../commands/component.js"; import { captureOutput } from "./capture.js"; import { createTestDb } from "./test-db.js"; diff --git a/packages/trace-cli/src/test/effect.test.ts b/packages/trace-cli/src/test/effect.test.ts index 1f5696b07..bb9fd6fcc 100644 --- a/packages/trace-cli/src/test/effect.test.ts +++ b/packages/trace-cli/src/test/effect.test.ts @@ -1,5 +1,7 @@ import { DatabaseSync } from "node:sqlite"; + import { afterEach, beforeEach, describe, expect, it } from "vitest"; + import { effectCommand } from "../commands/effect.js"; import { captureOutput } from "./capture.js"; import { createTestDb } from "./test-db.js"; diff --git a/packages/trace-cli/src/test/misc-commands.test.ts b/packages/trace-cli/src/test/misc-commands.test.ts index ac822ce5d..66c72081a 100644 --- a/packages/trace-cli/src/test/misc-commands.test.ts +++ b/packages/trace-cli/src/test/misc-commands.test.ts @@ -1,5 +1,7 @@ import { DatabaseSync } from "node:sqlite"; + import { afterEach, beforeEach, describe, expect, it } from "vitest"; + import { runErrors } from "../commands/errors.js"; import { fileCommand } from "../commands/file.js"; import { runQuery } from "../commands/query.js"; diff --git a/packages/trace-cli/src/test/ref.test.ts b/packages/trace-cli/src/test/ref.test.ts index aac08db20..eabe30a84 100644 --- a/packages/trace-cli/src/test/ref.test.ts +++ b/packages/trace-cli/src/test/ref.test.ts @@ -1,5 +1,7 @@ import { DatabaseSync } from "node:sqlite"; + import { afterEach, beforeEach, describe, expect, it } from "vitest"; + import { refCommand } from "../commands/ref.js"; import { captureOutput } from "./capture.js"; import { createTestDb } from "./test-db.js"; diff --git a/packages/trace-cli/src/test/types.test.ts b/packages/trace-cli/src/test/types.test.ts index 7008e444d..aa5a7bb2e 100644 --- a/packages/trace-cli/src/test/types.test.ts +++ b/packages/trace-cli/src/test/types.test.ts @@ -1,5 +1,7 @@ import { DatabaseSync } from "node:sqlite"; + import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; + import { formatComponentStack, outputFileContextsCte, diff --git a/packages/typescript/src/builtins/node.ts b/packages/typescript/src/builtins/node.ts index 44c2cec80..065fc03d0 100644 --- a/packages/typescript/src/builtins/node.ts +++ b/packages/typescript/src/builtins/node.ts @@ -1,4 +1,5 @@ import { SymbolCreator } from "@alloy-js/core"; + import { createPackage } from "../create-package.js"; // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/packages/typescript/src/components/ArrayExpression.tsx b/packages/typescript/src/components/ArrayExpression.tsx index 0bc428c70..894dc582a 100644 --- a/packages/typescript/src/components/ArrayExpression.tsx +++ b/packages/typescript/src/components/ArrayExpression.tsx @@ -1,4 +1,5 @@ import { Children, childrenArray, For, Indent, Show } from "@alloy-js/core"; + import { ValueExpression } from "./ValueExpression.js"; export interface ArrayExpressionProps { diff --git a/packages/typescript/src/components/ArrowFunction.tsx b/packages/typescript/src/components/ArrowFunction.tsx index b45da1de8..6e22a9ffb 100644 --- a/packages/typescript/src/components/ArrowFunction.tsx +++ b/packages/typescript/src/components/ArrowFunction.tsx @@ -4,6 +4,7 @@ import { findUnkeyedChildren, type Children, } from "@alloy-js/core"; + import { getCallSignatureProps } from "../utils.js"; import { CallSignature, CallSignatureProps } from "./CallSignature.jsx"; import { diff --git a/packages/typescript/src/components/BarrelFile.tsx b/packages/typescript/src/components/BarrelFile.tsx index e978535ea..942495239 100644 --- a/packages/typescript/src/components/BarrelFile.tsx +++ b/packages/typescript/src/components/BarrelFile.tsx @@ -1,5 +1,6 @@ import { For, memo, SourceDirectoryContext, useContext } from "@alloy-js/core"; import { basename } from "pathe"; + import { getSourceDirectoryData } from "../source-directory-data.js"; import { TSModuleScope } from "../symbols/index.js"; import { ExportStatement } from "./ExportStatement.js"; diff --git a/packages/typescript/src/components/BlockScope.tsx b/packages/typescript/src/components/BlockScope.tsx index fb88f0f4b..c768187ef 100644 --- a/packages/typescript/src/components/BlockScope.tsx +++ b/packages/typescript/src/components/BlockScope.tsx @@ -4,6 +4,7 @@ import { ScopePropsWithInfo, ScopePropsWithValue, } from "@alloy-js/core"; + import { LexicalScope } from "./LexicalScope.jsx"; export interface BlockScopePropsWithScopeValue diff --git a/packages/typescript/src/components/CallSignature.tsx b/packages/typescript/src/components/CallSignature.tsx index 089254ea6..7d83f191c 100644 --- a/packages/typescript/src/components/CallSignature.tsx +++ b/packages/typescript/src/components/CallSignature.tsx @@ -1,4 +1,5 @@ import { type Children } from "@alloy-js/core"; + import { ParameterDescriptor, TypeParameterDescriptor, @@ -45,23 +46,23 @@ export interface CallSignatureProps { * parameters. */ export function CallSignature(props: CallSignatureProps) { - const sTypeParameters = - props.typeParametersChildren ? - <> - {"<"} - {props.typeParametersChildren} - {">"} - - : ; + const sTypeParameters = props.typeParametersChildren ? ( + <> + {"<"} + {props.typeParametersChildren} + {">"} + + ) : ( + + ); const sParams = props.parametersChildren ?? ( ); - const sReturnType = - props.returnType ? - : {props.returnType} - : undefined; + const sReturnType = props.returnType ? ( + : {props.returnType} + ) : undefined; return ( <> diff --git a/packages/typescript/src/components/Declaration.tsx b/packages/typescript/src/components/Declaration.tsx index b11056d71..c712307c4 100644 --- a/packages/typescript/src/components/Declaration.tsx +++ b/packages/typescript/src/components/Declaration.tsx @@ -4,20 +4,19 @@ import { Namekey, Refkey, } from "@alloy-js/core"; + import { TypeScriptElements, useTSNamePolicy } from "../name-policy.js"; import { createTypeSymbol, createValueSymbol, TSOutputSymbol, } from "../symbols/index.js"; - +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import { EnumDeclaration } from "./EnumDeclaration.jsx"; // imports for documentation // eslint-disable-next-line @typescript-eslint/no-unused-vars import { TypeDeclaration } from "./TypeDeclaration.jsx"; -// eslint-disable-next-line @typescript-eslint/no-unused-vars -import { EnumDeclaration } from "./EnumDeclaration.jsx"; - export interface DeclarationPropsBase { children?: Children; diff --git a/packages/typescript/src/components/EnumDeclaration.tsx b/packages/typescript/src/components/EnumDeclaration.tsx index 89d77a04e..533f69755 100644 --- a/packages/typescript/src/components/EnumDeclaration.tsx +++ b/packages/typescript/src/components/EnumDeclaration.tsx @@ -6,6 +6,7 @@ import { Name, Show, } from "@alloy-js/core"; + import { useTSNamePolicy } from "../name-policy.js"; import { createTypeAndValueSymbol } from "../symbols/index.js"; import { CommonDeclarationProps } from "./Declaration.js"; diff --git a/packages/typescript/src/components/EnumMember.tsx b/packages/typescript/src/components/EnumMember.tsx index 458aab1ec..7f22e1b1a 100644 --- a/packages/typescript/src/components/EnumMember.tsx +++ b/packages/typescript/src/components/EnumMember.tsx @@ -1,4 +1,5 @@ import { Children, Namekey, Refkey, Show } from "@alloy-js/core"; + import { useTSNamePolicy } from "../name-policy.js"; import { createStaticMemberSymbol } from "../symbols/index.js"; import { JSDoc } from "./JSDoc.jsx"; @@ -52,9 +53,11 @@ export function EnumMember(props: EnumMemberProps) { namePolicy: namer.for("enum-member"), }); const valueCode = - props.jsValue !== undefined ? + props.jsValue !== undefined ? ( - : props.value; + ) : ( + props.value + ); return ( <> diff --git a/packages/typescript/src/components/ExportStatement.tsx b/packages/typescript/src/components/ExportStatement.tsx index b9a73c617..0d0424615 100644 --- a/packages/typescript/src/components/ExportStatement.tsx +++ b/packages/typescript/src/components/ExportStatement.tsx @@ -1,4 +1,5 @@ import { dirname, relative } from "pathe"; + import { TSModuleScope, TSOutputSymbol } from "../symbols/index.js"; import { modulePath } from "../utils.js"; import { useSourceFile } from "./SourceFile.js"; diff --git a/packages/typescript/src/components/FunctionBase.tsx b/packages/typescript/src/components/FunctionBase.tsx index c3eb95e30..5be0a7566 100644 --- a/packages/typescript/src/components/FunctionBase.tsx +++ b/packages/typescript/src/components/FunctionBase.tsx @@ -10,6 +10,7 @@ import { taggedComponent, type Children, } from "@alloy-js/core"; + import { useTSNamePolicy } from "../name-policy.js"; import type { FunctionTypeParameterDescriptor, @@ -218,9 +219,9 @@ function normalizeAndDeclareParameters( } else { return (parameters as ParameterDescriptor[]).map((param) => { const nullishFlag = - (param.nullish ?? param.optional) ? - TSSymbolFlags.Nullish - : TSSymbolFlags.None; + (param.nullish ?? param.optional) + ? TSSymbolFlags.Nullish + : TSSymbolFlags.None; const TypeSlot = createSymbolSlot(); const symbol = createValueSymbol(param.name, { refkeys: param.refkey, diff --git a/packages/typescript/src/components/FunctionDeclaration.tsx b/packages/typescript/src/components/FunctionDeclaration.tsx index da5ee4366..23eeea20a 100644 --- a/packages/typescript/src/components/FunctionDeclaration.tsx +++ b/packages/typescript/src/components/FunctionDeclaration.tsx @@ -7,6 +7,7 @@ import { Show, type Children, } from "@alloy-js/core"; + import { getCallSignatureProps } from "../utils.js"; import { CallSignature, CallSignatureProps } from "./CallSignature.jsx"; import { CommonDeclarationProps, Declaration } from "./Declaration.js"; diff --git a/packages/typescript/src/components/FunctionExpression.tsx b/packages/typescript/src/components/FunctionExpression.tsx index 21e10ebcc..876c56282 100644 --- a/packages/typescript/src/components/FunctionExpression.tsx +++ b/packages/typescript/src/components/FunctionExpression.tsx @@ -4,6 +4,7 @@ import { findUnkeyedChildren, type Children, } from "@alloy-js/core"; + import { getCallSignatureProps } from "../utils.js"; import { CallSignature, CallSignatureProps } from "./CallSignature.jsx"; import { diff --git a/packages/typescript/src/components/FunctionType.tsx b/packages/typescript/src/components/FunctionType.tsx index 7b3f9f064..3dd17893a 100644 --- a/packages/typescript/src/components/FunctionType.tsx +++ b/packages/typescript/src/components/FunctionType.tsx @@ -5,6 +5,7 @@ import { Show, type Children, } from "@alloy-js/core"; + import { getCallSignatureProps } from "../utils.js"; import { CallSignature, CallSignatureProps } from "./CallSignature.jsx"; import { diff --git a/packages/typescript/src/components/IfStatement.tsx b/packages/typescript/src/components/IfStatement.tsx index d1fda2423..aff615707 100644 --- a/packages/typescript/src/components/IfStatement.tsx +++ b/packages/typescript/src/components/IfStatement.tsx @@ -1,4 +1,5 @@ import { type Children } from "@alloy-js/core"; + import { BlockScope } from "./BlockScope.jsx"; export interface IfStatementProps { diff --git a/packages/typescript/src/components/ImportStatement.tsx b/packages/typescript/src/components/ImportStatement.tsx index 723d5a3c5..20c28623e 100644 --- a/packages/typescript/src/components/ImportStatement.tsx +++ b/packages/typescript/src/components/ImportStatement.tsx @@ -6,6 +6,7 @@ import { useContext, } from "@alloy-js/core"; import { relative } from "pathe"; + import { ImportedSymbol, ImportRecords, @@ -157,13 +158,11 @@ function ImportBinding(props: Readonly) { }); const prefix = memo(() => - ( - !props.inTypeImport && - props.importedSymbol.local.isTypeSymbol && - !props.importedSymbol.local.isValueSymbol - ) ? - "type " - : "", + !props.inTypeImport && + props.importedSymbol.local.isTypeSymbol && + !props.importedSymbol.local.isValueSymbol + ? "type " + : "", ); return ( <> diff --git a/packages/typescript/src/components/Interface.tsx b/packages/typescript/src/components/Interface.tsx index 206598d42..321a310dd 100644 --- a/packages/typescript/src/components/Interface.tsx +++ b/packages/typescript/src/components/Interface.tsx @@ -14,6 +14,7 @@ import { Show, takeSymbols, } from "@alloy-js/core"; + import { useTSNamePolicy } from "../name-policy.js"; import { TypeParameterDescriptor } from "../parameter-descriptor.js"; import { useTSLexicalScope, useTSMemberScope } from "../symbols/scopes.js"; @@ -65,14 +66,15 @@ const _InterfaceDeclaration = ensureTypeRefContext( const typeParametersChildren = findKeyedChild(children, TypeParameters.tag) ?? undefined; - const sTypeParameters = - typeParametersChildren ? - <> - {"<"} - {typeParametersChildren} - {">"} - - : ; + const sTypeParameters = typeParametersChildren ? ( + <> + {"<"} + {typeParametersChildren} + {">"} + + ) : ( + + ); const extendsPart = props.extends ? <> extends {props.extends} : ""; const filteredChildren = findUnkeyedChildren(children); @@ -202,9 +204,9 @@ export function InterfaceMember(props: InterfaceMemberProps) { refkeys: props.refkey, tsFlags: TSSymbolFlags.TypeSymbol | - ((props.nullish ?? props.optional) ? - TSSymbolFlags.Nullish - : TSSymbolFlags.None), + ((props.nullish ?? props.optional) + ? TSSymbolFlags.Nullish + : TSSymbolFlags.None), namePolicy: useTSNamePolicy().for("interface-member"), binder: scope.binder, }, diff --git a/packages/typescript/src/components/InterfaceMethod.tsx b/packages/typescript/src/components/InterfaceMethod.tsx index 65d31a07d..dd0eed1e9 100644 --- a/packages/typescript/src/components/InterfaceMethod.tsx +++ b/packages/typescript/src/components/InterfaceMethod.tsx @@ -8,6 +8,7 @@ import { Show, type Children, } from "@alloy-js/core"; + import { getCallSignatureProps } from "../utils.js"; import { CallSignature, CallSignatureProps } from "./CallSignature.jsx"; import { diff --git a/packages/typescript/src/components/JSDoc.tsx b/packages/typescript/src/components/JSDoc.tsx index 1a41b9096..682219bab 100644 --- a/packages/typescript/src/components/JSDoc.tsx +++ b/packages/typescript/src/components/JSDoc.tsx @@ -1,4 +1,5 @@ import { List, childrenArray, type Children } from "@alloy-js/core"; + import { JSDocComment } from "./JSDocComment.jsx"; export interface JSDocProps { diff --git a/packages/typescript/src/components/JSDocParam.tsx b/packages/typescript/src/components/JSDocParam.tsx index df2f409ba..4b04c8c08 100644 --- a/packages/typescript/src/components/JSDocParam.tsx +++ b/packages/typescript/src/components/JSDocParam.tsx @@ -1,4 +1,5 @@ import { For, Prose, Show, type Children } from "@alloy-js/core"; + import { ParameterDescriptor } from "../parameter-descriptor.js"; export interface JSDocParamsProps { diff --git a/packages/typescript/src/components/LexicalScope.tsx b/packages/typescript/src/components/LexicalScope.tsx index 1cccbe284..c089b3e9e 100644 --- a/packages/typescript/src/components/LexicalScope.tsx +++ b/packages/typescript/src/components/LexicalScope.tsx @@ -1,4 +1,5 @@ import { Scope, ScopePropsWithInfo, ScopePropsWithValue } from "@alloy-js/core"; + import { createLexicalScope, TSLexicalScope } from "../symbols/index.js"; export interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {} diff --git a/packages/typescript/src/components/MemberDeclaration.tsx b/packages/typescript/src/components/MemberDeclaration.tsx index f2b998bdf..8884468ec 100644 --- a/packages/typescript/src/components/MemberDeclaration.tsx +++ b/packages/typescript/src/components/MemberDeclaration.tsx @@ -3,6 +3,7 @@ import { MemberDeclarationPropsWithInfo as CoreMemberDeclarationPropsWithInfo, MemberDeclarationPropsWithSymbol as CoreMemberDeclarationPropsWithSymbol, } from "@alloy-js/core"; + import { TypeScriptElements, useTSNamePolicy } from "../name-policy.js"; import { createStaticMemberSymbol, @@ -38,8 +39,9 @@ export function MemberDeclaration(props: Readonly) { if ("symbol" in props) { sym = props.symbol; } else { - const tsFlags: TSSymbolFlags = - props.nullish ? TSSymbolFlags.Nullish : TSSymbolFlags.None; + const tsFlags: TSSymbolFlags = props.nullish + ? TSSymbolFlags.Nullish + : TSSymbolFlags.None; sym = createStaticMemberSymbol(props.name!, { refkeys: props.refkey, diff --git a/packages/typescript/src/components/MemberExpression.tsx b/packages/typescript/src/components/MemberExpression.tsx index 6ade01da9..e2e675d85 100644 --- a/packages/typescript/src/components/MemberExpression.tsx +++ b/packages/typescript/src/components/MemberExpression.tsx @@ -65,9 +65,8 @@ const { Expression, Part, registerOuterComponent } = createAccessExpression< } else if (first && partProps.refkey) { id = partProps.refkey; } else if (partProps.id !== undefined) { - id = - isNumericIdentifier(partProps.id) ? - partProps.id + id = isNumericIdentifier(partProps.id) + ? partProps.id : escapeId(partProps.id); } else if (partProps.index !== undefined) { id = partProps.index; @@ -80,20 +79,19 @@ const { Expression, Part, registerOuterComponent } = createAccessExpression< let accessStyle: "dot" | "bracket"; if (partProps.children !== undefined) { accessStyle = - typeof partProps.children === "string" ? - partProps.quoteId ? - "bracket" - : accessStyleForMemberName(partProps.children) - : "bracket"; + typeof partProps.children === "string" + ? partProps.quoteId + ? "bracket" + : accessStyleForMemberName(partProps.children) + : "bracket"; } else if (partProps.args) { accessStyle = "dot"; } else if (partProps.quoteId) { accessStyle = "bracket"; } else if (partProps.id !== undefined) { - accessStyle = - isNumericIdentifier(partProps.id) ? "bracket" : ( - accessStyleForMemberName(partProps.id) - ); + accessStyle = isNumericIdentifier(partProps.id) + ? "bracket" + : accessStyleForMemberName(partProps.id); } else if (partProps.index !== undefined) { accessStyle = "bracket"; } else if (sym) { @@ -105,17 +103,20 @@ const { Expression, Part, registerOuterComponent } = createAccessExpression< return { id, accessStyle, - quoteId: - partProps.quoteId ? partProps.quoteId - : partProps.id !== undefined ? - isNumericIdentifier(partProps.id) ? false - : !isValidJSIdentifier(partProps.id) - : sym ? !isValidJSIdentifier(sym.name) - : false, - nullish: - partProps.nullish ? partProps.nullish - : sym ? isNullish(sym) - : false, + quoteId: partProps.quoteId + ? partProps.quoteId + : partProps.id !== undefined + ? isNumericIdentifier(partProps.id) + ? false + : !isValidJSIdentifier(partProps.id) + : sym + ? !isValidJSIdentifier(sym.name) + : false, + nullish: partProps.nullish + ? partProps.nullish + : sym + ? isNullish(sym) + : false, args: partProps.args === true ? [] : partProps.args, jsPrivate: !!sym && (sym as TSOutputSymbol).isPrivateMemberSymbol, type: !!sym && (sym as TSOutputSymbol).isTypeSymbol, @@ -293,11 +294,11 @@ function formatDotAccess(prevPart: PartDescriptor, part: PartDescriptor) { {prevPart.nullish ? "?." : "."} - {isIdPartDescriptor(part) ? - part.jsPrivate ? - `#${part.id}` - : part.id - : part.index} + {isIdPartDescriptor(part) + ? part.jsPrivate + ? `#${part.id}` + : part.id + : part.index} ); diff --git a/packages/typescript/src/components/MemberScope.tsx b/packages/typescript/src/components/MemberScope.tsx index ebd268a33..5305c2fe4 100644 --- a/packages/typescript/src/components/MemberScope.tsx +++ b/packages/typescript/src/components/MemberScope.tsx @@ -3,6 +3,7 @@ import { MemberScope as CoreMemberScope, createScope, } from "@alloy-js/core"; + import { useTSLexicalScopeIfPresent } from "../symbols/scopes.js"; import { TSMemberScope } from "../symbols/ts-member-scope.js"; import { TSOutputSymbol } from "../symbols/ts-output-symbol.js"; diff --git a/packages/typescript/src/components/NewExpression.tsx b/packages/typescript/src/components/NewExpression.tsx index 38f08390f..96f7333d4 100644 --- a/packages/typescript/src/components/NewExpression.tsx +++ b/packages/typescript/src/components/NewExpression.tsx @@ -2,6 +2,7 @@ import { emitSymbol, instantiateTakenMembersTo as instantiateTakenSymbolsTo, } from "@alloy-js/core"; + import { createValueSymbol } from "../symbols/index.js"; import { FunctionCallExpression, diff --git a/packages/typescript/src/components/ObjectExpression.tsx b/packages/typescript/src/components/ObjectExpression.tsx index 9789fc3f4..c3ac1f9bb 100644 --- a/packages/typescript/src/components/ObjectExpression.tsx +++ b/packages/typescript/src/components/ObjectExpression.tsx @@ -12,6 +12,7 @@ import { Switch, takeSymbols, } from "@alloy-js/core"; + import { useTSNamePolicy } from "../name-policy.js"; import { createStaticMemberSymbol, diff --git a/packages/typescript/src/components/PackageDirectory.tsx b/packages/typescript/src/components/PackageDirectory.tsx index d30708cd7..7eb21c385 100644 --- a/packages/typescript/src/components/PackageDirectory.tsx +++ b/packages/typescript/src/components/PackageDirectory.tsx @@ -13,6 +13,7 @@ import { Wrap, } from "@alloy-js/core"; import { join } from "pathe"; + import { PackageMetadataContext } from "../context/package-metadata.js"; import { ExternalPackage, getPackageScope } from "../create-package.js"; import { TSPackageScope } from "../symbols/index.js"; diff --git a/packages/typescript/src/components/PackageJson.tsx b/packages/typescript/src/components/PackageJson.tsx index 63aedf70f..b22b6a3b9 100644 --- a/packages/typescript/src/components/PackageJson.tsx +++ b/packages/typescript/src/components/PackageJson.tsx @@ -1,4 +1,5 @@ import { memo, SourceFile, useContext } from "@alloy-js/core"; + import { PackageMetadataContext } from "../context/package-metadata.js"; import { modulePath } from "../utils.js"; import { usePackage } from "./PackageDirectory.js"; @@ -133,9 +134,9 @@ export function PackageJsonFile(props: PackageJsonFileProps) { } pkgJson.exports = - exportsEntries.length === 0 ? - undefined - : Object.fromEntries(exportsEntries); + exportsEntries.length === 0 + ? undefined + : Object.fromEntries(exportsEntries); } return JSON.stringify(pkgJson, null, 2); diff --git a/packages/typescript/src/components/PropertyName.tsx b/packages/typescript/src/components/PropertyName.tsx index 469792877..9c72d7575 100644 --- a/packages/typescript/src/components/PropertyName.tsx +++ b/packages/typescript/src/components/PropertyName.tsx @@ -1,4 +1,5 @@ import { MemberDeclarationContext, memo, useContext } from "@alloy-js/core"; + import { TSOutputSymbol } from "../symbols/ts-output-symbol.js"; import { isValidJSIdentifier } from "../utils.js"; diff --git a/packages/typescript/src/components/Reference.tsx b/packages/typescript/src/components/Reference.tsx index 4bcb64292..85c2625c5 100644 --- a/packages/typescript/src/components/Reference.tsx +++ b/packages/typescript/src/components/Reference.tsx @@ -1,4 +1,5 @@ import { computed, emitSymbol, Refkey } from "@alloy-js/core"; + import { isTypeRefContext } from "../context/type-ref-context.js"; import { ref } from "../symbols/index.js"; diff --git a/packages/typescript/src/components/SourceFile.tsx b/packages/typescript/src/components/SourceFile.tsx index 0250343a1..414d2455d 100644 --- a/packages/typescript/src/components/SourceFile.tsx +++ b/packages/typescript/src/components/SourceFile.tsx @@ -10,8 +10,8 @@ import { useScope, type Children, } from "@alloy-js/core"; - import { join } from "pathe"; + import { getSourceDirectoryData } from "../source-directory-data.js"; import { TSModuleScope } from "../symbols/index.js"; import { ImportStatements } from "./ImportStatement.js"; @@ -65,12 +65,12 @@ export function SourceFile(props: SourceFileProps) { } const header = - props.header || props.headerComment ? + props.header || props.headerComment ? ( - : undefined; + ) : undefined; return ( default case{" "} - {"expression" in props ? + {"expression" in props ? ( props.expression - : - } + )} {": "} diff --git a/packages/typescript/src/components/TryStatement.test.tsx b/packages/typescript/src/components/TryStatement.test.tsx index 2608fd075..6e294bfc5 100644 --- a/packages/typescript/src/components/TryStatement.test.tsx +++ b/packages/typescript/src/components/TryStatement.test.tsx @@ -1,5 +1,6 @@ import { refkey, StatementList } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { TestFile } from "../../test/utils.js"; import { CatchClause, FinallyClause, TryStatement } from "./TryStatement.jsx"; import { VarDeclaration } from "./VarDeclaration.jsx"; diff --git a/packages/typescript/src/components/TryStatement.tsx b/packages/typescript/src/components/TryStatement.tsx index 3ff06cfeb..1827e3492 100644 --- a/packages/typescript/src/components/TryStatement.tsx +++ b/packages/typescript/src/components/TryStatement.tsx @@ -1,4 +1,5 @@ import { onCleanup, type Children } from "@alloy-js/core"; + import { useTSNamePolicy } from "../name-policy.js"; import type { ParameterDescriptor } from "../parameter-descriptor.js"; import { createValueSymbol, TSSymbolFlags } from "../symbols/index.js"; @@ -76,9 +77,9 @@ export function CatchClause(props: CatchClauseProps) { const namePolicy = useTSNamePolicy(); const paramDesc = - typeof props.parameter === "string" ? - { name: props.parameter } - : props.parameter; + typeof props.parameter === "string" + ? { name: props.parameter } + : props.parameter; const symbol = createValueSymbol(paramDesc.name, { refkeys: paramDesc.refkey, diff --git a/packages/typescript/src/components/TsConfigJson.tsx b/packages/typescript/src/components/TsConfigJson.tsx index 89caf0e84..c981d8d7c 100644 --- a/packages/typescript/src/components/TsConfigJson.tsx +++ b/packages/typescript/src/components/TsConfigJson.tsx @@ -1,5 +1,6 @@ import { effect, memo, SourceFile } from "@alloy-js/core"; import { dirname, join, relative, sep } from "pathe"; + import { usePackage } from "./PackageDirectory.js"; export interface TSConfigJsonProps { diff --git a/packages/typescript/src/components/TypeDeclaration.tsx b/packages/typescript/src/components/TypeDeclaration.tsx index 63377f9aa..152de18d9 100644 --- a/packages/typescript/src/components/TypeDeclaration.tsx +++ b/packages/typescript/src/components/TypeDeclaration.tsx @@ -1,4 +1,5 @@ import { Name, Show } from "@alloy-js/core"; + import { CommonDeclarationProps, Declaration } from "./Declaration.js"; import { JSDoc } from "./JSDoc.jsx"; import { ensureTypeRefContext } from "./TypeRefContext.jsx"; diff --git a/packages/typescript/src/components/TypeRefContext.tsx b/packages/typescript/src/components/TypeRefContext.tsx index 193e4c1d1..6ee0563a8 100644 --- a/packages/typescript/src/components/TypeRefContext.tsx +++ b/packages/typescript/src/components/TypeRefContext.tsx @@ -1,4 +1,5 @@ import type { Children, Component } from "@alloy-js/core"; + import { isTypeRefContext, TypeRefContext as TypeRefContextDef, diff --git a/packages/typescript/src/components/ValueExpression.tsx b/packages/typescript/src/components/ValueExpression.tsx index 439cd9a24..45d7eac29 100644 --- a/packages/typescript/src/components/ValueExpression.tsx +++ b/packages/typescript/src/components/ValueExpression.tsx @@ -1,4 +1,5 @@ import { Children, memo } from "@alloy-js/core"; + import { ArrayExpression } from "./ArrayExpression.js"; import { ObjectExpression } from "./ObjectExpression.js"; diff --git a/packages/typescript/src/components/VarDeclaration.tsx b/packages/typescript/src/components/VarDeclaration.tsx index 2fa99b3d1..c851913eb 100644 --- a/packages/typescript/src/components/VarDeclaration.tsx +++ b/packages/typescript/src/components/VarDeclaration.tsx @@ -5,6 +5,7 @@ import { Name, Show, } from "@alloy-js/core"; + import { useTSNamePolicy } from "../name-policy.js"; import { createValueSymbol } from "../symbols/index.js"; import { TSSymbolFlags } from "../symbols/ts-output-symbol.js"; @@ -38,16 +39,12 @@ export function VarDeclaration(props: VarDeclarationProps) { ValueTypeSymbolSlot.moveMembersTo(sym); } - const keyword = - props.var ? "var" - : props.let ? "let" - : "const"; - const type = - props.type ? - - : {props.type} - - : undefined; + const keyword = props.var ? "var" : props.let ? "let" : "const"; + const type = props.type ? ( + + : {props.type} + + ) : undefined; return ( <> diff --git a/packages/typescript/src/components/interface/expression.test.tsx b/packages/typescript/src/components/interface/expression.test.tsx index fa8058ffd..ec50eccc3 100644 --- a/packages/typescript/src/components/interface/expression.test.tsx +++ b/packages/typescript/src/components/interface/expression.test.tsx @@ -1,5 +1,6 @@ import { List } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { TestFile } from "../../../test/utils.jsx"; import { InterfaceDeclaration, diff --git a/packages/typescript/src/context/package-metadata.ts b/packages/typescript/src/context/package-metadata.ts index f0b67d645..f9b59f258 100644 --- a/packages/typescript/src/context/package-metadata.ts +++ b/packages/typescript/src/context/package-metadata.ts @@ -1,4 +1,5 @@ import { ComponentContext, createNamedContext } from "@alloy-js/core"; + import { TSPackageScope } from "../symbols/ts-package-scope.js"; export interface PackageMetadataContext { diff --git a/packages/typescript/src/create-package.ts b/packages/typescript/src/create-package.ts index f2759fe67..2d64f540f 100644 --- a/packages/typescript/src/create-package.ts +++ b/packages/typescript/src/create-package.ts @@ -8,6 +8,7 @@ import { refkey, SymbolCreator, } from "@alloy-js/core"; + import { TSModuleScope, TSOutputSymbol, @@ -101,16 +102,16 @@ export type NamedMap = TDescriptor[number], { name: string } > as O["name"]]: Refkey & { - static: O extends ( - { staticMembers: infer SM extends NamedModuleDescriptor[] } - ) ? - NamedMap - : {}; - instance: O extends ( - { instanceMembers: infer IM extends NamedModuleDescriptor[] } - ) ? - NamedMap - : {}; + static: O extends { + staticMembers: infer SM extends NamedModuleDescriptor[]; + } + ? NamedMap + : {}; + instance: O extends { + instanceMembers: infer IM extends NamedModuleDescriptor[]; + } + ? NamedMap + : {}; }; }; @@ -220,9 +221,9 @@ function createSymbols( for (const exportedName of symbols.named ?? []) { const namedRef = - typeof exportedName === "string" ? - { name: exportedName } - : exportedName; + typeof exportedName === "string" + ? { name: exportedName } + : exportedName; const key = keys[namedRef.name]; const ownerSym = createSymbol( TSOutputSymbol, diff --git a/packages/typescript/src/name-conflict-resolver.ts b/packages/typescript/src/name-conflict-resolver.ts index 47e74b345..bb1c7e9e9 100644 --- a/packages/typescript/src/name-conflict-resolver.ts +++ b/packages/typescript/src/name-conflict-resolver.ts @@ -1,4 +1,5 @@ import { OutputSymbol } from "@alloy-js/core"; + import { TSOutputSymbol, TSSymbolFlags } from "./symbols/index.js"; export function tsNameConflictResolver(name: string, symbols: OutputSymbol[]) { diff --git a/packages/typescript/src/source-directory-data.ts b/packages/typescript/src/source-directory-data.ts index 4b246e197..0a5870b59 100644 --- a/packages/typescript/src/source-directory-data.ts +++ b/packages/typescript/src/source-directory-data.ts @@ -1,4 +1,5 @@ import { shallowReactive, SourceDirectoryContext } from "@alloy-js/core"; + import { TSModuleScope } from "./symbols/index.js"; export interface SourceDirectoryData { diff --git a/packages/typescript/src/symbols/index.ts b/packages/typescript/src/symbols/index.ts index 5279319c5..86777a9fc 100644 --- a/packages/typescript/src/symbols/index.ts +++ b/packages/typescript/src/symbols/index.ts @@ -7,6 +7,7 @@ import { OutputScopeOptions, toRef, } from "@alloy-js/core"; + import { useLexicalScope, useMemberOwner } from "../utils.js"; import { useTSScope } from "./scopes.js"; import { TSLexicalScope } from "./ts-lexical-scope.js"; diff --git a/packages/typescript/src/symbols/reference.tsx b/packages/typescript/src/symbols/reference.tsx index 7d44afa44..85b378f2a 100644 --- a/packages/typescript/src/symbols/reference.tsx +++ b/packages/typescript/src/symbols/reference.tsx @@ -10,6 +10,7 @@ import { untrack, useContext, } from "@alloy-js/core"; + import { MemberExpression } from "../components/MemberExpression.jsx"; import { usePackage } from "../components/PackageDirectory.jsx"; import { SourceFileContext } from "../components/SourceFile.jsx"; @@ -48,9 +49,11 @@ export function ref( // * module: target symbol is in a different module // * local: target symbol is within the current module const targetLocation = - pathDown[0] instanceof TSPackageScope ? "package" - : pathDown[0] instanceof TSModuleScope ? "module" - : "local"; + pathDown[0] instanceof TSPackageScope + ? "package" + : pathDown[0] instanceof TSModuleScope + ? "module" + : "local"; let localSymbol: TSOutputSymbol | undefined; if (targetLocation === "package") { diff --git a/packages/typescript/src/symbols/scopes.ts b/packages/typescript/src/symbols/scopes.ts index 2bd926563..fa0ff4950 100644 --- a/packages/typescript/src/symbols/scopes.ts +++ b/packages/typescript/src/symbols/scopes.ts @@ -1,4 +1,5 @@ import { useScope } from "@alloy-js/core"; + import { TSLexicalScope } from "./ts-lexical-scope.js"; import { TSMemberScope } from "./ts-member-scope.js"; import { TSModuleScope } from "./ts-module-scope.js"; diff --git a/packages/typescript/src/symbols/ts-member-scope.ts b/packages/typescript/src/symbols/ts-member-scope.ts index 9202b3f32..2ef67b3c7 100644 --- a/packages/typescript/src/symbols/ts-member-scope.ts +++ b/packages/typescript/src/symbols/ts-member-scope.ts @@ -1,4 +1,5 @@ import { OutputScopeOptions } from "@alloy-js/core"; + import { TSOutputScope } from "./scopes.js"; import { TSLexicalScope } from "./ts-lexical-scope.js"; import { TSOutputSymbol } from "./ts-output-symbol.js"; diff --git a/packages/typescript/src/symbols/ts-module-scope.ts b/packages/typescript/src/symbols/ts-module-scope.ts index 7fea6dd9b..8be93b49c 100644 --- a/packages/typescript/src/symbols/ts-module-scope.ts +++ b/packages/typescript/src/symbols/ts-module-scope.ts @@ -4,6 +4,7 @@ import { Refkey, shallowReactive, } from "@alloy-js/core"; + import { TSLexicalScope } from "./ts-lexical-scope.js"; import { TSOutputSymbol, TSSymbolFlags } from "./ts-output-symbol.js"; diff --git a/packages/typescript/src/symbols/ts-output-symbol.ts b/packages/typescript/src/symbols/ts-output-symbol.ts index d2e062316..f62c6bcf4 100644 --- a/packages/typescript/src/symbols/ts-output-symbol.ts +++ b/packages/typescript/src/symbols/ts-output-symbol.ts @@ -10,6 +10,7 @@ import { TriggerOpTypes, watch, } from "@alloy-js/core"; + import { TSOutputScope } from "./scopes.js"; import { TSModuleScope } from "./ts-module-scope.js"; diff --git a/packages/typescript/src/symbols/ts-package-scope.ts b/packages/typescript/src/symbols/ts-package-scope.ts index bf0b64273..d1ab27ccc 100644 --- a/packages/typescript/src/symbols/ts-package-scope.ts +++ b/packages/typescript/src/symbols/ts-package-scope.ts @@ -4,6 +4,7 @@ import { Refkey, shallowReactive, } from "@alloy-js/core"; + import { modulePath } from "../utils.js"; import { TSModuleScope } from "./ts-module-scope.js"; diff --git a/packages/typescript/src/utils.ts b/packages/typescript/src/utils.ts index 5b07bda56..8d2a2bfe6 100644 --- a/packages/typescript/src/utils.ts +++ b/packages/typescript/src/utils.ts @@ -4,6 +4,7 @@ import { useMemberContext, useScope, } from "@alloy-js/core"; + import { CallSignatureProps } from "./components/CallSignature.jsx"; import { TSLexicalScope } from "./symbols/ts-lexical-scope.js"; import { TSOutputSymbol } from "./symbols/ts-output-symbol.js"; diff --git a/packages/typescript/test/array.test.tsx b/packages/typescript/test/array.test.tsx index de8a279a6..216a728aa 100644 --- a/packages/typescript/test/array.test.tsx +++ b/packages/typescript/test/array.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { ArrayExpression } from "../src/index.js"; import { TestFile } from "./utils.js"; diff --git a/packages/typescript/test/arrow-function.test.tsx b/packages/typescript/test/arrow-function.test.tsx index 563fc7b5b..0afe7c0cf 100644 --- a/packages/typescript/test/arrow-function.test.tsx +++ b/packages/typescript/test/arrow-function.test.tsx @@ -1,5 +1,6 @@ import { Props, refkey, render, StatementList } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { ArrowFunction } from "../src/components/ArrowFunction.jsx"; import { VarDeclaration } from "../src/index.js"; import { ParameterDescriptor } from "../src/parameter-descriptor.js"; diff --git a/packages/typescript/test/barrel.test.tsx b/packages/typescript/test/barrel.test.tsx index 434d4d8cc..86dd1fa0d 100644 --- a/packages/typescript/test/barrel.test.tsx +++ b/packages/typescript/test/barrel.test.tsx @@ -1,6 +1,7 @@ import { Output, SourceDirectory, SourceFile } from "@alloy-js/core"; import { d } from "@alloy-js/core/testing"; import { expect, it } from "vitest"; + import * as ts from "../src/components/index.js"; it("exports everything from source files within it", () => { diff --git a/packages/typescript/test/basic.test.tsx b/packages/typescript/test/basic.test.tsx index 36c7326c9..2781b9795 100644 --- a/packages/typescript/test/basic.test.tsx +++ b/packages/typescript/test/basic.test.tsx @@ -1,5 +1,6 @@ import { List, Output, refkey, SourceFile } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as ts from "../src/components/index.js"; import { Reference } from "../src/components/Reference.js"; diff --git a/packages/typescript/test/block-scope.test.tsx b/packages/typescript/test/block-scope.test.tsx index 2ec446cc1..a3cc9460a 100644 --- a/packages/typescript/test/block-scope.test.tsx +++ b/packages/typescript/test/block-scope.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { BlockScope } from "../src/components/BlockScope.jsx"; import { VarDeclaration } from "../src/index.js"; import { TestFile } from "./utils.js"; diff --git a/packages/typescript/test/class.test.tsx b/packages/typescript/test/class.test.tsx index 2c36a4232..b6cda08c8 100644 --- a/packages/typescript/test/class.test.tsx +++ b/packages/typescript/test/class.test.tsx @@ -7,6 +7,7 @@ import { StatementList, } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import * as ts from "../src/components/index.js"; import { TestFile } from "./utils.js"; diff --git a/packages/typescript/test/decl-helpers.test.tsx b/packages/typescript/test/decl-helpers.test.tsx index b2af17a35..16151b52c 100644 --- a/packages/typescript/test/decl-helpers.test.tsx +++ b/packages/typescript/test/decl-helpers.test.tsx @@ -1,5 +1,6 @@ import { code, namekey, Output } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as ts from "../src/index.js"; import { decl, declMember, declType } from "../src/symbols/index.js"; diff --git a/packages/typescript/test/enum-jsdoc.test.tsx b/packages/typescript/test/enum-jsdoc.test.tsx index 517068226..f6ef53db1 100644 --- a/packages/typescript/test/enum-jsdoc.test.tsx +++ b/packages/typescript/test/enum-jsdoc.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import * as ts from "../src/index.js"; import { TestFile } from "./utils.js"; diff --git a/packages/typescript/test/externals.test.tsx b/packages/typescript/test/externals.test.tsx index b10606879..031eb572a 100644 --- a/packages/typescript/test/externals.test.tsx +++ b/packages/typescript/test/externals.test.tsx @@ -1,5 +1,6 @@ import { Output, render } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { fs } from "../src/builtins/node.js"; import { createPackage, diff --git a/packages/typescript/test/function-call-expression.test.tsx b/packages/typescript/test/function-call-expression.test.tsx index a34cfc457..bca7b06e5 100644 --- a/packages/typescript/test/function-call-expression.test.tsx +++ b/packages/typescript/test/function-call-expression.test.tsx @@ -1,5 +1,6 @@ import { Output, refkey, StatementList } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { FunctionCallExpression, FunctionDeclaration, diff --git a/packages/typescript/test/function-declaration-jsdoc.test.tsx b/packages/typescript/test/function-declaration-jsdoc.test.tsx index 54a11394e..f14ed994c 100644 --- a/packages/typescript/test/function-declaration-jsdoc.test.tsx +++ b/packages/typescript/test/function-declaration-jsdoc.test.tsx @@ -1,5 +1,6 @@ import { refkey, StatementList } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as ts from "../src/index.js"; import { TestFile } from "./utils.js"; diff --git a/packages/typescript/test/function-declaration.test.tsx b/packages/typescript/test/function-declaration.test.tsx index f7dc9f33c..117cb016c 100644 --- a/packages/typescript/test/function-declaration.test.tsx +++ b/packages/typescript/test/function-declaration.test.tsx @@ -10,6 +10,7 @@ import { StatementList, } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { ClassField } from "../src/components/stc/index.js"; import { ClassDeclaration, diff --git a/packages/typescript/test/function-expression.test.tsx b/packages/typescript/test/function-expression.test.tsx index 34ba7c5d1..0c68ea541 100644 --- a/packages/typescript/test/function-expression.test.tsx +++ b/packages/typescript/test/function-expression.test.tsx @@ -1,5 +1,6 @@ import { Props, refkey, render, StatementList } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { FunctionExpression } from "../src/components/FunctionExpression.jsx"; import { VarDeclaration } from "../src/index.js"; import { ParameterDescriptor } from "../src/parameter-descriptor.js"; diff --git a/packages/typescript/test/function-type.test.tsx b/packages/typescript/test/function-type.test.tsx index 42ef6f67d..1e65b36df 100644 --- a/packages/typescript/test/function-type.test.tsx +++ b/packages/typescript/test/function-type.test.tsx @@ -1,5 +1,6 @@ import { Props, refkey } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { FunctionType } from "../src/components/FunctionType.jsx"; import * as ts from "../src/components/index.js"; import { ParameterDescriptor } from "../src/components/index.js"; diff --git a/packages/typescript/test/if-statement.test.tsx b/packages/typescript/test/if-statement.test.tsx index 649ed1064..30566c7f8 100644 --- a/packages/typescript/test/if-statement.test.tsx +++ b/packages/typescript/test/if-statement.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { ElseClause, ElseIfClause, diff --git a/packages/typescript/test/imports-reactive.test.tsx b/packages/typescript/test/imports-reactive.test.tsx index 494beee5f..364b38d96 100644 --- a/packages/typescript/test/imports-reactive.test.tsx +++ b/packages/typescript/test/imports-reactive.test.tsx @@ -1,6 +1,7 @@ import { Output, ref, refkey, renderTree, Show } from "@alloy-js/core"; import { getFilesFromTree } from "@alloy-js/core/testing"; import { expect, it } from "vitest"; + import { flushJobs } from "../../core/src/scheduler.js"; import * as ts from "../src/components/index.js"; import { createPackage, PackageDirectory, SourceFile } from "../src/index.js"; diff --git a/packages/typescript/test/imports.test.tsx b/packages/typescript/test/imports.test.tsx index 5cddeae6e..e4367e089 100644 --- a/packages/typescript/test/imports.test.tsx +++ b/packages/typescript/test/imports.test.tsx @@ -6,6 +6,7 @@ import { refkey, } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import * as ts from "../src/components/index.js"; import { Reference } from "../src/components/Reference.js"; import { TypeRefContext } from "../src/context/type-ref-context.js"; diff --git a/packages/typescript/test/interface-jsdoc.test.tsx b/packages/typescript/test/interface-jsdoc.test.tsx index 88b19a76e..8bc6fd881 100644 --- a/packages/typescript/test/interface-jsdoc.test.tsx +++ b/packages/typescript/test/interface-jsdoc.test.tsx @@ -1,5 +1,6 @@ import { StatementList } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as ts from "../src/index.js"; import { TestFile } from "./utils.js"; diff --git a/packages/typescript/test/interface.test.tsx b/packages/typescript/test/interface.test.tsx index 0b63106c1..14b6ccb72 100644 --- a/packages/typescript/test/interface.test.tsx +++ b/packages/typescript/test/interface.test.tsx @@ -6,6 +6,7 @@ import { StatementList, } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import * as ts from "../src/components/index.js"; import { ParameterDescriptor } from "../src/components/index.js"; import { Reference } from "../src/components/Reference.js"; diff --git a/packages/typescript/test/jscomment.test.tsx b/packages/typescript/test/jscomment.test.tsx index 7f6e367d1..1cc54b62b 100644 --- a/packages/typescript/test/jscomment.test.tsx +++ b/packages/typescript/test/jscomment.test.tsx @@ -1,6 +1,7 @@ import { List } from "@alloy-js/core"; import { d } from "@alloy-js/core/testing"; import { describe, expect, it } from "vitest"; + import { SingleLineCommentBlock } from "../src/components/SingleLineCommentBlock.jsx"; describe("JSComment", () => { diff --git a/packages/typescript/test/jsdoc.test.tsx b/packages/typescript/test/jsdoc.test.tsx index 82d80f33f..9eb3efa3f 100644 --- a/packages/typescript/test/jsdoc.test.tsx +++ b/packages/typescript/test/jsdoc.test.tsx @@ -1,6 +1,7 @@ import { Prose } from "@alloy-js/core"; import { d } from "@alloy-js/core/testing"; import { describe, expect, it } from "vitest"; + import { JSDoc } from "../src/components/JSDoc.jsx"; import { JSDocComment } from "../src/components/JSDocComment.jsx"; import { JSDocExample } from "../src/components/JSDocExample.jsx"; diff --git a/packages/typescript/test/jsdocparam.test.tsx b/packages/typescript/test/jsdocparam.test.tsx index 2e9f4b9eb..8b1e2eed8 100644 --- a/packages/typescript/test/jsdocparam.test.tsx +++ b/packages/typescript/test/jsdocparam.test.tsx @@ -1,5 +1,6 @@ import { d } from "@alloy-js/core/testing"; import { expect, it } from "vitest"; + import { JSDocParam } from "../src/components/JSDocParam.jsx"; import { JSDoc } from "../src/index.js"; diff --git a/packages/typescript/test/member-expression.test.tsx b/packages/typescript/test/member-expression.test.tsx index 9af1385a7..a16ccc440 100644 --- a/packages/typescript/test/member-expression.test.tsx +++ b/packages/typescript/test/member-expression.test.tsx @@ -7,6 +7,7 @@ import { StatementList, } from "@alloy-js/core"; import { describe, expect, it } from "vitest"; + import { InterfaceMember, ObjectExpression } from "../src/components/index.js"; import { MemberExpression } from "../src/components/MemberExpression.jsx"; import { VarDeclaration } from "../src/components/VarDeclaration.jsx"; diff --git a/packages/typescript/test/name-conflict.test.tsx b/packages/typescript/test/name-conflict.test.tsx index f146a94d5..b97ba8348 100644 --- a/packages/typescript/test/name-conflict.test.tsx +++ b/packages/typescript/test/name-conflict.test.tsx @@ -1,6 +1,7 @@ import { Output, OutputSymbol } from "@alloy-js/core"; import { camelCase } from "change-case"; import { expect, it } from "vitest"; + import { FunctionDeclaration, SourceFile, diff --git a/packages/typescript/test/name-policy.test.tsx b/packages/typescript/test/name-policy.test.tsx index bfee0c107..a0ce8e650 100644 --- a/packages/typescript/test/name-policy.test.tsx +++ b/packages/typescript/test/name-policy.test.tsx @@ -1,5 +1,6 @@ import { Output, refkey, StatementList } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as ts from "../src/components/index.js"; import { createTSNamePolicy } from "../src/name-policy.js"; diff --git a/packages/typescript/test/new-expression.test.tsx b/packages/typescript/test/new-expression.test.tsx index 70b7014c2..4e586372e 100644 --- a/packages/typescript/test/new-expression.test.tsx +++ b/packages/typescript/test/new-expression.test.tsx @@ -1,6 +1,7 @@ import { Output, refkey, StatementList } from "@alloy-js/core"; import { d } from "@alloy-js/core/testing"; import { expect, it } from "vitest"; + import * as ts from "../src/index.js"; it("should instantiate classes", () => { diff --git a/packages/typescript/test/object.test.tsx b/packages/typescript/test/object.test.tsx index 439bc34ed..c89fcd202 100644 --- a/packages/typescript/test/object.test.tsx +++ b/packages/typescript/test/object.test.tsx @@ -1,5 +1,6 @@ import { List, namekey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { CommaList, ObjectExpression, diff --git a/packages/typescript/test/package-external.test.tsx b/packages/typescript/test/package-external.test.tsx index 97ec005df..b7773f3d6 100644 --- a/packages/typescript/test/package-external.test.tsx +++ b/packages/typescript/test/package-external.test.tsx @@ -1,5 +1,6 @@ import { Output, refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as ts from "../src/index.js"; it("imports external packages", () => { diff --git a/packages/typescript/test/package-json.test.tsx b/packages/typescript/test/package-json.test.tsx index 3217695d5..2e9837d09 100644 --- a/packages/typescript/test/package-json.test.tsx +++ b/packages/typescript/test/package-json.test.tsx @@ -1,5 +1,6 @@ import { Output } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { PackageJsonFile } from "../src/components/PackageJson.jsx"; it("creates a simple package.json", () => { diff --git a/packages/typescript/test/package.test.tsx b/packages/typescript/test/package.test.tsx index 29ab92e5d..3be3f492d 100644 --- a/packages/typescript/test/package.test.tsx +++ b/packages/typescript/test/package.test.tsx @@ -1,5 +1,6 @@ import { Output, refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as ts from "../src/components/index.js"; import { PackageDirectory } from "../src/components/PackageDirectory.js"; diff --git a/packages/typescript/test/reference.test.tsx b/packages/typescript/test/reference.test.tsx index 9ff39c3e1..8e7db043f 100644 --- a/packages/typescript/test/reference.test.tsx +++ b/packages/typescript/test/reference.test.tsx @@ -1,5 +1,6 @@ import { Output, refkey } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as ts from "../src/components/index.js"; import { Reference } from "../src/components/Reference.js"; diff --git a/packages/typescript/test/source-file.test.tsx b/packages/typescript/test/source-file.test.tsx index f152f68d9..fac0e99d8 100644 --- a/packages/typescript/test/source-file.test.tsx +++ b/packages/typescript/test/source-file.test.tsx @@ -1,5 +1,6 @@ import { Output } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { SourceFile } from "../src/components/SourceFile.jsx"; it("Includes header", () => { diff --git a/packages/typescript/test/switch-statement.test.tsx b/packages/typescript/test/switch-statement.test.tsx index cb117ff0d..91ee8db54 100644 --- a/packages/typescript/test/switch-statement.test.tsx +++ b/packages/typescript/test/switch-statement.test.tsx @@ -1,5 +1,6 @@ import { List } from "@alloy-js/core"; import { expect, it } from "vitest"; + import { CaseClause, SwitchStatement, diff --git a/packages/typescript/test/utils.tsx b/packages/typescript/test/utils.tsx index 83670314b..e7d6b232f 100644 --- a/packages/typescript/test/utils.tsx +++ b/packages/typescript/test/utils.tsx @@ -1,4 +1,5 @@ import { Children, Output } from "@alloy-js/core"; + import * as ts from "../src/index.js"; export function TestFile(props: { children?: Children }) { diff --git a/packages/typescript/test/value-expression.test.tsx b/packages/typescript/test/value-expression.test.tsx index b8bba595a..f809e36aa 100644 --- a/packages/typescript/test/value-expression.test.tsx +++ b/packages/typescript/test/value-expression.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import { ValueExpression } from "../src/index.js"; import { TestFile } from "./utils.js"; diff --git a/packages/typescript/test/var-declaration-jsdoc.test.tsx b/packages/typescript/test/var-declaration-jsdoc.test.tsx index bac481f1b..6fa83d48b 100644 --- a/packages/typescript/test/var-declaration-jsdoc.test.tsx +++ b/packages/typescript/test/var-declaration-jsdoc.test.tsx @@ -1,4 +1,5 @@ import { expect, it } from "vitest"; + import * as ts from "../src/index.js"; import { TestFile } from "./utils.js"; diff --git a/packages/typescript/test/var-declaration.test.tsx b/packages/typescript/test/var-declaration.test.tsx index 63f0ec559..15240063e 100644 --- a/packages/typescript/test/var-declaration.test.tsx +++ b/packages/typescript/test/var-declaration.test.tsx @@ -6,6 +6,7 @@ import { StatementList, } from "@alloy-js/core"; import { expect, it } from "vitest"; + import * as ts from "../src/index.js"; it("works", () => { diff --git a/packages/typescript/testing/create-wrapper.test.tsx b/packages/typescript/testing/create-wrapper.test.tsx index 7c2ea30d0..c4bb6464b 100644 --- a/packages/typescript/testing/create-wrapper.test.tsx +++ b/packages/typescript/testing/create-wrapper.test.tsx @@ -1,11 +1,13 @@ +import { List, Refkey } from "@alloy-js/core"; +import { d } from "@alloy-js/core/testing"; +import { expect, it } from "vitest"; + import { ClassDeclaration, ClassField, ClassMethod, } from "#components/index.js"; -import { List, Refkey } from "@alloy-js/core"; -import { d } from "@alloy-js/core/testing"; -import { expect, it } from "vitest"; + import { createTSTestWrapper } from "./create-wrapper.jsx"; it("should render defkey inline", async () => { diff --git a/packages/typescript/testing/create-wrapper.tsx b/packages/typescript/testing/create-wrapper.tsx index 6cf83c347..c05307c2c 100644 --- a/packages/typescript/testing/create-wrapper.tsx +++ b/packages/typescript/testing/create-wrapper.tsx @@ -1,5 +1,7 @@ -import { SourceFile } from "#components/index.js"; import { createTestWrapper, type TestWrapper } from "@alloy-js/core/testing"; + +import { SourceFile } from "#components/index.js"; + import { TSOutputSymbol, useTSScope } from "../src/index.js"; export function createTSTestWrapper(): TestWrapper { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2c7d79319..736deef04 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,9 +30,6 @@ catalogs: '@babel/types': specifier: ^7.29.7 version: 7.29.7 - '@eslint/js': - specifier: ^10.0.1 - version: 10.0.1 '@microsoft/api-extractor': specifier: ~7.58.8 version: 7.58.8 @@ -111,9 +108,6 @@ catalogs: '@vitejs/plugin-react': specifier: ^6.0.2 version: 6.0.2 - '@vitest/eslint-plugin': - specifier: ^1.6.19 - version: 1.6.19 '@vue/reactivity': specifier: ^3.5.35 version: 3.5.35 @@ -150,21 +144,9 @@ catalogs: diff-match-patch: specifier: ^1.0.5 version: 1.0.5 - eslint: - specifier: ^10.4.1 - version: 10.4.1 - eslint-plugin-react-hooks: - specifier: ^7.0.1 - version: 7.1.1 - eslint-plugin-react-refresh: - specifier: ^0.5.2 - version: 0.5.2 fast-xml-parser: specifier: ^5.8.0 version: 5.8.0 - globals: - specifier: ^17.6.0 - version: 17.6.0 html-entities: specifier: 2.6.0 version: 2.6.0 @@ -180,18 +162,21 @@ catalogs: marked: specifier: ^18.0.5 version: 18.0.5 + oxfmt: + specifier: ^0.59.0 + version: 0.59.0 + oxlint: + specifier: ^1.74.0 + version: 1.74.0 + oxlint-tsgolint: + specifier: ^0.24.0 + version: 0.24.0 pathe: specifier: ^2.0.3 version: 2.0.3 picocolors: specifier: ^1.1.1 version: 1.1.1 - prettier: - specifier: ^3.8.3 - version: 3.8.3 - prettier-plugin-organize-imports: - specifier: ^4.3.0 - version: 4.3.0 prompts: specifier: ^2.4.2 version: 2.4.2 @@ -234,9 +219,6 @@ catalogs: typescript: specifier: ^6.0.3 version: 6.0.3 - typescript-eslint: - specifier: ^8.60.1 - version: 8.60.1 validate-html-nesting: specifier: ^1.2.4 version: 1.2.4 @@ -268,37 +250,34 @@ importers: version: link:packages/cli '@chronus/chronus': specifier: ^1.1.0 - version: 1.3.1 + version: 1.3.1(supports-color@8.1.1) '@chronus/github': specifier: ^1.0.3 version: 1.0.6 '@chronus/github-pr-commenter': specifier: ^1.0.3 version: 1.0.6 - '@eslint/js': - specifier: 'catalog:' - version: 10.0.1(eslint@10.4.1(jiti@2.7.0)) - '@vitest/eslint-plugin': + '@types/node': specifier: 'catalog:' - version: 1.6.19(@typescript-eslint/eslint-plugin@8.60.1(@typescript-eslint/parser@8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3)(vitest@4.1.8(@types/node@25.9.2)(vite@8.0.16(@types/node@25.9.2)(esbuild@0.28.0)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0))) + version: 25.9.2 concurrently: specifier: 'catalog:' version: 10.0.3 - eslint: - specifier: 'catalog:' - version: 10.4.1(jiti@2.7.0) execa: specifier: ^9.6.0 version: 9.6.1 + oxfmt: + specifier: 'catalog:' + version: 0.59.0 + oxlint: + specifier: 'catalog:' + version: 1.74.0(oxlint-tsgolint@0.24.0) + oxlint-tsgolint: + specifier: 'catalog:' + version: 0.24.0 pathe: specifier: ^2.0.3 version: 2.0.3 - prettier: - specifier: 'catalog:' - version: 3.8.3 - prettier-plugin-organize-imports: - specifier: 'catalog:' - version: 4.3.0(prettier@3.8.3)(typescript@6.0.3) rimraf: specifier: 'catalog:' version: 6.1.3 @@ -308,9 +287,6 @@ importers: typedoc: specifier: ^0.28.8 version: 0.28.19(typescript@6.0.3) - typescript-eslint: - specifier: 'catalog:' - version: 8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3) vitest: specifier: 'catalog:' version: 4.1.8(@types/node@25.9.2)(vite@8.0.16(@types/node@25.9.2)(esbuild@0.28.0)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) @@ -636,9 +612,6 @@ importers: '@alloy-js/core': specifier: workspace:~ version: link:../core - '@eslint/js': - specifier: 'catalog:' - version: 10.0.1(eslint@10.4.1(jiti@2.7.0)) '@types/diff-match-patch': specifier: 'catalog:' version: 1.0.36 @@ -654,27 +627,15 @@ importers: '@vitejs/plugin-react': specifier: 'catalog:' version: 6.0.2(rolldown-vite@7.3.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.11.0)(@types/node@25.9.2)(esbuild@0.27.7)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) - eslint: - specifier: 'catalog:' - version: 10.4.1(jiti@2.7.0) - eslint-plugin-react-hooks: - specifier: 'catalog:' - version: 7.1.1(eslint@10.4.1(jiti@2.7.0)) - eslint-plugin-react-refresh: + oxlint: specifier: 'catalog:' - version: 0.5.2(eslint@10.4.1(jiti@2.7.0)) - globals: - specifier: 'catalog:' - version: 17.6.0 + version: 1.74.0(oxlint-tsgolint@0.24.0) tw-animate-css: specifier: 'catalog:' version: 1.4.0 typescript: specifier: 'catalog:' version: 6.0.3 - typescript-eslint: - specifier: 'catalog:' - version: 8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3) vite: specifier: npm:rolldown-vite@7.3.1 version: rolldown-vite@7.3.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.11.0)(@types/node@25.9.2)(esbuild@0.27.7)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) @@ -1845,45 +1806,6 @@ packages: cpu: [x64] os: [win32] - '@eslint-community/eslint-utils@4.9.1': - resolution: {integrity: sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - - '@eslint-community/regexpp@4.12.2': - resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - - '@eslint/config-array@0.23.5': - resolution: {integrity: sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==} - engines: {node: ^20.19.0 || ^22.13.0 || >=24} - - '@eslint/config-helpers@0.6.0': - resolution: {integrity: sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==} - engines: {node: ^20.19.0 || ^22.13.0 || >=24} - - '@eslint/core@1.2.1': - resolution: {integrity: sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==} - engines: {node: ^20.19.0 || ^22.13.0 || >=24} - - '@eslint/js@10.0.1': - resolution: {integrity: sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==} - engines: {node: ^20.19.0 || ^22.13.0 || >=24} - peerDependencies: - eslint: ^10.0.0 - peerDependenciesMeta: - eslint: - optional: true - - '@eslint/object-schema@3.0.5': - resolution: {integrity: sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==} - engines: {node: ^20.19.0 || ^22.13.0 || >=24} - - '@eslint/plugin-kit@0.7.2': - resolution: {integrity: sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==} - engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@expressive-code/core@0.42.0': resolution: {integrity: sha512-MN11+9nfmaC7sYu2BZJXAXqwkBRt8t1xTSqP+Ti1NfTEskgl6xUnzDxoaiQkg0BMzpglA0pys4dpDKquP/cyIw==} @@ -1930,26 +1852,6 @@ packages: '@gerrit0/mini-shiki@3.23.0': resolution: {integrity: sha512-bEMORlG0cqdjVyCEuU0cDQbORWX+kYCeo0kV1lbxF5bt4r7SID2l9bqsxJEM0zndaxpOUT7riCyIVEuqq/Ynxg==} - '@humanfs/core@0.19.2': - resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} - engines: {node: '>=18.18.0'} - - '@humanfs/node@0.16.8': - resolution: {integrity: sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==} - engines: {node: '>=18.18.0'} - - '@humanfs/types@0.15.0': - resolution: {integrity: sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==} - engines: {node: '>=18.18.0'} - - '@humanwhocodes/module-importer@1.0.1': - resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} - engines: {node: '>=12.22'} - - '@humanwhocodes/retry@0.4.3': - resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} - engines: {node: '>=18.18'} - '@img/colour@1.1.0': resolution: {integrity: sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==} engines: {node: '>=18'} @@ -2465,6 +2367,280 @@ packages: '@oxc-project/types@0.133.0': resolution: {integrity: sha512-KzkdCd6Uxqnf6l3HOw1xfatAlUURA0g14cvBYFyJ5SaNOQbOUvBr9PKArcPcrNIeRsBdgcUzOGrhKveVpvOIGA==} + '@oxfmt/binding-android-arm-eabi@0.59.0': + resolution: {integrity: sha512-bNTnfbuG7sAwb2PakMNaDukx5kXeW9duXOBeWtTOiLz3fXz3q2DlWguufPZ+c2IHEVrRXHD+M4aUgEWm841LDA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxfmt/binding-android-arm64@0.59.0': + resolution: {integrity: sha512-R/Sn7z52QtdAKNqQLLY0EK7hVMjXiz3XUlvoCFCm/60jgIzAnQtiqLKBCFaBkimCQL5rs2ezPMcicpjCsrl54Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxfmt/binding-darwin-arm64@0.59.0': + resolution: {integrity: sha512-vm/ynUqE4HjC0ZIEjmXv1UJu1/GngccQ+T+TJudTMxUxm6r+GQTg1TO3E5jJfI71pBaXxSzs1+vWHIwuilGHhw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxfmt/binding-darwin-x64@0.59.0': + resolution: {integrity: sha512-uTtYDpLN/obfKVWGpgEc8BqYlLZBQTPz2uYEvLRy3HPZxjZ34wiFzukUBU2bf64JuCYZI//GTV1EOMmWlPjf/w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxfmt/binding-freebsd-x64@0.59.0': + resolution: {integrity: sha512-e2UnxL/ifStSPy8ffBCDbdy595SYsGy+U1pur4G65TuMmWxAMBzYGG7atZo/3mp515p8rZdsflxVD/E1FAdPLQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxfmt/binding-linux-arm-gnueabihf@0.59.0': + resolution: {integrity: sha512-LtdeZ1l0urxte3VNi3g8cocZwv1xGM1NKHSgF/fJEEVhyQmlgGh7WFWKFd/pNuO7djfvPNtNO1+MS+FEWkgVSA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm-musleabihf@0.59.0': + resolution: {integrity: sha512-dBTciSsj9GTMl7p+h2gMSI0hoPn2ijfc/dUsbnWsP0RbwgPl2r0C/5zkMb3Pb+gGj17LH7f1o4qLo9aes/pAvA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm64-gnu@0.59.0': + resolution: {integrity: sha512-tXVdJ/JINsNWdponPHN0OuKHtC+HdpyoS9sd6IDPNiiEYsRki8b7tefRZ1iMnRkdbyT4SEbguWsr6o+5awvbPQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-arm64-musl@0.59.0': + resolution: {integrity: sha512-RRTq38i2zT5fnw6XGHjvT6w2mh6x/G3m6AZcAZ56OTDTT/lsOeYnG3SVjwmH40z5kPqF+lf+o35e6m6PpKy9Dw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-linux-ppc64-gnu@0.59.0': + resolution: {integrity: sha512-lD3k7glAJSaXW0D6xzu8VOZbYbosvy+0ktOVkfLEoQF5HJlMSxTQ2KNW0JO+08ccP/1ElOKktVEMI0fqRbVB4w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-riscv64-gnu@0.59.0': + resolution: {integrity: sha512-WH5ZP1RbuHKBO/yfPRQKpNO/ijHcEDNbnmC4VPf/Bcd3+mbMAZpRiJWRa1PL5bREdIZZHo343mk3sqlc9x7Usw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-riscv64-musl@0.59.0': + resolution: {integrity: sha512-743wOiaI9RZY4QVGkWkfGRavD5ZJUJ6gscFjVrVu1dP8AZh9jM+a6v3NhlR+OIzHdS6DhLM96w+gcVskskz7rw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-linux-s390x-gnu@0.59.0': + resolution: {integrity: sha512-xjRXQsRnrRZCcCkIEnbd2lmsQNobtwwkJxdy2bWXhZ1lIN0ouZwsBXRsoovW3yATuziAYwr9HMiQuR/Cc75NIw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-x64-gnu@0.59.0': + resolution: {integrity: sha512-4hNjqq/Rbr9B+StY9zMMAfm72+mtM4v80xYL5Qkb59Qd72g2vJMI0iFlPj3kf6miMsie/yJ7rt4urJT292HBgA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-x64-musl@0.59.0': + resolution: {integrity: sha512-NH579iN8EVQYsWowUB8B5vFchcylJtwPVJ7NmUAqEQHNLfhPbDT3K56KrECNAkUN4QpF4qiMgN2vsfZwVvjm7g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-openharmony-arm64@0.59.0': + resolution: {integrity: sha512-mzZy3Z5Aj1D75Aq9FVlmoRQH5ei8Ga4o/NZmlXkKyeZ5EmPrUXRR7c6BMBteV1ZuZ/356UYDuLRLjAMxTDTiBA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxfmt/binding-win32-arm64-msvc@0.59.0': + resolution: {integrity: sha512-0CpDJ1gE3jN1Gk6xms1Ie6LPfPcOtY4FAtoOmVLHQoAf8DvO2wd0DW2dIX2f7YTp5dxrr0ND8JeUEjm3DP3k5g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxfmt/binding-win32-ia32-msvc@0.59.0': + resolution: {integrity: sha512-zwdKBu3pt87uW0bRcywZb0oGMS7C6n87qogwRYFUgmk44T90ZzYlPjtlFYXs/DnBFrgNCvlHwCuWKfVWLeE7kw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxfmt/binding-win32-x64-msvc@0.59.0': + resolution: {integrity: sha512-dUUbZkKgWrmAeI/puzv4bxN8lzcYaFnQVwFTFtwO2Gp8M7lZGSE2qJjC58g518+1bltJ8mizjYwD0BGHym0l/w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@oxlint-tsgolint/darwin-arm64@0.24.0': + resolution: {integrity: sha512-C2uMmwK5Bc4ri4ysZ6sA8Rcu+A5zBQTp6ml2u0CLLbRZp4kMFPV3yWk8B5DK9Aw7y9bbjogIm75tUwGLFzlsYQ==} + cpu: [arm64] + os: [darwin] + + '@oxlint-tsgolint/darwin-x64@0.24.0': + resolution: {integrity: sha512-Wgvt/1lRbDxmoNqWQKKcL+UIiqLmdJ+EWLpQa1qzoNVAfNB0PJpa82/8dH1twT/3rSs4zrP5TXPWl4juB71WuQ==} + cpu: [x64] + os: [darwin] + + '@oxlint-tsgolint/linux-arm64@0.24.0': + resolution: {integrity: sha512-PB1rxII7KV83+ASY4sSkXtqvpij6ME66+QCRL49uksi/ofs2Rf/UVboYr095n0Rkbl2wgvlsHGl6DHC361jQUQ==} + cpu: [arm64] + os: [linux] + + '@oxlint-tsgolint/linux-x64@0.24.0': + resolution: {integrity: sha512-xcz3CxKmjTQLREtE/UShh+ruWmm9nAb7UM9zKcD65BStiuYgOakAKkPHl4YS5DztpVcDrE0+HqbOolTlRKYWmw==} + cpu: [x64] + os: [linux] + + '@oxlint-tsgolint/win32-arm64@0.24.0': + resolution: {integrity: sha512-A2i6ZGBec3i20S7RaxkgHc6r3HYtD5Mn7j/mb22NkTz14u0JuudvTu6JggAnbGMcv8+dBKQI//EasxSPJLD8pw==} + cpu: [arm64] + os: [win32] + + '@oxlint-tsgolint/win32-x64@0.24.0': + resolution: {integrity: sha512-0ZbGd9qRB6zs82moekaKdEvncRANq49EAwfNX62JpTS46feXUhKAuoyVDvZMj6Rywejylrmmu79Wo6faYCo4Ew==} + cpu: [x64] + os: [win32] + + '@oxlint/binding-android-arm-eabi@1.74.0': + resolution: {integrity: sha512-+gHd12muVI9ZLBaWLPkHt3Fj7jihFjgQ1MGtBaRL8vWrWrI0P7dLUty/cHrHS0oqPYIRgQUJsPu2CExQuMcwNw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxlint/binding-android-arm64@1.74.0': + resolution: {integrity: sha512-xjKdoMB+H+RCOByv/7l7nfIGW9mlOisqYdcyC75UqYuQecLpReAeEYUf2CNeDEI3KtmUgxpRw/+c63y4AeF/Bw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxlint/binding-darwin-arm64@1.74.0': + resolution: {integrity: sha512-iUK7wvc6sejMKsC+Pt67mntoF5weFcyEunhZfLJceU6gL419mexz5wBkSx/EnkFBExMLNtOi9fnDSc5xfK0IzQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxlint/binding-darwin-x64@1.74.0': + resolution: {integrity: sha512-ggKc/tn5SJ1u2yG2izC6VKODfYKV8MQ2AicJlNzOjuyrC29udvOef6/JzK2r32xqCnBDLFouR1VCkjzEI0/N9Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxlint/binding-freebsd-x64@1.74.0': + resolution: {integrity: sha512-u++dH/43jy9hTLbneaWlS0gla/Bp1JdwJ2zgevCl8nDFUh6qRCGMxcL0f0lb7By3A9p/LfFr+7cG4HU1hG856g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxlint/binding-linux-arm-gnueabihf@1.74.0': + resolution: {integrity: sha512-Sj1zmtFDVTPeIbIz4ZfcXAbFHqCmKCXdCUlAJzvTF7I20NTH1RDpoF2PhkqNODutJzVhJYmm3oz0GwgY+tvE2g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm-musleabihf@1.74.0': + resolution: {integrity: sha512-//PKyQb/tQXcHArx2f7z+oVI/eMS2Jpv+edNuAtOrgIhWdGcpHxogveAxzmF2rpH1AIHp4Hq04RF/rgJdiICnQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm64-gnu@1.74.0': + resolution: {integrity: sha512-/k1Me+aX2tjuH10K62mLS0y8cLkJBHX6Ce0xPK+eWeel4bSdEGZ8dv4+hYMzg0GrSmjwy4yAYsDPeEeKBft/2w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-arm64-musl@1.74.0': + resolution: {integrity: sha512-3tFSjBxc5D8/zvjEuLvOqcA8ZXKD0+6NuaVO/edeamNc49MoAsbfaC9s1UiwODwgF6slGaF8yJA2TPkukd77tg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oxlint/binding-linux-ppc64-gnu@1.74.0': + resolution: {integrity: sha512-9QggtPkSPXOCTu8Szis7auOK/sC7KdQaN+/TujP7YVVhzCAOhgdRfgv8uEz0r2tk5xdgus5rLYUrCDoZNtiRUw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-riscv64-gnu@1.74.0': + resolution: {integrity: sha512-VM5VPUJ4DJIWiK+AZn8FScUqMr6OFrCAYybMYjEEi7W13ParI64MByiXTkKMqZpBmvQ9zxl9Ebq2VUOiZRJYUg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-riscv64-musl@1.74.0': + resolution: {integrity: sha512-SaDY1gh9rOA592J54g+gu5hkOFFQBZsMmIYHs+NRHG+Uq0OxtuuCXMWQ3vu1830Eugv5uMXyjG+bv2Z9y4IXjw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@oxlint/binding-linux-s390x-gnu@1.74.0': + resolution: {integrity: sha512-ZATQeHZCyr6MbDveg0obD5sxLHFOghtOdC5jwVwYlvFWqtFOxctgFEG6Ef/64hYvZrWyhyCckB10AelqLopeDA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-x64-gnu@1.74.0': + resolution: {integrity: sha512-+aIvJyrdeD7LwCQ2WYLMUWNmnbeDRSPb40aBYtPjD9+PTqUwgJnk+HK5yLfSMeqXrMrDhE9uTmtt2y50tvjhHw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-x64-musl@1.74.0': + resolution: {integrity: sha512-XyktaR8lhK2qWiCK0Tk8oYD+/cgn+oHA6ddRnxSSXUKkkojkV78CmShZUxQF+yrBFs0SuW+JBOPG6hecyc/iZg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oxlint/binding-openharmony-arm64@1.74.0': + resolution: {integrity: sha512-mzbjrPl4neaVUiJ1fUiEUxTGaSZBoiKtaoB6jmIpz9S+VOA2vDYmJpihQ82w6178V5jxziclTg8Cgj5yF6tTDg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxlint/binding-win32-arm64-msvc@1.74.0': + resolution: {integrity: sha512-vUAe9okpS2Oa5+lX67lqHMuNUvfkleRKwrUDJ/WJBsgmddvZ1mrsh2HVmuFDRzqFELhaJhFaCNOuR6a7L3rtIA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxlint/binding-win32-ia32-msvc@1.74.0': + resolution: {integrity: sha512-yyXXJyYYSXL4I8K8jAWjJs+J3fa9gH2JmEbo4f5adm+1tNC9itseicBNuwK7BDHvqQ5J534s+yDULu89vYL2ZQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxlint/binding-win32-x64-msvc@1.74.0': + resolution: {integrity: sha512-VTC9IYTIMrVUk/i6Ms1ohzzDKZFkWn0KU2OBbPBzgmVZ2V30165T/zK4LztTr0Xgp9fZ1qQZ1rsZAu/rEmySlA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + '@pagefind/darwin-arm64@1.5.2': resolution: {integrity: sha512-MXpI+7HsAdPkvJ0gk9xj9g541BCqBZOBbdwj9g6lB5LCj6kSV6nqDSjzcAJwvOsfu0fjwvC8hQU+ecfhp+MpiQ==} cpu: [arm64] @@ -3445,9 +3621,6 @@ packages: '@types/diff-match-patch@1.0.36': resolution: {integrity: sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg==} - '@types/esrecurse@4.3.1': - resolution: {integrity: sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==} - '@types/estree-jsx@1.0.5': resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} @@ -3460,9 +3633,6 @@ packages: '@types/js-yaml@4.0.9': resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==} - '@types/json-schema@7.0.15': - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - '@types/mdast@4.0.4': resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} @@ -3510,65 +3680,6 @@ packages: '@types/ws@8.18.1': resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} - '@typescript-eslint/eslint-plugin@8.60.1': - resolution: {integrity: sha512-JQ4S5GB0tfjO8BuJ4fcX+HodkzJjYBV+7OJ+wLygaX7OGQ7FudyHL4NSCA6ob+w3Yn+5MkKIozOwQhXeM7opVg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - '@typescript-eslint/parser': ^8.60.1 - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/parser@8.60.1': - resolution: {integrity: sha512-A0M6ua6H252bVjPvvtSgl2QA4+ET9S5Mtkb2GDyTxIhH/C4qDItT7RQNO5PhMC6NXGYXOR9dIalcDDgBKT7oFA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/project-service@8.60.1': - resolution: {integrity: sha512-eXkTH2bxmXlqD1RnOPmLZ9ZM9D3VwSx04JOwBnP9RQ+yUA5a2Mu7SfW8uaV2Aon53NJzZlZYuX7tn91Izf+xaw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/scope-manager@8.60.1': - resolution: {integrity: sha512-gvI5OQoptnxQnchOirukCuQ55svJSTuD/4k5+pC267xyBtYry748R9/c3tYUzb/iE6RZfllRz2lVulLCHkTm4w==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@typescript-eslint/tsconfig-utils@8.60.1': - resolution: {integrity: sha512-nh8w4qAteiKuZu3pSSzG/yGKpw0OlkrKnzFmbVRenKaD4qc+7i1GrmZaLVkr8rk4uipiPGMOW4YsM6WmKZ5CvA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/type-utils@8.60.1': - resolution: {integrity: sha512-sdwTrpjosW7ANQYJ39ZBF1ZyEMEGVB2UsikrserVM/30a/F1dTLnu9bGxEdosugyu5caigjLrR2qiD11asjI1A==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/types@8.60.1': - resolution: {integrity: sha512-4h0tY8ppCkdCzcrl2YM5M3my0xsE1Tf8om3owEu5oPWmXwkKRmk0j0LGDzYBGUcAlesEbxBhazqu/K4cu3Ug7w==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@typescript-eslint/typescript-estree@8.60.1': - resolution: {integrity: sha512-alpRkfG8hlVE5kdJW2GkfgDgXxold3e8e4l6EnmhRmRLbekgAPCCGDVD++sABy9FcgPFroq+uFcCSM1vR57Cew==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/utils@8.60.1': - resolution: {integrity: sha512-h2MPBLoNtjc3qZWfY3Tl51yPorQ2McHn8pJfcMNTcIvrrZrr90Ykffit0yjrPFWQcRcUxzH20+6OcVdW4yHtUg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - - '@typescript-eslint/visitor-keys@8.60.1': - resolution: {integrity: sha512-EbGRQg4FhrmwLodl+t3JNAnXHWVr9Vp+Zl1QBZVPY4ByfkzIT8cX3K6QWODHtkIZqqJVEWvhHSx3v5PDHsaQag==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typespec/compiler@1.12.0': resolution: {integrity: sha512-hKCkHEEDdCpXFyOU8ln+TzBBwonFMbkeUV0zIc+vBETyO8p/Upui3XvEyLOyB4CpKUReHzGeGm3gcFjNc73ygg==} engines: {node: '>=22.0.0'} @@ -3600,22 +3711,6 @@ packages: babel-plugin-react-compiler: optional: true - '@vitest/eslint-plugin@1.6.19': - resolution: {integrity: sha512-zodmXRsVKFsuHxHJILuTFaaKsrsxm0YsiOX65clk+LpCW9JrVXaf6ERXr0caDs+NEk0S62Jyk0K7XYQ7gWXheA==} - engines: {node: '>=18'} - peerDependencies: - '@typescript-eslint/eslint-plugin': '*' - eslint: '>=8.57.0' - typescript: '>=5.0.0' - vitest: '*' - peerDependenciesMeta: - '@typescript-eslint/eslint-plugin': - optional: true - typescript: - optional: true - vitest: - optional: true - '@vitest/expect@4.1.8': resolution: {integrity: sha512-h3nDO677RDLEGlBxyQ5CW8RlMThSKSRLUePLOx09gNIWRL40edgA1GCZSZgf1W55MFAG6/Sw14KeaAnqv0NKdQ==} @@ -3711,9 +3806,6 @@ packages: ajv: optional: true - ajv@6.15.0: - resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} - ajv@8.18.0: resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} @@ -4022,9 +4114,6 @@ packages: decode-named-character-reference@1.3.0: resolution: {integrity: sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==} - deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} @@ -4143,63 +4232,10 @@ packages: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} - escape-string-regexp@4.0.0: - resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} - engines: {node: '>=10'} - escape-string-regexp@5.0.0: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} - eslint-plugin-react-hooks@7.1.1: - resolution: {integrity: sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g==} - engines: {node: '>=18'} - peerDependencies: - eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 || ^10.0.0 - - eslint-plugin-react-refresh@0.5.2: - resolution: {integrity: sha512-hmgTH57GfzoTFjVN0yBwTggnsVUF2tcqi7RJZHqi9lIezSs4eFyAMktA68YD4r5kNw1mxyY4dmkyoFDb3FIqrA==} - peerDependencies: - eslint: ^9 || ^10 - - eslint-scope@9.1.2: - resolution: {integrity: sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==} - engines: {node: ^20.19.0 || ^22.13.0 || >=24} - - eslint-visitor-keys@3.4.3: - resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - - eslint-visitor-keys@5.0.1: - resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} - engines: {node: ^20.19.0 || ^22.13.0 || >=24} - - eslint@10.4.1: - resolution: {integrity: sha512-AyIKhnOBuOAdueD7RB3xB+YeAWScb9jHsJBgH2Hcde8InP5JYhqrRR6iTMHyTEwgENK54Cp44e4v8BwNhsuHuw==} - engines: {node: ^20.19.0 || ^22.13.0 || >=24} - hasBin: true - peerDependencies: - jiti: '*' - peerDependenciesMeta: - jiti: - optional: true - - espree@11.2.0: - resolution: {integrity: sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==} - engines: {node: ^20.19.0 || ^22.13.0 || >=24} - - esquery@1.7.0: - resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} - engines: {node: '>=0.10'} - - esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} - - estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} - estree-util-attach-comments@3.0.0: resolution: {integrity: sha512-cKUwm/HUcTDsYh/9FgnuFqpfquUbwIqwKM26BVCGDPVgvaCl/nDCCjUfiLlx6lsEZ3Z4RFxNbOQ60pkaEwFxGw==} @@ -4224,10 +4260,6 @@ packages: estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} - esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - eventemitter3@5.0.4: resolution: {integrity: sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==} @@ -4262,12 +4294,6 @@ packages: resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} engines: {node: '>=8.6.0'} - fast-json-stable-stringify@2.1.0: - resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - - fast-levenshtein@2.0.6: - resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - fast-string-truncated-width@3.0.3: resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==} @@ -4303,25 +4329,10 @@ packages: resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} engines: {node: '>=18'} - file-entry-cache@8.0.0: - resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} - engines: {node: '>=16.0.0'} - fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} - find-up@5.0.0: - resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} - engines: {node: '>=10'} - - flat-cache@4.0.1: - resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} - engines: {node: '>=16'} - - flatted@3.4.2: - resolution: {integrity: sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==} - flattie@1.1.1: resolution: {integrity: sha512-9UbaD6XdAL97+k/n+N7JwX46K/M6Zc6KcFYskrYL8wbBV/Uyk0CTAMY0VT+qiK5PM7AIc9aTWYtq65U7T+aCNQ==} engines: {node: '>=8'} @@ -4380,18 +4391,10 @@ packages: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} - glob-parent@6.0.2: - resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} - engines: {node: '>=10.13.0'} - glob@13.0.6: resolution: {integrity: sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==} engines: {node: 18 || 20 || >=22} - globals@17.6.0: - resolution: {integrity: sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA==} - engines: {node: '>=18'} - globby@16.2.0: resolution: {integrity: sha512-QrJia2qDf5BB/V6HYlDTs0I0lBahyjLzpGQg3KT7FnCdTonAyPy2RtY802m2k4ALx6Dp752f82WsOczEVr3l6Q==} engines: {node: '>=20'} @@ -4476,12 +4479,6 @@ packages: hastscript@9.0.1: resolution: {integrity: sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w==} - hermes-estree@0.25.1: - resolution: {integrity: sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==} - - hermes-parser@0.25.1: - resolution: {integrity: sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==} - hosted-git-info@9.0.3: resolution: {integrity: sha512-Hc+ghLoSt6QaYZUv0WBiIvmMDZuZZ7oaDvdH8MbfOO4lOsxdXLEvuC6ePoGs9H1X9oCLyq6+NVN0MKqD+ydxyg==} engines: {node: ^20.17.0 || >=22.9.0} @@ -4529,10 +4526,6 @@ packages: resolution: {integrity: sha512-FCeMZT4NiRQGh+YkeKMtWrOmBgWjHjMJ26WQWrRQyoyzqevdaGSakUaJW5xQYmjLlUVk2qUnCjYVBax9EKKg8A==} engines: {node: ^20.17.0 || >=22.9.0} - ignore@5.3.2: - resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} - engines: {node: '>= 4'} - ignore@7.0.5: resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} engines: {node: '>= 4'} @@ -4541,10 +4534,6 @@ packages: resolution: {integrity: sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==} engines: {node: '>=8'} - imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - indent-string@5.0.0: resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} engines: {node: '>=12'} @@ -4667,22 +4656,13 @@ packages: engines: {node: '>=6'} hasBin: true - json-buffer@3.0.1: - resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - json-parse-even-better-errors@5.0.0: resolution: {integrity: sha512-ZF1nxZ28VhQouRWhUcVlUIN3qwSgPuswK05s/HIaoetAoE/9tngVmCHjSxmSQPav1nd+lPtTL0YZ/2AFdR/iYQ==} engines: {node: ^20.17.0 || >=22.9.0} - json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} - json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - json-with-bigint@3.5.8: resolution: {integrity: sha512-eq/4KP6K34kwa7TcFdtvnftvHCD9KvHOGGICWwMFc4dOOKF5t4iYqnfLK8otCRCRv06FXOzGGyqE8h8ElMvvdw==} @@ -4704,9 +4684,6 @@ packages: resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} engines: {'0': node >= 0.2.0} - keyv@4.5.4: - resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - kleur@3.0.3: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} @@ -4719,10 +4696,6 @@ packages: resolution: {integrity: sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==} engines: {node: '>= 8'} - levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} - engines: {node: '>= 0.8.0'} - lightningcss-android-arm64@1.32.0: resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} engines: {node: '>= 12.0.0'} @@ -4804,10 +4777,6 @@ packages: resolution: {integrity: sha512-7I5knELsJKTUjXG+A6BkKAiGkW1i25fNa/xlUl9hFtk15WbE9jndA89xu5FzQKrY5llajE1hfZZFMILXkDHk/Q==} engines: {node: '>=22.13.0'} - locate-path@6.0.0: - resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} - engines: {node: '>=10'} - lodash.mergewith@4.6.2: resolution: {integrity: sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==} @@ -5112,9 +5081,6 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - negotiator@1.0.0: resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==} engines: {node: '>= 0.6'} @@ -5209,22 +5175,40 @@ packages: oniguruma-to-es@4.3.6: resolution: {integrity: sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==} - optionator@0.9.4: - resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} - engines: {node: '>= 0.8.0'} + oxfmt@0.59.0: + resolution: {integrity: sha512-Xqk6cPZS1yMvVa7OAuenaDZUsgMDutvvbZ9/L5gSvAfW64+WN4HVhgipLj5rVERbYQt8fLs9TopyZ1rU1XEG/w==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + svelte: ^5.0.0 + vite-plus: '*' + peerDependenciesMeta: + svelte: + optional: true + vite-plus: + optional: true + + oxlint-tsgolint@0.24.0: + resolution: {integrity: sha512-giCk5sEvG02d5tzPmFMX3hem8ndzEEu1xvGYS5OwNfO2WGl6ZVxt5LjE0yiMDoz94INI7XkXwgFAQiydPvVHDw==} + hasBin: true - p-limit@3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} + oxlint@1.74.0: + resolution: {integrity: sha512-odGl2s2x5IOJoj3A0v1k0PGBXVFBZeZ2+AK/+K2MJur7Ghi3bkyX5NuLUWHKqa4js1wjep3hJeuTQJOlr+4+dA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + oxlint-tsgolint: '>=0.24.0' + vite-plus: '*' + peerDependenciesMeta: + oxlint-tsgolint: + optional: true + vite-plus: + optional: true p-limit@7.3.0: resolution: {integrity: sha512-7cIXg/Z0M5WZRblrsOla88S4wAK+zOQQWeBYfV3qJuJXMr+LnbYjaadrFaS0JILfEDPVqHyKnZ1Z/1d6J9VVUw==} engines: {node: '>=20'} - p-locate@5.0.0: - resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} - engines: {node: '>=10'} - p-map@7.0.4: resolution: {integrity: sha512-tkAQEw8ysMzmkhgw8k+1U/iPhWNhykKnSk4Rd5zLoPJCuJaGRPo6YposrZgaxHKzDHdDWWZvE/Sk7hsL2X/CpQ==} engines: {node: '>=18'} @@ -5268,10 +5252,6 @@ packages: path-browserify@1.0.1: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} - path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - path-expression-matcher@1.5.0: resolution: {integrity: sha512-cbrerZV+6rvdQrrD+iGMcZFEiiSrbv9Tfdkvnusy6y0x0GKBXREFg/Y65GhIfm0tnLntThhzCnfKwp1WRjeCyQ==} engines: {node: '>=14.0.0'} @@ -5326,20 +5306,6 @@ packages: resolution: {integrity: sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==} engines: {node: ^10 || ^12 || >=14} - prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} - engines: {node: '>= 0.8.0'} - - prettier-plugin-organize-imports@4.3.0: - resolution: {integrity: sha512-FxFz0qFhyBsGdIsb697f/EkvHzi5SZOhWAjxcx2dLt+Q532bAlhswcXGYB1yzjZ69kW8UoadFBw7TyNwlq96Iw==} - peerDependencies: - prettier: '>=2.0' - typescript: '>=2.9' - vue-tsc: ^2.1.0 || 3 - peerDependenciesMeta: - vue-tsc: - optional: true - prettier@3.8.3: resolution: {integrity: sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==} engines: {node: '>=14'} @@ -5372,10 +5338,6 @@ packages: resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==} engines: {node: '>=6'} - punycode@2.3.1: - resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} - engines: {node: '>=6'} - queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -5887,6 +5849,10 @@ packages: resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} engines: {node: '>=12.0.0'} + tinypool@2.1.0: + resolution: {integrity: sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==} + engines: {node: ^20.0.0 || >=22.0.0} + tinyrainbow@3.1.0: resolution: {integrity: sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==} engines: {node: '>=14.0.0'} @@ -5912,12 +5878,6 @@ packages: trough@2.2.0: resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} - ts-api-utils@2.5.0: - resolution: {integrity: sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==} - engines: {node: '>=18.12'} - peerDependencies: - typescript: '>=4.8.4' - tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} @@ -5937,10 +5897,6 @@ packages: tw-animate-css@1.4.0: resolution: {integrity: sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ==} - type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} - engines: {node: '>= 0.8.0'} - type-fest@4.41.0: resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==} engines: {node: '>=16'} @@ -5958,13 +5914,6 @@ packages: typescript-auto-import-cache@0.3.6: resolution: {integrity: sha512-RpuHXrknHdVdK7wv/8ug3Fr0WNsNi5l5aB8MYYuXhq2UH5lnEB1htJ1smhtD5VeCsGr2p8mUDtd83LCQDFVgjQ==} - typescript-eslint@8.60.1: - resolution: {integrity: sha512-6m5hkkRAp8lKvhVpcprAIn5KkehQEh+47oHH2VGnExEh7dhNxXlg6GPAOIu6TxbVQxhebrJDvjl3020ooiWCMA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 || ^10.0.0 - typescript: '>=4.8.4 <6.1.0' - typescript@5.9.3: resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} @@ -6122,9 +6071,6 @@ packages: peerDependencies: browserslist: '>= 4.21.0' - uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - use-callback-ref@1.3.3: resolution: {integrity: sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==} engines: {node: '>=10'} @@ -6430,10 +6376,6 @@ packages: engines: {node: '>=8'} hasBin: true - word-wrap@1.2.5: - resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} - engines: {node: '>=0.10.0'} - workerpool@9.3.4: resolution: {integrity: sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==} @@ -6512,10 +6454,6 @@ packages: resolution: {integrity: sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==} engines: {node: ^20.19.0 || ^22.12.0 || >=23} - yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} - yocto-queue@1.2.2: resolution: {integrity: sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==} engines: {node: '>=12.20'} @@ -6524,12 +6462,6 @@ packages: resolution: {integrity: sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==} engines: {node: '>=18'} - zod-validation-error@4.0.2: - resolution: {integrity: sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==} - engines: {node: '>=18.0.0'} - peerDependencies: - zod: ^3.25.0 || ^4.0.0 - zod@4.4.3: resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} @@ -6933,13 +6865,13 @@ snapshots: dependencies: fontkitten: 1.0.3 - '@chronus/chronus@1.3.1': + '@chronus/chronus@1.3.1(supports-color@8.1.1)': dependencies: cross-spawn: 7.0.6 globby: 16.2.0 is-unicode-supported: 2.1.0 micromatch: 4.0.8 - pacote: 21.5.0 + pacote: 21.5.0(supports-color@8.1.1) picocolors: 1.1.1 pluralize: 8.0.0 prompts: 2.4.2 @@ -6962,7 +6894,7 @@ snapshots: '@chronus/github@1.0.6': dependencies: - '@chronus/chronus': 1.3.1 + '@chronus/chronus': 1.3.1(supports-color@8.1.1) '@octokit/graphql': 9.0.3 '@octokit/rest': 22.0.1 cross-spawn: 7.0.6 @@ -7186,42 +7118,8 @@ snapshots: '@esbuild/win32-x64@0.27.7': optional: true - '@esbuild/win32-x64@0.28.0': - optional: true - - '@eslint-community/eslint-utils@4.9.1(eslint@10.4.1(jiti@2.7.0))': - dependencies: - eslint: 10.4.1(jiti@2.7.0) - eslint-visitor-keys: 3.4.3 - - '@eslint-community/regexpp@4.12.2': {} - - '@eslint/config-array@0.23.5': - dependencies: - '@eslint/object-schema': 3.0.5 - debug: 4.4.3(supports-color@8.1.1) - minimatch: 10.2.5 - transitivePeerDependencies: - - supports-color - - '@eslint/config-helpers@0.6.0': - dependencies: - '@eslint/core': 1.2.1 - - '@eslint/core@1.2.1': - dependencies: - '@types/json-schema': 7.0.15 - - '@eslint/js@10.0.1(eslint@10.4.1(jiti@2.7.0))': - optionalDependencies: - eslint: 10.4.1(jiti@2.7.0) - - '@eslint/object-schema@3.0.5': {} - - '@eslint/plugin-kit@0.7.2': - dependencies: - '@eslint/core': 1.2.1 - levn: 0.4.1 + '@esbuild/win32-x64@0.28.0': + optional: true '@expressive-code/core@0.42.0': dependencies: @@ -7300,22 +7198,6 @@ snapshots: '@shikijs/types': 3.23.0 '@shikijs/vscode-textmate': 10.0.2 - '@humanfs/core@0.19.2': - dependencies: - '@humanfs/types': 0.15.0 - - '@humanfs/node@0.16.8': - dependencies: - '@humanfs/core': 0.19.2 - '@humanfs/types': 0.15.0 - '@humanwhocodes/retry': 0.4.3 - - '@humanfs/types@0.15.0': {} - - '@humanwhocodes/module-importer@1.0.1': {} - - '@humanwhocodes/retry@0.4.3': {} - '@img/colour@1.1.0': {} '@img/sharp-darwin-arm64@0.34.5': @@ -7874,6 +7756,138 @@ snapshots: '@oxc-project/types@0.133.0': {} + '@oxfmt/binding-android-arm-eabi@0.59.0': + optional: true + + '@oxfmt/binding-android-arm64@0.59.0': + optional: true + + '@oxfmt/binding-darwin-arm64@0.59.0': + optional: true + + '@oxfmt/binding-darwin-x64@0.59.0': + optional: true + + '@oxfmt/binding-freebsd-x64@0.59.0': + optional: true + + '@oxfmt/binding-linux-arm-gnueabihf@0.59.0': + optional: true + + '@oxfmt/binding-linux-arm-musleabihf@0.59.0': + optional: true + + '@oxfmt/binding-linux-arm64-gnu@0.59.0': + optional: true + + '@oxfmt/binding-linux-arm64-musl@0.59.0': + optional: true + + '@oxfmt/binding-linux-ppc64-gnu@0.59.0': + optional: true + + '@oxfmt/binding-linux-riscv64-gnu@0.59.0': + optional: true + + '@oxfmt/binding-linux-riscv64-musl@0.59.0': + optional: true + + '@oxfmt/binding-linux-s390x-gnu@0.59.0': + optional: true + + '@oxfmt/binding-linux-x64-gnu@0.59.0': + optional: true + + '@oxfmt/binding-linux-x64-musl@0.59.0': + optional: true + + '@oxfmt/binding-openharmony-arm64@0.59.0': + optional: true + + '@oxfmt/binding-win32-arm64-msvc@0.59.0': + optional: true + + '@oxfmt/binding-win32-ia32-msvc@0.59.0': + optional: true + + '@oxfmt/binding-win32-x64-msvc@0.59.0': + optional: true + + '@oxlint-tsgolint/darwin-arm64@0.24.0': + optional: true + + '@oxlint-tsgolint/darwin-x64@0.24.0': + optional: true + + '@oxlint-tsgolint/linux-arm64@0.24.0': + optional: true + + '@oxlint-tsgolint/linux-x64@0.24.0': + optional: true + + '@oxlint-tsgolint/win32-arm64@0.24.0': + optional: true + + '@oxlint-tsgolint/win32-x64@0.24.0': + optional: true + + '@oxlint/binding-android-arm-eabi@1.74.0': + optional: true + + '@oxlint/binding-android-arm64@1.74.0': + optional: true + + '@oxlint/binding-darwin-arm64@1.74.0': + optional: true + + '@oxlint/binding-darwin-x64@1.74.0': + optional: true + + '@oxlint/binding-freebsd-x64@1.74.0': + optional: true + + '@oxlint/binding-linux-arm-gnueabihf@1.74.0': + optional: true + + '@oxlint/binding-linux-arm-musleabihf@1.74.0': + optional: true + + '@oxlint/binding-linux-arm64-gnu@1.74.0': + optional: true + + '@oxlint/binding-linux-arm64-musl@1.74.0': + optional: true + + '@oxlint/binding-linux-ppc64-gnu@1.74.0': + optional: true + + '@oxlint/binding-linux-riscv64-gnu@1.74.0': + optional: true + + '@oxlint/binding-linux-riscv64-musl@1.74.0': + optional: true + + '@oxlint/binding-linux-s390x-gnu@1.74.0': + optional: true + + '@oxlint/binding-linux-x64-gnu@1.74.0': + optional: true + + '@oxlint/binding-linux-x64-musl@1.74.0': + optional: true + + '@oxlint/binding-openharmony-arm64@1.74.0': + optional: true + + '@oxlint/binding-win32-arm64-msvc@1.74.0': + optional: true + + '@oxlint/binding-win32-ia32-msvc@1.74.0': + optional: true + + '@oxlint/binding-win32-x64-msvc@1.74.0': + optional: true + '@pagefind/darwin-arm64@1.5.2': optional: true @@ -8523,10 +8537,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@sigstore/tuf@4.0.2': + '@sigstore/tuf@4.0.2(supports-color@8.1.1)': dependencies: '@sigstore/protobuf-specs': 0.5.1 - tuf-js: 4.1.0 + tuf-js: 4.1.0(supports-color@8.1.1) transitivePeerDependencies: - supports-color @@ -8672,8 +8686,6 @@ snapshots: '@types/diff-match-patch@1.0.36': {} - '@types/esrecurse@4.3.1': {} - '@types/estree-jsx@1.0.5': dependencies: '@types/estree': 1.0.9 @@ -8686,8 +8698,6 @@ snapshots: '@types/js-yaml@4.0.9': {} - '@types/json-schema@7.0.15': {} - '@types/mdast@4.0.4': dependencies: '@types/unist': 3.0.3 @@ -8739,97 +8749,6 @@ snapshots: dependencies: '@types/node': 25.9.2 - '@typescript-eslint/eslint-plugin@8.60.1(@typescript-eslint/parser@8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3)': - dependencies: - '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3) - '@typescript-eslint/scope-manager': 8.60.1 - '@typescript-eslint/type-utils': 8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3) - '@typescript-eslint/utils': 8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3) - '@typescript-eslint/visitor-keys': 8.60.1 - eslint: 10.4.1(jiti@2.7.0) - ignore: 7.0.5 - natural-compare: 1.4.0 - ts-api-utils: 2.5.0(typescript@6.0.3) - typescript: 6.0.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/parser@8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3)': - dependencies: - '@typescript-eslint/scope-manager': 8.60.1 - '@typescript-eslint/types': 8.60.1 - '@typescript-eslint/typescript-estree': 8.60.1(typescript@6.0.3) - '@typescript-eslint/visitor-keys': 8.60.1 - debug: 4.4.3(supports-color@8.1.1) - eslint: 10.4.1(jiti@2.7.0) - typescript: 6.0.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/project-service@8.60.1(typescript@6.0.3)': - dependencies: - '@typescript-eslint/tsconfig-utils': 8.60.1(typescript@6.0.3) - '@typescript-eslint/types': 8.60.1 - debug: 4.4.3(supports-color@8.1.1) - typescript: 6.0.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/scope-manager@8.60.1': - dependencies: - '@typescript-eslint/types': 8.60.1 - '@typescript-eslint/visitor-keys': 8.60.1 - - '@typescript-eslint/tsconfig-utils@8.60.1(typescript@6.0.3)': - dependencies: - typescript: 6.0.3 - - '@typescript-eslint/type-utils@8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3)': - dependencies: - '@typescript-eslint/types': 8.60.1 - '@typescript-eslint/typescript-estree': 8.60.1(typescript@6.0.3) - '@typescript-eslint/utils': 8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3) - debug: 4.4.3(supports-color@8.1.1) - eslint: 10.4.1(jiti@2.7.0) - ts-api-utils: 2.5.0(typescript@6.0.3) - typescript: 6.0.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/types@8.60.1': {} - - '@typescript-eslint/typescript-estree@8.60.1(typescript@6.0.3)': - dependencies: - '@typescript-eslint/project-service': 8.60.1(typescript@6.0.3) - '@typescript-eslint/tsconfig-utils': 8.60.1(typescript@6.0.3) - '@typescript-eslint/types': 8.60.1 - '@typescript-eslint/visitor-keys': 8.60.1 - debug: 4.4.3(supports-color@8.1.1) - minimatch: 10.2.5 - semver: 7.8.2 - tinyglobby: 0.2.17 - ts-api-utils: 2.5.0(typescript@6.0.3) - typescript: 6.0.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/utils@8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3)': - dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@10.4.1(jiti@2.7.0)) - '@typescript-eslint/scope-manager': 8.60.1 - '@typescript-eslint/types': 8.60.1 - '@typescript-eslint/typescript-estree': 8.60.1(typescript@6.0.3) - eslint: 10.4.1(jiti@2.7.0) - typescript: 6.0.3 - transitivePeerDependencies: - - supports-color - - '@typescript-eslint/visitor-keys@8.60.1': - dependencies: - '@typescript-eslint/types': 8.60.1 - eslint-visitor-keys: 5.0.1 - '@typespec/compiler@1.12.0(@types/node@25.9.2)': dependencies: '@babel/code-frame': 7.29.7 @@ -8862,18 +8781,6 @@ snapshots: '@rolldown/pluginutils': 1.0.1 vite: rolldown-vite@7.3.1(@emnapi/core@1.10.0)(@emnapi/runtime@1.11.0)(@types/node@25.9.2)(esbuild@0.27.7)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0) - '@vitest/eslint-plugin@1.6.19(@typescript-eslint/eslint-plugin@8.60.1(@typescript-eslint/parser@8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3)(vitest@4.1.8(@types/node@25.9.2)(vite@8.0.16(@types/node@25.9.2)(esbuild@0.28.0)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)))': - dependencies: - '@typescript-eslint/scope-manager': 8.60.1 - '@typescript-eslint/utils': 8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3) - eslint: 10.4.1(jiti@2.7.0) - optionalDependencies: - '@typescript-eslint/eslint-plugin': 8.60.1(@typescript-eslint/parser@8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3) - typescript: 6.0.3 - vitest: 4.1.8(@types/node@25.9.2)(vite@8.0.16(@types/node@25.9.2)(esbuild@0.28.0)(jiti@2.7.0)(tsx@4.22.4)(yaml@2.9.0)) - transitivePeerDependencies: - - supports-color - '@vitest/expect@4.1.8': dependencies: '@standard-schema/spec': 1.1.0 @@ -9001,13 +8908,6 @@ snapshots: optionalDependencies: ajv: 8.18.0 - ajv@6.15.0: - dependencies: - fast-deep-equal: 3.1.3 - fast-json-stable-stringify: 2.1.0 - json-schema-traverse: 0.4.1 - uri-js: 4.4.1 - ajv@8.18.0: dependencies: fast-deep-equal: 3.1.3 @@ -9386,8 +9286,6 @@ snapshots: dependencies: character-entities: 2.0.2 - deep-is@0.1.4: {} - deepmerge@4.3.1: {} defu@6.1.7: {} @@ -9538,89 +9436,8 @@ snapshots: escalade@3.2.0: {} - escape-string-regexp@4.0.0: {} - escape-string-regexp@5.0.0: {} - eslint-plugin-react-hooks@7.1.1(eslint@10.4.1(jiti@2.7.0)): - dependencies: - '@babel/core': 7.29.7 - '@babel/parser': 7.29.7 - eslint: 10.4.1(jiti@2.7.0) - hermes-parser: 0.25.1 - zod: 4.4.3 - zod-validation-error: 4.0.2(zod@4.4.3) - transitivePeerDependencies: - - supports-color - - eslint-plugin-react-refresh@0.5.2(eslint@10.4.1(jiti@2.7.0)): - dependencies: - eslint: 10.4.1(jiti@2.7.0) - - eslint-scope@9.1.2: - dependencies: - '@types/esrecurse': 4.3.1 - '@types/estree': 1.0.9 - esrecurse: 4.3.0 - estraverse: 5.3.0 - - eslint-visitor-keys@3.4.3: {} - - eslint-visitor-keys@5.0.1: {} - - eslint@10.4.1(jiti@2.7.0): - dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@10.4.1(jiti@2.7.0)) - '@eslint-community/regexpp': 4.12.2 - '@eslint/config-array': 0.23.5 - '@eslint/config-helpers': 0.6.0 - '@eslint/core': 1.2.1 - '@eslint/plugin-kit': 0.7.2 - '@humanfs/node': 0.16.8 - '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.4.3 - '@types/estree': 1.0.9 - ajv: 6.15.0 - cross-spawn: 7.0.6 - debug: 4.4.3(supports-color@8.1.1) - escape-string-regexp: 4.0.0 - eslint-scope: 9.1.2 - eslint-visitor-keys: 5.0.1 - espree: 11.2.0 - esquery: 1.7.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 8.0.0 - find-up: 5.0.0 - glob-parent: 6.0.2 - ignore: 5.3.2 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - json-stable-stringify-without-jsonify: 1.0.1 - minimatch: 10.2.5 - natural-compare: 1.4.0 - optionator: 0.9.4 - optionalDependencies: - jiti: 2.7.0 - transitivePeerDependencies: - - supports-color - - espree@11.2.0: - dependencies: - acorn: 8.16.0 - acorn-jsx: 5.3.2(acorn@8.16.0) - eslint-visitor-keys: 5.0.1 - - esquery@1.7.0: - dependencies: - estraverse: 5.3.0 - - esrecurse@4.3.0: - dependencies: - estraverse: 5.3.0 - - estraverse@5.3.0: {} - estree-util-attach-comments@3.0.0: dependencies: '@types/estree': 1.0.9 @@ -9656,8 +9473,6 @@ snapshots: dependencies: '@types/estree': 1.0.9 - esutils@2.0.3: {} - eventemitter3@5.0.4: {} execa@9.6.1: @@ -9707,10 +9522,6 @@ snapshots: merge2: 1.4.1 micromatch: 4.0.8 - fast-json-stable-stringify@2.1.0: {} - - fast-levenshtein@2.0.6: {} - fast-string-truncated-width@3.0.3: {} fast-string-width@3.0.2: @@ -9748,26 +9559,10 @@ snapshots: dependencies: is-unicode-supported: 2.1.0 - file-entry-cache@8.0.0: - dependencies: - flat-cache: 4.0.1 - fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 - find-up@5.0.0: - dependencies: - locate-path: 6.0.0 - path-exists: 4.0.0 - - flat-cache@4.0.1: - dependencies: - flatted: 3.4.2 - keyv: 4.5.4 - - flatted@3.4.2: {} - flattie@1.1.1: {} fontace@0.4.1: @@ -9816,18 +9611,12 @@ snapshots: dependencies: is-glob: 4.0.3 - glob-parent@6.0.2: - dependencies: - is-glob: 4.0.3 - glob@13.0.6: dependencies: minimatch: 10.2.5 minipass: 7.1.3 path-scurry: 2.0.2 - globals@17.6.0: {} - globby@16.2.0: dependencies: '@sindresorhus/merge-streams': 4.0.0 @@ -10067,12 +9856,6 @@ snapshots: property-information: 7.2.0 space-separated-tokens: 2.0.2 - hermes-estree@0.25.1: {} - - hermes-parser@0.25.1: - dependencies: - hermes-estree: 0.25.1 - hosted-git-info@9.0.3: dependencies: lru-cache: 11.5.1 @@ -10115,14 +9898,10 @@ snapshots: dependencies: minimatch: 10.2.5 - ignore@5.3.2: {} - ignore@7.0.5: {} import-lazy@4.0.0: {} - imurmurhash@0.1.4: {} - indent-string@5.0.0: {} ini@6.0.0: {} @@ -10202,16 +9981,10 @@ snapshots: jsesc@3.1.0: {} - json-buffer@3.0.1: {} - json-parse-even-better-errors@5.0.0: {} - json-schema-traverse@0.4.1: {} - json-schema-traverse@1.0.0: {} - json-stable-stringify-without-jsonify@1.0.1: {} - json-with-bigint@3.5.8: {} json5@2.2.3: {} @@ -10228,21 +10001,12 @@ snapshots: jsonparse@1.3.1: {} - keyv@4.5.4: - dependencies: - json-buffer: 3.0.1 - kleur@3.0.3: {} kleur@4.1.5: {} klona@2.0.6: {} - levn@0.4.1: - dependencies: - prelude-ls: 1.2.1 - type-check: 0.4.0 - lightningcss-android-arm64@1.32.0: optional: true @@ -10304,10 +10068,6 @@ snapshots: rfdc: 1.4.1 wrap-ansi: 10.0.0 - locate-path@6.0.0: - dependencies: - p-locate: 5.0.0 - lodash.mergewith@4.6.2: {} lodash@4.18.1: {} @@ -10904,8 +10664,6 @@ snapshots: nanoid@3.3.12: {} - natural-compare@1.4.0: {} - negotiator@1.0.0: {} neotraverse@0.6.18: {} @@ -11026,27 +10784,66 @@ snapshots: regex: 6.1.0 regex-recursion: 6.0.2 - optionator@0.9.4: - dependencies: - deep-is: 0.1.4 - fast-levenshtein: 2.0.6 - levn: 0.4.1 - prelude-ls: 1.2.1 - type-check: 0.4.0 - word-wrap: 1.2.5 - - p-limit@3.1.0: + oxfmt@0.59.0: dependencies: - yocto-queue: 0.1.0 + tinypool: 2.1.0 + optionalDependencies: + '@oxfmt/binding-android-arm-eabi': 0.59.0 + '@oxfmt/binding-android-arm64': 0.59.0 + '@oxfmt/binding-darwin-arm64': 0.59.0 + '@oxfmt/binding-darwin-x64': 0.59.0 + '@oxfmt/binding-freebsd-x64': 0.59.0 + '@oxfmt/binding-linux-arm-gnueabihf': 0.59.0 + '@oxfmt/binding-linux-arm-musleabihf': 0.59.0 + '@oxfmt/binding-linux-arm64-gnu': 0.59.0 + '@oxfmt/binding-linux-arm64-musl': 0.59.0 + '@oxfmt/binding-linux-ppc64-gnu': 0.59.0 + '@oxfmt/binding-linux-riscv64-gnu': 0.59.0 + '@oxfmt/binding-linux-riscv64-musl': 0.59.0 + '@oxfmt/binding-linux-s390x-gnu': 0.59.0 + '@oxfmt/binding-linux-x64-gnu': 0.59.0 + '@oxfmt/binding-linux-x64-musl': 0.59.0 + '@oxfmt/binding-openharmony-arm64': 0.59.0 + '@oxfmt/binding-win32-arm64-msvc': 0.59.0 + '@oxfmt/binding-win32-ia32-msvc': 0.59.0 + '@oxfmt/binding-win32-x64-msvc': 0.59.0 + + oxlint-tsgolint@0.24.0: + optionalDependencies: + '@oxlint-tsgolint/darwin-arm64': 0.24.0 + '@oxlint-tsgolint/darwin-x64': 0.24.0 + '@oxlint-tsgolint/linux-arm64': 0.24.0 + '@oxlint-tsgolint/linux-x64': 0.24.0 + '@oxlint-tsgolint/win32-arm64': 0.24.0 + '@oxlint-tsgolint/win32-x64': 0.24.0 + + oxlint@1.74.0(oxlint-tsgolint@0.24.0): + optionalDependencies: + '@oxlint/binding-android-arm-eabi': 1.74.0 + '@oxlint/binding-android-arm64': 1.74.0 + '@oxlint/binding-darwin-arm64': 1.74.0 + '@oxlint/binding-darwin-x64': 1.74.0 + '@oxlint/binding-freebsd-x64': 1.74.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.74.0 + '@oxlint/binding-linux-arm-musleabihf': 1.74.0 + '@oxlint/binding-linux-arm64-gnu': 1.74.0 + '@oxlint/binding-linux-arm64-musl': 1.74.0 + '@oxlint/binding-linux-ppc64-gnu': 1.74.0 + '@oxlint/binding-linux-riscv64-gnu': 1.74.0 + '@oxlint/binding-linux-riscv64-musl': 1.74.0 + '@oxlint/binding-linux-s390x-gnu': 1.74.0 + '@oxlint/binding-linux-x64-gnu': 1.74.0 + '@oxlint/binding-linux-x64-musl': 1.74.0 + '@oxlint/binding-openharmony-arm64': 1.74.0 + '@oxlint/binding-win32-arm64-msvc': 1.74.0 + '@oxlint/binding-win32-ia32-msvc': 1.74.0 + '@oxlint/binding-win32-x64-msvc': 1.74.0 + oxlint-tsgolint: 0.24.0 p-limit@7.3.0: dependencies: yocto-queue: 1.2.2 - p-locate@5.0.0: - dependencies: - p-limit: 3.1.0 - p-map@7.0.4: {} p-queue@9.3.0: @@ -11060,7 +10857,7 @@ snapshots: package-manager-detector@1.6.0: {} - pacote@21.5.0: + pacote@21.5.0(supports-color@8.1.1): dependencies: '@gar/promise-retry': 1.0.3 '@npmcli/git': 7.0.2 @@ -11076,7 +10873,7 @@ snapshots: npm-pick-manifest: 11.0.3 npm-registry-fetch: 19.1.1 proc-log: 6.1.0 - sigstore: 4.1.1 + sigstore: 4.1.1(supports-color@8.1.1) ssri: 13.0.1 tar: 7.5.16 transitivePeerDependencies: @@ -11119,8 +10916,6 @@ snapshots: path-browserify@1.0.1: {} - path-exists@4.0.0: {} - path-expression-matcher@1.5.0: {} path-key@3.1.1: {} @@ -11162,13 +10957,6 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 - prelude-ls@1.2.1: {} - - prettier-plugin-organize-imports@4.3.0(prettier@3.8.3)(typescript@6.0.3): - dependencies: - prettier: 3.8.3 - typescript: 6.0.3 - prettier@3.8.3: {} pretty-format@30.4.1: @@ -11195,8 +10983,6 @@ snapshots: punycode.js@2.3.1: {} - punycode@2.3.1: {} - queue-microtask@1.2.3: {} radix3@1.1.2: {} @@ -11641,13 +11427,13 @@ snapshots: signal-exit@4.1.0: {} - sigstore@4.1.1: + sigstore@4.1.1(supports-color@8.1.1): dependencies: '@sigstore/bundle': 4.0.0 '@sigstore/core': 3.2.1 '@sigstore/protobuf-specs': 0.5.1 '@sigstore/sign': 4.1.1 - '@sigstore/tuf': 4.0.2 + '@sigstore/tuf': 4.0.2(supports-color@8.1.1) '@sigstore/verify': 3.1.1 transitivePeerDependencies: - supports-color @@ -11846,6 +11632,8 @@ snapshots: fdir: 6.5.0(picomatch@4.0.4) picomatch: 4.0.4 + tinypool@2.1.0: {} + tinyrainbow@3.1.0: {} to-regex-range@5.0.1: @@ -11862,10 +11650,6 @@ snapshots: trough@2.2.0: {} - ts-api-utils@2.5.0(typescript@6.0.3): - dependencies: - typescript: 6.0.3 - tslib@2.8.1: {} tsx@4.22.4: @@ -11874,7 +11658,7 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - tuf-js@4.1.0: + tuf-js@4.1.0(supports-color@8.1.1): dependencies: '@tufjs/models': 4.1.0 debug: 4.4.3(supports-color@8.1.1) @@ -11886,10 +11670,6 @@ snapshots: tw-animate-css@1.4.0: {} - type-check@0.4.0: - dependencies: - prelude-ls: 1.2.1 - type-fest@4.41.0: {} typedoc@0.28.19(typescript@6.0.3): @@ -11907,17 +11687,6 @@ snapshots: dependencies: semver: 7.8.3 - typescript-eslint@8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3): - dependencies: - '@typescript-eslint/eslint-plugin': 8.60.1(@typescript-eslint/parser@8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3))(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3) - '@typescript-eslint/parser': 8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3) - '@typescript-eslint/typescript-estree': 8.60.1(typescript@6.0.3) - '@typescript-eslint/utils': 8.60.1(eslint@10.4.1(jiti@2.7.0))(typescript@6.0.3) - eslint: 10.4.1(jiti@2.7.0) - typescript: 6.0.3 - transitivePeerDependencies: - - supports-color - typescript@5.9.3: {} typescript@6.0.3: {} @@ -12031,10 +11800,6 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 - uri-js@4.4.1: - dependencies: - punycode: 2.3.1 - use-callback-ref@1.3.3(@types/react@19.2.17)(react@19.2.7): dependencies: react: 19.2.7 @@ -12290,8 +12055,6 @@ snapshots: siginfo: 2.0.0 stackback: 0.0.2 - word-wrap@1.2.5: {} - workerpool@9.3.4: {} wrap-ansi@10.0.0: @@ -12367,16 +12130,10 @@ snapshots: y18n: 5.0.8 yargs-parser: 22.0.0 - yocto-queue@0.1.0: {} - yocto-queue@1.2.2: {} yoctocolors@2.1.2: {} - zod-validation-error@4.0.2(zod@4.4.3): - dependencies: - zod: 4.4.3 - zod@4.4.3: {} zwitch@2.0.4: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 4fac57e6e..b7fdf1d5a 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -18,7 +18,6 @@ catalog: "@babel/plugin-syntax-jsx": ^7.29.7 "@babel/preset-typescript": 7.29.7 "@babel/types": ^7.29.7 - "@eslint/js": ^10.0.1 "@microsoft/api-extractor": ~7.58.8 "@microsoft/api-extractor-model": ~7.33.8 "@microsoft/tsdoc": 0.16.0 @@ -45,7 +44,6 @@ catalog: "@typespec/compiler": ^1.0.0 "@typespec/http": ^1.0.1 "@vitejs/plugin-react": ^6.0.2 - "@vitest/eslint-plugin": ^1.6.19 "@vue/reactivity": ^3.5.35 astro: ^6.4.4 astro-expressive-code: ^0.43.0 @@ -58,20 +56,17 @@ catalog: dagre: ^0.8.5 devalue: ^5.8.1 diff-match-patch: ^1.0.5 - eslint: ^10.4.1 - eslint-plugin-react-hooks: ^7.0.1 - eslint-plugin-react-refresh: ^0.5.2 fast-xml-parser: ^5.8.0 - globals: ^17.6.0 html-entities: 2.6.0 js-yaml: ^4.1.0 listr2: ^10.2.1 lucide-react: ^1.17.0 marked: ^18.0.5 + oxfmt: ^0.59.0 + oxlint: ^1.74.0 + oxlint-tsgolint: ^0.24.0 pathe: ^2.0.3 picocolors: ^1.1.1 - prettier: ^3.8.3 - prettier-plugin-organize-imports: ^4.3.0 prompts: ^2.4.2 react: ^19.2.0 react-dom: ^19.2.0 @@ -86,7 +81,6 @@ catalog: tsx: ^4.22.4 tw-animate-css: ^1.4.0 typescript: ^6.0.3 - typescript-eslint: ^8.60.1 validate-html-nesting: ^1.2.4 vite: ^8.0.16 vite-plugin-singlefile: ^2.3.0 diff --git a/samples/basic-project/src/java.tsx b/samples/basic-project/src/java.tsx index 37d07679e..b9bf5ecc7 100644 --- a/samples/basic-project/src/java.tsx +++ b/samples/basic-project/src/java.tsx @@ -79,7 +79,7 @@ const res = ay.render( parameters={{ args: "String[]" }} > {code` - ${javaUtil.List}${()} animals = new ${javaUtil.ArrayList}${()}(); + ${javaUtil.List}${} animals = new ${javaUtil.ArrayList}${}(); animals.add(new ${refkey("Cat")}()); `} diff --git a/samples/client-emitter/src/components/Client.tsx b/samples/client-emitter/src/components/Client.tsx index 952a7feab..b10ad20d2 100644 --- a/samples/client-emitter/src/components/Client.tsx +++ b/samples/client-emitter/src/components/Client.tsx @@ -1,5 +1,6 @@ import { Children, For, refkey } from "@alloy-js/core"; import * as ts from "@alloy-js/typescript"; + import { useApi } from "../context/api.js"; import { ClientMethod } from "./ClientMethod.jsx"; diff --git a/samples/client-emitter/src/components/ClientMethod.tsx b/samples/client-emitter/src/components/ClientMethod.tsx index 0feb4cfe7..bb937936e 100644 --- a/samples/client-emitter/src/components/ClientMethod.tsx +++ b/samples/client-emitter/src/components/ClientMethod.tsx @@ -1,5 +1,6 @@ import { Children, code, refkey } from "@alloy-js/core"; import * as ts from "@alloy-js/typescript"; + import { useApi } from "../context/api.js"; import { RestApiOperation } from "../schema.js"; diff --git a/samples/client-emitter/src/components/Model.tsx b/samples/client-emitter/src/components/Model.tsx index f07ad27ab..d99e9057c 100644 --- a/samples/client-emitter/src/components/Model.tsx +++ b/samples/client-emitter/src/components/Model.tsx @@ -1,5 +1,6 @@ import { For, refkey } from "@alloy-js/core"; import * as ts from "@alloy-js/typescript"; + import { RestApiModel } from "../schema.js"; import { ModelProperty } from "./ModelProperty.jsx"; interface ModelProps { diff --git a/samples/client-emitter/src/components/ModelProperty.tsx b/samples/client-emitter/src/components/ModelProperty.tsx index 59187cc0d..ecbda480f 100644 --- a/samples/client-emitter/src/components/ModelProperty.tsx +++ b/samples/client-emitter/src/components/ModelProperty.tsx @@ -1,5 +1,6 @@ import { Children, refkey } from "@alloy-js/core"; import * as ts from "@alloy-js/typescript"; + import { useApi } from "../context/api.js"; import { RestApiModelProperty } from "../schema.js"; import { Model } from "./Model.jsx"; diff --git a/samples/client-emitter/src/context/api.ts b/samples/client-emitter/src/context/api.ts index 12e545521..e6d630340 100644 --- a/samples/client-emitter/src/context/api.ts +++ b/samples/client-emitter/src/context/api.ts @@ -1,4 +1,5 @@ import { createContext, useContext } from "@alloy-js/core"; + import { RestApi, RestApiModel, RestApiModelReference } from "../schema.js"; interface ApiContext { diff --git a/samples/python-example/src/components/Client.tsx b/samples/python-example/src/components/Client.tsx index 3304dceb1..ceae9d4f2 100644 --- a/samples/python-example/src/components/Client.tsx +++ b/samples/python-example/src/components/Client.tsx @@ -1,5 +1,6 @@ import { For, Prose, refkey } from "@alloy-js/core"; import * as py from "@alloy-js/python"; + import { useApi } from "../context/api.js"; import { ClientMethod } from "./index.js"; diff --git a/samples/python-example/src/components/ClientMethod.tsx b/samples/python-example/src/components/ClientMethod.tsx index 846846a23..84fe9ef1a 100644 --- a/samples/python-example/src/components/ClientMethod.tsx +++ b/samples/python-example/src/components/ClientMethod.tsx @@ -1,5 +1,6 @@ import { Children, code, Prose, refkey } from "@alloy-js/core"; import * as py from "@alloy-js/python"; + import { useApi } from "../context/api.js"; import { RestApiOperation } from "../schema.js"; import { diff --git a/samples/python-example/src/components/Model.tsx b/samples/python-example/src/components/Model.tsx index 5f9c539f4..7af4b024c 100644 --- a/samples/python-example/src/components/Model.tsx +++ b/samples/python-example/src/components/Model.tsx @@ -1,5 +1,6 @@ import { For, refkey } from "@alloy-js/core"; import * as py from "@alloy-js/python"; + import { RestApiModel } from "../schema.js"; import { ModelProperty } from "./index.js"; diff --git a/samples/python-example/src/components/ModelProperty.tsx b/samples/python-example/src/components/ModelProperty.tsx index 9f9a0513c..6637c54c5 100644 --- a/samples/python-example/src/components/ModelProperty.tsx +++ b/samples/python-example/src/components/ModelProperty.tsx @@ -1,5 +1,6 @@ import { Children, code } from "@alloy-js/core"; import * as py from "@alloy-js/python"; + import { useApi } from "../context/api.js"; import { RestApiModelProperty } from "../schema.js"; import { castOpenAPITypeToPython, resolveRestAPIReference } from "../utils.js"; diff --git a/samples/python-example/src/context/api.ts b/samples/python-example/src/context/api.ts index a3cfd9157..0fd518b58 100644 --- a/samples/python-example/src/context/api.ts +++ b/samples/python-example/src/context/api.ts @@ -1,4 +1,5 @@ import { createContext, useContext } from "@alloy-js/core"; + import { RestApi, RestApiModel, RestApiModelReference } from "../schema.js"; // context interface diff --git a/samples/python-example/src/index.tsx b/samples/python-example/src/index.tsx index 5bd67532d..c798e7297 100644 --- a/samples/python-example/src/index.tsx +++ b/samples/python-example/src/index.tsx @@ -7,6 +7,7 @@ import { writeOutput, } from "@alloy-js/core"; import * as py from "@alloy-js/python"; + import { Client } from "./components/Client.jsx"; import { Model } from "./components/Model.jsx"; import { Usage } from "./components/Usage.jsx"; diff --git a/samples/python-example/src/utils.tsx b/samples/python-example/src/utils.tsx index 44e2925e9..bbbcd7617 100644 --- a/samples/python-example/src/utils.tsx +++ b/samples/python-example/src/utils.tsx @@ -1,4 +1,5 @@ import { Children, code, refkey } from "@alloy-js/core"; + import { ApiContext } from "./context/api.js"; import { RestApiModelReference, RestApiNonModelReference } from "./schema.js"; diff --git a/samples/scaffold-generator/src/index.tsx b/samples/scaffold-generator/src/index.tsx index 8a5391479..9ac50abd2 100644 --- a/samples/scaffold-generator/src/index.tsx +++ b/samples/scaffold-generator/src/index.tsx @@ -1,3 +1,6 @@ +import { join } from "path"; +import { fileURLToPath } from "url"; + import { AppendFile, CopyFile, @@ -10,8 +13,6 @@ import { writeOutput, } from "@alloy-js/core"; import { Code, Heading } from "@alloy-js/markdown"; -import { join } from "path"; -import { fileURLToPath } from "url"; function content(subpath: string) { return join(fileURLToPath(import.meta.url), "../../..", "content", subpath); diff --git a/test/performance/scenarios/ts-huge-object/index.tsx b/test/performance/scenarios/ts-huge-object/index.tsx index 039a1b32e..d8e7bcee8 100644 --- a/test/performance/scenarios/ts-huge-object/index.tsx +++ b/test/performance/scenarios/ts-huge-object/index.tsx @@ -20,8 +20,8 @@ export async function runTest(): Promise { const WIDTH = 4; const DEPTH = 3; const root = (function build(d: number): any { - return d ? - Object.fromEntries( + return d + ? Object.fromEntries( Array.from({ length: WIDTH }, (_, i) => [ `k${d}_${i}`, Array.from({ length: WIDTH }, () => build(d - 1)), diff --git a/test/performance/src/index.ts b/test/performance/src/index.ts index 0e0e5f6ae..6f3d47e6c 100644 --- a/test/performance/src/index.ts +++ b/test/performance/src/index.ts @@ -2,8 +2,6 @@ // Discovers scenario directories under ../scenarios/*/index.ts // Each scenario exports async function runTest(): Promise -import Table from "cli-table3"; -import { Listr } from "listr2"; import { spawn } from "node:child_process"; import { constants as FS_CONSTANTS } from "node:fs"; import { access, readdir, readFile, writeFile } from "node:fs/promises"; @@ -11,6 +9,9 @@ import path from "node:path"; import process from "node:process"; import { fileURLToPath, pathToFileURL } from "node:url"; import { parseArgs } from "node:util"; + +import Table from "cli-table3"; +import { Listr } from "listr2"; import pc from "picocolors"; interface ScenarioResult { @@ -67,9 +68,8 @@ const entries = await readdir(scenariosDir, { withFileTypes: true }); const scenarioDirs = entries.filter((e) => e.isDirectory()); // Optional single-scenario filter const scenarioFilter = parsed.values.scenario as string | undefined; -const selectedScenarioDirs = - scenarioFilter ? - scenarioDirs.filter((d) => d.name === scenarioFilter) +const selectedScenarioDirs = scenarioFilter + ? scenarioDirs.filter((d) => d.name === scenarioFilter) : scenarioDirs; if (scenarioFilter && selectedScenarioDirs.length === 0) { // eslint-disable-next-line no-console @@ -218,14 +218,12 @@ const tasks = new Listr( task.output = `ERROR: ${error}`; } else { const cpu = fmtCpu(aggregated.totalCpuMicros); - const cpuSd = - aggregated.cpuStdDevMicros ? - fmtCpu(aggregated.cpuStdDevMicros) + const cpuSd = aggregated.cpuStdDevMicros + ? fmtCpu(aggregated.cpuStdDevMicros) : undefined; const mem = fmtMem(aggregated.heapUsedBytesDelta); - const memSd = - aggregated.memStdDevBytes ? - fmtMem(aggregated.memStdDevBytes) + const memSd = aggregated.memStdDevBytes + ? fmtMem(aggregated.memStdDevBytes) : undefined; task.output = `runs=${aggregated.runs} cpu=${cpu}${cpuSd ? ` (± ${cpuSd})` : ""} memΔ=${mem}${memSd ? ` (± ${memSd})` : ""}`; } @@ -276,9 +274,9 @@ try { } const table = new Table({ - head: (baselineCompare ? - ["Title", "CPU (avg ± sd)", "CPU Δ%", "Mem Δ (avg ± sd)", "Mem Δ%"] - : ["Title", "CPU (avg ± sd)", "Mem Δ (avg ± sd)"]) as string[], + head: (baselineCompare + ? ["Title", "CPU (avg ± sd)", "CPU Δ%", "Mem Δ (avg ± sd)", "Mem Δ%"] + : ["Title", "CPU (avg ± sd)", "Mem Δ (avg ± sd)"]) as string[], style: { head: [], border: [] }, wordWrap: true, }); @@ -287,58 +285,58 @@ for (const r of results) { if (r.error) { const errTxt = pc.bold(pc.red(`ERROR: ${r.error}`)); table.push( - baselineCompare ? - [pc.yellow(titleOnly), errTxt, pc.dim("-"), pc.dim("-"), pc.dim("-")] - : [pc.yellow(titleOnly), errTxt, pc.dim("-")], + baselineCompare + ? [pc.yellow(titleOnly), errTxt, pc.dim("-"), pc.dim("-"), pc.dim("-")] + : [pc.yellow(titleOnly), errTxt, pc.dim("-")], ); continue; } const cpuAvgMsNum = r.totalCpuMicros / 1000; const cpuAvgMs = cpuAvgMsNum.toFixed(2); - const cpuSdMs = - r.cpuStdDevMicros ? (r.cpuStdDevMicros / 1000).toFixed(2) : "0.00"; + const cpuSdMs = r.cpuStdDevMicros + ? (r.cpuStdDevMicros / 1000).toFixed(2) + : "0.00"; const memAvgNum = r.heapUsedBytesDelta; const memAvg = fmtMem(memAvgNum); const memSd = r.memStdDevBytes ? fmtMem(r.memStdDevBytes) : "0 KB"; if (baselineCompare && baselineCompare.has(r.name)) { const b = baselineCompare.get(r.name)!; const bCpuMs = b.cpu ? b.cpu.avgMicros / 1000 : undefined; - const bCpuStdDevMs = - b.cpu?.stddevMicros ? b.cpu.stddevMicros / 1000 : undefined; + const bCpuStdDevMs = b.cpu?.stddevMicros + ? b.cpu.stddevMicros / 1000 + : undefined; const bMemBytes = b.memory ? b.memory.avgBytesDelta : undefined; const bMemStdDevBytes = b.memory?.stddevBytes; const cpuDeltaRatio = bCpuMs && bCpuMs !== 0 ? (cpuAvgMsNum - bCpuMs) / bCpuMs : undefined; const memDeltaRatio = - bMemBytes && bMemBytes !== 0 ? - (memAvgNum - bMemBytes) / bMemBytes - : undefined; + bMemBytes && bMemBytes !== 0 + ? (memAvgNum - bMemBytes) / bMemBytes + : undefined; const cpuDeltaPct = - cpuDeltaRatio !== undefined ? - `${cpuDeltaRatio > 0 ? "+" : ""}${(cpuDeltaRatio * 100).toFixed(1)}%` - : "-"; + cpuDeltaRatio !== undefined + ? `${cpuDeltaRatio > 0 ? "+" : ""}${(cpuDeltaRatio * 100).toFixed(1)}%` + : "-"; const memDeltaPct = - memDeltaRatio !== undefined ? - `${memDeltaRatio > 0 ? "+" : ""}${(memDeltaRatio * 100).toFixed(1)}%` - : "-"; + memDeltaRatio !== undefined + ? `${memDeltaRatio > 0 ? "+" : ""}${(memDeltaRatio * 100).toFixed(1)}%` + : "-"; // Determine if increase exceeds baseline error bars; only then color red const cpuIncrease = cpuDeltaRatio !== undefined && cpuDeltaRatio > 0; const memIncrease = memDeltaRatio !== undefined && memDeltaRatio > 0; const cpuBeyondError = - cpuIncrease && bCpuStdDevMs !== undefined ? - cpuAvgMsNum - (bCpuMs ?? 0) > bCpuStdDevMs - : cpuIncrease; + cpuIncrease && bCpuStdDevMs !== undefined + ? cpuAvgMsNum - (bCpuMs ?? 0) > bCpuStdDevMs + : cpuIncrease; const memBeyondError = - memIncrease && bMemStdDevBytes !== undefined ? - memAvgNum - (bMemBytes ?? 0) > bMemStdDevBytes - : memIncrease; - const cpuColor = - cpuBeyondError ? - (s: string) => pc.bold(pc.red(s)) + memIncrease && bMemStdDevBytes !== undefined + ? memAvgNum - (bMemBytes ?? 0) > bMemStdDevBytes + : memIncrease; + const cpuColor = cpuBeyondError + ? (s: string) => pc.bold(pc.red(s)) : (s: string) => (cpuIncrease ? pc.yellow(s) : pc.green(s)); - const memColor = - memBeyondError ? - (s: string) => pc.bold(pc.red(s)) + const memColor = memBeyondError + ? (s: string) => pc.bold(pc.red(s)) : (s: string) => (memIncrease ? pc.yellow(s) : pc.green(s)); table.push([ pc.cyan(titleOnly), @@ -351,9 +349,9 @@ for (const r of results) { table.push([ pc.cyan(titleOnly), pc.white(`${cpuAvgMs} ms ± ${cpuSdMs} ms`), - ...(baselineCompare ? - [pc.dim("-"), pc.white(`${memAvg} ± ${memSd}`), pc.dim("-")] - : [pc.white(`${memAvg} ± ${memSd}`)]), + ...(baselineCompare + ? [pc.dim("-"), pc.white(`${memAvg} ± ${memSd}`), pc.dim("-")] + : [pc.white(`${memAvg} ± ${memSd}`)]), ]); } } @@ -375,8 +373,9 @@ if (baselinePath) { avgMicros: r.totalCpuMicros, avgMs: Number((r.totalCpuMicros / 1000).toFixed(3)), stddevMicros: r.cpuStdDevMicros ?? 0, - stddevMs: - r.cpuStdDevMicros ? Number((r.cpuStdDevMicros / 1000).toFixed(3)) : 0, + stddevMs: r.cpuStdDevMicros + ? Number((r.cpuStdDevMicros / 1000).toFixed(3)) + : 0, }, memory: { avgBytesDelta: r.heapUsedBytesDelta,