From 733b697ee2888769e23d6cf8b17f5da86b2507d8 Mon Sep 17 00:00:00 2001 From: lonelyhentxi Date: Fri, 31 Jan 2025 02:02:07 +0800 Subject: [PATCH] fix: add cli --- package.json | 15 +- pnpm-lock.yaml | 614 +++++++++++++++++- scripts/cli.ts | 19 + scripts/code-transform.spec.ts | 35 + scripts/code-transform.ts | 113 ++++ src/iframe/check-session.service.spec.ts | 13 +- src/iframe/check-session.service.ts | 16 +- .../refresh-session-iframe.service.spec.ts | 9 +- src/utils/url/url.service.spec.ts | 23 +- tsconfig.json | 3 + tsconfig.scripts.json | 12 + 11 files changed, 818 insertions(+), 54 deletions(-) create mode 100644 scripts/cli.ts create mode 100644 scripts/code-transform.spec.ts create mode 100644 scripts/code-transform.ts create mode 100644 tsconfig.scripts.json diff --git a/package.json b/package.json index 6fa083a..0a3e117 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,8 @@ "publish": "npm run build && npm publish ./dist", "coverage": "vitest run --coverage", "lint": "ultracite lint", - "format": "ultracite format" + "format": "ultracite format", + "cli": "tsx scripts/cli.ts" }, "dependencies": { "@ngify/http": "^2.0.4", @@ -43,18 +44,24 @@ "rxjs": "^7.4.0||>=8.0.0" }, "devDependencies": { + "@biomejs/biome": "1.9.4", + "@biomejs/js-api": "0.7.1", + "@biomejs/wasm-nodejs": "^1.9.4", "@evilmartians/lefthook": "^1.0.3", "@playwright/test": "^1.49.1", "@rslib/core": "^0.3.1", "@types/lodash-es": "^4.17.12", - "@types/node": "^22.10.1", "@vitest/coverage-v8": "^3.0.1", + "commander": "^13.1.0", "lodash-es": "^4.17.21", + "oxc-parser": "^0.48.1", + "oxc-walker": "^0.2.2", "rfc4648": "^1.5.0", + "rxjs": "^7.4.0", + "tsx": "^4.19.2", "typescript": "^5.7.3", "ultracite": "^4.1.15", - "vitest": "^3.0.1", - "rxjs": "^7.4.0" + "vitest": "^3.0.1" }, "keywords": [ "rxjs", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 003f594..36e0d79 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,6 +18,15 @@ importers: specifier: ^0.2.2 version: 0.2.2 devDependencies: + '@biomejs/biome': + specifier: 1.9.4 + version: 1.9.4 + '@biomejs/js-api': + specifier: 0.7.1 + version: 0.7.1(@biomejs/wasm-nodejs@1.9.4) + '@biomejs/wasm-nodejs': + specifier: ^1.9.4 + version: 1.9.4 '@evilmartians/lefthook': specifier: ^1.0.3 version: 1.10.7 @@ -30,21 +39,30 @@ importers: '@types/lodash-es': specifier: ^4.17.12 version: 4.17.12 - '@types/node': - specifier: ^22.10.1 - version: 22.10.7 '@vitest/coverage-v8': specifier: ^3.0.1 - version: 3.0.1(vitest@3.0.1(@types/node@22.10.7)) + version: 3.0.1(vitest@3.0.1(@types/node@22.10.7)(tsx@4.19.2)) + commander: + specifier: ^13.1.0 + version: 13.1.0 lodash-es: specifier: ^4.17.21 version: 4.17.21 + oxc-parser: + specifier: ^0.48.1 + version: 0.48.1 + oxc-walker: + specifier: ^0.2.2 + version: 0.2.2(oxc-parser@0.48.1) rfc4648: specifier: ^1.5.0 version: 1.5.4 rxjs: specifier: ^7.4.0 version: 7.8.1 + tsx: + specifier: ^4.19.2 + version: 4.19.2 typescript: specifier: ^5.7.3 version: 5.7.3 @@ -53,7 +71,7 @@ importers: version: 4.1.15 vitest: specifier: ^3.0.1 - version: 3.0.1(@types/node@22.10.7) + version: 3.0.1(@types/node@22.10.7)(tsx@4.19.2) packages: @@ -82,102 +100,274 @@ packages: resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} + '@biomejs/biome@1.9.4': + resolution: {integrity: sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==} + engines: {node: '>=14.21.3'} + hasBin: true + + '@biomejs/cli-darwin-arm64@1.9.4': + resolution: {integrity: sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [darwin] + + '@biomejs/cli-darwin-x64@1.9.4': + resolution: {integrity: sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [darwin] + + '@biomejs/cli-linux-arm64-musl@1.9.4': + resolution: {integrity: sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + + '@biomejs/cli-linux-arm64@1.9.4': + resolution: {integrity: sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + + '@biomejs/cli-linux-x64-musl@1.9.4': + resolution: {integrity: sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + + '@biomejs/cli-linux-x64@1.9.4': + resolution: {integrity: sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + + '@biomejs/cli-win32-arm64@1.9.4': + resolution: {integrity: sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [win32] + + '@biomejs/cli-win32-x64@1.9.4': + resolution: {integrity: sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [win32] + + '@biomejs/js-api@0.7.1': + resolution: {integrity: sha512-VFdgFFZWcyCQxZcAasyv8Enpexn4CblMdWmr6izLYHTLcbd+z9x/LuKU71qnmClABfnYqZjiY7c8DKTVri3Ajw==} + peerDependencies: + '@biomejs/wasm-bundler': ^1.9.2 + '@biomejs/wasm-nodejs': ^1.9.2 + '@biomejs/wasm-web': ^1.9.2 + peerDependenciesMeta: + '@biomejs/wasm-bundler': + optional: true + '@biomejs/wasm-nodejs': + optional: true + '@biomejs/wasm-web': + optional: true + + '@biomejs/wasm-nodejs@1.9.4': + resolution: {integrity: sha512-ZqNlhKcZW6MW1LxWIOfh9YVrBykvzyFad3bOh6JJFraDnNa3NXboRDiaI8dmrbb0ZHXCU1Tsq6WQsKV2Vpp5dw==} + + '@esbuild/aix-ppc64@0.23.1': + resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + '@esbuild/aix-ppc64@0.24.2': resolution: {integrity: sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] + '@esbuild/android-arm64@0.23.1': + resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm64@0.24.2': resolution: {integrity: sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==} engines: {node: '>=18'} cpu: [arm64] os: [android] + '@esbuild/android-arm@0.23.1': + resolution: {integrity: sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + '@esbuild/android-arm@0.24.2': resolution: {integrity: sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==} engines: {node: '>=18'} cpu: [arm] os: [android] + '@esbuild/android-x64@0.23.1': + resolution: {integrity: sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + '@esbuild/android-x64@0.24.2': resolution: {integrity: sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==} engines: {node: '>=18'} cpu: [x64] os: [android] + '@esbuild/darwin-arm64@0.23.1': + resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-arm64@0.24.2': resolution: {integrity: sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] + '@esbuild/darwin-x64@0.23.1': + resolution: {integrity: sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + '@esbuild/darwin-x64@0.24.2': resolution: {integrity: sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==} engines: {node: '>=18'} cpu: [x64] os: [darwin] + '@esbuild/freebsd-arm64@0.23.1': + resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-arm64@0.24.2': resolution: {integrity: sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-x64@0.23.1': + resolution: {integrity: sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + '@esbuild/freebsd-x64@0.24.2': resolution: {integrity: sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] + '@esbuild/linux-arm64@0.23.1': + resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm64@0.24.2': resolution: {integrity: sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==} engines: {node: '>=18'} cpu: [arm64] os: [linux] + '@esbuild/linux-arm@0.23.1': + resolution: {integrity: sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + '@esbuild/linux-arm@0.24.2': resolution: {integrity: sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==} engines: {node: '>=18'} cpu: [arm] os: [linux] + '@esbuild/linux-ia32@0.23.1': + resolution: {integrity: sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-ia32@0.24.2': resolution: {integrity: sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==} engines: {node: '>=18'} cpu: [ia32] os: [linux] + '@esbuild/linux-loong64@0.23.1': + resolution: {integrity: sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-loong64@0.24.2': resolution: {integrity: sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==} engines: {node: '>=18'} cpu: [loong64] os: [linux] + '@esbuild/linux-mips64el@0.23.1': + resolution: {integrity: sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-mips64el@0.24.2': resolution: {integrity: sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] + '@esbuild/linux-ppc64@0.23.1': + resolution: {integrity: sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-ppc64@0.24.2': resolution: {integrity: sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] + '@esbuild/linux-riscv64@0.23.1': + resolution: {integrity: sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-riscv64@0.24.2': resolution: {integrity: sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] + '@esbuild/linux-s390x@0.23.1': + resolution: {integrity: sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-s390x@0.24.2': resolution: {integrity: sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==} engines: {node: '>=18'} cpu: [s390x] os: [linux] + '@esbuild/linux-x64@0.23.1': + resolution: {integrity: sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + '@esbuild/linux-x64@0.24.2': resolution: {integrity: sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==} engines: {node: '>=18'} @@ -190,42 +380,84 @@ packages: cpu: [arm64] os: [netbsd] + '@esbuild/netbsd-x64@0.23.1': + resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + '@esbuild/netbsd-x64@0.24.2': resolution: {integrity: sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] + '@esbuild/openbsd-arm64@0.23.1': + resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + '@esbuild/openbsd-arm64@0.24.2': resolution: {integrity: sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] + '@esbuild/openbsd-x64@0.23.1': + resolution: {integrity: sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + '@esbuild/openbsd-x64@0.24.2': resolution: {integrity: sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] + '@esbuild/sunos-x64@0.23.1': + resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + '@esbuild/sunos-x64@0.24.2': resolution: {integrity: sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==} engines: {node: '>=18'} cpu: [x64] os: [sunos] + '@esbuild/win32-arm64@0.23.1': + resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-arm64@0.24.2': resolution: {integrity: sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==} engines: {node: '>=18'} cpu: [arm64] os: [win32] + '@esbuild/win32-ia32@0.23.1': + resolution: {integrity: sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-ia32@0.24.2': resolution: {integrity: sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==} engines: {node: '>=18'} cpu: [ia32] os: [win32] + '@esbuild/win32-x64@0.23.1': + resolution: {integrity: sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@esbuild/win32-x64@0.24.2': resolution: {integrity: sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==} engines: {node: '>=18'} @@ -286,6 +518,49 @@ packages: peerDependencies: rxjs: ^7.0.0 + '@oxc-parser/binding-darwin-arm64@0.48.1': + resolution: {integrity: sha512-qCpCWt+8B1c76KndRgTQmCswsd1Nx+7/8Rm/JCee+tSB+emW/EcJEP5cIHvnUAueqlF0ZUuQ9LQWdPNN2n5SiQ==} + cpu: [arm64] + os: [darwin] + + '@oxc-parser/binding-darwin-x64@0.48.1': + resolution: {integrity: sha512-Uf2IYgKizJEiUoDi3u6NrQTH6WvNFj0XS3g1KC3/rXdM/UQghTo4dhe1oll/NdrQ5i/EuY0qRwdOxPdxHr50pQ==} + cpu: [x64] + os: [darwin] + + '@oxc-parser/binding-linux-arm64-gnu@0.48.1': + resolution: {integrity: sha512-5rxOgUkXpp3q988y86HMTk8+Jw8AdILpHzS3MPTptGySXrv/7g41Xp+KVwLzd8FQpu0fMCy9VAzcBMwCe+aojg==} + cpu: [arm64] + os: [linux] + + '@oxc-parser/binding-linux-arm64-musl@0.48.1': + resolution: {integrity: sha512-NqVaud/N3jOJiwt7afrXG+b6guqglPuTIvuQnhmokq0i8q0fQUgmg0/ZdNI5bu941wijmCC+eCg52H5jD1iaHA==} + cpu: [arm64] + os: [linux] + + '@oxc-parser/binding-linux-x64-gnu@0.48.1': + resolution: {integrity: sha512-x+THqLaXVwgi6+YxNz9KmxdfIed89UNr1Ez1IsOew/Rg57RcX9XP4rT9fcjAZ9GM3krszkYAVq2KxP471Dgv8g==} + cpu: [x64] + os: [linux] + + '@oxc-parser/binding-linux-x64-musl@0.48.1': + resolution: {integrity: sha512-m6XDdH6kEQsM3DAOK+jIN9hMAM9bHPQfdw0Ldbg6W1M9S8vvAvz0nQHkLF2ChBBV1HkTjLolK40sR0W6BGCYww==} + cpu: [x64] + os: [linux] + + '@oxc-parser/binding-win32-arm64-msvc@0.48.1': + resolution: {integrity: sha512-Zxfnuea6THWQiGmnLyJXlpi3bmN0lcWf7QYLVr71ZaTs9S14eOFwHuH2efZ7zcto+a8osysQT9xMDvdIkiqGZA==} + cpu: [arm64] + os: [win32] + + '@oxc-parser/binding-win32-x64-msvc@0.48.1': + resolution: {integrity: sha512-klialzt6wZOzGl2W+tAKPJAGu0vO3iqPGd13+ZY+VCC2xM+EA5/mYuv+NEK1WDFSxlmz/898Puhqk4teCbxZug==} + cpu: [x64] + os: [win32] + + '@oxc-project/types@0.48.1': + resolution: {integrity: sha512-/CoLnZmEI+FmpMvF8vOdVpQddt9Me+paM3c56m5jMZ7EMaU1TQFCrNH0JZr1Cwn4wKb/ALY32HPaCtA8dvgkrw==} + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -522,6 +797,11 @@ packages: '@vitest/utils@3.0.1': resolution: {integrity: sha512-i+Gm61rfIeSitPUsu4ZcWqucfb18ShAanRpOG6KlXfd1j6JVK5XxO2Z6lEmfjMnAQRIvvLtJ3JByzDTv347e8w==} + acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} + engines: {node: '>=0.4.0'} + hasBin: true + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -574,6 +854,13 @@ packages: resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} engines: {node: '>=18'} + commander@13.1.0: + resolution: {integrity: sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==} + engines: {node: '>=18'} + + confbox@0.1.8: + resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} + core-js@3.39.0: resolution: {integrity: sha512-raM0ew0/jJUqkJ0E6e8UDtl+y/7ktFivgWvqw8dNSQeNWoSDLvQ1H/RN3aPXB9tBd4/FhyR4RDPGhsNIMsAn7g==} @@ -606,6 +893,11 @@ packages: es-module-lexer@1.6.0: resolution: {integrity: sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==} + esbuild@0.23.1: + resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==} + engines: {node: '>=18'} + hasBin: true + esbuild@0.24.2: resolution: {integrity: sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==} engines: {node: '>=18'} @@ -640,6 +932,9 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + get-tsconfig@4.10.0: + resolution: {integrity: sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==} + glob@10.4.5: resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true @@ -695,6 +990,9 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + magic-regexp@0.8.0: + resolution: {integrity: sha512-lOSLWdE156csDYwCTIGiAymOLN7Epu/TU5e/oAnISZfU6qP+pgjkE+xbVjVn3yLPKN8n1G2yIAYTAM5KRk6/ow==} + magic-string@0.30.17: resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} @@ -713,6 +1011,9 @@ packages: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} + mlly@1.7.4: + resolution: {integrity: sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==} + ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -721,6 +1022,14 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + oxc-parser@0.48.1: + resolution: {integrity: sha512-06Y1yBSlUP5j7wdcyLdjXUe3kBw1QYu7E4vowi59IcwZ7jc/iUCMXxqnSoJLdqex3fZAjCnuzW7/gPi3h5bumA==} + + oxc-walker@0.2.2: + resolution: {integrity: sha512-beQrIxhRrJigGgct4HJ2UtZv8HHA5553rAhD5rydHPPfLHnVzxEHNRiop8VU3zmhL6COMq4XxLVHnTMXiwNGxQ==} + peerDependencies: + oxc-parser: ^0.39.0 || ^0.40.0 + package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} @@ -746,6 +1055,9 @@ packages: resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} engines: {node: '>=12'} + pkg-types@1.3.1: + resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} + playwright-core@1.49.1: resolution: {integrity: sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==} engines: {node: '>=18'} @@ -763,6 +1075,13 @@ packages: reflect-metadata@0.2.2: resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==} + regexp-tree@0.1.27: + resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==} + hasBin: true + + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + rfc4648@1.5.4: resolution: {integrity: sha512-rRg/6Lb+IGfJqO05HZkN50UtY7K/JhxJag1kP23+zyMfrvoB0B7RWv06MbOzoc79RgCdNTiUaNsTT1AJZ7Z+cg==} @@ -866,11 +1185,22 @@ packages: tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + tsx@4.19.2: + resolution: {integrity: sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==} + engines: {node: '>=18.0.0'} + hasBin: true + + type-level-regexp@0.1.17: + resolution: {integrity: sha512-wTk4DH3cxwk196uGLK/E9pE45aLfeKJacKmcEgEOA/q5dnPGNxXt0cfYdFxb57L+sEpf1oJH4Dnx/pnRcku9jg==} + typescript@5.7.3: resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==} engines: {node: '>=14.17'} hasBin: true + ufo@1.5.4: + resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} + ultracite@4.1.15: resolution: {integrity: sha512-sIFmJ91rSF3nSMux83V8g9355JIJ40AJq82ymdYriv8/opbTizjlTgDNuXKhgyFP3/YmmyhqCYK6ACVHZXMk6Q==} hasBin: true @@ -878,6 +1208,10 @@ packages: undici-types@6.20.0: resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} + unplugin@1.16.1: + resolution: {integrity: sha512-4/u/j4FrCKdi17jaxuJA0jClGxB1AvU2hw/IuayPc4ay1XGaJs/rbb4v5WKwAjNifjmXK9PIFyuPiaK8azyR9w==} + engines: {node: '>=14.0.0'} + vite-node@3.0.1: resolution: {integrity: sha512-PoH9mCNsSZQXl3gdymM5IE4WR0k0WbnFd89nAyyDvltF2jVGdFcI8vpB1PBdKTcjAR7kkYiHSlIO68X/UT8Q1A==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} @@ -948,6 +1282,9 @@ packages: jsdom: optional: true + webpack-virtual-modules@0.6.2: + resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==} + which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -988,78 +1325,191 @@ snapshots: '@bcoe/v8-coverage@1.0.2': {} + '@biomejs/biome@1.9.4': + optionalDependencies: + '@biomejs/cli-darwin-arm64': 1.9.4 + '@biomejs/cli-darwin-x64': 1.9.4 + '@biomejs/cli-linux-arm64': 1.9.4 + '@biomejs/cli-linux-arm64-musl': 1.9.4 + '@biomejs/cli-linux-x64': 1.9.4 + '@biomejs/cli-linux-x64-musl': 1.9.4 + '@biomejs/cli-win32-arm64': 1.9.4 + '@biomejs/cli-win32-x64': 1.9.4 + + '@biomejs/cli-darwin-arm64@1.9.4': + optional: true + + '@biomejs/cli-darwin-x64@1.9.4': + optional: true + + '@biomejs/cli-linux-arm64-musl@1.9.4': + optional: true + + '@biomejs/cli-linux-arm64@1.9.4': + optional: true + + '@biomejs/cli-linux-x64-musl@1.9.4': + optional: true + + '@biomejs/cli-linux-x64@1.9.4': + optional: true + + '@biomejs/cli-win32-arm64@1.9.4': + optional: true + + '@biomejs/cli-win32-x64@1.9.4': + optional: true + + '@biomejs/js-api@0.7.1(@biomejs/wasm-nodejs@1.9.4)': + optionalDependencies: + '@biomejs/wasm-nodejs': 1.9.4 + + '@biomejs/wasm-nodejs@1.9.4': {} + + '@esbuild/aix-ppc64@0.23.1': + optional: true + '@esbuild/aix-ppc64@0.24.2': optional: true + '@esbuild/android-arm64@0.23.1': + optional: true + '@esbuild/android-arm64@0.24.2': optional: true + '@esbuild/android-arm@0.23.1': + optional: true + '@esbuild/android-arm@0.24.2': optional: true + '@esbuild/android-x64@0.23.1': + optional: true + '@esbuild/android-x64@0.24.2': optional: true + '@esbuild/darwin-arm64@0.23.1': + optional: true + '@esbuild/darwin-arm64@0.24.2': optional: true + '@esbuild/darwin-x64@0.23.1': + optional: true + '@esbuild/darwin-x64@0.24.2': optional: true + '@esbuild/freebsd-arm64@0.23.1': + optional: true + '@esbuild/freebsd-arm64@0.24.2': optional: true + '@esbuild/freebsd-x64@0.23.1': + optional: true + '@esbuild/freebsd-x64@0.24.2': optional: true + '@esbuild/linux-arm64@0.23.1': + optional: true + '@esbuild/linux-arm64@0.24.2': optional: true + '@esbuild/linux-arm@0.23.1': + optional: true + '@esbuild/linux-arm@0.24.2': optional: true + '@esbuild/linux-ia32@0.23.1': + optional: true + '@esbuild/linux-ia32@0.24.2': optional: true + '@esbuild/linux-loong64@0.23.1': + optional: true + '@esbuild/linux-loong64@0.24.2': optional: true + '@esbuild/linux-mips64el@0.23.1': + optional: true + '@esbuild/linux-mips64el@0.24.2': optional: true + '@esbuild/linux-ppc64@0.23.1': + optional: true + '@esbuild/linux-ppc64@0.24.2': optional: true + '@esbuild/linux-riscv64@0.23.1': + optional: true + '@esbuild/linux-riscv64@0.24.2': optional: true + '@esbuild/linux-s390x@0.23.1': + optional: true + '@esbuild/linux-s390x@0.24.2': optional: true + '@esbuild/linux-x64@0.23.1': + optional: true + '@esbuild/linux-x64@0.24.2': optional: true '@esbuild/netbsd-arm64@0.24.2': optional: true + '@esbuild/netbsd-x64@0.23.1': + optional: true + '@esbuild/netbsd-x64@0.24.2': optional: true + '@esbuild/openbsd-arm64@0.23.1': + optional: true + '@esbuild/openbsd-arm64@0.24.2': optional: true + '@esbuild/openbsd-x64@0.23.1': + optional: true + '@esbuild/openbsd-x64@0.24.2': optional: true + '@esbuild/sunos-x64@0.23.1': + optional: true + '@esbuild/sunos-x64@0.24.2': optional: true + '@esbuild/win32-arm64@0.23.1': + optional: true + '@esbuild/win32-arm64@0.24.2': optional: true + '@esbuild/win32-ia32@0.23.1': + optional: true + '@esbuild/win32-ia32@0.24.2': optional: true + '@esbuild/win32-x64@0.23.1': + optional: true + '@esbuild/win32-x64@0.24.2': optional: true @@ -1124,6 +1574,32 @@ snapshots: rxjs: 7.8.1 tslib: 2.8.1 + '@oxc-parser/binding-darwin-arm64@0.48.1': + optional: true + + '@oxc-parser/binding-darwin-x64@0.48.1': + optional: true + + '@oxc-parser/binding-linux-arm64-gnu@0.48.1': + optional: true + + '@oxc-parser/binding-linux-arm64-musl@0.48.1': + optional: true + + '@oxc-parser/binding-linux-x64-gnu@0.48.1': + optional: true + + '@oxc-parser/binding-linux-x64-musl@0.48.1': + optional: true + + '@oxc-parser/binding-win32-arm64-msvc@0.48.1': + optional: true + + '@oxc-parser/binding-win32-x64-msvc@0.48.1': + optional: true + + '@oxc-project/types@0.48.1': {} + '@pkgjs/parseargs@0.11.0': optional: true @@ -1268,8 +1744,9 @@ snapshots: '@types/node@22.10.7': dependencies: undici-types: 6.20.0 + optional: true - '@vitest/coverage-v8@3.0.1(vitest@3.0.1(@types/node@22.10.7))': + '@vitest/coverage-v8@3.0.1(vitest@3.0.1(@types/node@22.10.7)(tsx@4.19.2))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 1.0.2 @@ -1283,7 +1760,7 @@ snapshots: std-env: 3.8.0 test-exclude: 7.0.1 tinyrainbow: 2.0.0 - vitest: 3.0.1(@types/node@22.10.7) + vitest: 3.0.1(@types/node@22.10.7)(tsx@4.19.2) transitivePeerDependencies: - supports-color @@ -1294,13 +1771,13 @@ snapshots: chai: 5.1.2 tinyrainbow: 2.0.0 - '@vitest/mocker@3.0.1(vite@6.0.7(@types/node@22.10.7))': + '@vitest/mocker@3.0.1(vite@6.0.7(@types/node@22.10.7)(tsx@4.19.2))': dependencies: '@vitest/spy': 3.0.1 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: 6.0.7(@types/node@22.10.7) + vite: 6.0.7(@types/node@22.10.7)(tsx@4.19.2) '@vitest/pretty-format@3.0.1': dependencies: @@ -1327,6 +1804,8 @@ snapshots: loupe: 3.1.2 tinyrainbow: 2.0.0 + acorn@8.14.0: {} + ansi-regex@5.0.1: {} ansi-regex@6.1.0: {} @@ -1367,6 +1846,10 @@ snapshots: commander@12.1.0: {} + commander@13.1.0: {} + + confbox@0.1.8: {} + core-js@3.39.0: {} cross-spawn@7.0.6: @@ -1389,6 +1872,33 @@ snapshots: es-module-lexer@1.6.0: {} + esbuild@0.23.1: + optionalDependencies: + '@esbuild/aix-ppc64': 0.23.1 + '@esbuild/android-arm': 0.23.1 + '@esbuild/android-arm64': 0.23.1 + '@esbuild/android-x64': 0.23.1 + '@esbuild/darwin-arm64': 0.23.1 + '@esbuild/darwin-x64': 0.23.1 + '@esbuild/freebsd-arm64': 0.23.1 + '@esbuild/freebsd-x64': 0.23.1 + '@esbuild/linux-arm': 0.23.1 + '@esbuild/linux-arm64': 0.23.1 + '@esbuild/linux-ia32': 0.23.1 + '@esbuild/linux-loong64': 0.23.1 + '@esbuild/linux-mips64el': 0.23.1 + '@esbuild/linux-ppc64': 0.23.1 + '@esbuild/linux-riscv64': 0.23.1 + '@esbuild/linux-s390x': 0.23.1 + '@esbuild/linux-x64': 0.23.1 + '@esbuild/netbsd-x64': 0.23.1 + '@esbuild/openbsd-arm64': 0.23.1 + '@esbuild/openbsd-x64': 0.23.1 + '@esbuild/sunos-x64': 0.23.1 + '@esbuild/win32-arm64': 0.23.1 + '@esbuild/win32-ia32': 0.23.1 + '@esbuild/win32-x64': 0.23.1 + esbuild@0.24.2: optionalDependencies: '@esbuild/aix-ppc64': 0.24.2 @@ -1438,6 +1948,10 @@ snapshots: fsevents@2.3.3: optional: true + get-tsconfig@4.10.0: + dependencies: + resolve-pkg-maps: 1.0.0 + glob@10.4.5: dependencies: foreground-child: 3.3.0 @@ -1494,6 +2008,16 @@ snapshots: lru-cache@10.4.3: {} + magic-regexp@0.8.0: + dependencies: + estree-walker: 3.0.3 + magic-string: 0.30.17 + mlly: 1.7.4 + regexp-tree: 0.1.27 + type-level-regexp: 0.1.17 + ufo: 1.5.4 + unplugin: 1.16.1 + magic-string@0.30.17: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 @@ -1514,10 +2038,36 @@ snapshots: minipass@7.1.2: {} + mlly@1.7.4: + dependencies: + acorn: 8.14.0 + pathe: 2.0.1 + pkg-types: 1.3.1 + ufo: 1.5.4 + ms@2.1.3: {} nanoid@3.3.8: {} + oxc-parser@0.48.1: + dependencies: + '@oxc-project/types': 0.48.1 + optionalDependencies: + '@oxc-parser/binding-darwin-arm64': 0.48.1 + '@oxc-parser/binding-darwin-x64': 0.48.1 + '@oxc-parser/binding-linux-arm64-gnu': 0.48.1 + '@oxc-parser/binding-linux-arm64-musl': 0.48.1 + '@oxc-parser/binding-linux-x64-gnu': 0.48.1 + '@oxc-parser/binding-linux-x64-musl': 0.48.1 + '@oxc-parser/binding-win32-arm64-msvc': 0.48.1 + '@oxc-parser/binding-win32-x64-msvc': 0.48.1 + + oxc-walker@0.2.2(oxc-parser@0.48.1): + dependencies: + estree-walker: 3.0.3 + magic-regexp: 0.8.0 + oxc-parser: 0.48.1 + package-json-from-dist@1.0.1: {} path-key@3.1.1: {} @@ -1535,6 +2085,12 @@ snapshots: picomatch@4.0.2: {} + pkg-types@1.3.1: + dependencies: + confbox: 0.1.8 + mlly: 1.7.4 + pathe: 2.0.1 + playwright-core@1.49.1: {} playwright@1.49.1: @@ -1551,6 +2107,10 @@ snapshots: reflect-metadata@0.2.2: {} + regexp-tree@0.1.27: {} + + resolve-pkg-maps@1.0.0: {} + rfc4648@1.5.4: {} rollup@4.30.1: @@ -1656,21 +2216,38 @@ snapshots: tslib@2.8.1: {} + tsx@4.19.2: + dependencies: + esbuild: 0.23.1 + get-tsconfig: 4.10.0 + optionalDependencies: + fsevents: 2.3.3 + + type-level-regexp@0.1.17: {} + typescript@5.7.3: {} + ufo@1.5.4: {} + ultracite@4.1.15: dependencies: commander: 12.1.0 - undici-types@6.20.0: {} + undici-types@6.20.0: + optional: true - vite-node@3.0.1(@types/node@22.10.7): + unplugin@1.16.1: + dependencies: + acorn: 8.14.0 + webpack-virtual-modules: 0.6.2 + + vite-node@3.0.1(@types/node@22.10.7)(tsx@4.19.2): dependencies: cac: 6.7.14 debug: 4.4.0 es-module-lexer: 1.6.0 pathe: 2.0.1 - vite: 6.0.7(@types/node@22.10.7) + vite: 6.0.7(@types/node@22.10.7)(tsx@4.19.2) transitivePeerDependencies: - '@types/node' - jiti @@ -1685,7 +2262,7 @@ snapshots: - tsx - yaml - vite@6.0.7(@types/node@22.10.7): + vite@6.0.7(@types/node@22.10.7)(tsx@4.19.2): dependencies: esbuild: 0.24.2 postcss: 8.5.1 @@ -1693,11 +2270,12 @@ snapshots: optionalDependencies: '@types/node': 22.10.7 fsevents: 2.3.3 + tsx: 4.19.2 - vitest@3.0.1(@types/node@22.10.7): + vitest@3.0.1(@types/node@22.10.7)(tsx@4.19.2): dependencies: '@vitest/expect': 3.0.1 - '@vitest/mocker': 3.0.1(vite@6.0.7(@types/node@22.10.7)) + '@vitest/mocker': 3.0.1(vite@6.0.7(@types/node@22.10.7)(tsx@4.19.2)) '@vitest/pretty-format': 3.0.1 '@vitest/runner': 3.0.1 '@vitest/snapshot': 3.0.1 @@ -1713,8 +2291,8 @@ snapshots: tinyexec: 0.3.2 tinypool: 1.0.2 tinyrainbow: 2.0.0 - vite: 6.0.7(@types/node@22.10.7) - vite-node: 3.0.1(@types/node@22.10.7) + vite: 6.0.7(@types/node@22.10.7)(tsx@4.19.2) + vite-node: 3.0.1(@types/node@22.10.7)(tsx@4.19.2) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.10.7 @@ -1732,6 +2310,8 @@ snapshots: - tsx - yaml + webpack-virtual-modules@0.6.2: {} + which@2.0.2: dependencies: isexe: 2.0.0 diff --git a/scripts/cli.ts b/scripts/cli.ts new file mode 100644 index 0000000..3f257c8 --- /dev/null +++ b/scripts/cli.ts @@ -0,0 +1,19 @@ +#!/usr/bin/env node + +import { Command } from 'commander'; +import { rewriteAllObservableSubscribeToLastValueFrom } from './code-transform'; + +const program = new Command(); + +program + .version('1.0.0') + .description('A CLI tool to help develop oidc-client-rx'); + +program + .command('rewrite ') + .description('Rewrite files matching the given glob pattern') + .action(async (pattern: string) => { + await rewriteAllObservableSubscribeToLastValueFrom(pattern); + }); + +program.parse(process.argv); diff --git a/scripts/code-transform.spec.ts b/scripts/code-transform.spec.ts new file mode 100644 index 0000000..0d041a9 --- /dev/null +++ b/scripts/code-transform.spec.ts @@ -0,0 +1,35 @@ +import assert from 'node:assert/strict'; +import { describe, it } from 'node:test'; +import { Biome, Distribution } from '@biomejs/js-api'; +import { rewriteObservableSubscribeToLastValueFrom } from './code-transform'; + +describe('writeAllSpecObservableSubscribeToLastValueFrom', () => { + it('should transform valid string', async () => { + const actual = await rewriteObservableSubscribeToLastValueFrom( + 'index.ts', + `refreshSessionIframeService + .refreshSessionWithIframe(allConfigs[0]!, allConfigs) + .subscribe((result) => { + expect( + result + ).toHaveBeenCalledExactlyOnceWith( + 'a-url', + allConfigs[0]!, + allConfigs + ); + });` + ); + + const expect = `const result = await lastValueFrom(refreshSessionIframeService.refreshSessionWithIframe(allConfigs[0]!, allConfigs)); + expect(result).toHaveBeenCalledExactlyOnceWith('a-url',allConfigs[0]!,allConfigs);`; + + const biome = await Biome.create({ + distribution: Distribution.NODE, + }); + + assert.equal( + biome.formatContent(actual, { filePath: 'index.ts' }).content, + biome.formatContent(expect, { filePath: 'index.ts' }).content + ); + }); +}); diff --git a/scripts/code-transform.ts b/scripts/code-transform.ts new file mode 100644 index 0000000..cc7c005 --- /dev/null +++ b/scripts/code-transform.ts @@ -0,0 +1,113 @@ +import assert from 'node:assert/strict'; +import fsp from 'node:fs/promises'; +import { + type ClassElement, + type MagicString, + type Statement, + parseSync, +} from 'oxc-parser'; +import { type Node, walk } from 'oxc-walker'; + +function sourceTextFromNode( + context: { magicString?: MagicString }, + node: Node +): string { + const magicString = context.magicString; + assert(magicString, 'magicString should be defined'); + const start = node.start; + const end = node.end; + return magicString.getSourceText(start, end); +} + +export async function rewriteObservableSubscribeToLastValueFrom( + filename: string, + content?: string +) { + const code = content ?? (await fsp.readFile(filename, 'utf-8')); + const parsedResult = parseSync('index.ts', code); + const magicString = parsedResult.magicString; + walk(parsedResult, { + leave(node, _, context) { + const transformExprs = ( + children: T + // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: + ): T => { + const newChildren: T = [] as any as T; + for (const child of children) { + if ( + child.type === 'ExpressionStatement' && + child.expression.type === 'CallExpression' && + child.expression.callee.type === 'StaticMemberExpression' && + child.expression.callee.property.name === 'subscribe' && + child.expression.arguments[0]?.type === 'ArrowFunctionExpression' && + child.expression.arguments[0].body.type === 'FunctionBody' + ) { + const awaited = + child.expression.arguments[0].params.kind === + 'ArrowFormalParameters' && + child.expression.arguments[0].params.items[0]?.type === + 'FormalParameter' && + child.expression.arguments[0].params.items[0].pattern.type === + 'Identifier' + ? child.expression.arguments[0].params.items[0].pattern.name + : undefined; + const newContent = + (awaited + ? `const ${awaited} = await lastValueFrom(${sourceTextFromNode( + context, + child.expression.callee.object + )});\n` + : `await lastValueFrom(${sourceTextFromNode(context, child.expression.callee.object)});\n`) + + child.expression.arguments[0].body.statements + .map((s) => sourceTextFromNode(context, s)) + .join(';\n'); + + const newStatements = parseSync('index.ts', newContent).program + .body as any[]; + + magicString.remove(child.start, child.end); + magicString.appendRight(child.start, newContent); + + newChildren.push(...newStatements); + } else { + newChildren.push(child as any); + } + return newChildren; + } + return newChildren; + }; + if ('body' in node && Array.isArray(node.body) && node.body.length > 0) { + const children = node.body; + node.body = transformExprs(children as any)!; + } else if ( + 'body' in node && + node.body && + 'type' in node.body && + node.body.type === 'FunctionBody' + ) { + console.error('xxx', node.body.type); + const children = node.body.statements; + node.body.statements = transformExprs(children)!; + } + }, + }); + + const result = magicString.toString(); + + return result; +} + +export async function rewriteAllObservableSubscribeToLastValueFrom( + pattern: string | string[] +) { + const files = fsp.glob(pattern); + for await (const file of files) { + const source = await fsp.readFile(file, 'utf-8'); + const result = await rewriteObservableSubscribeToLastValueFrom(file); + if (source !== result) { + console.error('not equal'); + } + + await fsp.writeFile(file, result, 'utf-8'); + } +} diff --git a/src/iframe/check-session.service.spec.ts b/src/iframe/check-session.service.spec.ts index 7e957c4..4a1f9d1 100644 --- a/src/iframe/check-session.service.spec.ts +++ b/src/iframe/check-session.service.spec.ts @@ -346,11 +346,9 @@ describe('CheckSessionService', () => { describe('checkSessionChanged$', () => { it('emits when internal event is thrown', async () => { - checkSessionService.checkSessionChanged$ - .pipe(skip(1)) - .subscribe((result) => { - expect(result).toBe(true); - }); + const result = await lastValueFrom(checkSessionService.checkSessionChanged$ + .pipe(skip(1))); +expect(result).toBe(true); const serviceAsAny = checkSessionService as any; @@ -358,9 +356,8 @@ describe('CheckSessionService', () => { }); it('emits false initially', async () => { - checkSessionService.checkSessionChanged$.subscribe((result) => { - expect(result).toBe(false); - }); + const result = await lastValueFrom(checkSessionService.checkSessionChanged$); +expect(result).toBe(false); }); it('emits false then true when emitted', async () => { diff --git a/src/iframe/check-session.service.ts b/src/iframe/check-session.service.ts index ace87d8..7afade4 100644 --- a/src/iframe/check-session.service.ts +++ b/src/iframe/check-session.service.ts @@ -1,8 +1,8 @@ -import { DOCUMENT } from '../dom'; -import { Injectable, NgZone, OnDestroy, inject } from 'injection-js'; +import { Injectable, NgZone, type OnDestroy, inject } from 'injection-js'; import { BehaviorSubject, Observable, of } from 'rxjs'; import { take } from 'rxjs/operators'; -import { OpenIdConfiguration } from '../config/openid-configuration'; +import type { OpenIdConfiguration } from '../config/openid-configuration'; +import { DOCUMENT } from '../dom'; import { LoggerService } from '../logging/logger.service'; import { EventTypes } from '../public-events/event-types'; import { PublicEventsService } from '../public-events/public-events.service'; @@ -74,7 +74,7 @@ export class CheckSessionService implements OnDestroy { } start(configuration: OpenIdConfiguration): void { - if (!!this.scheduledHeartBeatRunning) { + if (this.scheduledHeartBeatRunning) { return; } @@ -141,13 +141,13 @@ export class CheckSessionService implements OnDestroy { return of(); } - if (!contentWindow) { + if (contentWindow) { + contentWindow.location.replace(checkSessionIframe); + } else { this.loggerService.logWarning( configuration, 'CheckSession - init check session: IFrame contentWindow does not exist' ); - } else { - contentWindow.location.replace(checkSessionIframe); } return new Observable((observer) => { @@ -197,7 +197,7 @@ export class CheckSessionService implements OnDestroy { this.outstandingMessages++; contentWindow.postMessage( - clientId + ' ' + sessionState, + `${clientId} ${sessionState}`, iframeOrigin ); } else { diff --git a/src/iframe/refresh-session-iframe.service.spec.ts b/src/iframe/refresh-session-iframe.service.spec.ts index 0bd4c4a..a398159 100644 --- a/src/iframe/refresh-session-iframe.service.spec.ts +++ b/src/iframe/refresh-session-iframe.service.spec.ts @@ -1,5 +1,5 @@ import { TestBed } from '@/testing'; -import { of } from 'rxjs'; +import { lastValueFrom, of } from 'rxjs'; import { vi } from 'vitest'; import { LoggerService } from '../logging/logger.service'; import { mockProvider } from '../testing/mock'; @@ -20,9 +20,6 @@ describe('RefreshSessionIframeService ', () => { mockProvider(UrlService), ], }); - }); - - beforeEach(() => { refreshSessionIframeService = TestBed.inject(RefreshSessionIframeService); urlService = TestBed.inject(UrlService); }); @@ -62,7 +59,9 @@ describe('RefreshSessionIframeService ', () => { it('dispatches customevent to window object', async () => { const dispatchEventSpy = vi.spyOn(window, 'dispatchEvent'); - (refreshSessionIframeService as any).initSilentRenewRequest(); + await lastValueFrom( + (refreshSessionIframeService as any).initSilentRenewRequest() + ); expect(dispatchEventSpy).toHaveBeenCalledExactlyOnceWith( new CustomEvent('oidc-silent-renew-init', { diff --git a/src/utils/url/url.service.spec.ts b/src/utils/url/url.service.spec.ts index 0100a71..24c2429 100644 --- a/src/utils/url/url.service.spec.ts +++ b/src/utils/url/url.service.spec.ts @@ -1,5 +1,5 @@ -import { TestBed } from '@/testing'; -import { of } from 'rxjs'; +import { TestBed, mockImplementationWhenArgsEqual } from '@/testing'; +import { lastValueFrom, of } from 'rxjs'; import { vi } from 'vitest'; import type { OpenIdConfiguration } from '../../config/openid-configuration'; import { FlowsDataService } from '../../flows/flows-data.service'; @@ -1044,9 +1044,8 @@ describe('UrlService Tests', () => { describe('getAuthorizeUrl', () => { it('returns null if no config is given', async () => { - service.getAuthorizeUrl(null).subscribe((url) => { - expect(url).toBeNull(); - }); + const url = await lastValueFrom(service.getAuthorizeUrl(null)); + expect(url).toBeNull(); }); it('returns null if current flow is code flow and no redirect url is defined', async () => { @@ -1383,7 +1382,7 @@ describe('UrlService Tests', () => { resultObs$.subscribe((result) => { expect(result).toBe( - `client_id=testClientId&redirect_uri=testRedirectUrl&response_type=testResponseType&scope=testScope&nonce=testNonce&state=testState&code_challenge=testCodeChallenge&code_challenge_method=S256` + 'client_id=testClientId&redirect_uri=testRedirectUrl&response_type=testResponseType&scope=testScope&nonce=testNonce&state=testState&code_challenge=testCodeChallenge&code_challenge_method=S256' ); }); }); @@ -1414,7 +1413,7 @@ describe('UrlService Tests', () => { resultObs$.subscribe((result) => { expect(result).toBe( - `client_id=testClientId&redirect_uri=testRedirectUrl&response_type=testResponseType&scope=testScope&nonce=testNonce&state=testState&code_challenge=testCodeChallenge&code_challenge_method=S256&hd=testHdParam` + 'client_id=testClientId&redirect_uri=testRedirectUrl&response_type=testResponseType&scope=testScope&nonce=testNonce&state=testState&code_challenge=testCodeChallenge&code_challenge_method=S256&hd=testHdParam' ); }); }); @@ -1445,7 +1444,7 @@ describe('UrlService Tests', () => { resultObs$.subscribe((result) => { expect(result).toBe( - `client_id=testClientId&redirect_uri=testRedirectUrl&response_type=testResponseType&scope=testScope&nonce=testNonce&state=testState&code_challenge=testCodeChallenge&code_challenge_method=S256&hd=testHdParam&any=thing` + 'client_id=testClientId&redirect_uri=testRedirectUrl&response_type=testResponseType&scope=testScope&nonce=testNonce&state=testState&code_challenge=testCodeChallenge&code_challenge_method=S256&hd=testHdParam&any=thing' ); }); }); @@ -1480,7 +1479,7 @@ describe('UrlService Tests', () => { resultObs$.subscribe((result) => { expect(result).toBe( - `client_id=testClientId&redirect_uri=testRedirectUrl&response_type=testResponseType&scope=testScope&nonce=testNonce&state=testState&code_challenge=testCodeChallenge&code_challenge_method=S256&hd=testHdParam&any=thing&any=otherThing` + 'client_id=testClientId&redirect_uri=testRedirectUrl&response_type=testResponseType&scope=testScope&nonce=testNonce&state=testState&code_challenge=testCodeChallenge&code_challenge_method=S256&hd=testHdParam&any=thing&any=otherThing' ); }); }); @@ -1904,8 +1903,7 @@ describe('UrlService Tests', () => { resultObs$.subscribe((result: any) => { expect(result).toBe( - `authorizationEndpoint?client_id=clientId&redirect_uri=http%3A%2F%2Fany-url.com` + - `&response_type=${responseType}&scope=${scope}&nonce=${nonce}&state=${state}&to=add&as=well` + `authorizationEndpoint?client_id=clientId&redirect_uri=http%3A%2F%2Fany-url.com&response_type=${responseType}&scope=${scope}&nonce=${nonce}&state=${state}&to=add&as=well` ); }); }); @@ -2121,7 +2119,8 @@ describe('UrlService Tests', () => { const value = service.getEndSessionUrl(config); // Assert - const expectValue = `something.auth0.com/v2/logout?client_id=someClientId&returnTo=https://localhost:1234/unauthorized`; + const expectValue = + 'something.auth0.com/v2/logout?client_id=someClientId&returnTo=https://localhost:1234/unauthorized'; expect(value).toEqual(expectValue); }); diff --git a/tsconfig.json b/tsconfig.json index 95f8a1d..191f686 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,6 +25,9 @@ }, { "path": "./tsconfig.spec.json" + }, + { + "path": "./tsconfig.scripts.json" } ] } diff --git a/tsconfig.scripts.json b/tsconfig.scripts.json new file mode 100644 index 0000000..108abb7 --- /dev/null +++ b/tsconfig.scripts.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "rootDir": ".", + "composite": true, + "noUncheckedIndexedAccess": true, + "noEmit": true, + "types": ["node"] + }, + "files": [], + "include": ["scripts/"] +}