diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 0000000..c7b3d0a --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,14 @@ +{ + "$schema": "./node_modules/oxfmt/configuration_schema.json", + "printWidth": 100, + "singleQuote": true, + "sortPackageJson": false, + "ignorePatterns": [ + "node_modules", + "dist", + ".angular", + "pnpm-lock.yaml", + "extension/ui", + "docs/privacy-policy.html" + ] +} diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 00b7438..0000000 --- a/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -node_modules -dist -.angular -pnpm-lock.yaml -extension/ui -docs/privacy-policy.html diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index d6c16d7..0000000 --- a/.prettierrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "printWidth": 100, - "singleQuote": true, - "overrides": [ - { - "files": "*.html", - "options": { - "parser": "angular" - } - } - ] -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 77b3745..4792e3b 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,4 +1,4 @@ { // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 - "recommendations": ["angular.ng-template"] + "recommendations": ["angular.ng-template", "oxc.oxc-vscode"] } diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8dfb9da --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "editor.defaultFormatter": "oxc.oxc-vscode", + "editor.formatOnSave": true +} diff --git a/package.json b/package.json index d3eef9e..4dba960 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "test": "ng test", "test:devtools": "vitest run --root packages/ng-devtools", "typecheck": "tsc -p tsconfig.app.json --noEmit && tsc -p tsconfig.spec.json --noEmit && tsc -p app/tsconfig.json --noEmit && tsc -p packages/ng-devtools", - "format": "prettier --write .", - "format:check": "prettier --check .", + "format": "oxfmt", + "format:check": "oxfmt --check", "serve:ssr:angular-devtools": "node dist/angular-devtools/server/server.mjs", "devtools:dev": "vite --config app/vite.config.ts", "devtools:build": "vite build --config app/vite.config.ts", @@ -59,7 +59,7 @@ "@types/express": "^5.0.1", "@types/node": "^24.0.0", "jsdom": "^28.0.0", - "prettier": "^3.8.1", + "oxfmt": "0.71.0", "typescript": "~6.0.2", "vite": "^8.3.0", "vitest": "^4.0.8" diff --git a/packages/ng-devtools/src/forms-read.ts b/packages/ng-devtools/src/forms-read.ts index f8c7556..0ccf82d 100644 --- a/packages/ng-devtools/src/forms-read.ts +++ b/packages/ng-devtools/src/forms-read.ts @@ -1,7 +1,14 @@ type AnyRecord = Record; export type ErrorSource = - 'parse' | 'own' | 'tree' | 'async' | 'submission' | 'schema' | 'directive' | 'manual'; + | 'parse' + | 'own' + | 'tree' + | 'async' + | 'submission' + | 'schema' + | 'directive' + | 'manual'; export interface ErrorOrigin { source: ErrorSource; diff --git a/packages/ng-devtools/src/overlay.ts b/packages/ng-devtools/src/overlay.ts index cd0b8d7..b052658 100644 --- a/packages/ng-devtools/src/overlay.ts +++ b/packages/ng-devtools/src/overlay.ts @@ -196,7 +196,8 @@ export async function initOverlay(options: { baseURL?: string | string[] } = {}) lastRouterPayload = payload; lastRouterPushAt = Date.now(); const answer = (await my.rpc.call('push-router', report)) as - { hasConfig?: boolean } | undefined; + | { hasConfig?: boolean } + | undefined; if (answer?.hasConfig === false) sentGeneration = -1; else if (report['config']) sentGeneration = configTracker.generation; } catch { diff --git a/packages/ng-devtools/src/router.ts b/packages/ng-devtools/src/router.ts index 18d04b4..7d14e61 100644 --- a/packages/ng-devtools/src/router.ts +++ b/packages/ng-devtools/src/router.ts @@ -37,7 +37,12 @@ export interface RouterSnapshot { } export type NavigationOutcome = - 'pending' | 'succeeded' | 'redirected' | 'cancelled' | 'failed' | 'skipped'; + | 'pending' + | 'succeeded' + | 'redirected' + | 'cancelled' + | 'failed' + | 'skipped'; export interface GuardRun { guard: string; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0cb1241..c60cba7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -81,9 +81,9 @@ importers: jsdom: specifier: ^28.0.0 version: 28.1.0 - prettier: - specifier: ^3.8.1 - version: 3.9.8 + oxfmt: + specifier: 0.71.0 + version: 0.71.0 typescript: specifier: ~6.0.2 version: 6.0.3 @@ -1697,6 +1697,128 @@ packages: '@oxc-project/types@0.150.0': resolution: {integrity: sha512-rDS5/31E9HfPl/CIzGrn0DOlvBbXFseQ5URJ9sYMfstbKLD/c6Gm9vmRzRGDdAXyOIL4zmO37lc9RIwYqVruZw==} + '@oxfmt/binding-android-arm-eabi@0.71.0': + resolution: {integrity: sha512-l31EyBfB4egJeFua11aQFEUE9nnDtfpWCadqQovm0WL30t/yUHtdFl/5HyFXvd5xT8Ewh3U4TI9f30GowrQ1fw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxfmt/binding-android-arm64@0.71.0': + resolution: {integrity: sha512-E8q39SUZzSXQ08oZoFoTkxRADkdBNgL6De4qgZYr2O4JCunwqrZwAyCebxIF3yVHBafHM30WUkhTkDi+jNYZOw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxfmt/binding-darwin-arm64@0.71.0': + resolution: {integrity: sha512-pTteTrN88DicrmJ3DocBmpNDa6Umfh0iveEG8rnAlDFQpclmtDS7hnIvZbIEV9mDO0Ot1U0sjtoJQ1itd/ZMhQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxfmt/binding-darwin-x64@0.71.0': + resolution: {integrity: sha512-G5melRC3IiNEgXlNKJhSExJYQGAQIppHFp2cl/wFrqQcEwmc4k4TkrHaFTR29SDudjoW5AZq5cXPGJDqtlH/Yg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxfmt/binding-freebsd-x64@0.71.0': + resolution: {integrity: sha512-Hb1P5yKb9aiH2VSbm3Ml37mKjzqpunYet9krw/YK7V5JsAUJDQlju3Yk/dEqQvJD/usBvpi01Vbk9ZDNo0a8Cw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxfmt/binding-linux-arm-gnueabihf@0.71.0': + resolution: {integrity: sha512-r7n4JEO+rkp0kaP3ia+0hv6FzK3PQIHqaF0jxGuhjJ4JHVX9ZVRbgpDVDW+OloyuJsRWpWFDKIHe8gfl1p/4mQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm-musleabihf@0.71.0': + resolution: {integrity: sha512-EEynTF4nakgqDhVCmd3cHQCmTcw0BM8ea6eHigTdtZ3yxdsBNv+dYkt+OpDDZx1n/jzjI7J+Ht7IgkqFWuJUxQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm64-gnu@0.71.0': + resolution: {integrity: sha512-7VgJIrywCwR/G6YMv+HqsccUt8Z4q4mbM2xR+Ry/6AeMk4pCmZ9aO4Srd3mmrvVu8PsCZGP7oHEHSXWTmyloaQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-arm64-musl@0.71.0': + resolution: {integrity: sha512-AOCaminv/+fhinUXKvtPZT4POhNYmN9GfvaJdgJa1AbvuzClWGwDIXfJg8eu3sYaVL2B68jNvmS7LZGAYa0z3A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-linux-ppc64-gnu@0.71.0': + resolution: {integrity: sha512-0SHxuaa4QRLM7jfsd8wc6L7KdLg+FR6/ah9k1eAvcrK/Sni7oxchMvsjwUsyakVAta+wBVDkjJTr7/RFU0uUGA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-riscv64-gnu@0.71.0': + resolution: {integrity: sha512-UNKj1+rPorTK6uSlQzpN96vDNbHbL/63zcpznweo0ImQdkDdtQCS7G3puxX++2cESPKT2B56Y6DICUmFTJde5A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-riscv64-musl@0.71.0': + resolution: {integrity: sha512-5cVXKj7a0mWu7GU6/bZgNyv+KtLgM5S9cnT26Os2/abj8pK/bklHsbdYEHGLLniGjNYkyzwem8mZciPCaDtilw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-linux-s390x-gnu@0.71.0': + resolution: {integrity: sha512-lNpcMuZvyU1V/CY5h19hac03m4E4PLSYRckcxZOynSPojI4Mwt6nEu9wT/gVf0bclH3xGEWjwqApnSTgjkd2oA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-x64-gnu@0.71.0': + resolution: {integrity: sha512-5/Z6pUewQpknXqC4/ykK6Zc6RiteAnPem1Ci7K1RZLVF6w6MMjwHjR4vsjijW4Czidgv7HKeVglGjElADliT9w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-x64-musl@0.71.0': + resolution: {integrity: sha512-uVdG2N/4GEbOeljpQ+xv+NeEwJWJGj0WaxSiSYnoiqIYy3RWrWd3rGUmxWXP1A8+ferNvvwFoDAtvgsDUvBuSw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-openharmony-arm64@0.71.0': + resolution: {integrity: sha512-1LwEZmSDRFKeBaGd/Hgj2xI3SmgGFpF4YtgkSx0sTYdTiZfHWbcFvRIBjL1YiDNdQd9Khda3Ij8CoqBULjskDg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxfmt/binding-win32-arm64-msvc@0.71.0': + resolution: {integrity: sha512-5tplmkeMXmza3PUptJQy25wCPJbIAg5g5r7zs+DI+7eEYOqbY+7roMdSH2zbDvv1Pb4oTDJ6NWYx9IRxBxXwhQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxfmt/binding-win32-ia32-msvc@0.71.0': + resolution: {integrity: sha512-T2LWgh3Vx4PYDjtcqRRGDyCsVxeF/VE5xTpUQiCm65bNLwMpRnJYj6Hlkf6qRM3+jxCIOqHD1kVHNQCCiAVMNQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxfmt/binding-win32-x64-msvc@0.71.0': + resolution: {integrity: sha512-L06SVp7Hu1EQTkh3+PHnKK26dxVbEpOG2InMwCooTE4MA437b5FgfTleCCiGn4ykISHnHU6UHaIg7SiMO7rBHA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + '@parcel/watcher-android-arm64@2.6.0': resolution: {integrity: sha512-trgpLSCKRC/huFjXX/Smh+0sWe4+YtKfktIToiMl59ghz7z+qkH6kMvNnUbLyRs9N11t8l4svSCs1+5B3rOAhA==} engines: {node: '>= 10.0.0'} @@ -3927,6 +4049,19 @@ packages: resolution: {integrity: sha512-kKR+jPiRJYJDexVoziIg/FVGvr1fT1FZSSJOk6tVoMKKSlsf1Cso+cgGCJkOEDWOP174vRntCPFKg+AS7InWvw==} engines: {node: ^20.19.0 || >=22.12.0} + oxfmt@0.71.0: + resolution: {integrity: sha512-lUPUl0d/+Io5pDrsPXWs6rB4N/bpB78oj9CTDpnbulfDz+0r3XXcHPlQ7kRPJ2GjIT4nX+/mcqunOeP9BvsEtg==} + 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 + package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} @@ -4017,11 +4152,6 @@ packages: resolution: {integrity: sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==} engines: {node: '>=20'} - prettier@3.9.8: - resolution: {integrity: sha512-WRFq3Wn3WId7LLROfMLdH7xaFr2jR62wU8nLO6rQUOLOxNZUviyJQs1M0iIhLexSFy+L+w0ch66wtoO2jRjG0A==} - engines: {node: '>=14'} - hasBin: true - pretty-bytes@7.2.0: resolution: {integrity: sha512-T2kroepGB5DRVbkN/nOpW03+VRWqdtJhZNuCW3wYk3chdPjgi4GcTBOaxWfHq1MIM0ypidxsSWbQaAiRpxnXmg==} engines: {node: '>=20'} @@ -4421,6 +4551,10 @@ packages: resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} engines: {node: '>=12.0.0'} + tinypool@2.2.0: + resolution: {integrity: sha512-jBrmx4lYmaC9k/mgPbylxs7kBUxHtD8256up+HjLaDFfXScKJQyil+SWXSvhAtT7XHo+yTVlpB81PGmHP8oLSQ==} + engines: {node: ^20.0.0 || >=22.0.0} + tinyrainbow@3.1.1: resolution: {integrity: sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw==} engines: {node: '>=14.0.0'} @@ -6227,6 +6361,63 @@ snapshots: '@oxc-project/types@0.150.0': {} + '@oxfmt/binding-android-arm-eabi@0.71.0': + optional: true + + '@oxfmt/binding-android-arm64@0.71.0': + optional: true + + '@oxfmt/binding-darwin-arm64@0.71.0': + optional: true + + '@oxfmt/binding-darwin-x64@0.71.0': + optional: true + + '@oxfmt/binding-freebsd-x64@0.71.0': + optional: true + + '@oxfmt/binding-linux-arm-gnueabihf@0.71.0': + optional: true + + '@oxfmt/binding-linux-arm-musleabihf@0.71.0': + optional: true + + '@oxfmt/binding-linux-arm64-gnu@0.71.0': + optional: true + + '@oxfmt/binding-linux-arm64-musl@0.71.0': + optional: true + + '@oxfmt/binding-linux-ppc64-gnu@0.71.0': + optional: true + + '@oxfmt/binding-linux-riscv64-gnu@0.71.0': + optional: true + + '@oxfmt/binding-linux-riscv64-musl@0.71.0': + optional: true + + '@oxfmt/binding-linux-s390x-gnu@0.71.0': + optional: true + + '@oxfmt/binding-linux-x64-gnu@0.71.0': + optional: true + + '@oxfmt/binding-linux-x64-musl@0.71.0': + optional: true + + '@oxfmt/binding-openharmony-arm64@0.71.0': + optional: true + + '@oxfmt/binding-win32-arm64-msvc@0.71.0': + optional: true + + '@oxfmt/binding-win32-ia32-msvc@0.71.0': + optional: true + + '@oxfmt/binding-win32-x64-msvc@0.71.0': + optional: true + '@parcel/watcher-android-arm64@2.6.0': optional: true @@ -8304,6 +8495,30 @@ snapshots: '@oxc-parser/binding-win32-ia32-msvc': 0.142.0 '@oxc-parser/binding-win32-x64-msvc': 0.142.0 + oxfmt@0.71.0: + dependencies: + tinypool: 2.2.0 + optionalDependencies: + '@oxfmt/binding-android-arm-eabi': 0.71.0 + '@oxfmt/binding-android-arm64': 0.71.0 + '@oxfmt/binding-darwin-arm64': 0.71.0 + '@oxfmt/binding-darwin-x64': 0.71.0 + '@oxfmt/binding-freebsd-x64': 0.71.0 + '@oxfmt/binding-linux-arm-gnueabihf': 0.71.0 + '@oxfmt/binding-linux-arm-musleabihf': 0.71.0 + '@oxfmt/binding-linux-arm64-gnu': 0.71.0 + '@oxfmt/binding-linux-arm64-musl': 0.71.0 + '@oxfmt/binding-linux-ppc64-gnu': 0.71.0 + '@oxfmt/binding-linux-riscv64-gnu': 0.71.0 + '@oxfmt/binding-linux-riscv64-musl': 0.71.0 + '@oxfmt/binding-linux-s390x-gnu': 0.71.0 + '@oxfmt/binding-linux-x64-gnu': 0.71.0 + '@oxfmt/binding-linux-x64-musl': 0.71.0 + '@oxfmt/binding-openharmony-arm64': 0.71.0 + '@oxfmt/binding-win32-arm64-msvc': 0.71.0 + '@oxfmt/binding-win32-ia32-msvc': 0.71.0 + '@oxfmt/binding-win32-x64-msvc': 0.71.0 + package-json-from-dist@1.0.1: {} parse5-html-rewriting-stream@8.0.1: @@ -8384,8 +8599,6 @@ snapshots: powershell-utils@0.2.1: {} - prettier@3.9.8: {} - pretty-bytes@7.2.0: {} prismjs@1.30.0: {} @@ -8864,6 +9077,8 @@ snapshots: fdir: 6.5.0(picomatch@4.0.7) picomatch: 4.0.7 + tinypool@2.2.0: {} + tinyrainbow@3.1.1: {} tldts-core@7.4.13: {}