diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a15913..8ed102f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,14 +9,38 @@ jobs: strategy: matrix: versions: - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - # - os: ubuntu-latest - # target: aarch64-unknown-linux-gnu - os: macos-latest target: aarch64-apple-darwin - # - os: windows-latest - # target: x86_64-pc-windows-msvc + filename: highlight.darwin-arm64.node + out_dir: darwin-arm64 + - os: macos-latest + target: x86_64-apple-darwin + filename: highlight.darwin-x64.node + out_dir: darwin-x64 + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + filename: highlight.linux-arm64-gnu.node + out_dir: linux-arm64-gnu + - os: ubuntu-latest + target: aarch64-unknown-linux-musl + filename: highlight.linux-arm64-musl.node + out_dir: linux-arm64-musl + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + filename: highlight.linux-x64-gnu.node + out_dir: linux-x64-gnu + - os: ubuntu-latest + target: x86_64-unknown-linux-musl + filename: highlight.linux-x64-musl.node + out_dir: linux-x64-musl + - os: windows-latest + target: aarch64-pc-windows-msvc + filename: highlight.win32-arm64-msvc.node + out_dir: win32-arm64-msvc + - os: windows-latest + target: x86_64-pc-windows-msvc + filename: highlight.win32-x64-msvc.node + out_dir: win32-x64-msvc runs-on: ${{ matrix.versions.os }} name: ${{ matrix.versions.os }}-${{ matrix.versions.target }} steps: @@ -28,12 +52,18 @@ jobs: with: targets: ${{ matrix.versions.target }} - uses: mlugg/setup-zig@v1 + - uses: actions/setup-node@v4 + with: + registry: "https://npm.zerolimits.dev" - run: bun install - run: bun run build --target ${{ matrix.versions.target }} + - run: mv ${{ matrix.versions.filename }} packages/${{ matrix.versions.out_dir }}/${{ matrix.versions.filename }} - uses: actions/upload-artifact@v4 with: name: highlight-${{ matrix.versions.target }} path: dist/ + - run: cd packages/${{ matrix.versions.out_dir }}/${{ matrix.versions.filename }} + - run: bun publish publish: needs: build @@ -48,6 +78,7 @@ jobs: path: dist/ merge-multiple: true - uses: oven-sh/setup-bun@v2 + - uses: actions/setup-node@v4 with: - bun-version: latest - - run: bunx jsr publish + registry: "https://npm.zerolimits.dev" + - run: bun publish diff --git a/jsr.json b/jsr.json deleted file mode 100644 index aae0759..0000000 --- a/jsr.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$schema": "https://jsr.io/schema/config-file.v1.json", - "name": "@noclaps/highlight", - "version": "0.3.0", - "exports": "./index.ts", - "publish": { - "include": [ - "dist", - "bun.lockb", - "index.ts", - "LICENSE", - "README.md", - "package.json" - ] - } -} diff --git a/package.json b/package.json index 114cb69..a272786 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,18 @@ "@napi-rs/cli": "^2.18.4", "@types/bun": "^1.1.14" }, + "optionalDependencies": { + "@noclaps/highlight-darwin-arm64": "^0.3.0", + "@noclaps/highlight-darwin-x64": "^0.3.0", + "@noclaps/highlight-linux-arm64-gnu": "^0.3.0", + "@noclaps/highlight-linux-arm64-musl": "^0.3.0", + "@noclaps/highlight-linux-x64-gnu": "^0.3.0", + "@noclaps/highlight-linux-x64-musl": "^0.3.0", + "@noclaps/highlight-win32-arm64-msvc": "^0.3.0", + "@noclaps/highlight-win32-x64-msvc": "^0.3.0" + }, "scripts": { - "build": "napi build --release ./dist --platform" + "build": "napi build --platform --js ./dist/index.js --dts ./dist/index.d.ts" }, "napi": { "name": "highlight", @@ -21,5 +31,14 @@ ] } }, - "type": "module" + "type": "module", + "exports": "./index.ts", + "files": [ + "dist", + "bun.lockb", + "index.ts", + "LICENSE", + "README.md", + "package.json" + ] } diff --git a/packages/darwin-arm64/package.json b/packages/darwin-arm64/package.json new file mode 100644 index 0000000..83442f5 --- /dev/null +++ b/packages/darwin-arm64/package.json @@ -0,0 +1,16 @@ +{ + "name": "@noclaps/highlight-darwin-arm64", + "version": "0.3.0", + "type": "module", + "exports": "./highlight.darwin-arm64.node", + "files": [ + "highlight.darwin-arm64.node", + "package.json" + ], + "os": [ + "darwin" + ], + "cpu": [ + "arm64" + ] +} diff --git a/packages/darwin-x64/package.json b/packages/darwin-x64/package.json new file mode 100644 index 0000000..817a0a0 --- /dev/null +++ b/packages/darwin-x64/package.json @@ -0,0 +1,16 @@ +{ + "name": "@noclaps/highlight-darwin-x64", + "version": "0.3.0", + "type": "module", + "exports": "./highlight.darwin-x64.node", + "files": [ + "highlight.darwin-x64.node", + "package.json" + ], + "os": [ + "darwin" + ], + "cpu": [ + "x64" + ] +} diff --git a/packages/linux-arm64-gnu/package.json b/packages/linux-arm64-gnu/package.json new file mode 100644 index 0000000..7fcfd4e --- /dev/null +++ b/packages/linux-arm64-gnu/package.json @@ -0,0 +1,19 @@ +{ + "name": "@noclaps/highlight-linux-arm64-gnu", + "version": "0.3.0", + "type": "module", + "exports": "./highlight.linux-arm64-gnu.node", + "files": [ + "highlight.linux-arm64-gnu.node", + "package.json" + ], + "os": [ + "linux" + ], + "libc": [ + "glibc" + ], + "cpu": [ + "arm64" + ] +} diff --git a/packages/linux-arm64-musl/package.json b/packages/linux-arm64-musl/package.json new file mode 100644 index 0000000..382cfc2 --- /dev/null +++ b/packages/linux-arm64-musl/package.json @@ -0,0 +1,19 @@ +{ + "name": "@noclaps/highlight-linux-arm64-musl", + "version": "0.3.0", + "type": "module", + "exports": "./highlight.linux-arm64-musl.node", + "files": [ + "highlight.linux-arm64-musl.node", + "package.json" + ], + "os": [ + "linux" + ], + "libc": [ + "musl" + ], + "cpu": [ + "arm64" + ] +} diff --git a/packages/linux-x64-gnu/package.json b/packages/linux-x64-gnu/package.json new file mode 100644 index 0000000..9dbbc96 --- /dev/null +++ b/packages/linux-x64-gnu/package.json @@ -0,0 +1,19 @@ +{ + "name": "@noclaps/highlight-linux-x64-gnu", + "version": "0.3.0", + "type": "module", + "exports": "./highlight.linux-x64-gnu.node", + "files": [ + "highlight.linux-x64-gnu.node", + "package.json" + ], + "os": [ + "linux" + ], + "libc": [ + "glibc" + ], + "cpu": [ + "x64" + ] +} diff --git a/packages/linux-x64-musl/package.json b/packages/linux-x64-musl/package.json new file mode 100644 index 0000000..3884ec2 --- /dev/null +++ b/packages/linux-x64-musl/package.json @@ -0,0 +1,19 @@ +{ + "name": "@noclaps/highlight-linux-x64-musl", + "version": "0.3.0", + "type": "module", + "exports": "./highlight.linux-x64-musl.node", + "files": [ + "highlight.linux-x64-musl.node", + "package.json" + ], + "os": [ + "linux" + ], + "libc": [ + "musl" + ], + "cpu": [ + "x64" + ] +} diff --git a/packages/win32-arm64-msvc/package.json b/packages/win32-arm64-msvc/package.json new file mode 100644 index 0000000..3a753da --- /dev/null +++ b/packages/win32-arm64-msvc/package.json @@ -0,0 +1,19 @@ +{ + "name": "@noclaps/highlight-win32-arm64-msvc", + "version": "0.3.0", + "type": "module", + "exports": "./highlight.win32-arm64-msvc.node", + "files": [ + "highlight.win32-arm64-msvc.node", + "package.json" + ], + "os": [ + "win32" + ], + "libc": [ + "msvc" + ], + "cpu": [ + "arm64" + ] +} diff --git a/packages/win32-x64-msvc/package.json b/packages/win32-x64-msvc/package.json new file mode 100644 index 0000000..d54a929 --- /dev/null +++ b/packages/win32-x64-msvc/package.json @@ -0,0 +1,19 @@ +{ + "name": "@noclaps/highlight-win32-x64-msvc", + "version": "0.3.0", + "type": "module", + "exports": "./highlight.win32-x64-msvc.node", + "files": [ + "highlight.win32-x64-msvc.node", + "package.json" + ], + "os": [ + "win32" + ], + "libc": [ + "msvc" + ], + "cpu": [ + "x64" + ] +}