diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d895df888..c247e39d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,10 +3,10 @@ name: CI on: push: branches: - - master + - v10 pull_request: branches: - - master + - v10 permissions: contents: read env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2a7b221d..3b71ae7de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: - name: Commit changelog uses: stefanzweifel/git-auto-commit-action@v5 with: - branch: master + branch: v10 file_pattern: '*.md' commit_message: 'chore: sync changelog' diff --git a/package.json b/package.json index a73910316..56873160c 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,7 @@ "@types/minimist": "^1.2.5", "@types/node": "^22.5.3", "@types/rc": "^1.2.4", + "@types/serve-handler": "^6.1.4", "@vitest/coverage-v8": "^2.0.0", "api-docs-gen": "^0.4.0", "benchmark": "^2.1.4", @@ -121,7 +122,7 @@ "rollup-plugin-node-globals": "^1.4.0", "rollup-plugin-typescript2": "^0.36.0", "secretlint": "^3.2.0", - "serve-static": "^1.15.0", + "serve-handler": "^6.1.6", "textlint": "^12.6.1", "textlint-filter-rule-comments": "^1.2.2", "textlint-rule-abbr-within-parentheses": "^1.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 23e154584..2aeb00893 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -66,6 +66,9 @@ importers: '@types/rc': specifier: ^1.2.4 version: 1.2.4 + '@types/serve-handler': + specifier: ^6.1.4 + version: 6.1.4 '@vitest/coverage-v8': specifier: ^2.0.0 version: 2.0.0(vitest@2.0.4(@types/node@22.5.3)(jsdom@24.0.0)(terser@5.27.0)) @@ -165,9 +168,9 @@ importers: secretlint: specifier: ^3.2.0 version: 3.3.0 - serve-static: - specifier: ^1.15.0 - version: 1.15.0(supports-color@6.1.0) + serve-handler: + specifier: ^6.1.6 + version: 6.1.6 textlint: specifier: ^12.6.1 version: 12.6.1 @@ -1348,6 +1351,10 @@ packages: resolution: {integrity: sha512-hwqQXyTnDzAVZ300SU31jO0+3OJbpOdfVU6iBkrmNpS7t2HRnVACo0EwcEXzJa++4EVDreqz5OeqJbt+PeSGGA==} engines: {node: '>= 16'} + '@intlify/shared@10.0.4': + resolution: {integrity: sha512-ukFn0I01HsSgr3VYhYcvkTCLS7rGa0gw4A4AMpcy/A9xx/zRJy7PS2BElMXLwUazVFMAr5zuiTk3MQeoeGXaJg==} + engines: {node: '>= 16'} + '@intlify/shared@9.10.2': resolution: {integrity: sha512-ttHCAJkRy7R5W2S9RVnN9KYQYPIpV2+GiS79T4EE37nrPyH6/1SrOh3bmdCRC1T3ocL8qCDx7x2lBJ0xaITU7Q==} engines: {node: '>= 16'} @@ -1360,10 +1367,6 @@ packages: resolution: {integrity: sha512-u3b6BKGhE6j/JeRU6C/RL2FgyJfy6LakbtfeVF8fJXURpZZTzfh3e05J0bu0XPw447Q6/WUp3C4ajv4TMS4YsQ==} engines: {node: '>= 16'} - '@intlify/shared@9.14.1': - resolution: {integrity: sha512-XjHu6PEQup9MnP1x0W9y0nXXfq9jFftAYSfV11hryjtH4XqXP8HrzMvXI+ZVifF+jZLszaTzIhvukllplxTQTg==} - engines: {node: '>= 16'} - '@intlify/shared@9.3.0-beta.20': resolution: {integrity: sha512-RucSPqh8O9FFxlYUysQTerSw0b9HIRpyoN1Zjogpm0qLiHK+lBNSa5sh1nCJ4wSsNcjphzgpLQCyR60GZlRV8g==} engines: {node: '>= 16'} @@ -2100,6 +2103,9 @@ packages: '@types/send@0.17.4': resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==} + '@types/serve-handler@6.1.4': + resolution: {integrity: sha512-aXy58tNie0NkuSCY291xUxl0X+kGYy986l4kqW6Gi4kEXgr6Tx0fpSH7YwUSa5usPpG3s9DBeIR6hHcDtL2IvQ==} + '@types/serve-static@1.15.5': resolution: {integrity: sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==} @@ -3094,6 +3100,10 @@ packages: constants-browserify@1.0.0: resolution: {integrity: sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==} + content-disposition@0.5.2: + resolution: {integrity: sha512-kRGRZw3bLlFISDBgwTSA1TMBFN6J6GWDeubmDE3AF+3+yXL8hTWv8r5rkLbqYXY4RjPk/EzHnClI3zQf1cFmHA==} + engines: {node: '>= 0.6'} + content-disposition@0.5.4: resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} engines: {node: '>= 0.6'} @@ -5067,10 +5077,18 @@ packages: resolution: {integrity: sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==} hasBin: true + mime-db@1.33.0: + resolution: {integrity: sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==} + engines: {node: '>= 0.6'} + mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} + mime-types@2.1.18: + resolution: {integrity: sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==} + engines: {node: '>= 0.6'} + mime-types@2.1.35: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} @@ -5597,6 +5615,9 @@ packages: path-to-regexp@0.1.7: resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} + path-to-regexp@3.3.0: + resolution: {integrity: sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==} + path-type@1.1.0: resolution: {integrity: sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==} engines: {node: '>=0.10.0'} @@ -5885,6 +5906,10 @@ packages: randomfill@1.0.4: resolution: {integrity: sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==} + range-parser@1.2.0: + resolution: {integrity: sha512-kA5WQoNVo4t9lNx2kQNFCxKeBl5IbbSNBl1M/tLkw9WCn+hxNBAW5Qh8gdhs63CJnhjJ2zQWFoqPJP2sK1AV5A==} + engines: {node: '>= 0.6'} + range-parser@1.2.1: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} engines: {node: '>= 0.6'} @@ -6214,6 +6239,9 @@ packages: serialize-javascript@6.0.2: resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} + serve-handler@6.1.6: + resolution: {integrity: sha512-x5RL9Y2p5+Sh3D38Fh9i/iQ5ZK+e4xuXRd/pGbM4D13tgo/MGwbttUk8emytcr1YYzBYs+apnUngBDFYfpjPuQ==} + serve-index@1.9.1: resolution: {integrity: sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==} engines: {node: '>= 0.8.0'} @@ -8196,14 +8224,14 @@ snapshots: '@intlify/shared': 9.3.0-beta.20 source-map-js: 1.0.2 + '@intlify/shared@10.0.4': {} + '@intlify/shared@9.10.2': {} '@intlify/shared@9.11.0': {} '@intlify/shared@9.13.1': {} - '@intlify/shared@9.14.1': {} - '@intlify/shared@9.3.0-beta.20': {} '@intlify/shared@9.3.0-beta.24': {} @@ -9093,6 +9121,10 @@ snapshots: '@types/mime': 1.3.5 '@types/node': 22.5.3 + '@types/serve-handler@6.1.4': + dependencies: + '@types/node': 22.5.3 + '@types/serve-static@1.15.5': dependencies: '@types/http-errors': 2.0.4 @@ -9472,7 +9504,7 @@ snapshots: '@vue/compiler-dom': 3.5.10 '@vue/shared': 3.5.10 computeds: 0.0.1 - minimatch: 9.0.3 + minimatch: 9.0.5 path-browserify: 1.0.1 vue-template-compiler: 2.7.16 optionalDependencies: @@ -9784,7 +9816,7 @@ snapshots: api-docs-gen@0.4.0(@types/node@22.5.3): dependencies: - '@intlify/shared': 9.14.1 + '@intlify/shared': 10.0.4 '@microsoft/api-extractor-model': 7.28.9(@types/node@22.5.3) '@microsoft/tsdoc': 0.13.2 '@microsoft/tsdoc-config': 0.15.2 @@ -10376,6 +10408,8 @@ snapshots: constants-browserify@1.0.0: {} + content-disposition@0.5.2: {} + content-disposition@0.5.4: dependencies: safe-buffer: 5.2.1 @@ -12716,8 +12750,14 @@ snapshots: bn.js: 4.12.0 brorand: 1.1.0 + mime-db@1.33.0: {} + mime-db@1.52.0: {} + mime-types@2.1.18: + dependencies: + mime-db: 1.33.0 + mime-types@2.1.35: dependencies: mime-db: 1.52.0 @@ -13244,6 +13284,8 @@ snapshots: path-to-regexp@0.1.7: {} + path-to-regexp@3.3.0: {} + path-type@1.1.0: dependencies: graceful-fs: 4.2.11 @@ -13533,6 +13575,8 @@ snapshots: randombytes: 2.1.0 safe-buffer: 5.2.1 + range-parser@1.2.0: {} + range-parser@1.2.1: {} raw-body@2.5.2: @@ -13991,6 +14035,16 @@ snapshots: dependencies: randombytes: 2.1.0 + serve-handler@6.1.6: + dependencies: + bytes: 3.0.0 + content-disposition: 0.5.2 + mime-types: 2.1.18 + minimatch: 3.1.2 + path-is-inside: 1.0.2 + path-to-regexp: 3.3.0 + range-parser: 1.2.0 + serve-index@1.9.1(supports-color@6.1.0): dependencies: accepts: 1.3.8 diff --git a/scripts/release.sh b/scripts/release.sh index fe6ce59f6..c4eac8540 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -23,7 +23,7 @@ for PKG in packages/* ; do continue fi pushd $PKG - TAG="latest" + TAG="stable" echo "⚡ Publishing $PKG with tag $TAG" pnpm publish --access public --no-git-checks --tag $TAG popd > /dev/null diff --git a/scripts/vitest.globalSetup.ts b/scripts/vitest.globalSetup.ts index 785336f0c..4fcd4198e 100644 --- a/scripts/vitest.globalSetup.ts +++ b/scripts/vitest.globalSetup.ts @@ -1,14 +1,18 @@ -import { fileURLToPath } from 'node:url' -import { URL } from 'node:url' +import { fileURLToPath, URL } from 'node:url' -// @ts-ignore -import serveStatic from 'serve-static' import { listen } from 'listhen' +import handler from 'serve-handler' const __dirname = fileURLToPath(new URL('..', import.meta.url)) export async function setup() { - const listener = await listen(serveStatic(__dirname), { port: 8080 }) + const listener = await listen( + (req, res) => { + // eslint-disable-next-line @typescript-eslint/no-floating-promises + handler(req, res, { public: __dirname }) + }, + { port: 8080 } + ) return async () => { await listener.close() }