diff --git a/.claude/settings.json b/.claude/settings.json index bb88ceca06..68b8f99cd9 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -6,7 +6,7 @@ "hooks": [ { "type": "command", - "command": "jq -r '.tool_input.file_path' | xargs ./node_modules/.bin/prettier --write --ignore-unknown", + "command": "jq -r '.tool_input.file_path' | xargs ./node_modules/.bin/oxfmt --no-error-on-unmatched-pattern", "timeout": 10 } ] diff --git a/.claude/skills/add-relevant-docs/SKILL.md b/.claude/skills/add-relevant-docs/SKILL.md index 0c2243f754..384b50ce09 100644 --- a/.claude/skills/add-relevant-docs/SKILL.md +++ b/.claude/skills/add-relevant-docs/SKILL.md @@ -84,7 +84,6 @@ Used on list pages and detail pages inside ``. ```tsx import { DocsPopover } from '~/components/DocsPopover' import { docLinks } from '~/util/links' - ; }>Page Title ``` @@ -116,7 +114,6 @@ For custom links not in `docLinks`, use `ModalLinks` and `ModalLink` directly: ```tsx import { ModalLink, ModalLinks } from '~/ui/lib/ModalLinks' import { links } from '~/util/links' - ; diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 0000000000..ec677e4140 --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,29 @@ +{ + "$schema": "./node_modules/oxfmt/configuration_schema.json", + "printWidth": 92, + "singleQuote": true, + "semi": false, + "trailingComma": "es5", + "experimentalTailwindcss": {}, + "experimentalSortImports": { + "internalPattern": ["~/", "app/"], + "partitionByComment": true, + "customGroups": [{ "groupName": "oxide", "elementNamePattern": ["@oxide/**"] }], + "groups": [ + "builtin", + "external", + "oxide", + "internal", + ["parent", "sibling", "index"], + "unknown" + ] + }, + "experimentalSortPackageJson": false, + "ignorePatterns": [ + "dist/**", + "coverage/**", + "templates/**", + "mockServiceWorker.js", + "index.html" + ] +} diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index b8ccc18ed3..0000000000 --- a/.prettierignore +++ /dev/null @@ -1,7 +0,0 @@ -# Add files here to ignore them from prettier formatting - -/dist -/coverage -/templates - -mockServiceWorker.js \ No newline at end of file diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index 899aa78c16..0000000000 --- a/.prettierrc.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at https://mozilla.org/MPL/2.0/. - * - * Copyright Oxide Computer Company - */ - -// eslint-disable-next-line no-default-export -export default { - // note: it seems like tailwind has to be last for it to work - plugins: ['@ianvs/prettier-plugin-sort-imports', 'prettier-plugin-tailwindcss'], - printWidth: 92, - singleQuote: true, - semi: false, - trailingComma: 'es5', // default changed to all in prettier 3, wanted to minimize diff - importOrder: [ - '', - '', - '^@oxide/(.*)$', - '', - '^~/(.*)$', - '^app/(.*)$', - '', - '^[./]', - ], - importOrderTypeScriptVersion: '5.2.2', - // ts and jsx are the default, last is needed for `await using` in bump-omicron.ts - importOrderParserPlugins: ['typescript', 'jsx', 'explicitResourceManagement'], -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 0df1f57cf2..4ea727f0aa 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,7 +1,3 @@ { - "recommendations": [ - "oxc.oxc-vscode", - "esbenp.prettier-vscode", - "bradlc.vscode-tailwindcss" - ] + "recommendations": ["oxc.oxc-vscode", "bradlc.vscode-tailwindcss"] } diff --git a/.vscode/settings.json b/.vscode/settings.json index b07c4b1f2c..48bbf12b81 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,10 @@ { - "[jsonc]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, - "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, - "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, - "[javascriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, - "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, - "[typescriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[jsonc]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, + "[json]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, + "[javascript]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, + "[javascriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, + "[typescript]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, + "[typescriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, "typescript.tsdk": "node_modules/typescript/lib", "editor.formatOnSave": true, "tailwindCSS.experimental.classRegex": ["classed.[a-z]+`([^`]*)`"], @@ -13,7 +13,7 @@ "explorer.fileNesting.expand": false, "explorer.fileNesting.patterns": { ".gitignore": ".gitattributes, .gitmodules, .gitmessage, .mailmap, .git-blame*", - "package.json": "package-lock.json, .babelrc, .editorconfig, .figma*, .github*, .huskyrc*, plopfile*, .oxlintrc*, .prettier*, .vscode*, playwright.config.*, prettier*, tsconfig.*, vitest.config.*, yarn*, postcss.config.*, tailwind.config.*, vite.config.ts, mockServiceWorker.js, vercel.json, .licenserc.yaml, LICENSE" + "package.json": "package-lock.json, .babelrc, .editorconfig, .figma*, .github*, .huskyrc*, plopfile*, .oxlintrc*, .oxfmtrc*, .prettier*, .vscode*, playwright.config.*, tsconfig.*, vitest.config.*, yarn*, postcss.config.*, tailwind.config.*, vite.config.ts, mockServiceWorker.js, vercel.json, .licenserc.yaml, LICENSE" }, "vite.browserType": "system", "vite.buildCommand": "npm run build", diff --git a/app/api/__tests__/client.spec.tsx b/app/api/__tests__/client.spec.tsx index b52c14d46f..e469bbb002 100644 --- a/app/api/__tests__/client.spec.tsx +++ b/app/api/__tests__/client.spec.tsx @@ -12,8 +12,8 @@ import { describe, expect, it, vi } from 'vitest' import { project } from '@oxide/api-mocks' import { api, q, useApiMutation } from '..' -import type { DiskCreate } from '../__generated__/Api' import { overrideOnce } from '../../../test/unit/server' +import type { DiskCreate } from '../__generated__/Api' // TODO: rethink whether these tests need to exist when they are so well-covered // by playwright tests diff --git a/app/api/__tests__/safety.spec.ts b/app/api/__tests__/safety.spec.ts index fe96cc27e1..35575bfc3f 100644 --- a/app/api/__tests__/safety.spec.ts +++ b/app/api/__tests__/safety.spec.ts @@ -8,6 +8,7 @@ import { execSync } from 'child_process' import fs from 'fs' import path from 'path' + import { expect, it } from 'vitest' it('Generated API client version matches API version specified for deployment', () => { diff --git a/app/api/index.ts b/app/api/index.ts index 66be84ea60..222bd778f1 100644 --- a/app/api/index.ts +++ b/app/api/index.ts @@ -8,7 +8,6 @@ // for convenience so we can do `import type { ApiTypes } from '@oxide/api'` import type * as ApiTypes from './__generated__/Api' - import './window.ts' export * from './client' diff --git a/app/hooks/use-key.ts b/app/hooks/use-key.ts index 35f9f7c23d..a438e11ffa 100644 --- a/app/hooks/use-key.ts +++ b/app/hooks/use-key.ts @@ -6,9 +6,7 @@ * Copyright Oxide Computer Company */ import Mousetrap from 'mousetrap' - import 'mousetrap/plugins/global-bind/mousetrap-global-bind' - import { useEffect, useRef } from 'react' type Key = Parameters[0] diff --git a/app/main.tsx b/app/main.tsx index 6bc7ecb541..62560963a3 100644 --- a/app/main.tsx +++ b/app/main.tsx @@ -23,7 +23,6 @@ import { routes } from './routes' // this is the only allowed css import // eslint-disable-next-line no-restricted-imports import '~/ui/styles/index.css' - import { SkipLink } from '~/ui/lib/SkipLink' if (process.env.SHA) { diff --git a/app/pages/project/instances/AntiAffinityCard.tsx b/app/pages/project/instances/AntiAffinityCard.tsx index 70fb93e667..abbe5602a2 100644 --- a/app/pages/project/instances/AntiAffinityCard.tsx +++ b/app/pages/project/instances/AntiAffinityCard.tsx @@ -146,9 +146,10 @@ export function AntiAffinityCard() { let disabledReason = undefined if (!instanceCan.addToAffinityGroup(instanceData)) { - disabledReason = + disabledReason = ( // prettier-ignore <>Only stopped instances can be added to a group + ) } else if (allGroups.items.length === 0) { disabledReason = 'No groups found' } else if (nonMemberGroups.length === 0) { diff --git a/package-lock.json b/package-lock.json index 9a68ecd67d..e51509a1a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56,7 +56,6 @@ "zustand": "^5.0.3" }, "devDependencies": { - "@ianvs/prettier-plugin-sort-imports": "^4.7.0", "@mswjs/http-middleware": "^0.10.3", "@oxide/openapi-gen-ts": "~0.14.0", "@playwright/test": "^1.56.1", @@ -80,11 +79,10 @@ "ip-num": "^1.5.1", "jsdom": "^25.0.1", "msw": "^2.7.5", + "oxfmt": "^0.31.0", "oxlint": "^1.35.0", "oxlint-tsgolint": "^0.10.0", "patch-package": "^8.0.0", - "prettier": "^3.6.2", - "prettier-plugin-tailwindcss": "^0.7.1", "resize-observer-polyfill": "^1.5.1", "tailwindcss": "^4.1.18", "tsx": "^4.19.2", @@ -187,7 +185,7 @@ "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.27.1", @@ -198,69 +196,16 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/generator": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.5.tgz", - "integrity": "sha512-3EwLFhZ38J4VyIP6WNtt2kUdW9dokXA9Cr4IVIFHuCpZ3H8/YFOl5JjZHisrn1fATPBmKKqXzDFvh9fUwHz6CQ==", - "devOptional": true, - "license": "MIT", - "dependencies": { - "@babel/parser": "^7.28.5", - "@babel/types": "^7.28.5", - "@jridgewell/gen-mapping": "^0.3.12", - "@jridgewell/trace-mapping": "^0.3.28", - "jsesc": "^3.0.2" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-globals": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", - "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", - "devOptional": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", - "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", - "devOptional": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-validator-identifier": { "version": "7.28.5", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", - "devOptional": true, + "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/parser": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", - "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", - "devOptional": true, - "license": "MIT", - "dependencies": { - "@babel/types": "^7.28.5" - }, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@babel/runtime": { "version": "7.27.0", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.0.tgz", @@ -273,54 +218,6 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/template": { - "version": "7.27.2", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", - "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", - "devOptional": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/parser": "^7.27.2", - "@babel/types": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/traverse": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", - "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", - "devOptional": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.28.5", - "@babel/helper-globals": "^7.28.0", - "@babel/parser": "^7.28.5", - "@babel/template": "^7.27.2", - "@babel/types": "^7.28.5", - "debug": "^4.3.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/types": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", - "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", - "devOptional": true, - "license": "MIT", - "dependencies": { - "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.28.5" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@bundled-es-modules/cookie": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@bundled-es-modules/cookie/-/cookie-2.0.1.tgz", @@ -1158,41 +1055,6 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@ianvs/prettier-plugin-sort-imports": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@ianvs/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.7.0.tgz", - "integrity": "sha512-soa2bPUJAFruLL4z/CnMfSEKGznm5ebz29fIa9PxYtu8HHyLKNE1NXAs6dylfw1jn/ilEIfO2oLLN6uAafb7DA==", - "devOptional": true, - "license": "Apache-2.0", - "dependencies": { - "@babel/generator": "^7.26.2", - "@babel/parser": "^7.26.2", - "@babel/traverse": "^7.25.9", - "@babel/types": "^7.26.0", - "semver": "^7.5.2" - }, - "peerDependencies": { - "@prettier/plugin-oxc": "^0.0.4", - "@vue/compiler-sfc": "2.7.x || 3.x", - "content-tag": "^4.0.0", - "prettier": "2 || 3 || ^4.0.0-0", - "prettier-plugin-ember-template-tag": "^2.1.0" - }, - "peerDependenciesMeta": { - "@prettier/plugin-oxc": { - "optional": true - }, - "@vue/compiler-sfc": { - "optional": true - }, - "content-tag": { - "optional": true - }, - "prettier-plugin-ember-template-tag": { - "optional": true - } - } - }, "node_modules/@inquirer/confirm": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.0.1.tgz", @@ -1564,6 +1426,329 @@ "dev": true, "license": "MIT" }, + "node_modules/@oxfmt/binding-android-arm-eabi": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-android-arm-eabi/-/binding-android-arm-eabi-0.31.0.tgz", + "integrity": "sha512-2A7s+TmsY7xF3yM0VWXq2YJ82Z7Rd7AOKraotyp58Fbk7q9cFZKczW6Zrz/iaMaJYfR/UHDxF3kMR11vayflug==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-android-arm64": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-android-arm64/-/binding-android-arm64-0.31.0.tgz", + "integrity": "sha512-3ppKOIf2lQv/BFhRyENWs/oarueppCEnPNo0Az2fKkz63JnenRuJPoHaGRrMHg1oFMUitdYy+YH29Cv5ISZWRQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-darwin-arm64": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-darwin-arm64/-/binding-darwin-arm64-0.31.0.tgz", + "integrity": "sha512-eFhNnle077DPRW6QPsBtl/wEzPoqgsB1LlzDRYbbztizObHdCo6Yo8T0hew9+HoYtnVMAP19zcRE7VG9OfqkMw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-darwin-x64": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-darwin-x64/-/binding-darwin-x64-0.31.0.tgz", + "integrity": "sha512-9UQSunEqokhR1WnlQCgJjkjw13y8PSnBvR98L78beGudTtNSaPMgwE7t/T0IPDibtDTxeEt+IQVKoQJ+8Jo6Lg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-freebsd-x64": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-freebsd-x64/-/binding-freebsd-x64-0.31.0.tgz", + "integrity": "sha512-FHo7ITkDku3kQ8/44nU6IGR1UNH22aqYM3LV2ytV40hWSMVllXFlM+xIVusT+I/SZBAtuFpwEWzyS+Jn4TkkAQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm-gnueabihf": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.31.0.tgz", + "integrity": "sha512-o1NiDlJDO9SOoY5wH8AyPUX60yQcOwu5oVuepi2eetArBp0iFF9qIH1uLlZsUu4QQ6ywqxcJSMjXCqGKC5uQFg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm-musleabihf": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.31.0.tgz", + "integrity": "sha512-VXiRxlBz7ivAIjhnnVBEYdjCQ66AsjM0YKxYAcliS0vPqhWKiScIT61gee0DPCVaw1XcuW8u19tfRwpfdYoreg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm64-gnu": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.31.0.tgz", + "integrity": "sha512-ryGPOtPViNcjs8N8Ap+wn7SM6ViiLzR9f0Pu7yprae+wjl6qwnNytzsUe7wcb+jT43DJYmvemFqE8tLVUavYbQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm64-musl": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.31.0.tgz", + "integrity": "sha512-BA3Euxp4bfd+AU3cKPgmHL44BbuBtmQTyAQoVDhX/nqPgbS/auoGp71uQBE4SAPTsQM/FcXxfKmCAdBS7ygF9w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-ppc64-gnu": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.31.0.tgz", + "integrity": "sha512-wIiKHulVWE9s6PSftPItucTviyCvjugwPqEyUl1VD47YsFqa5UtQTknBN49NODHJvBgO+eqqUodgRqmNMp3xyw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-riscv64-gnu": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.31.0.tgz", + "integrity": "sha512-6cM8Jt54bg9V/JoeUWhwnzHAS9Kvgc0oFsxql8PVs/njAGs0H4r+GEU4d+LXZPwI3b3ZUuzpbxlRJzer8KW+Cg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-riscv64-musl": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.31.0.tgz", + "integrity": "sha512-d+b05wXVRGaO6gobTaDqUdBvTXwYc0ro7k1UVC37k4VimLRQOzEZqTwVinqIX3LxTaFCmfO1yG00u9Pct3AKwQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-s390x-gnu": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.31.0.tgz", + "integrity": "sha512-Q+i2kj8e+two9jTZ3vxmxdNlg++qShe1ODL6xV4+Qt6SnJYniMxfcqphuXli4ft270kuHqd8HSVZs84CsSh1EA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-x64-gnu": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.31.0.tgz", + "integrity": "sha512-F2Z5ffj2okhaQBi92MylwZddKvFPBjrsZnGvvRmVvWRf8WJ0WkKUTtombDgRYNDgoW7GBUUrNNNgWhdB7kVjBA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-x64-musl": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-x64-musl/-/binding-linux-x64-musl-0.31.0.tgz", + "integrity": "sha512-Vz7dZQd1yhE5wTWujGanPmZgDtzLZS1PQoeMmUj89p4eMTmpIkvWaIr3uquJCbh8dQd5cPZrFvMmdDgcY5z+GA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-openharmony-arm64": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-openharmony-arm64/-/binding-openharmony-arm64-0.31.0.tgz", + "integrity": "sha512-nm0gus6R5V9tM1XaELiiIduUzmdBuCefkwToWKL4UtuFoMCGkigVQnbzHwPTGLVWOEF6wTQucFA8Fn1U8hxxVw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-arm64-msvc": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.31.0.tgz", + "integrity": "sha512-mMpvvPpoLD97Q2TMhjWDJSn+ib3kN+H+F4gq9p88zpeef6sqWc9djorJ3JXM2sOZMJ6KZ+1kSJfe0rkji74Pog==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-ia32-msvc": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.31.0.tgz", + "integrity": "sha512-zTngbPyrTDBYJFVQa4OJldM6w1Rqzi8c0/eFxAEbZRoj6x149GkyMkAY3kM+09ZhmszFitCML2S3p10NE2XmHA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-x64-msvc": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.31.0.tgz", + "integrity": "sha512-TB30D+iRLe6eUbc/utOA93+FNz5C6vXSb/TEhwvlODhKYZZSSKn/lFpYzZC7bdhx3a8m4Jq8fEUoCJ6lKnzdpA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, "node_modules/@oxide/design-system": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@oxide/design-system/-/design-system-4.1.0.tgz", @@ -7473,7 +7658,7 @@ "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -9544,19 +9729,6 @@ "node": ">=16" } }, - "node_modules/jsesc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", - "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", - "devOptional": true, - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -10308,7 +10480,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/msw": { @@ -10587,6 +10759,46 @@ "dev": true, "license": "MIT" }, + "node_modules/oxfmt": { + "version": "0.31.0", + "resolved": "https://registry.npmjs.org/oxfmt/-/oxfmt-0.31.0.tgz", + "integrity": "sha512-ukl7nojEuJUGbqR4ijC0Z/7a6BYpD4RxLS2UsyJKgbeZfx6TNrsa48veG0z2yQbhTx1nVnes4GIcqMn7n2jFtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinypool": "2.1.0" + }, + "bin": { + "oxfmt": "bin/oxfmt" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxfmt/binding-android-arm-eabi": "0.31.0", + "@oxfmt/binding-android-arm64": "0.31.0", + "@oxfmt/binding-darwin-arm64": "0.31.0", + "@oxfmt/binding-darwin-x64": "0.31.0", + "@oxfmt/binding-freebsd-x64": "0.31.0", + "@oxfmt/binding-linux-arm-gnueabihf": "0.31.0", + "@oxfmt/binding-linux-arm-musleabihf": "0.31.0", + "@oxfmt/binding-linux-arm64-gnu": "0.31.0", + "@oxfmt/binding-linux-arm64-musl": "0.31.0", + "@oxfmt/binding-linux-ppc64-gnu": "0.31.0", + "@oxfmt/binding-linux-riscv64-gnu": "0.31.0", + "@oxfmt/binding-linux-riscv64-musl": "0.31.0", + "@oxfmt/binding-linux-s390x-gnu": "0.31.0", + "@oxfmt/binding-linux-x64-gnu": "0.31.0", + "@oxfmt/binding-linux-x64-musl": "0.31.0", + "@oxfmt/binding-openharmony-arm64": "0.31.0", + "@oxfmt/binding-win32-arm64-msvc": "0.31.0", + "@oxfmt/binding-win32-ia32-msvc": "0.31.0", + "@oxfmt/binding-win32-x64-msvc": "0.31.0" + } + }, "node_modules/oxlint": { "version": "1.36.0", "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.36.0.tgz", @@ -11088,6 +11300,7 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -11098,85 +11311,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/prettier-plugin-tailwindcss": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.7.1.tgz", - "integrity": "sha512-Bzv1LZcuiR1Sk02iJTS1QzlFNp/o5l2p3xkopwOrbPmtMeh3fK9rVW5M3neBQzHq+kGKj/4LGQMTNcTH4NGPtQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=20.19" - }, - "peerDependencies": { - "@ianvs/prettier-plugin-sort-imports": "*", - "@prettier/plugin-hermes": "*", - "@prettier/plugin-oxc": "*", - "@prettier/plugin-pug": "*", - "@shopify/prettier-plugin-liquid": "*", - "@trivago/prettier-plugin-sort-imports": "*", - "@zackad/prettier-plugin-twig": "*", - "prettier": "^3.0", - "prettier-plugin-astro": "*", - "prettier-plugin-css-order": "*", - "prettier-plugin-jsdoc": "*", - "prettier-plugin-marko": "*", - "prettier-plugin-multiline-arrays": "*", - "prettier-plugin-organize-attributes": "*", - "prettier-plugin-organize-imports": "*", - "prettier-plugin-sort-imports": "*", - "prettier-plugin-svelte": "*" - }, - "peerDependenciesMeta": { - "@ianvs/prettier-plugin-sort-imports": { - "optional": true - }, - "@prettier/plugin-hermes": { - "optional": true - }, - "@prettier/plugin-oxc": { - "optional": true - }, - "@prettier/plugin-pug": { - "optional": true - }, - "@shopify/prettier-plugin-liquid": { - "optional": true - }, - "@trivago/prettier-plugin-sort-imports": { - "optional": true - }, - "@zackad/prettier-plugin-twig": { - "optional": true - }, - "prettier-plugin-astro": { - "optional": true - }, - "prettier-plugin-css-order": { - "optional": true - }, - "prettier-plugin-jsdoc": { - "optional": true - }, - "prettier-plugin-marko": { - "optional": true - }, - "prettier-plugin-multiline-arrays": { - "optional": true - }, - "prettier-plugin-organize-attributes": { - "optional": true - }, - "prettier-plugin-organize-imports": { - "optional": true - }, - "prettier-plugin-sort-imports": { - "optional": true - }, - "prettier-plugin-svelte": { - "optional": true - } - } - }, "node_modules/pretty-format": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", @@ -12534,6 +12668,16 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/tinypool": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-2.1.0.tgz", + "integrity": "sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.0.0 || >=22.0.0" + } + }, "node_modules/tinyrainbow": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.0.3.tgz", diff --git a/package.json b/package.json index 5df46b5fe6..d79e8a8ffa 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,9 @@ "visual:baseline": "./tools/generate-visual-baseline.sh", "visual:compare": "playwright test -c playwright.visual.config.ts", "lint": "oxlint --type-aware", - "fmt": "prettier --cache --write .", - "fmt:check": "prettier --check .", + "fmt": "oxfmt", + "fmt:check": "oxfmt --check", "openapi-gen-ts": "openapi-gen-ts", - "prettier": "prettier", "gen-api": "./tools/generate_api_client.sh", "postinstall": "patch-package", "prepare": "husky" @@ -81,7 +80,6 @@ "zustand": "^5.0.3" }, "devDependencies": { - "@ianvs/prettier-plugin-sort-imports": "^4.7.0", "@mswjs/http-middleware": "^0.10.3", "@oxide/openapi-gen-ts": "~0.14.0", "@playwright/test": "^1.56.1", @@ -105,11 +103,10 @@ "ip-num": "^1.5.1", "jsdom": "^25.0.1", "msw": "^2.7.5", + "oxfmt": "^0.31.0", "oxlint": "^1.35.0", "oxlint-tsgolint": "^0.10.0", "patch-package": "^8.0.0", - "prettier": "^3.6.2", - "prettier-plugin-tailwindcss": "^0.7.1", "resize-observer-polyfill": "^1.5.1", "tailwindcss": "^4.1.18", "tsx": "^4.19.2", diff --git a/test/unit/setup.ts b/test/unit/setup.ts index 482166d250..4f0909e735 100644 --- a/test/unit/setup.ts +++ b/test/unit/setup.ts @@ -11,7 +11,6 @@ * in this file does _not_ impact end-to-end tests. */ import '@testing-library/jest-dom/vitest' - import { cleanup } from '@testing-library/react' import { afterAll, afterEach, beforeAll } from 'vitest' diff --git a/tools/deno/api-diff.ts b/tools/deno/api-diff.ts index 5c5dd5aaa5..811e944af6 100755 --- a/tools/deno/api-diff.ts +++ b/tools/deno/api-diff.ts @@ -130,7 +130,7 @@ async function ensureClient(schemaPath: string, force: boolean) { if (force || !(await exists(clientPath))) { console.error(`Generating client...`) await $`npx @oxide/openapi-gen-ts@latest ${schemaPath} ${dir}` - await $`npx prettier --write --log-level error ${dir}` + await $`npx oxfmt ${dir}` } return clientPath } diff --git a/vite.config.ts b/vite.config.ts index dced1e0ab5..af4340ffcd 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,6 +7,7 @@ */ import { randomBytes } from 'crypto' import { resolve } from 'path' + import tailwindcss from '@tailwindcss/vite' import basicSsl from '@vitejs/plugin-basic-ssl' import react from '@vitejs/plugin-react-swc'