From c4d984abb6d4cead36ab37b5abbe6005ddc7ddf1 Mon Sep 17 00:00:00 2001 From: madinah <497350746@qq.com> Date: Fri, 11 Apr 2025 18:50:18 +0800 Subject: [PATCH] =?UTF-8?q?chore(none):=20=F0=9F=A4=96=20update=20yaml=20c?= =?UTF-8?q?onfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yaml | 144 +++++++-------- .github/workflows/release-rust-plugins.yml | 10 +- .husky/pre-commit | 5 + package.json | 9 +- pnpm-lock.yaml | 205 +++++++++++++++++---- scripts/update-artifacts.ts | 54 ++++++ tsconfig.json | 10 + 7 files changed, 329 insertions(+), 108 deletions(-) mode change 100644 => 100755 .husky/pre-commit create mode 100644 scripts/update-artifacts.ts create mode 100644 tsconfig.json diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b6cd980b..dda378bf 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,6 +1,5 @@ name: Building Rust Binding And Upload Artifacts on: workflow_call - jobs: build: name: Build and Upload Artifacts - ${{ matrix.settings.abi }} @@ -12,50 +11,50 @@ jobs: - os: ubuntu-latest docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian abi: linux-x64-gnu - build: >- - git config --global --add safe.directory /build && - set -e && - unset CC_x86_64_unknown_linux_gnu && - unset CC && - corepack disable || true && - npm install -g pnpm@9.1.0 && - export PNPM_HOME="/root/.local/share/pnpm" && - export PATH="$PNPM_HOME:$PATH" && - pnpm --filter "{rust-plugins}[HEAD~1]" --sequential build --target x86_64-unknown-linux-gnu --abi linux-x64-gnu + build: git config --global --add safe.directory /build && set -e && unset + CC_x86_64_unknown_linux_gnu && unset CC && corepack disable || + true && npm install -g pnpm@9.1.0 && export + PNPM_HOME="/root/.local/share/pnpm" && export + PATH="$PNPM_HOME:$PATH" && pnpm --filter "{rust-plugins}[HEAD~1]" + --sequential build --target x86_64-unknown-linux-gnu --abi + linux-x64-gnu - os: ubuntu-latest docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine abi: linux-x64-musl - build: >- - git config --global --add safe.directory /build && - set -e && - unset CC_x86_64_unknown_linux_musl && - unset CC && - pnpm --filter "{rust-plugins}[HEAD~1]" --sequential build --target x86_64-unknown-linux-musl --abi linux-x64-musl + build: git config --global --add safe.directory /build && set -e && unset + CC_x86_64_unknown_linux_musl && unset CC && pnpm --filter + "{rust-plugins}[HEAD~1]" --sequential build --target + x86_64-unknown-linux-musl --abi linux-x64-musl - os: windows-latest abi: win32-x64-msvc - os: macos-latest abi: darwin-arm64 - os: macos-13 abi: darwin-x64 - # cross compile - # windows. Note swc plugins is not supported on ia32 and arm64 - os: windows-latest abi: win32-ia32-msvc target: i686-pc-windows-msvc - build: | + build: > export CARGO_PROFILE_RELEASE_LTO=false + cargo install cargo-xwin --locked - pnpm --filter "{rust-plugins}[HEAD~1]" --sequential build --target i686-pc-windows-msvc --abi win32-ia32-msvc --cargo-flags="--no-default-features" + + pnpm --filter "{rust-plugins}[HEAD~1]" --sequential build --target + i686-pc-windows-msvc --abi win32-ia32-msvc + --cargo-flags="--no-default-features" - os: windows-latest abi: win32-arm64-msvc target: aarch64-pc-windows-msvc - build: | + build: > export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=256 + export CARGO_PROFILE_RELEASE_LTO=false + cargo install cargo-xwin --locked - pnpm --filter "{rust-plugins}[HEAD~1]" --sequential build --target aarch64-pc-windows-msvc --abi win32-arm64-msvc --cargo-flags="--no-default-features" - # linux + pnpm --filter "{rust-plugins}[HEAD~1]" --sequential build --target + aarch64-pc-windows-msvc --abi win32-arm64-msvc + --cargo-flags="--no-default-features" - os: ubuntu-latest abi: linux-arm64-musl target: aarch64-unknown-linux-musl @@ -68,14 +67,10 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 2 - # - run: | - # git fetch --no-tags --prune --depth=1 origin +refs/heads/main:refs/remotes/HEAD~1 - - name: Cache rust artifacts uses: Swatinem/rust-cache@v2 with: shared-key: rust-build-${{ matrix.settings.abi }} - - uses: actions/setup-node@v4 with: node-version: 18 @@ -86,61 +81,82 @@ jobs: pnpm i --frozen-lockfile - run: rustup target add ${{ matrix.settings.target }} if: ${{ matrix.settings.target }} - # Use the v1 of this action - uses: mbround18/setup-osxcross@v1 if: ${{ matrix.settings.osxcross }} - # This builds executables & sets env variables for rust to consume. with: osx-version: "12.3" - uses: goto-bus-stop/setup-zig@v2 if: ${{ matrix.settings.zig }} with: - version: "0.13.0" + version: 0.13.0 - name: Build in docker uses: addnab/docker-run-action@v3 if: ${{ matrix.settings.docker }} with: image: ${{ matrix.settings.docker }} - options: -v ${{ env.HOME }}/.cargo/git:/root/.cargo/git -v ${{ env.HOME }}/.cargo/registry:/root/.cargo/registry -v ${{ github.workspace }}:/build -w /build + options: -v ${{ env.HOME }}/.cargo/git:/root/.cargo/git -v ${{ env.HOME + }}/.cargo/registry:/root/.cargo/registry -v ${{ github.workspace + }}:/build -w /build run: ${{ matrix.settings.build }} - name: Default Build if: ${{ !matrix.settings.docker && !matrix.settings.build }} - run: | - pnpm --filter "{rust-plugins}[HEAD~1]" --sequential build --abi ${{ matrix.settings.abi }} ${{ matrix.settings.target && format('--target {0}', matrix.settings.target) || '' }} ${{ matrix.settings.zig && '--zig' || '' }} + run: > + pnpm --filter "{rust-plugins}[HEAD~1]" --sequential build --abi ${{ + matrix.settings.abi }} ${{ matrix.settings.target && format('--target + {0}', matrix.settings.target) || '' }} ${{ matrix.settings.zig && + '--zig' || '' }} shell: bash - name: Build if: ${{ !matrix.settings.docker && matrix.settings.build }} run: ${{ matrix.settings.build }} shell: bash + - name: Upload Plugin auto-import + uses: actions/upload-artifact@v4 + with: + name: ${{ github.sha }}-${{ matrix.settings.abi }}-auto-import + path: ./rust-plugins/auto-import/npm/${{ matrix.settings.abi }}/index.farm + if-no-files-found: ignore + - name: Upload Plugin compress + uses: actions/upload-artifact@v4 + with: + name: ${{ github.sha }}-${{ matrix.settings.abi }}-compress + path: ./rust-plugins/compress/npm/${{ matrix.settings.abi }}/index.farm + if-no-files-found: ignore - name: Upload Plugin dsv uses: actions/upload-artifact@v4 with: name: ${{ github.sha }}-${{ matrix.settings.abi }}-dsv path: ./rust-plugins/dsv/npm/${{ matrix.settings.abi }}/index.farm if-no-files-found: ignore - - name: Upload Plugin react-components + - name: Upload Plugin icons uses: actions/upload-artifact@v4 with: - name: ${{ github.sha }}-${{ matrix.settings.abi }}-react-components - path: ./rust-plugins/react-components/npm/${{ matrix.settings.abi }}/index.farm + name: ${{ github.sha }}-${{ matrix.settings.abi }}-icons + path: ./rust-plugins/icons/npm/${{ matrix.settings.abi }}/index.farm if-no-files-found: ignore - - name: Upload Plugin virtual + - name: Upload Plugin image uses: actions/upload-artifact@v4 with: - name: ${{ github.sha }}-${{ matrix.settings.abi }}-virtual - path: ./rust-plugins/virtual/npm/${{ matrix.settings.abi }}/index.farm + name: ${{ github.sha }}-${{ matrix.settings.abi }}-image + path: ./rust-plugins/image/npm/${{ matrix.settings.abi }}/index.farm if-no-files-found: ignore - - name: Upload Plugin svgr + - name: Upload Plugin mdx uses: actions/upload-artifact@v4 with: - name: ${{ github.sha }}-${{ matrix.settings.abi }}-svgr - path: ./rust-plugins/svgr/npm/${{ matrix.settings.abi }}/index.farm + name: ${{ github.sha }}-${{ matrix.settings.abi }}-mdx + path: ./rust-plugins/mdx/npm/${{ matrix.settings.abi }}/index.farm if-no-files-found: ignore - - name: Upload Plugin yaml + - name: Upload Plugin modular-import uses: actions/upload-artifact@v4 with: - name: ${{ github.sha }}-${{ matrix.settings.abi }}-yaml - path: ./rust-plugins/yaml/npm/${{ matrix.settings.abi }}/index.farm + name: ${{ github.sha }}-${{ matrix.settings.abi }}-modular-import + path: ./rust-plugins/modular-import/npm/${{ matrix.settings.abi }}/index.farm + if-no-files-found: ignore + - name: Upload Plugin react-components + uses: actions/upload-artifact@v4 + with: + name: ${{ github.sha }}-${{ matrix.settings.abi }}-react-components + path: ./rust-plugins/react-components/npm/${{ matrix.settings.abi }}/index.farm if-no-files-found: ignore - name: Upload Plugin strip uses: actions/upload-artifact@v4 @@ -148,11 +164,11 @@ jobs: name: ${{ github.sha }}-${{ matrix.settings.abi }}-strip path: ./rust-plugins/strip/npm/${{ matrix.settings.abi }}/index.farm if-no-files-found: ignore - - name: Upload Plugin image + - name: Upload Plugin svgr uses: actions/upload-artifact@v4 with: - name: ${{ github.sha }}-${{ matrix.settings.abi }}-image - path: ./rust-plugins/image/npm/${{ matrix.settings.abi }}/index.farm + name: ${{ github.sha }}-${{ matrix.settings.abi }}-svgr + path: ./rust-plugins/svgr/npm/${{ matrix.settings.abi }}/index.farm if-no-files-found: ignore - name: Upload Plugin url uses: actions/upload-artifact@v4 @@ -160,17 +176,11 @@ jobs: name: ${{ github.sha }}-${{ matrix.settings.abi }}-url path: ./rust-plugins/url/npm/${{ matrix.settings.abi }}/index.farm if-no-files-found: ignore - - name: Upload Plugin icons - uses: actions/upload-artifact@v4 - with: - name: ${{ github.sha }}-${{ matrix.settings.abi }}-icons - path: ./rust-plugins/icons/npm/${{ matrix.settings.abi }}/index.farm - if-no-files-found: ignore - - name: Upload Plugin auto-import + - name: Upload Plugin virtual uses: actions/upload-artifact@v4 with: - name: ${{ github.sha }}-${{ matrix.settings.abi }}-auto-import - path: ./rust-plugins/auto-import/npm/${{ matrix.settings.abi }}/index.farm + name: ${{ github.sha }}-${{ matrix.settings.abi }}-virtual + path: ./rust-plugins/virtual/npm/${{ matrix.settings.abi }}/index.farm if-no-files-found: ignore - name: Upload Plugin wasm uses: actions/upload-artifact@v4 @@ -184,21 +194,9 @@ jobs: name: ${{ github.sha }}-${{ matrix.settings.abi }}-worker path: ./rust-plugins/worker/npm/${{ matrix.settings.abi }}/index.farm if-no-files-found: ignore - - name: Upload Plugin modular-import - uses: actions/upload-artifact@v4 - with: - name: ${{ github.sha }}-${{ matrix.settings.abi }}-modular-import - path: ./rust-plugins/modular-import/npm/${{ matrix.settings.abi }}/index.farm - if-no-files-found: ignore - - name: Upload Plugin mdx - uses: actions/upload-artifact@v4 - with: - name: ${{ github.sha }}-${{ matrix.settings.abi }}-mdx - path: ./rust-plugins/mdx/npm/${{ matrix.settings.abi }}/index.farm - if-no-files-found: ignore - - name: Upload Plugin compress + - name: Upload Plugin yaml uses: actions/upload-artifact@v4 with: - name: ${{ github.sha }}-${{ matrix.settings.abi }}-compress - path: ./rust-plugins/compress/npm/${{ matrix.settings.abi }}/index.farm + name: ${{ github.sha }}-${{ matrix.settings.abi }}-yaml + path: ./rust-plugins/yaml/npm/${{ matrix.settings.abi }}/index.farm if-no-files-found: ignore diff --git a/.github/workflows/release-rust-plugins.yml b/.github/workflows/release-rust-plugins.yml index 26cbb64f..71c19cb1 100644 --- a/.github/workflows/release-rust-plugins.yml +++ b/.github/workflows/release-rust-plugins.yml @@ -3,6 +3,8 @@ on: push: branches: - main + paths: + - "rust-plugins/**" concurrency: ${{ github.workflow }}-${{ github.ref }} @@ -26,6 +28,12 @@ jobs: uses: actions/setup-node@v4 with: node-version: 18.x + - name: Get Package List + id: package-list + run: | + PACKAGES=$(ls -d ./rust-plugins/*/ | cut -d'/' -f3 | tr '\n' ' ') + echo "packages=$PACKAGES" >> $GITHUB_OUTPUT + echo "Found packages: $PACKAGES" # batch download artifacts - uses: actions/download-artifact@v4 @@ -35,7 +43,7 @@ jobs: run: | for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc do - for package in dsv react-components virtual yaml strip image url icons auto-import mdx wasm worker svgr modular-import compress + for package in ${{ steps.package-list.outputs.packages }} do folder_path="/tmp/artifacts/${{github.sha}}-${abi}-${package}" if [ -d "${folder_path}" ] && [ -n "$(ls -A $folder_path)" ]; then diff --git a/.husky/pre-commit b/.husky/pre-commit old mode 100644 new mode 100755 index e69de29b..cbf9c8de --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +pnpm run update-artifacts +git add .github/workflows/build.yaml \ No newline at end of file diff --git a/package.json b/package.json index 793f21e5..a537bb87 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "release": "npx changeset && npx changeset version", "prepare": "husky install", - "commit": "git cz" + "commit": "git cz", + "update-artifacts": "ts-node scripts/update-artifacts.ts" }, "keywords": [], "author": "", @@ -14,10 +15,14 @@ "devDependencies": { "@changesets/cli": "^2.27.7", "@farmfe/plugin-tools": "latest", + "@types/node": "^22.14.0", "commitlint": "^19.5.0", "git-cz": "^4.9.0", "husky": "^9.1.6", - "picocolors": "^1.1.0" + "picocolors": "^1.1.0", + "ts-node": "^10.9.2", + "typescript": "~5.6.3", + "yaml": "^2.7.1" }, "config": { "commitizen": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 19bb9b70..ce5b55f2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,9 +14,12 @@ importers: '@farmfe/plugin-tools': specifier: latest version: 0.1.1 + '@types/node': + specifier: ^22.14.0 + version: 22.14.0 commitlint: specifier: ^19.5.0 - version: 19.6.1(@types/node@22.13.14)(typescript@5.7.2) + version: 19.6.1(@types/node@22.14.0)(typescript@5.6.3) git-cz: specifier: ^4.9.0 version: 4.9.0 @@ -26,6 +29,15 @@ importers: picocolors: specifier: ^1.1.0 version: 1.1.1 + ts-node: + specifier: ^10.9.2 + version: 10.9.2(@types/node@22.14.0)(typescript@5.6.3) + typescript: + specifier: ~5.6.3 + version: 5.6.3 + yaml: + specifier: ^2.7.1 + version: 2.7.1 examples/babel-react-compiler: dependencies: @@ -167,7 +179,7 @@ importers: version: 22.13.14 '@vitejs/plugin-vue': specifier: ^4 - version: 4.6.2(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8))(vue@3.5.13(typescript@5.6.3)) + version: 4.6.2(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(yaml@2.7.1))(vue@3.5.13(typescript@5.6.3)) '@vue/eslint-config-typescript': specifier: ^14.5.0 version: 14.5.0(eslint-plugin-vue@10.0.0(eslint@9.23.0(jiti@2.4.2))(vue-eslint-parser@10.1.1(eslint@9.23.0(jiti@2.4.2))))(eslint@9.23.0(jiti@2.4.2))(typescript@5.6.3) @@ -191,10 +203,10 @@ importers: version: 5.6.3 unplugin-fonts: specifier: ^1.3.1 - version: 1.3.1(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)) + version: 1.3.1(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(yaml@2.7.1)) unplugin-vue: specifier: ^6.0.1 - version: 6.0.1(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(vue@3.5.13(typescript@5.6.3)) + version: 6.0.1(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(vue@3.5.13(typescript@5.6.3))(yaml@2.7.1) unplugin-vue-components: specifier: ^0.27.5 version: 0.27.5(@babel/parser@7.27.0)(rollup@4.38.0)(vue@3.5.13(typescript@5.6.3)) @@ -622,6 +634,10 @@ packages: resolution: {integrity: sha512-DSHae2obMSMkAtTBSOulg5X7/z+rGLxcXQIkg3OmWvY6wifojge5uVMydfhUvs7yQj+V7jNmRZ2Xzl8GJyqRgg==} engines: {node: '>=v18'} + '@cspotcode/source-map-support@0.8.1': + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + '@ctrl/tinycolor@3.6.1': resolution: {integrity: sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==} engines: {node: '>=10'} @@ -1126,6 +1142,9 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + '@jridgewell/trace-mapping@0.3.9': + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + '@koa/cors@5.0.0': resolution: {integrity: sha512-x/iUDjcS90W69PryLDIMgFyV21YLTnG9zOpPXS7Bkt2b8AsY3zZsIpOLBkYr9fBcF3HbkKaER5hOBZLfpLgYNw==} engines: {node: '>= 14.0.0'} @@ -1293,6 +1312,18 @@ packages: '@ts-morph/common@0.24.0': resolution: {integrity: sha512-c1xMmNHWpNselmpIqursHeOHHBTIsJLbB+NuovbTTRCNiTLEr/U9dbJ8qy0jd/O2x5pc3seWuOUN5R2IoOTp8A==} + '@tsconfig/node10@1.0.11': + resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} + + '@tsconfig/node12@1.0.11': + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + + '@tsconfig/node14@1.0.3': + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + + '@tsconfig/node16@1.0.4': + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + '@tsconfig/node22@22.0.1': resolution: {integrity: sha512-VkgOa3n6jvs1p+r3DiwBqeEwGAwEvnVCg/hIjiANl5IEcqP3G0u5m8cBJspe1t9qjZRlZ7WFgqq5bJrGdgAKMg==} @@ -1341,6 +1372,9 @@ packages: '@types/node@22.13.5': resolution: {integrity: sha512-+lTU0PxZXn0Dr1NBtC7Y8cR21AJr87dLLU953CWA6pMxxv/UDc7jYAY90upcrie1nRcD6XNG5HOYEDtgW5TxAg==} + '@types/node@22.14.0': + resolution: {integrity: sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA==} + '@types/object-path@0.11.4': resolution: {integrity: sha512-4tgJ1Z3elF/tOMpA8JLVuR9spt9Ynsf7+JjqsQ2IqtiPJtcLoHoXcT6qU4E10cPFqyXX5HDm9QwIzZhBSkLxsw==} @@ -1508,6 +1542,10 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + acorn-walk@8.3.4: + resolution: {integrity: sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==} + engines: {node: '>=0.4.0'} + acorn@8.14.1: resolution: {integrity: sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==} engines: {node: '>=0.4.0'} @@ -1546,6 +1584,9 @@ packages: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} + arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} @@ -1780,6 +1821,9 @@ packages: typescript: optional: true + create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + cross-env@7.0.3: resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} @@ -1873,6 +1917,10 @@ packages: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} + diff@4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -2614,6 +2662,9 @@ packages: magic-string@0.30.17: resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} + make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + math-intrinsics@1.1.0: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} @@ -3326,6 +3377,20 @@ packages: ts-morph@23.0.0: resolution: {integrity: sha512-FcvFx7a9E8TUe6T3ShihXJLiJOiqyafzFKUO4aqIHDUCIvADdGNShcbc2W5PMr3LerXRv7mafvFZ9lRENxJmug==} + ts-node@10.9.2: + resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} @@ -3375,6 +3440,9 @@ packages: undici-types@6.20.0: resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} + undici-types@6.21.0: + resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + unicorn-magic@0.1.0: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} @@ -3451,6 +3519,9 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + varint@6.0.0: resolution: {integrity: sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==} @@ -3611,6 +3682,11 @@ packages: yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + yaml@2.7.1: + resolution: {integrity: sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==} + engines: {node: '>= 14'} + hasBin: true + yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} @@ -3623,6 +3699,10 @@ packages: resolution: {integrity: sha512-2OQsPNEmBCvXuFlIni/a+Rn+R2pHW9INm0BxXJ4hVDA8TirqMj+J/Rp9ItLatT/5pZqWwefVrTQcHpixsxnVlA==} engines: {node: '>= 4.0.0'} + yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -3923,11 +4003,11 @@ snapshots: human-id: 1.0.2 prettier: 2.8.8 - '@commitlint/cli@19.6.1(@types/node@22.13.14)(typescript@5.7.2)': + '@commitlint/cli@19.6.1(@types/node@22.14.0)(typescript@5.6.3)': dependencies: '@commitlint/format': 19.5.0 '@commitlint/lint': 19.6.0 - '@commitlint/load': 19.6.1(@types/node@22.13.14)(typescript@5.7.2) + '@commitlint/load': 19.6.1(@types/node@22.14.0)(typescript@5.6.3) '@commitlint/read': 19.5.0 '@commitlint/types': 19.5.0 tinyexec: 0.3.1 @@ -3969,15 +4049,15 @@ snapshots: '@commitlint/rules': 19.6.0 '@commitlint/types': 19.5.0 - '@commitlint/load@19.6.1(@types/node@22.13.14)(typescript@5.7.2)': + '@commitlint/load@19.6.1(@types/node@22.14.0)(typescript@5.6.3)': dependencies: '@commitlint/config-validator': 19.5.0 '@commitlint/execute-rule': 19.5.0 '@commitlint/resolve-extends': 19.5.0 '@commitlint/types': 19.5.0 chalk: 5.4.1 - cosmiconfig: 9.0.0(typescript@5.7.2) - cosmiconfig-typescript-loader: 6.1.0(@types/node@22.13.14)(cosmiconfig@9.0.0(typescript@5.7.2))(typescript@5.7.2) + cosmiconfig: 9.0.0(typescript@5.6.3) + cosmiconfig-typescript-loader: 6.1.0(@types/node@22.14.0)(cosmiconfig@9.0.0(typescript@5.6.3))(typescript@5.6.3) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 @@ -4028,6 +4108,10 @@ snapshots: '@types/conventional-commits-parser': 5.0.1 chalk: 5.4.1 + '@cspotcode/source-map-support@0.8.1': + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + '@ctrl/tinycolor@3.6.1': {} '@esbuild/aix-ppc64@0.25.2': @@ -4501,6 +4585,11 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/trace-mapping@0.3.9': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.0 + '@koa/cors@5.0.0': dependencies: vary: 1.1.2 @@ -4638,6 +4727,14 @@ snapshots: mkdirp: 3.0.1 path-browserify: 1.0.1 + '@tsconfig/node10@1.0.11': {} + + '@tsconfig/node12@1.0.11': {} + + '@tsconfig/node14@1.0.3': {} + + '@tsconfig/node16@1.0.4': {} + '@tsconfig/node22@22.0.1': {} '@types/babel__core@7.20.5': @@ -4663,24 +4760,24 @@ snapshots: '@types/conventional-commits-parser@5.0.1': dependencies: - '@types/node': 22.13.14 + '@types/node': 22.14.0 '@types/estree@1.0.7': {} '@types/fs-extra@11.0.4': dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 22.10.2 + '@types/node': 22.13.14 '@types/http-proxy@1.17.15': dependencies: - '@types/node': 22.10.2 + '@types/node': 22.13.14 '@types/json-schema@7.0.15': {} '@types/jsonfile@6.1.4': dependencies: - '@types/node': 22.10.2 + '@types/node': 22.13.14 '@types/node@12.20.55': {} @@ -4700,6 +4797,10 @@ snapshots: dependencies: undici-types: 6.20.0 + '@types/node@22.14.0': + dependencies: + undici-types: 6.21.0 + '@types/object-path@0.11.4': {} '@types/prop-types@15.7.14': {} @@ -4806,9 +4907,9 @@ snapshots: '@typescript-eslint/types': 8.28.0 eslint-visitor-keys: 4.2.0 - '@vitejs/plugin-vue@4.6.2(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8))(vue@3.5.13(typescript@5.6.3))': + '@vitejs/plugin-vue@4.6.2(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(yaml@2.7.1))(vue@3.5.13(typescript@5.6.3))': dependencies: - vite: 6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8) + vite: 6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(yaml@2.7.1) vue: 3.5.13(typescript@5.6.3) '@volar/language-core@2.4.12': @@ -4943,6 +5044,10 @@ snapshots: dependencies: acorn: 8.14.1 + acorn-walk@8.3.4: + dependencies: + acorn: 8.14.1 + acorn@8.14.1: {} ajv@6.12.6: @@ -4980,6 +5085,8 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.1 + arg@4.1.3: {} + argparse@1.0.10: dependencies: sprintf-js: 1.0.3 @@ -5147,9 +5254,9 @@ snapshots: dependencies: delayed-stream: 1.0.0 - commitlint@19.6.1(@types/node@22.13.14)(typescript@5.7.2): + commitlint@19.6.1(@types/node@22.14.0)(typescript@5.6.3): dependencies: - '@commitlint/cli': 19.6.1(@types/node@22.13.14)(typescript@5.7.2) + '@commitlint/cli': 19.6.1(@types/node@22.14.0)(typescript@5.6.3) '@commitlint/types': 19.5.0 transitivePeerDependencies: - '@types/node' @@ -5194,21 +5301,23 @@ snapshots: core-js@3.39.0: {} - cosmiconfig-typescript-loader@6.1.0(@types/node@22.13.14)(cosmiconfig@9.0.0(typescript@5.7.2))(typescript@5.7.2): + cosmiconfig-typescript-loader@6.1.0(@types/node@22.14.0)(cosmiconfig@9.0.0(typescript@5.6.3))(typescript@5.6.3): dependencies: - '@types/node': 22.13.14 - cosmiconfig: 9.0.0(typescript@5.7.2) + '@types/node': 22.14.0 + cosmiconfig: 9.0.0(typescript@5.6.3) jiti: 2.4.2 - typescript: 5.7.2 + typescript: 5.6.3 - cosmiconfig@9.0.0(typescript@5.7.2): + cosmiconfig@9.0.0(typescript@5.6.3): dependencies: env-paths: 2.2.1 import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 optionalDependencies: - typescript: 5.7.2 + typescript: 5.6.3 + + create-require@1.1.1: {} cross-env@7.0.3: dependencies: @@ -5278,6 +5387,8 @@ snapshots: detect-indent@6.1.0: {} + diff@4.0.2: {} + dir-glob@3.0.1: dependencies: path-type: 4.0.0 @@ -6057,6 +6168,8 @@ snapshots: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 + make-error@1.3.6: {} + math-intrinsics@1.1.0: {} media-typer@0.3.0: {} @@ -6653,6 +6766,24 @@ snapshots: '@ts-morph/common': 0.24.0 code-block-writer: 13.0.3 + ts-node@10.9.2(@types/node@22.14.0)(typescript@5.6.3): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 22.14.0 + acorn: 8.14.1 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.6.3 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + tslib@2.8.1: {} tsscmp@1.0.6: {} @@ -6680,7 +6811,8 @@ snapshots: typescript@5.6.3: {} - typescript@5.7.2: {} + typescript@5.7.2: + optional: true ua-parser-js@1.0.40: {} @@ -6690,17 +6822,19 @@ snapshots: undici-types@6.20.0: {} + undici-types@6.21.0: {} + unicorn-magic@0.1.0: {} universalify@0.1.2: {} universalify@2.0.1: {} - unplugin-fonts@1.3.1(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)): + unplugin-fonts@1.3.1(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(yaml@2.7.1)): dependencies: fast-glob: 3.3.3 unplugin: 2.0.0-beta.1 - vite: 6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8) + vite: 6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(yaml@2.7.1) unplugin-vue-components@0.27.5(@babel/parser@7.27.0)(rollup@4.38.0)(vue@3.5.13(typescript@5.6.3)): dependencies: @@ -6721,12 +6855,12 @@ snapshots: - rollup - supports-color - unplugin-vue@6.0.1(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(vue@3.5.13(typescript@5.6.3)): + unplugin-vue@6.0.1(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(vue@3.5.13(typescript@5.6.3))(yaml@2.7.1): dependencies: '@vue/reactivity': 3.5.13 debug: 4.4.0 unplugin: 2.2.2 - vite: 6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8) + vite: 6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(yaml@2.7.1) vue: 3.5.13(typescript@5.6.3) transitivePeerDependencies: - '@types/node' @@ -6777,16 +6911,18 @@ snapshots: util-deprecate@1.0.2: {} + v8-compile-cache-lib@3.0.1: {} + varint@6.0.0: {} vary@1.1.2: {} - vite-plugin-vuetify@2.1.0(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8))(vue@3.5.13(typescript@5.6.3))(vuetify@3.7.19): + vite-plugin-vuetify@2.1.0(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(yaml@2.7.1))(vue@3.5.13(typescript@5.6.3))(vuetify@3.7.19): dependencies: '@vuetify/loader-shared': 2.1.0(vue@3.5.13(typescript@5.6.3))(vuetify@3.7.19(typescript@5.6.3)(vite-plugin-vuetify@2.1.0)(vue@3.5.13(typescript@5.6.3))) debug: 4.4.0 upath: 2.0.1 - vite: 6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8) + vite: 6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(yaml@2.7.1) vue: 3.5.13(typescript@5.6.3) vuetify: 3.7.19(typescript@5.6.3)(vite-plugin-vuetify@2.1.0)(vue@3.5.13(typescript@5.6.3)) transitivePeerDependencies: @@ -6804,7 +6940,7 @@ snapshots: - supports-color optional: true - vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8): + vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(yaml@2.7.1): dependencies: esbuild: 0.25.2 postcss: 8.5.3 @@ -6815,6 +6951,7 @@ snapshots: jiti: 2.4.2 sass: 1.77.8 sass-embedded: 1.86.0 + yaml: 2.7.1 vscode-uri@3.1.0: {} @@ -6866,7 +7003,7 @@ snapshots: vue: 3.5.13(typescript@5.6.3) optionalDependencies: typescript: 5.6.3 - vite-plugin-vuetify: 2.1.0(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8))(vue@3.5.13(typescript@5.6.3))(vuetify@3.7.19) + vite-plugin-vuetify: 2.1.0(vite@6.2.3(@types/node@22.13.14)(jiti@2.4.2)(sass-embedded@1.86.0)(sass@1.77.8)(yaml@2.7.1))(vue@3.5.13(typescript@5.6.3))(vuetify@3.7.19) vuetify@3.7.19(typescript@5.7.2)(vite-plugin-vuetify@2.1.0)(vue@3.5.13(typescript@5.7.2)): dependencies: @@ -6916,6 +7053,8 @@ snapshots: yallist@3.1.1: {} + yaml@2.7.1: {} + yargs-parser@21.1.1: {} yargs@17.7.2: @@ -6930,6 +7069,8 @@ snapshots: ylru@1.4.0: {} + yn@3.1.1: {} + yocto-queue@0.1.0: {} yocto-queue@1.1.1: {} diff --git a/scripts/update-artifacts.ts b/scripts/update-artifacts.ts new file mode 100644 index 00000000..85e484f3 --- /dev/null +++ b/scripts/update-artifacts.ts @@ -0,0 +1,54 @@ +import * as fs from 'fs'; +import * as path from 'path'; +import * as yaml from 'yaml'; + +const WORKFLOW_FILE = '.github/workflows/build.yaml'; +const RUST_PLUGINS_DIR = 'rust-plugins'; + +function generateUploadStep(pluginName: string): object { + return { + name: `Upload Plugin ${pluginName}`, + uses: 'actions/upload-artifact@v4', + with: { + name: `\${{ github.sha }}-\${{ matrix.settings.abi }}-${pluginName}`, + path: `./rust-plugins/${pluginName}/npm/\${{ matrix.settings.abi }}/index.farm`, + 'if-no-files-found': 'ignore' + } + }; +} + +function updateWorkflow() { + // Read the workflow file + const workflowPath = path.join(process.cwd(), WORKFLOW_FILE); + const workflowContent = fs.readFileSync(workflowPath, 'utf8'); + const workflow = yaml.parse(workflowContent); + + // Get all rust plugin directories + const pluginsPath = path.join(process.cwd(), RUST_PLUGINS_DIR); + const plugins = fs.readdirSync(pluginsPath) + .filter(name => fs.statSync(path.join(pluginsPath, name)).isDirectory()); + + // Find the build job + const buildJob = workflow.jobs.build; + if (!buildJob) { + throw new Error('Could not find build job in workflow file'); + } + + // Remove existing upload steps + // @ts-ignore + buildJob.steps = buildJob.steps.filter(step => + !(step.name && step.name.startsWith('Upload Plugin ')) + ); + + // Add new upload steps for each plugin + plugins.forEach(plugin => { + buildJob.steps.push(generateUploadStep(plugin)); + }); + + // Write back to file + fs.writeFileSync(workflowPath, yaml.stringify(workflow)); + + console.log(`Updated workflow file with ${plugins.length} plugins`); +} + +updateWorkflow(); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..a7eeb3b3 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + } +} \ No newline at end of file