From f63ffd1179f6494b84f19da9c1e264d623996e39 Mon Sep 17 00:00:00 2001 From: tobias-tengler <45513122+tobias-tengler@users.noreply.github.com> Date: Fri, 17 Apr 2026 11:18:14 +0200 Subject: [PATCH 01/13] Remove win-arm64 --- .github/workflows/release.yml | 5 ++--- src/Nitro/CommandLine/src/chillicream-nitro/cli.js | 1 - src/Nitro/CommandLine/src/chillicream-nitro/package.json | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3b46c97747..10cd0a5f034 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,12 +99,11 @@ jobs: strategy: matrix: include: - # Linux (x64) + # Linux - os: ubuntu-22.04 rid: linux-x64 - os: ubuntu-22.04 rid: linux-musl-x64 - # Linux (arm64 on ARM runner!) - os: ubuntu-24.04-arm rid: linux-arm64 # macOS @@ -117,7 +116,7 @@ jobs: rid: win-x64 - os: windows-2025 rid: win-x86 - # Windows (arm64 on ARM runner!) + # Commented, since azure/artifact-signing-action does not currently support ARM. # - os: windows-11-arm # rid: win-arm64 diff --git a/src/Nitro/CommandLine/src/chillicream-nitro/cli.js b/src/Nitro/CommandLine/src/chillicream-nitro/cli.js index 65c93937c9e..ffa28612d15 100755 --- a/src/Nitro/CommandLine/src/chillicream-nitro/cli.js +++ b/src/Nitro/CommandLine/src/chillicream-nitro/cli.js @@ -19,7 +19,6 @@ async function resolveBinary() { win32: { x64: "win-x64/nitro.exe", ia32: "win-x86/nitro.exe", - arm64: "win-arm64/nitro.exe", }, linux: { x64: async () => { diff --git a/src/Nitro/CommandLine/src/chillicream-nitro/package.json b/src/Nitro/CommandLine/src/chillicream-nitro/package.json index a090f3a4241..095455cbd2f 100644 --- a/src/Nitro/CommandLine/src/chillicream-nitro/package.json +++ b/src/Nitro/CommandLine/src/chillicream-nitro/package.json @@ -38,8 +38,7 @@ "osx-x64/", "osx-arm64/", "win-x64/", - "win-x86/", - "win-arm64/" + "win-x86/" ], "packageManager": "yarn@4.9.4", "dependencies": { From f9eaea19040e3de52348a5dbe27391841469ec6e Mon Sep 17 00:00:00 2001 From: tobias-tengler <45513122+tobias-tengler@users.noreply.github.com> Date: Fri, 17 Apr 2026 11:22:24 +0200 Subject: [PATCH 02/13] wip --- .github/workflows/release.yml | 149 +++++++++++------- .../CommandLine/src/chillicream-nitro/cli.js | 79 ++++------ .../src/chillicream-nitro/package.json | 19 ++- .../src/chillicream-nitro/yarn.lock | 23 --- 4 files changed, 132 insertions(+), 138 deletions(-) delete mode 100644 src/Nitro/CommandLine/src/chillicream-nitro/yarn.lock diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 10cd0a5f034..71e19fa24d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -315,9 +315,6 @@ jobs: registry-url: ${{ vars.NPM_REGISTRY_URL }} scope: "@chillicream" - - name: 🧰 Enable corepack - run: corepack enable - - name: 📥 Download all packaged nitro binaries uses: actions/download-artifact@v8 with: @@ -328,72 +325,106 @@ jobs: - name: 🏷 Get the version from tag run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - name: 🗂️ Move binaries to npm package + - name: 🏷 Compute dist-tag run: | - PACKAGE_DIR="src/Nitro/CommandLine/src/chillicream-nitro" - - for archive in dist-archives/nitro-*; do - base=$(basename "$archive") - - case "$base" in - nitro-*.zip) - rid=${base#nitro-} - rid=${rid%.zip} - echo "Unpacking $archive -> $PACKAGE_DIR/$rid" - mkdir -p "$PACKAGE_DIR/$rid" - unzip -q "$archive" -d "$PACKAGE_DIR/$rid" - ;; - nitro-*.tar.gz) - rid=${base#nitro-} - rid=${rid%.tar.gz} - echo "Unpacking $archive -> $PACKAGE_DIR/$rid" - mkdir -p "$PACKAGE_DIR/$rid" - tar -xzf "$archive" -C "$PACKAGE_DIR/$rid" - ;; - *) - echo "Skipping unknown artifact: $archive" - ;; - esac - done - - # Ensure unix binaries are executable - chmod +x $PACKAGE_DIR/linux-x64/nitro || true - chmod +x $PACKAGE_DIR/linux-musl-x64/nitro || true - chmod +x $PACKAGE_DIR/linux-arm64/nitro || true - chmod +x $PACKAGE_DIR/osx-x64/nitro || true - chmod +x $PACKAGE_DIR/osx-arm64/nitro || true - - # Ensure cli.js is executable - chmod +x $PACKAGE_DIR/cli.js + if [[ "$GIT_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "DIST_TAG=latest" >> $GITHUB_ENV + else + echo "DIST_TAG=preview" >> $GITHUB_ENV + fi + shell: bash - - name: 🔍 Install dependencies - working-directory: src/Nitro/CommandLine/src/chillicream-nitro - run: yarn install --immutable + - name: 📦 Publish platform packages to npm + shell: bash + run: | + set -euo pipefail + + # rid pkg-suffix os cpu libc binary + targets=( + "linux-x64 linux-x64 linux x64 glibc nitro" + "linux-musl-x64 linux-x64-musl linux x64 musl nitro" + "linux-arm64 linux-arm64 linux arm64 - nitro" + "osx-x64 darwin-x64 darwin x64 - nitro" + "osx-arm64 darwin-arm64 darwin arm64 - nitro" + "win-x64 win32-x64 win32 x64 - nitro.exe" + "win-x86 win32-ia32 win32 ia32 - nitro.exe" + ) + + STAGING="$(mktemp -d)" + + for t in "${targets[@]}"; do + read -r rid suffix os cpu libc binary <<< "$t" + pkg_dir="$STAGING/nitro-$suffix" + mkdir -p "$pkg_dir" + + archive="dist-archives/nitro-$rid.tar.gz" + if [ ! -f "$archive" ]; then + archive="dist-archives/nitro-$rid.zip" + fi + + case "$archive" in + *.tar.gz) tar -xzf "$archive" -C "$pkg_dir" ;; + *.zip) unzip -q "$archive" -d "$pkg_dir" ;; + esac - - name: 📥 Install npm@11.9.0 - run: npm install -g npm@11.9.0 + if [ "$os" != "win32" ]; then + chmod +x "$pkg_dir/$binary" + fi + + jq_args=( + --arg name "@chillicream/nitro-$suffix" + --arg version "$GIT_TAG" + --arg os "$os" + --arg cpu "$cpu" + --arg binary "$binary" + ) + jq_filter='{ + name: $name, + version: $version, + description: ("Nitro CLI binary (" + $os + "-" + $cpu + ")"), + repository: { + type: "git", + url: "https://github.com/ChilliCream/graphql-platform" + }, + license: "MIT", + os: [$os], + cpu: [$cpu], + files: [$binary] + }' + if [ "$libc" != "-" ]; then + jq_args+=(--arg libc "$libc") + jq_filter="$jq_filter + {libc: [\$libc]}" + fi + + jq -n "${jq_args[@]}" "$jq_filter" > "$pkg_dir/package.json" + + echo "Publishing @chillicream/nitro-$suffix@$GIT_TAG" + (cd "$pkg_dir" && npm publish --access public --tag "$DIST_TAG" --registry="${{ vars.NPM_REGISTRY_URL }}") + done - - name: 🏷️ Set version + - name: 🏷️ Bump main package versions working-directory: src/Nitro/CommandLine/src/chillicream-nitro - run: npm version $GIT_TAG - - - name: 📦 Create tarball + shell: bash + run: | + set -euo pipefail + chmod +x cli.js + jq --arg v "$GIT_TAG" \ + '.version = $v | .optionalDependencies = (.optionalDependencies | map_values($v))' \ + package.json > package.json.tmp + mv package.json.tmp package.json + + - name: 📦 Create main tarball working-directory: src/Nitro/CommandLine/src/chillicream-nitro run: npm pack - - name: 🚀 Publish tarball to npm + - name: 🚀 Publish main to npm working-directory: src/Nitro/CommandLine/src/chillicream-nitro - run: | - TARBALL="chillicream-nitro-${GIT_TAG}.tgz" - - if [[ "$GIT_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - DIST_TAG="latest" - else - DIST_TAG="preview" - fi - - npm publish "./${TARBALL}" --access public --registry=${{ vars.NPM_REGISTRY_URL }} --tag "${DIST_TAG}" shell: bash + run: | + npm publish "./chillicream-nitro-${GIT_TAG}.tgz" \ + --access public \ + --registry="${{ vars.NPM_REGISTRY_URL }}" \ + --tag "${DIST_TAG}" - name: 📤 Upload tarball as artifact uses: actions/upload-artifact@v7 diff --git a/src/Nitro/CommandLine/src/chillicream-nitro/cli.js b/src/Nitro/CommandLine/src/chillicream-nitro/cli.js index ffa28612d15..33d704f482c 100755 --- a/src/Nitro/CommandLine/src/chillicream-nitro/cli.js +++ b/src/Nitro/CommandLine/src/chillicream-nitro/cli.js @@ -1,57 +1,44 @@ #!/usr/bin/env node "use strict"; -import { join, dirname } from "path"; -import { fileURLToPath } from "url"; +import { createRequire } from "module"; import { spawn } from "child_process"; -import { family, GLIBC, MUSL } from "detect-libc"; - -const __dirname = dirname(fileURLToPath(import.meta.url)); - -async function resolveBinary() { - const { platform, arch } = process; - - const binaries = { - darwin: { - x64: "osx-x64/nitro", - arm64: "osx-arm64/nitro", - }, - win32: { - x64: "win-x64/nitro.exe", - ia32: "win-x86/nitro.exe", - }, - linux: { - x64: async () => { - const libc = await family(); - - if (libc === GLIBC) { - return "linux-x64/nitro"; - } else if (libc === MUSL) { - return "linux-musl-x64/nitro"; - } - - return null; - }, - arm64: "linux-arm64/nitro", - }, - }; - - const binary = binaries[platform]?.[arch]; - if (!binary) { - return null; +import { dirname, join } from "path"; + +const require = createRequire(import.meta.url); + +const candidates = { + "darwin-arm64": ["@chillicream/nitro-darwin-arm64"], + "darwin-x64": ["@chillicream/nitro-darwin-x64"], + "linux-arm64": ["@chillicream/nitro-linux-arm64"], + "linux-x64": [ + "@chillicream/nitro-linux-x64", + "@chillicream/nitro-linux-x64-musl", + ], + "win32-ia32": ["@chillicream/nitro-win32-ia32"], + "win32-x64": ["@chillicream/nitro-win32-x64"], +}; + +function resolveBinary() { + const key = `${process.platform}-${process.arch}`; + const binaryName = process.platform === "win32" ? "nitro.exe" : "nitro"; + + for (const pkg of candidates[key] ?? []) { + try { + const pkgJson = require.resolve(`${pkg}/package.json`); + return join(dirname(pkgJson), binaryName); + } catch {} } - - const binaryPath = typeof binary === "function" ? await binary() : binary; - return binaryPath ? join(__dirname, binaryPath) : null; + return null; } -const bin = await resolveBinary(); -const input = process.argv.slice(2); +const bin = resolveBinary(); -if (bin !== null) { - spawn(bin, input, { stdio: "inherit" }).on("exit", process.exit); -} else { +if (bin === null) { throw new Error( - `Platform "${process.platform} (${process.arch})" not supported.` + `Platform "${process.platform} (${process.arch})" is not supported by @chillicream/nitro.` ); } + +const child = spawn(bin, process.argv.slice(2), { stdio: "inherit" }); +child.on("exit", (code) => process.exit(code ?? 0)); diff --git a/src/Nitro/CommandLine/src/chillicream-nitro/package.json b/src/Nitro/CommandLine/src/chillicream-nitro/package.json index 095455cbd2f..21a1c35e972 100644 --- a/src/Nitro/CommandLine/src/chillicream-nitro/package.json +++ b/src/Nitro/CommandLine/src/chillicream-nitro/package.json @@ -32,16 +32,15 @@ }, "files": [ "cli.js", - "linux-x64/", - "linux-musl-x64/", - "linux-arm64/", - "osx-x64/", - "osx-arm64/", - "win-x64/", - "win-x86/" + "README.md" ], - "packageManager": "yarn@4.9.4", - "dependencies": { - "detect-libc": "^2.0.4" + "optionalDependencies": { + "@chillicream/nitro-darwin-arm64": "0.0.0", + "@chillicream/nitro-darwin-x64": "0.0.0", + "@chillicream/nitro-linux-arm64": "0.0.0", + "@chillicream/nitro-linux-x64": "0.0.0", + "@chillicream/nitro-linux-x64-musl": "0.0.0", + "@chillicream/nitro-win32-ia32": "0.0.0", + "@chillicream/nitro-win32-x64": "0.0.0" } } diff --git a/src/Nitro/CommandLine/src/chillicream-nitro/yarn.lock b/src/Nitro/CommandLine/src/chillicream-nitro/yarn.lock deleted file mode 100644 index f68a7f78e19..00000000000 --- a/src/Nitro/CommandLine/src/chillicream-nitro/yarn.lock +++ /dev/null @@ -1,23 +0,0 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! - -__metadata: - version: 8 - cacheKey: 10c0 - -"@chillicream/nitro@workspace:.": - version: 0.0.0-use.local - resolution: "@chillicream/nitro@workspace:." - dependencies: - detect-libc: "npm:^2.0.4" - bin: - nitro: cli.js - languageName: unknown - linkType: soft - -"detect-libc@npm:^2.0.4": - version: 2.0.4 - resolution: "detect-libc@npm:2.0.4" - checksum: 10c0/c15541f836eba4b1f521e4eecc28eefefdbc10a94d3b8cb4c507689f332cc111babb95deda66f2de050b22122113189986d5190be97d51b5a2b23b938415e67c - languageName: node - linkType: hard From 67bc446d4522540a525b031f7992c5bf0d06d28c Mon Sep 17 00:00:00 2001 From: tobias-tengler <45513122+tobias-tengler@users.noreply.github.com> Date: Fri, 17 Apr 2026 11:28:05 +0200 Subject: [PATCH 03/13] wip --- .github/workflows/release.yml | 169 ++++++++++-------- .../package.json | 29 +++ .../chillicream-nitro-darwin-x64/package.json | 29 +++ .../package.json | 32 ++++ .../package.json | 32 ++++ .../chillicream-nitro-linux-x64/package.json | 32 ++++ .../chillicream-nitro-win32-ia32/package.json | 29 +++ .../chillicream-nitro-win32-x64/package.json | 29 +++ .../{ => npm}/chillicream-nitro/.editorconfig | 0 .../chillicream-nitro/.gitattributes | 0 .../{ => npm}/chillicream-nitro/.gitignore | 0 .../{ => npm}/chillicream-nitro/.yarnrc.yml | 0 .../src/{ => npm}/chillicream-nitro/README.md | 0 .../src/{ => npm}/chillicream-nitro/cli.js | 0 .../{ => npm}/chillicream-nitro/package.json | 2 +- 15 files changed, 304 insertions(+), 79 deletions(-) create mode 100644 src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-arm64/package.json create mode 100644 src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-x64/package.json create mode 100644 src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-arm64/package.json create mode 100644 src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-x64-musl/package.json create mode 100644 src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-x64/package.json create mode 100644 src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-ia32/package.json create mode 100644 src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-x64/package.json rename src/Nitro/CommandLine/src/{ => npm}/chillicream-nitro/.editorconfig (100%) rename src/Nitro/CommandLine/src/{ => npm}/chillicream-nitro/.gitattributes (100%) rename src/Nitro/CommandLine/src/{ => npm}/chillicream-nitro/.gitignore (100%) rename src/Nitro/CommandLine/src/{ => npm}/chillicream-nitro/.yarnrc.yml (100%) rename src/Nitro/CommandLine/src/{ => npm}/chillicream-nitro/README.md (100%) rename src/Nitro/CommandLine/src/{ => npm}/chillicream-nitro/cli.js (100%) rename src/Nitro/CommandLine/src/{ => npm}/chillicream-nitro/package.json (94%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 71e19fa24d0..861a7291277 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -295,14 +295,39 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - publish-nitro-cli-npm: - name: 🧱 Publish Nitro CLI to npm + publish-nitro-cli-platforms: + name: 🧱 Publish Nitro CLI (${{ matrix.dir }}) to npm runs-on: ubuntu-latest needs: [build-nitro-cli] if: startsWith(github.ref, 'refs/tags/') permissions: - contents: write + contents: read id-token: write + strategy: + fail-fast: false + matrix: + include: + - rid: linux-x64 + dir: linux-x64 + binary: nitro + - rid: linux-musl-x64 + dir: linux-x64-musl + binary: nitro + - rid: linux-arm64 + dir: linux-arm64 + binary: nitro + - rid: osx-x64 + dir: darwin-x64 + binary: nitro + - rid: osx-arm64 + dir: darwin-arm64 + binary: nitro + - rid: win-x64 + dir: win32-x64 + binary: nitro.exe + - rid: win-x86 + dir: win32-ia32 + binary: nitro.exe steps: - name: 📦 Checkout @@ -315,12 +340,11 @@ jobs: registry-url: ${{ vars.NPM_REGISTRY_URL }} scope: "@chillicream" - - name: 📥 Download all packaged nitro binaries + - name: 📥 Download nitro binary uses: actions/download-artifact@v8 with: - pattern: nitro-* - merge-multiple: true - path: dist-archives + name: nitro-${{ matrix.rid }} + path: dist - name: 🏷 Get the version from tag run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV @@ -334,76 +358,65 @@ jobs: fi shell: bash - - name: 📦 Publish platform packages to npm + - name: 🗂️ Stage binary in package directory shell: bash + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.dir }} run: | set -euo pipefail + archive="$GITHUB_WORKSPACE/dist/nitro-${{ matrix.rid }}.tar.gz" + if [ ! -f "$archive" ]; then + archive="$GITHUB_WORKSPACE/dist/nitro-${{ matrix.rid }}.zip" + fi + case "$archive" in + *.tar.gz) tar -xzf "$archive" ;; + *.zip) unzip -q "$archive" ;; + esac + if [ "${{ matrix.binary }}" = "nitro" ]; then + chmod +x "${{ matrix.binary }}" + fi - # rid pkg-suffix os cpu libc binary - targets=( - "linux-x64 linux-x64 linux x64 glibc nitro" - "linux-musl-x64 linux-x64-musl linux x64 musl nitro" - "linux-arm64 linux-arm64 linux arm64 - nitro" - "osx-x64 darwin-x64 darwin x64 - nitro" - "osx-arm64 darwin-arm64 darwin arm64 - nitro" - "win-x64 win32-x64 win32 x64 - nitro.exe" - "win-x86 win32-ia32 win32 ia32 - nitro.exe" - ) - - STAGING="$(mktemp -d)" - - for t in "${targets[@]}"; do - read -r rid suffix os cpu libc binary <<< "$t" - pkg_dir="$STAGING/nitro-$suffix" - mkdir -p "$pkg_dir" - - archive="dist-archives/nitro-$rid.tar.gz" - if [ ! -f "$archive" ]; then - archive="dist-archives/nitro-$rid.zip" - fi - - case "$archive" in - *.tar.gz) tar -xzf "$archive" -C "$pkg_dir" ;; - *.zip) unzip -q "$archive" -d "$pkg_dir" ;; - esac - - if [ "$os" != "win32" ]; then - chmod +x "$pkg_dir/$binary" - fi - - jq_args=( - --arg name "@chillicream/nitro-$suffix" - --arg version "$GIT_TAG" - --arg os "$os" - --arg cpu "$cpu" - --arg binary "$binary" - ) - jq_filter='{ - name: $name, - version: $version, - description: ("Nitro CLI binary (" + $os + "-" + $cpu + ")"), - repository: { - type: "git", - url: "https://github.com/ChilliCream/graphql-platform" - }, - license: "MIT", - os: [$os], - cpu: [$cpu], - files: [$binary] - }' - if [ "$libc" != "-" ]; then - jq_args+=(--arg libc "$libc") - jq_filter="$jq_filter + {libc: [\$libc]}" - fi - - jq -n "${jq_args[@]}" "$jq_filter" > "$pkg_dir/package.json" - - echo "Publishing @chillicream/nitro-$suffix@$GIT_TAG" - (cd "$pkg_dir" && npm publish --access public --tag "$DIST_TAG" --registry="${{ vars.NPM_REGISTRY_URL }}") - done + - name: 🏷️ Set version + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.dir }} + run: npm version "$GIT_TAG" --no-git-tag-version --allow-same-version + + - name: 🚀 Publish to npm + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.dir }} + run: npm publish --access public --tag "$DIST_TAG" --registry="${{ vars.NPM_REGISTRY_URL }}" + + publish-nitro-cli-npm: + name: 🧱 Publish Nitro CLI to npm + runs-on: ubuntu-latest + needs: [publish-nitro-cli-platforms] + if: startsWith(github.ref, 'refs/tags/') + permissions: + contents: write + id-token: write + + steps: + - name: 📦 Checkout + uses: actions/checkout@v6 + + - name: 🧰 Setup Node + uses: actions/setup-node@v6 + with: + node-version: 24 + registry-url: ${{ vars.NPM_REGISTRY_URL }} + scope: "@chillicream" + + - name: 🏷 Get the version from tag + run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: 🏷 Compute dist-tag + run: | + if [[ "$GIT_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "DIST_TAG=latest" >> $GITHUB_ENV + else + echo "DIST_TAG=preview" >> $GITHUB_ENV + fi + shell: bash - - name: 🏷️ Bump main package versions - working-directory: src/Nitro/CommandLine/src/chillicream-nitro + - name: 🏷️ Bump version and optionalDependencies + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro shell: bash run: | set -euo pipefail @@ -413,12 +426,12 @@ jobs: package.json > package.json.tmp mv package.json.tmp package.json - - name: 📦 Create main tarball - working-directory: src/Nitro/CommandLine/src/chillicream-nitro + - name: 📦 Create tarball + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro run: npm pack - - name: 🚀 Publish main to npm - working-directory: src/Nitro/CommandLine/src/chillicream-nitro + - name: 🚀 Publish tarball to npm + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro shell: bash run: | npm publish "./chillicream-nitro-${GIT_TAG}.tgz" \ @@ -430,12 +443,12 @@ jobs: uses: actions/upload-artifact@v7 with: name: chillicream-nitro-${{ env.GIT_TAG }}.tgz - path: src/Nitro/CommandLine/src/chillicream-nitro/chillicream-nitro-${{ env.GIT_TAG }}.tgz + path: src/Nitro/CommandLine/src/npm/chillicream-nitro/chillicream-nitro-${{ env.GIT_TAG }}.tgz - name: 📤 Attach tarball to GitHub release env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - working-directory: src/Nitro/CommandLine/src/chillicream-nitro + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro run: | gh release upload "${{ github.ref_name }}" "chillicream-nitro-${{ github.ref_name }}.tgz" --repo "${{ github.repository }}" diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-arm64/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-arm64/package.json new file mode 100644 index 00000000000..0476c433c59 --- /dev/null +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-arm64/package.json @@ -0,0 +1,29 @@ +{ + "name": "@chillicream/nitro-darwin-arm64", + "version": "0.0.0", + "description": "Nitro CLI binary for darwin-arm64", + "homepage": "https://chillicream.com", + "repository": { + "type": "git", + "url": "https://github.com/ChilliCream/graphql-platform", + "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-arm64" + }, + "bugs": { + "url": "https://github.com/ChilliCream/graphql-platform/issues" + }, + "author": { + "name": "ChilliCream", + "url": "https://chillicream.com", + "email": "info@chillicream.com" + }, + "license": "MIT", + "os": [ + "darwin" + ], + "cpu": [ + "arm64" + ], + "files": [ + "nitro" + ] +} diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-x64/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-x64/package.json new file mode 100644 index 00000000000..ed037baddc8 --- /dev/null +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-x64/package.json @@ -0,0 +1,29 @@ +{ + "name": "@chillicream/nitro-darwin-x64", + "version": "0.0.0", + "description": "Nitro CLI binary for darwin-x64", + "homepage": "https://chillicream.com", + "repository": { + "type": "git", + "url": "https://github.com/ChilliCream/graphql-platform", + "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-x64" + }, + "bugs": { + "url": "https://github.com/ChilliCream/graphql-platform/issues" + }, + "author": { + "name": "ChilliCream", + "url": "https://chillicream.com", + "email": "info@chillicream.com" + }, + "license": "MIT", + "os": [ + "darwin" + ], + "cpu": [ + "x64" + ], + "files": [ + "nitro" + ] +} diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-arm64/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-arm64/package.json new file mode 100644 index 00000000000..dde7bcd67a7 --- /dev/null +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-arm64/package.json @@ -0,0 +1,32 @@ +{ + "name": "@chillicream/nitro-linux-arm64", + "version": "0.0.0", + "description": "Nitro CLI binary for linux-arm64 (glibc)", + "homepage": "https://chillicream.com", + "repository": { + "type": "git", + "url": "https://github.com/ChilliCream/graphql-platform", + "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-arm64" + }, + "bugs": { + "url": "https://github.com/ChilliCream/graphql-platform/issues" + }, + "author": { + "name": "ChilliCream", + "url": "https://chillicream.com", + "email": "info@chillicream.com" + }, + "license": "MIT", + "os": [ + "linux" + ], + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "files": [ + "nitro" + ] +} diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-x64-musl/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-x64-musl/package.json new file mode 100644 index 00000000000..8bac13614ec --- /dev/null +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-x64-musl/package.json @@ -0,0 +1,32 @@ +{ + "name": "@chillicream/nitro-linux-x64-musl", + "version": "0.0.0", + "description": "Nitro CLI binary for linux-x64 (musl)", + "homepage": "https://chillicream.com", + "repository": { + "type": "git", + "url": "https://github.com/ChilliCream/graphql-platform", + "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-x64-musl" + }, + "bugs": { + "url": "https://github.com/ChilliCream/graphql-platform/issues" + }, + "author": { + "name": "ChilliCream", + "url": "https://chillicream.com", + "email": "info@chillicream.com" + }, + "license": "MIT", + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "files": [ + "nitro" + ] +} diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-x64/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-x64/package.json new file mode 100644 index 00000000000..c9aa1360b34 --- /dev/null +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-x64/package.json @@ -0,0 +1,32 @@ +{ + "name": "@chillicream/nitro-linux-x64", + "version": "0.0.0", + "description": "Nitro CLI binary for linux-x64 (glibc)", + "homepage": "https://chillicream.com", + "repository": { + "type": "git", + "url": "https://github.com/ChilliCream/graphql-platform", + "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-x64" + }, + "bugs": { + "url": "https://github.com/ChilliCream/graphql-platform/issues" + }, + "author": { + "name": "ChilliCream", + "url": "https://chillicream.com", + "email": "info@chillicream.com" + }, + "license": "MIT", + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "files": [ + "nitro" + ] +} diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-ia32/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-ia32/package.json new file mode 100644 index 00000000000..af5ff3bc97d --- /dev/null +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-ia32/package.json @@ -0,0 +1,29 @@ +{ + "name": "@chillicream/nitro-win32-ia32", + "version": "0.0.0", + "description": "Nitro CLI binary for win32-ia32", + "homepage": "https://chillicream.com", + "repository": { + "type": "git", + "url": "https://github.com/ChilliCream/graphql-platform", + "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-ia32" + }, + "bugs": { + "url": "https://github.com/ChilliCream/graphql-platform/issues" + }, + "author": { + "name": "ChilliCream", + "url": "https://chillicream.com", + "email": "info@chillicream.com" + }, + "license": "MIT", + "os": [ + "win32" + ], + "cpu": [ + "ia32" + ], + "files": [ + "nitro.exe" + ] +} diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-x64/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-x64/package.json new file mode 100644 index 00000000000..e723a843d4f --- /dev/null +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-x64/package.json @@ -0,0 +1,29 @@ +{ + "name": "@chillicream/nitro-win32-x64", + "version": "0.0.0", + "description": "Nitro CLI binary for win32-x64", + "homepage": "https://chillicream.com", + "repository": { + "type": "git", + "url": "https://github.com/ChilliCream/graphql-platform", + "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-x64" + }, + "bugs": { + "url": "https://github.com/ChilliCream/graphql-platform/issues" + }, + "author": { + "name": "ChilliCream", + "url": "https://chillicream.com", + "email": "info@chillicream.com" + }, + "license": "MIT", + "os": [ + "win32" + ], + "cpu": [ + "x64" + ], + "files": [ + "nitro.exe" + ] +} diff --git a/src/Nitro/CommandLine/src/chillicream-nitro/.editorconfig b/src/Nitro/CommandLine/src/npm/chillicream-nitro/.editorconfig similarity index 100% rename from src/Nitro/CommandLine/src/chillicream-nitro/.editorconfig rename to src/Nitro/CommandLine/src/npm/chillicream-nitro/.editorconfig diff --git a/src/Nitro/CommandLine/src/chillicream-nitro/.gitattributes b/src/Nitro/CommandLine/src/npm/chillicream-nitro/.gitattributes similarity index 100% rename from src/Nitro/CommandLine/src/chillicream-nitro/.gitattributes rename to src/Nitro/CommandLine/src/npm/chillicream-nitro/.gitattributes diff --git a/src/Nitro/CommandLine/src/chillicream-nitro/.gitignore b/src/Nitro/CommandLine/src/npm/chillicream-nitro/.gitignore similarity index 100% rename from src/Nitro/CommandLine/src/chillicream-nitro/.gitignore rename to src/Nitro/CommandLine/src/npm/chillicream-nitro/.gitignore diff --git a/src/Nitro/CommandLine/src/chillicream-nitro/.yarnrc.yml b/src/Nitro/CommandLine/src/npm/chillicream-nitro/.yarnrc.yml similarity index 100% rename from src/Nitro/CommandLine/src/chillicream-nitro/.yarnrc.yml rename to src/Nitro/CommandLine/src/npm/chillicream-nitro/.yarnrc.yml diff --git a/src/Nitro/CommandLine/src/chillicream-nitro/README.md b/src/Nitro/CommandLine/src/npm/chillicream-nitro/README.md similarity index 100% rename from src/Nitro/CommandLine/src/chillicream-nitro/README.md rename to src/Nitro/CommandLine/src/npm/chillicream-nitro/README.md diff --git a/src/Nitro/CommandLine/src/chillicream-nitro/cli.js b/src/Nitro/CommandLine/src/npm/chillicream-nitro/cli.js similarity index 100% rename from src/Nitro/CommandLine/src/chillicream-nitro/cli.js rename to src/Nitro/CommandLine/src/npm/chillicream-nitro/cli.js diff --git a/src/Nitro/CommandLine/src/chillicream-nitro/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json similarity index 94% rename from src/Nitro/CommandLine/src/chillicream-nitro/package.json rename to src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json index 21a1c35e972..f053e98203f 100644 --- a/src/Nitro/CommandLine/src/chillicream-nitro/package.json +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json @@ -6,7 +6,7 @@ "repository": { "type": "git", "url": "https://github.com/ChilliCream/graphql-platform", - "directory": "src/Nitro/CommandLine/src/chillicream-nitro" + "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro" }, "bugs": { "url": "https://github.com/ChilliCream/graphql-platform/issues" From 3b876b3f9ead7055ce83d58411a7d6b62267bca9 Mon Sep 17 00:00:00 2001 From: tobias-tengler <45513122+tobias-tengler@users.noreply.github.com> Date: Fri, 17 Apr 2026 11:32:56 +0200 Subject: [PATCH 04/13] wip --- .github/workflows/release.yml | 19 ++++++++----------- .../package.json | 6 +++--- .../package.json | 6 +++--- .../package.json | 6 +++--- .../package.json | 6 +++--- .../package.json | 6 +++--- .../src/npm/chillicream-nitro/cli.js | 10 +++++----- .../src/npm/chillicream-nitro/package.json | 10 +++++----- 8 files changed, 33 insertions(+), 36 deletions(-) rename src/Nitro/CommandLine/src/npm/{chillicream-nitro-linux-x64-musl => chillicream-nitro-linux-musl-x64}/package.json (82%) rename src/Nitro/CommandLine/src/npm/{chillicream-nitro-darwin-arm64 => chillicream-nitro-osx-arm64}/package.json (82%) rename src/Nitro/CommandLine/src/npm/{chillicream-nitro-darwin-x64 => chillicream-nitro-osx-x64}/package.json (83%) rename src/Nitro/CommandLine/src/npm/{chillicream-nitro-win32-x64 => chillicream-nitro-win-x64}/package.json (83%) rename src/Nitro/CommandLine/src/npm/{chillicream-nitro-win32-ia32 => chillicream-nitro-win-x86}/package.json (83%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 861a7291277..a78abbfae40 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -296,7 +296,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} publish-nitro-cli-platforms: - name: 🧱 Publish Nitro CLI (${{ matrix.dir }}) to npm + name: 🧱 Publish Nitro CLI (${{ matrix.rid }}) to npm runs-on: ubuntu-latest needs: [build-nitro-cli] if: startsWith(github.ref, 'refs/tags/') @@ -308,25 +308,18 @@ jobs: matrix: include: - rid: linux-x64 - dir: linux-x64 binary: nitro - rid: linux-musl-x64 - dir: linux-x64-musl binary: nitro - rid: linux-arm64 - dir: linux-arm64 binary: nitro - rid: osx-x64 - dir: darwin-x64 binary: nitro - rid: osx-arm64 - dir: darwin-arm64 binary: nitro - rid: win-x64 - dir: win32-x64 binary: nitro.exe - rid: win-x86 - dir: win32-ia32 binary: nitro.exe steps: @@ -353,6 +346,8 @@ jobs: run: | if [[ "$GIT_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "DIST_TAG=latest" >> $GITHUB_ENV + elif [[ "$GIT_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc\. ]]; then + echo "DIST_TAG=rc" >> $GITHUB_ENV else echo "DIST_TAG=preview" >> $GITHUB_ENV fi @@ -360,7 +355,7 @@ jobs: - name: 🗂️ Stage binary in package directory shell: bash - working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.dir }} + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.rid }} run: | set -euo pipefail archive="$GITHUB_WORKSPACE/dist/nitro-${{ matrix.rid }}.tar.gz" @@ -376,11 +371,11 @@ jobs: fi - name: 🏷️ Set version - working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.dir }} + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.rid }} run: npm version "$GIT_TAG" --no-git-tag-version --allow-same-version - name: 🚀 Publish to npm - working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.dir }} + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.rid }} run: npm publish --access public --tag "$DIST_TAG" --registry="${{ vars.NPM_REGISTRY_URL }}" publish-nitro-cli-npm: @@ -410,6 +405,8 @@ jobs: run: | if [[ "$GIT_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "DIST_TAG=latest" >> $GITHUB_ENV + elif [[ "$GIT_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc\. ]]; then + echo "DIST_TAG=rc" >> $GITHUB_ENV else echo "DIST_TAG=preview" >> $GITHUB_ENV fi diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-x64-musl/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-musl-x64/package.json similarity index 82% rename from src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-x64-musl/package.json rename to src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-musl-x64/package.json index 8bac13614ec..3292c8b559a 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-x64-musl/package.json +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-musl-x64/package.json @@ -1,12 +1,12 @@ { - "name": "@chillicream/nitro-linux-x64-musl", + "name": "@chillicream/nitro-linux-musl-x64", "version": "0.0.0", - "description": "Nitro CLI binary for linux-x64 (musl)", + "description": "Nitro CLI binary for linux-musl-x64", "homepage": "https://chillicream.com", "repository": { "type": "git", "url": "https://github.com/ChilliCream/graphql-platform", - "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-x64-musl" + "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-linux-musl-x64" }, "bugs": { "url": "https://github.com/ChilliCream/graphql-platform/issues" diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-arm64/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro-osx-arm64/package.json similarity index 82% rename from src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-arm64/package.json rename to src/Nitro/CommandLine/src/npm/chillicream-nitro-osx-arm64/package.json index 0476c433c59..6248dcd4cf7 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-arm64/package.json +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro-osx-arm64/package.json @@ -1,12 +1,12 @@ { - "name": "@chillicream/nitro-darwin-arm64", + "name": "@chillicream/nitro-osx-arm64", "version": "0.0.0", - "description": "Nitro CLI binary for darwin-arm64", + "description": "Nitro CLI binary for osx-arm64", "homepage": "https://chillicream.com", "repository": { "type": "git", "url": "https://github.com/ChilliCream/graphql-platform", - "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-arm64" + "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-osx-arm64" }, "bugs": { "url": "https://github.com/ChilliCream/graphql-platform/issues" diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-x64/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro-osx-x64/package.json similarity index 83% rename from src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-x64/package.json rename to src/Nitro/CommandLine/src/npm/chillicream-nitro-osx-x64/package.json index ed037baddc8..806cbadc054 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-x64/package.json +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro-osx-x64/package.json @@ -1,12 +1,12 @@ { - "name": "@chillicream/nitro-darwin-x64", + "name": "@chillicream/nitro-osx-x64", "version": "0.0.0", - "description": "Nitro CLI binary for darwin-x64", + "description": "Nitro CLI binary for osx-x64", "homepage": "https://chillicream.com", "repository": { "type": "git", "url": "https://github.com/ChilliCream/graphql-platform", - "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-darwin-x64" + "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-osx-x64" }, "bugs": { "url": "https://github.com/ChilliCream/graphql-platform/issues" diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-x64/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro-win-x64/package.json similarity index 83% rename from src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-x64/package.json rename to src/Nitro/CommandLine/src/npm/chillicream-nitro-win-x64/package.json index e723a843d4f..9fee60112a2 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-x64/package.json +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro-win-x64/package.json @@ -1,12 +1,12 @@ { - "name": "@chillicream/nitro-win32-x64", + "name": "@chillicream/nitro-win-x64", "version": "0.0.0", - "description": "Nitro CLI binary for win32-x64", + "description": "Nitro CLI binary for win-x64", "homepage": "https://chillicream.com", "repository": { "type": "git", "url": "https://github.com/ChilliCream/graphql-platform", - "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-x64" + "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-win-x64" }, "bugs": { "url": "https://github.com/ChilliCream/graphql-platform/issues" diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-ia32/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro-win-x86/package.json similarity index 83% rename from src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-ia32/package.json rename to src/Nitro/CommandLine/src/npm/chillicream-nitro-win-x86/package.json index af5ff3bc97d..4a57aeb3b8a 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-ia32/package.json +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro-win-x86/package.json @@ -1,12 +1,12 @@ { - "name": "@chillicream/nitro-win32-ia32", + "name": "@chillicream/nitro-win-x86", "version": "0.0.0", - "description": "Nitro CLI binary for win32-ia32", + "description": "Nitro CLI binary for win-x86", "homepage": "https://chillicream.com", "repository": { "type": "git", "url": "https://github.com/ChilliCream/graphql-platform", - "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-win32-ia32" + "directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro-win-x86" }, "bugs": { "url": "https://github.com/ChilliCream/graphql-platform/issues" diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/cli.js b/src/Nitro/CommandLine/src/npm/chillicream-nitro/cli.js index 33d704f482c..ea671f73c2d 100755 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro/cli.js +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/cli.js @@ -8,15 +8,15 @@ import { dirname, join } from "path"; const require = createRequire(import.meta.url); const candidates = { - "darwin-arm64": ["@chillicream/nitro-darwin-arm64"], - "darwin-x64": ["@chillicream/nitro-darwin-x64"], + "darwin-arm64": ["@chillicream/nitro-osx-arm64"], + "darwin-x64": ["@chillicream/nitro-osx-x64"], "linux-arm64": ["@chillicream/nitro-linux-arm64"], "linux-x64": [ "@chillicream/nitro-linux-x64", - "@chillicream/nitro-linux-x64-musl", + "@chillicream/nitro-linux-musl-x64", ], - "win32-ia32": ["@chillicream/nitro-win32-ia32"], - "win32-x64": ["@chillicream/nitro-win32-x64"], + "win32-ia32": ["@chillicream/nitro-win-x86"], + "win32-x64": ["@chillicream/nitro-win-x64"], }; function resolveBinary() { diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json index f053e98203f..8c0b71b6ff3 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json @@ -35,12 +35,12 @@ "README.md" ], "optionalDependencies": { - "@chillicream/nitro-darwin-arm64": "0.0.0", - "@chillicream/nitro-darwin-x64": "0.0.0", + "@chillicream/nitro-osx-arm64": "0.0.0", + "@chillicream/nitro-osx-x64": "0.0.0", "@chillicream/nitro-linux-arm64": "0.0.0", "@chillicream/nitro-linux-x64": "0.0.0", - "@chillicream/nitro-linux-x64-musl": "0.0.0", - "@chillicream/nitro-win32-ia32": "0.0.0", - "@chillicream/nitro-win32-x64": "0.0.0" + "@chillicream/nitro-linux-musl-x64": "0.0.0", + "@chillicream/nitro-win-x64": "0.0.0", + "@chillicream/nitro-win-x86": "0.0.0" } } From 55951baf249464b80e59b40e57e6b3b8d40d459e Mon Sep 17 00:00:00 2001 From: tobias-tengler <45513122+tobias-tengler@users.noreply.github.com> Date: Fri, 17 Apr 2026 11:41:56 +0200 Subject: [PATCH 05/13] Pin version of optionalDependencies --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a78abbfae40..7f2751646e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -418,8 +418,9 @@ jobs: run: | set -euo pipefail chmod +x cli.js + npm version "$GIT_TAG" --no-git-tag-version --allow-same-version jq --arg v "$GIT_TAG" \ - '.version = $v | .optionalDependencies = (.optionalDependencies | map_values($v))' \ + '.optionalDependencies = (.optionalDependencies | map_values($v))' \ package.json > package.json.tmp mv package.json.tmp package.json From 7d6bdbf46995517101e6a59af238f4c138cd1176 Mon Sep 17 00:00:00 2001 From: tobias-tengler <45513122+tobias-tengler@users.noreply.github.com> Date: Fri, 17 Apr 2026 11:42:41 +0200 Subject: [PATCH 06/13] Cleanup --- .github/workflows/release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f2751646e4..0cc3038fcf3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -136,8 +136,8 @@ jobs: - name: 🏷 Get the version from tag (Unix) if: runner.os != 'Windows' - run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV shell: bash + run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - name: 📦 Publish binary (Windows) if: runner.os == 'Windows' @@ -151,9 +151,9 @@ jobs: - name: 📦 Publish binary (Unix) if: runner.os != 'Windows' + shell: bash run: | ./build.sh publishaot --SemVersion $GIT_TAG --RuntimeIdentifier ${{ matrix.rid }} --Configuration Release - shell: bash env: NitroApiClientId: ${{ secrets.NITRO_API_CLIENT_ID }} NitroIdentityClientId: ${{ secrets.NITRO_IDENTITY_CLIENT_ID }} @@ -237,15 +237,15 @@ jobs: - name: 📦 Zip binary (macOS) if: runner.os == 'macOS' + shell: bash run: | zip -j nitro-${{ matrix.rid }}.zip publish/nitro - shell: bash - name: 📦 Tar binary (Linux) if: runner.os == 'Linux' + shell: bash run: | tar -czf nitro-${{ matrix.rid }}.tar.gz -C publish nitro - shell: bash - name: 🖋️ Notarize binary (macOS) if: runner.os == 'macOS' @@ -343,6 +343,7 @@ jobs: run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - name: 🏷 Compute dist-tag + shell: bash run: | if [[ "$GIT_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "DIST_TAG=latest" >> $GITHUB_ENV @@ -351,7 +352,6 @@ jobs: else echo "DIST_TAG=preview" >> $GITHUB_ENV fi - shell: bash - name: 🗂️ Stage binary in package directory shell: bash @@ -402,6 +402,7 @@ jobs: run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - name: 🏷 Compute dist-tag + shell: bash run: | if [[ "$GIT_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "DIST_TAG=latest" >> $GITHUB_ENV @@ -410,7 +411,6 @@ jobs: else echo "DIST_TAG=preview" >> $GITHUB_ENV fi - shell: bash - name: 🏷️ Bump version and optionalDependencies working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro From b295e4471e82e8f655d246cdd8525295c0654052 Mon Sep 17 00:00:00 2001 From: tobias-tengler <45513122+tobias-tengler@users.noreply.github.com> Date: Fri, 17 Apr 2026 11:47:40 +0200 Subject: [PATCH 07/13] More cleanup --- .github/workflows/release.yml | 38 ++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0cc3038fcf3..f4d74000796 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -301,7 +301,7 @@ jobs: needs: [build-nitro-cli] if: startsWith(github.ref, 'refs/tags/') permissions: - contents: read + contents: write id-token: write strategy: fail-fast: false @@ -342,17 +342,6 @@ jobs: - name: 🏷 Get the version from tag run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - name: 🏷 Compute dist-tag - shell: bash - run: | - if [[ "$GIT_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "DIST_TAG=latest" >> $GITHUB_ENV - elif [[ "$GIT_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc\. ]]; then - echo "DIST_TAG=rc" >> $GITHUB_ENV - else - echo "DIST_TAG=preview" >> $GITHUB_ENV - fi - - name: 🗂️ Stage binary in package directory shell: bash working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.rid }} @@ -374,9 +363,30 @@ jobs: working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.rid }} run: npm version "$GIT_TAG" --no-git-tag-version --allow-same-version - - name: 🚀 Publish to npm + - name: 📦 Create tarball + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.rid }} + run: npm pack + + - name: 🚀 Publish tarball to npm working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.rid }} - run: npm publish --access public --tag "$DIST_TAG" --registry="${{ vars.NPM_REGISTRY_URL }}" + shell: bash + run: | + npm publish "./chillicream-nitro-${{ matrix.rid }}-${GIT_TAG}.tgz" \ + --access public \ + --registry="${{ vars.NPM_REGISTRY_URL }}" + + - name: 📤 Upload tarball as artifact + uses: actions/upload-artifact@v7 + with: + name: chillicream-nitro-${{ matrix.rid }}-${{ env.GIT_TAG }}.tgz + path: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.rid }}/chillicream-nitro-${{ matrix.rid }}-${{ env.GIT_TAG }}.tgz + + - name: 📤 Attach tarball to GitHub release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro-${{ matrix.rid }} + run: | + gh release upload "${{ github.ref_name }}" "chillicream-nitro-${{ matrix.rid }}-${{ github.ref_name }}.tgz" --repo "${{ github.repository }}" publish-nitro-cli-npm: name: 🧱 Publish Nitro CLI to npm From 776c7eacf6f6cb1baca1981da540fa69c44315ce Mon Sep 17 00:00:00 2001 From: tobias-tengler <45513122+tobias-tengler@users.noreply.github.com> Date: Fri, 17 Apr 2026 12:06:50 +0200 Subject: [PATCH 08/13] wip --- .github/workflows/release.yml | 12 +- .../src/npm/chillicream-nitro/.gitignore | 8 +- .../src/npm/chillicream-nitro/cli.js | 44 ------ .../src/npm/chillicream-nitro/package.json | 23 ++- .../src/npm/chillicream-nitro/src/cli.ts | 73 ++++++++++ .../src/npm/chillicream-nitro/tsconfig.json | 14 ++ .../src/npm/chillicream-nitro/yarn.lock | 132 ++++++++++++++++++ 7 files changed, 247 insertions(+), 59 deletions(-) delete mode 100755 src/Nitro/CommandLine/src/npm/chillicream-nitro/cli.js create mode 100644 src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts create mode 100644 src/Nitro/CommandLine/src/npm/chillicream-nitro/tsconfig.json create mode 100644 src/Nitro/CommandLine/src/npm/chillicream-nitro/yarn.lock diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f4d74000796..b7f1a734751 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -427,13 +427,23 @@ jobs: shell: bash run: | set -euo pipefail - chmod +x cli.js npm version "$GIT_TAG" --no-git-tag-version --allow-same-version jq --arg v "$GIT_TAG" \ '.optionalDependencies = (.optionalDependencies | map_values($v))' \ package.json > package.json.tmp mv package.json.tmp package.json + - name: 🧰 Enable corepack + run: corepack enable + + - name: 📥 Install dependencies + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro + run: yarn install --immutable + + - name: 🏗️ Build + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro + run: yarn build + - name: 📦 Create tarball working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro run: npm pack diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/.gitignore b/src/Nitro/CommandLine/src/npm/chillicream-nitro/.gitignore index f03eaec0604..a24b6406537 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro/.gitignore +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/.gitignore @@ -5,13 +5,7 @@ !.yarn/sdks !.yarn/versions -# Whether you use PnP or not, the node_modules folder is often used to store -# build artifacts that should be gitignored node_modules +dist -# Swap the comments on the following lines if you wish to use zero-installs -# In that case, don't forget to run `yarn config set enableGlobalCache false`! -# Documentation here: https://yarnpkg.com/features/caching#zero-installs - -#!.yarn/cache .pnp.* diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/cli.js b/src/Nitro/CommandLine/src/npm/chillicream-nitro/cli.js deleted file mode 100755 index ea671f73c2d..00000000000 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro/cli.js +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env node -"use strict"; - -import { createRequire } from "module"; -import { spawn } from "child_process"; -import { dirname, join } from "path"; - -const require = createRequire(import.meta.url); - -const candidates = { - "darwin-arm64": ["@chillicream/nitro-osx-arm64"], - "darwin-x64": ["@chillicream/nitro-osx-x64"], - "linux-arm64": ["@chillicream/nitro-linux-arm64"], - "linux-x64": [ - "@chillicream/nitro-linux-x64", - "@chillicream/nitro-linux-musl-x64", - ], - "win32-ia32": ["@chillicream/nitro-win-x86"], - "win32-x64": ["@chillicream/nitro-win-x64"], -}; - -function resolveBinary() { - const key = `${process.platform}-${process.arch}`; - const binaryName = process.platform === "win32" ? "nitro.exe" : "nitro"; - - for (const pkg of candidates[key] ?? []) { - try { - const pkgJson = require.resolve(`${pkg}/package.json`); - return join(dirname(pkgJson), binaryName); - } catch {} - } - return null; -} - -const bin = resolveBinary(); - -if (bin === null) { - throw new Error( - `Platform "${process.platform} (${process.arch})" is not supported by @chillicream/nitro.` - ); -} - -const child = spawn(bin, process.argv.slice(2), { stdio: "inherit" }); -child.on("exit", (code) => process.exit(code ?? 0)); diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json index 8c0b71b6ff3..3f9818ae82f 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json @@ -27,19 +27,28 @@ "url": "https://opencollective.com/chillicream" }, "type": "module", - "bin": { - "nitro": "cli.js" - }, + "bin": "./dist/cli.js", "files": [ - "cli.js", + "dist", "README.md" ], + "scripts": { + "build": "tsc" + }, + "packageManager": "yarn@4.9.4", + "dependencies": { + "detect-libc": "^2.0.4" + }, + "devDependencies": { + "@types/node": "^24.0.0", + "typescript": "^5.9.0" + }, "optionalDependencies": { - "@chillicream/nitro-osx-arm64": "0.0.0", - "@chillicream/nitro-osx-x64": "0.0.0", "@chillicream/nitro-linux-arm64": "0.0.0", - "@chillicream/nitro-linux-x64": "0.0.0", "@chillicream/nitro-linux-musl-x64": "0.0.0", + "@chillicream/nitro-linux-x64": "0.0.0", + "@chillicream/nitro-osx-arm64": "0.0.0", + "@chillicream/nitro-osx-x64": "0.0.0", "@chillicream/nitro-win-x64": "0.0.0", "@chillicream/nitro-win-x86": "0.0.0" } diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts b/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts new file mode 100644 index 00000000000..e87a2e18084 --- /dev/null +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts @@ -0,0 +1,73 @@ +#!/usr/bin/env node +import { createRequire } from "node:module"; +import { spawn } from "node:child_process"; +import { dirname, join } from "node:path"; +import { familySync, MUSL } from "detect-libc"; + +const require = createRequire(import.meta.url); + +function resolveCandidates(): readonly string[] { + const { platform, arch } = process; + + if (platform === "linux" && arch === "x64") { + return familySync() === MUSL + ? ["@chillicream/nitro-linux-musl-x64"] + : ["@chillicream/nitro-linux-x64"]; + } + + const map: Record = { + "darwin-arm64": ["@chillicream/nitro-osx-arm64"], + "darwin-x64": ["@chillicream/nitro-osx-x64"], + "linux-arm64": ["@chillicream/nitro-linux-arm64"], + "win32-ia32": ["@chillicream/nitro-win-x86"], + "win32-x64": ["@chillicream/nitro-win-x64"], + }; + + return map[`${platform}-${arch}`] ?? []; +} + +function resolveBinary(): string | null { + const binaryName = process.platform === "win32" ? "nitro.exe" : "nitro"; + + for (const pkg of resolveCandidates()) { + try { + const pkgJson = require.resolve(`${pkg}/package.json`); + return join(dirname(pkgJson), binaryName); + } catch { + continue; + } + } + + return null; +} + +const bin = resolveBinary(); + +if (bin === null) { + console.error( + `Platform "${process.platform} (${process.arch})" is not supported by @chillicream/nitro.`, + ); + process.exit(1); +} + +const child = spawn(bin, process.argv.slice(2), { stdio: "inherit" }); + +child.on("error", (error) => { + console.error( + `Failed to start @chillicream/nitro binary "${bin}": ${error.message}`, + ); + process.exit(1); +}); + +child.on("exit", (code, signal) => { + if (signal !== null) { + try { + process.kill(process.pid, signal); + return; + } catch { + process.exit(1); + } + } + + process.exit(code ?? 1); +}); diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/tsconfig.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro/tsconfig.json new file mode 100644 index 00000000000..dbc884c7a8d --- /dev/null +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "noImplicitOverride": true, + "rootDir": "./src", + "outDir": "./dist" + }, + "include": ["src/**/*"] +} diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/yarn.lock b/src/Nitro/CommandLine/src/npm/chillicream-nitro/yarn.lock new file mode 100644 index 00000000000..154fdc00aa8 --- /dev/null +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/yarn.lock @@ -0,0 +1,132 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + +__metadata: + version: 8 + cacheKey: 10c0 + +"@chillicream/nitro-linux-arm64@npm:0.0.0": + version: 0.0.0 + resolution: "@chillicream/nitro-linux-arm64@npm:0.0.0" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@chillicream/nitro-linux-musl-x64@npm:0.0.0": + version: 0.0.0 + resolution: "@chillicream/nitro-linux-musl-x64@npm:0.0.0" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@chillicream/nitro-linux-x64@npm:0.0.0": + version: 0.0.0 + resolution: "@chillicream/nitro-linux-x64@npm:0.0.0" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@chillicream/nitro-osx-arm64@npm:0.0.0": + version: 0.0.0 + resolution: "@chillicream/nitro-osx-arm64@npm:0.0.0" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@chillicream/nitro-osx-x64@npm:0.0.0": + version: 0.0.0 + resolution: "@chillicream/nitro-osx-x64@npm:0.0.0" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@chillicream/nitro-win-x64@npm:0.0.0": + version: 0.0.0 + resolution: "@chillicream/nitro-win-x64@npm:0.0.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@chillicream/nitro-win-x86@npm:0.0.0": + version: 0.0.0 + resolution: "@chillicream/nitro-win-x86@npm:0.0.0" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@chillicream/nitro@workspace:.": + version: 0.0.0-use.local + resolution: "@chillicream/nitro@workspace:." + dependencies: + "@chillicream/nitro-linux-arm64": "npm:0.0.0" + "@chillicream/nitro-linux-musl-x64": "npm:0.0.0" + "@chillicream/nitro-linux-x64": "npm:0.0.0" + "@chillicream/nitro-osx-arm64": "npm:0.0.0" + "@chillicream/nitro-osx-x64": "npm:0.0.0" + "@chillicream/nitro-win-x64": "npm:0.0.0" + "@chillicream/nitro-win-x86": "npm:0.0.0" + "@types/node": "npm:^24.0.0" + detect-libc: "npm:^2.0.4" + typescript: "npm:^5.9.0" + dependenciesMeta: + "@chillicream/nitro-linux-arm64": + optional: true + "@chillicream/nitro-linux-musl-x64": + optional: true + "@chillicream/nitro-linux-x64": + optional: true + "@chillicream/nitro-osx-arm64": + optional: true + "@chillicream/nitro-osx-x64": + optional: true + "@chillicream/nitro-win-x64": + optional: true + "@chillicream/nitro-win-x86": + optional: true + bin: + nitro: ./dist/cli.js + languageName: unknown + linkType: soft + +"@types/node@npm:^24.0.0": + version: 24.12.2 + resolution: "@types/node@npm:24.12.2" + dependencies: + undici-types: "npm:~7.16.0" + checksum: 10c0/710050c42f89075c4479e4e1e4c2532486b0c41b1e2a8a13ad88641c88b88cdaea87414e19224f30028719737bd70e327edcaa184d50e86b9418941edd7eb02b + languageName: node + linkType: hard + +"detect-libc@npm:^2.0.4": + version: 2.1.2 + resolution: "detect-libc@npm:2.1.2" + checksum: 10c0/acc675c29a5649fa1fb6e255f993b8ee829e510b6b56b0910666949c80c364738833417d0edb5f90e4e46be17228b0f2b66a010513984e18b15deeeac49369c4 + languageName: node + linkType: hard + +"typescript@npm:^5.9.0": + version: 5.9.3 + resolution: "typescript@npm:5.9.3" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/6bd7552ce39f97e711db5aa048f6f9995b53f1c52f7d8667c1abdc1700c68a76a308f579cd309ce6b53646deb4e9a1be7c813a93baaf0a28ccd536a30270e1c5 + languageName: node + linkType: hard + +"typescript@patch:typescript@npm%3A^5.9.0#optional!builtin": + version: 5.9.3 + resolution: "typescript@patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=5786d5" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/ad09fdf7a756814dce65bc60c1657b40d44451346858eea230e10f2e95a289d9183b6e32e5c11e95acc0ccc214b4f36289dcad4bf1886b0adb84d711d336a430 + languageName: node + linkType: hard + +"undici-types@npm:~7.16.0": + version: 7.16.0 + resolution: "undici-types@npm:7.16.0" + checksum: 10c0/3033e2f2b5c9f1504bdc5934646cb54e37ecaca0f9249c983f7b1fc2e87c6d18399ebb05dc7fd5419e02b2e915f734d872a65da2e3eeed1813951c427d33cc9a + languageName: node + linkType: hard From 583633d0d213bfdde121638490159589fac7487e Mon Sep 17 00:00:00 2001 From: tobias-tengler <45513122+tobias-tengler@users.noreply.github.com> Date: Fri, 17 Apr 2026 12:13:21 +0200 Subject: [PATCH 09/13] Add npm package validation to ci.yml --- .github/workflows/ci.yml | 38 ++++++++++++++++++- .../src/npm/chillicream-nitro/package.json | 3 ++ .../src/npm/chillicream-nitro/src/cli.ts | 8 ++-- .../src/npm/chillicream-nitro/tsconfig.json | 1 + 4 files changed, 43 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cae156eb66c..eef3f576bb8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -297,9 +297,42 @@ jobs: api-key: ${{ secrets.NITRO_API_KEY }} comment-mode: "review" + verify-nitro-npm-package: + name: Verify Nitro npm package + runs-on: ubuntu-latest + needs: check-changes + if: needs.check-changes.outputs.src_changes == 'true' + steps: + - name: Checkout Repository + uses: actions/checkout@v6 + with: + show-progress: false + + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version: 24 + + - name: Enable corepack + run: corepack enable + + - name: Install dependencies + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro + run: yarn install --immutable + + - name: Build + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro + run: yarn build + ci-status-check: name: "CI Status Check" - needs: [library-tests, website-tests, validate-nitro-client] + needs: + [ + library-tests, + website-tests, + validate-nitro-client, + verify-nitro-npm-package, + ] if: always() runs-on: ubuntu-latest steps: @@ -308,4 +341,5 @@ jobs: if: | always() && (needs.library-tests.result == 'failure' || - needs.website-tests.result == 'failure') + needs.website-tests.result == 'failure' || + needs.verify-nitro-npm-package.result == 'failure') diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json index 3f9818ae82f..3cdff46727a 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json @@ -27,6 +27,9 @@ "url": "https://opencollective.com/chillicream" }, "type": "module", + "engines": { + "node": ">=20.6.0" + }, "bin": "./dist/cli.js", "files": [ "dist", diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts b/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts index e87a2e18084..7502c344056 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts @@ -1,11 +1,9 @@ #!/usr/bin/env node -import { createRequire } from "node:module"; import { spawn } from "node:child_process"; import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; import { familySync, MUSL } from "detect-libc"; -const require = createRequire(import.meta.url); - function resolveCandidates(): readonly string[] { const { platform, arch } = process; @@ -31,10 +29,10 @@ function resolveBinary(): string | null { for (const pkg of resolveCandidates()) { try { - const pkgJson = require.resolve(`${pkg}/package.json`); + const pkgJson = fileURLToPath(import.meta.resolve(`${pkg}/package.json`)); return join(dirname(pkgJson), binaryName); } catch { - continue; + // try next candidate } } diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/tsconfig.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro/tsconfig.json index dbc884c7a8d..f00925c874a 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro/tsconfig.json +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/tsconfig.json @@ -7,6 +7,7 @@ "esModuleInterop": true, "skipLibCheck": true, "noImplicitOverride": true, + "types": ["node"], "rootDir": "./src", "outDir": "./dist" }, From fcf923471f9f12256210829044f73e514f915ba7 Mon Sep 17 00:00:00 2001 From: tobias-tengler <45513122+tobias-tengler@users.noreply.github.com> Date: Fri, 17 Apr 2026 12:15:15 +0200 Subject: [PATCH 10/13] remove optionalDependencies --- .github/workflows/release.yml | 7 +- .../src/npm/chillicream-nitro/package.json | 9 --- .../src/npm/chillicream-nitro/yarn.lock | 71 ------------------- 3 files changed, 4 insertions(+), 83 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b7f1a734751..6903d402e6e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -422,14 +422,15 @@ jobs: echo "DIST_TAG=preview" >> $GITHUB_ENV fi - - name: 🏷️ Bump version and optionalDependencies + - name: 🏷️ Bump version and inject optionalDependencies working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro shell: bash run: | set -euo pipefail npm version "$GIT_TAG" --no-git-tag-version --allow-same-version - jq --arg v "$GIT_TAG" \ - '.optionalDependencies = (.optionalDependencies | map_values($v))' \ + names=$(jq -s '[.[].name]' ../chillicream-nitro-*/package.json) + jq --argjson names "$names" --arg v "$GIT_TAG" \ + '.optionalDependencies = ([$names[] | {key: ., value: $v}] | from_entries)' \ package.json > package.json.tmp mv package.json.tmp package.json diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json b/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json index 3cdff46727a..b4009b425bb 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/package.json @@ -45,14 +45,5 @@ "devDependencies": { "@types/node": "^24.0.0", "typescript": "^5.9.0" - }, - "optionalDependencies": { - "@chillicream/nitro-linux-arm64": "0.0.0", - "@chillicream/nitro-linux-musl-x64": "0.0.0", - "@chillicream/nitro-linux-x64": "0.0.0", - "@chillicream/nitro-osx-arm64": "0.0.0", - "@chillicream/nitro-osx-x64": "0.0.0", - "@chillicream/nitro-win-x64": "0.0.0", - "@chillicream/nitro-win-x86": "0.0.0" } } diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/yarn.lock b/src/Nitro/CommandLine/src/npm/chillicream-nitro/yarn.lock index 154fdc00aa8..2ac2eca9724 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro/yarn.lock +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/yarn.lock @@ -5,84 +5,13 @@ __metadata: version: 8 cacheKey: 10c0 -"@chillicream/nitro-linux-arm64@npm:0.0.0": - version: 0.0.0 - resolution: "@chillicream/nitro-linux-arm64@npm:0.0.0" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - -"@chillicream/nitro-linux-musl-x64@npm:0.0.0": - version: 0.0.0 - resolution: "@chillicream/nitro-linux-musl-x64@npm:0.0.0" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - -"@chillicream/nitro-linux-x64@npm:0.0.0": - version: 0.0.0 - resolution: "@chillicream/nitro-linux-x64@npm:0.0.0" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - -"@chillicream/nitro-osx-arm64@npm:0.0.0": - version: 0.0.0 - resolution: "@chillicream/nitro-osx-arm64@npm:0.0.0" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - -"@chillicream/nitro-osx-x64@npm:0.0.0": - version: 0.0.0 - resolution: "@chillicream/nitro-osx-x64@npm:0.0.0" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - -"@chillicream/nitro-win-x64@npm:0.0.0": - version: 0.0.0 - resolution: "@chillicream/nitro-win-x64@npm:0.0.0" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - -"@chillicream/nitro-win-x86@npm:0.0.0": - version: 0.0.0 - resolution: "@chillicream/nitro-win-x86@npm:0.0.0" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - "@chillicream/nitro@workspace:.": version: 0.0.0-use.local resolution: "@chillicream/nitro@workspace:." dependencies: - "@chillicream/nitro-linux-arm64": "npm:0.0.0" - "@chillicream/nitro-linux-musl-x64": "npm:0.0.0" - "@chillicream/nitro-linux-x64": "npm:0.0.0" - "@chillicream/nitro-osx-arm64": "npm:0.0.0" - "@chillicream/nitro-osx-x64": "npm:0.0.0" - "@chillicream/nitro-win-x64": "npm:0.0.0" - "@chillicream/nitro-win-x86": "npm:0.0.0" "@types/node": "npm:^24.0.0" detect-libc: "npm:^2.0.4" typescript: "npm:^5.9.0" - dependenciesMeta: - "@chillicream/nitro-linux-arm64": - optional: true - "@chillicream/nitro-linux-musl-x64": - optional: true - "@chillicream/nitro-linux-x64": - optional: true - "@chillicream/nitro-osx-arm64": - optional: true - "@chillicream/nitro-osx-x64": - optional: true - "@chillicream/nitro-win-x64": - optional: true - "@chillicream/nitro-win-x86": - optional: true bin: nitro: ./dist/cli.js languageName: unknown From c45e9ac7306ad1a34627971a6f4676e7d829c1c0 Mon Sep 17 00:00:00 2001 From: tobias-tengler <45513122+tobias-tengler@users.noreply.github.com> Date: Fri, 17 Apr 2026 12:17:48 +0200 Subject: [PATCH 11/13] Replace resolveCandidates --- .../src/npm/chillicream-nitro/src/cli.ts | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts b/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts index 7502c344056..04bed5032ab 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts @@ -4,39 +4,38 @@ import { dirname, join } from "node:path"; import { fileURLToPath } from "node:url"; import { familySync, MUSL } from "detect-libc"; -function resolveCandidates(): readonly string[] { +function resolveBinary(): string | null { const { platform, arch } = process; + let pkg: string | null; if (platform === "linux" && arch === "x64") { - return familySync() === MUSL - ? ["@chillicream/nitro-linux-musl-x64"] - : ["@chillicream/nitro-linux-x64"]; + pkg = + familySync() === MUSL + ? "@chillicream/nitro-linux-musl-x64" + : "@chillicream/nitro-linux-x64"; + } else { + const map: Record = { + "darwin-arm64": "@chillicream/nitro-osx-arm64", + "darwin-x64": "@chillicream/nitro-osx-x64", + "linux-arm64": "@chillicream/nitro-linux-arm64", + "win32-ia32": "@chillicream/nitro-win-x86", + "win32-x64": "@chillicream/nitro-win-x64", + }; + pkg = map[`${platform}-${arch}`] ?? null; } - const map: Record = { - "darwin-arm64": ["@chillicream/nitro-osx-arm64"], - "darwin-x64": ["@chillicream/nitro-osx-x64"], - "linux-arm64": ["@chillicream/nitro-linux-arm64"], - "win32-ia32": ["@chillicream/nitro-win-x86"], - "win32-x64": ["@chillicream/nitro-win-x64"], - }; - - return map[`${platform}-${arch}`] ?? []; -} + if (pkg === null) { + return null; + } -function resolveBinary(): string | null { - const binaryName = process.platform === "win32" ? "nitro.exe" : "nitro"; + const binaryName = platform === "win32" ? "nitro.exe" : "nitro"; - for (const pkg of resolveCandidates()) { - try { - const pkgJson = fileURLToPath(import.meta.resolve(`${pkg}/package.json`)); - return join(dirname(pkgJson), binaryName); - } catch { - // try next candidate - } + try { + const pkgJson = fileURLToPath(import.meta.resolve(`${pkg}/package.json`)); + return join(dirname(pkgJson), binaryName); + } catch { + return null; } - - return null; } const bin = resolveBinary(); From f4b267dbf75bbf0425f6ca2eeb3ca51e720aca6b Mon Sep 17 00:00:00 2001 From: tobias-tengler <45513122+tobias-tengler@users.noreply.github.com> Date: Fri, 17 Apr 2026 12:23:29 +0200 Subject: [PATCH 12/13] Cleanup --- .github/workflows/ci.yml | 22 +++++++++++++++++++ .github/workflows/release.yml | 16 +++++++++----- .../src/npm/chillicream-nitro/src/cli.ts | 11 +++++++++- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eef3f576bb8..998734e78c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -324,6 +324,28 @@ jobs: working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro run: yarn build + - name: Inject optionalDependencies + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro + shell: bash + run: | + set -euo pipefail + jq --arg v "0.0.0-ci" ' + .optionalDependencies = { + "@chillicream/nitro-linux-arm64": $v, + "@chillicream/nitro-linux-musl-x64": $v, + "@chillicream/nitro-linux-x64": $v, + "@chillicream/nitro-osx-arm64": $v, + "@chillicream/nitro-osx-x64": $v, + "@chillicream/nitro-win-x64": $v, + "@chillicream/nitro-win-x86": $v + } + ' package.json > package.json.tmp + mv package.json.tmp package.json + + - name: Pack + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro + run: npm pack --dry-run + ci-status-check: name: "CI Status Check" needs: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6903d402e6e..4dc026fc5e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -304,7 +304,6 @@ jobs: contents: write id-token: write strategy: - fail-fast: false matrix: include: - rid: linux-x64 @@ -428,10 +427,17 @@ jobs: run: | set -euo pipefail npm version "$GIT_TAG" --no-git-tag-version --allow-same-version - names=$(jq -s '[.[].name]' ../chillicream-nitro-*/package.json) - jq --argjson names "$names" --arg v "$GIT_TAG" \ - '.optionalDependencies = ([$names[] | {key: ., value: $v}] | from_entries)' \ - package.json > package.json.tmp + jq --arg v "$GIT_TAG" ' + .optionalDependencies = { + "@chillicream/nitro-linux-arm64": $v, + "@chillicream/nitro-linux-musl-x64": $v, + "@chillicream/nitro-linux-x64": $v, + "@chillicream/nitro-osx-arm64": $v, + "@chillicream/nitro-osx-x64": $v, + "@chillicream/nitro-win-x64": $v, + "@chillicream/nitro-win-x86": $v + } + ' package.json > package.json.tmp mv package.json.tmp package.json - name: 🧰 Enable corepack diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts b/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts index 04bed5032ab..595cb1006ec 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts @@ -38,11 +38,20 @@ function resolveBinary(): string | null { } } +function describePlatform(): string { + const { platform, arch } = process; + if (platform === "linux") { + const libc = familySync(); + return libc ? `linux-${arch} (${libc})` : `linux-${arch}`; + } + return `${platform}-${arch}`; +} + const bin = resolveBinary(); if (bin === null) { console.error( - `Platform "${process.platform} (${process.arch})" is not supported by @chillicream/nitro.`, + `Platform "${describePlatform()}" is not supported by @chillicream/nitro.`, ); process.exit(1); } From 2e18078b4266927d90a38f6813ef6b8b0312c360 Mon Sep 17 00:00:00 2001 From: tobias-tengler <45513122+tobias-tengler@users.noreply.github.com> Date: Fri, 17 Apr 2026 12:25:39 +0200 Subject: [PATCH 13/13] Cleanup --- .github/workflows/release.yml | 22 +++---- .../src/npm/chillicream-nitro/src/cli.ts | 58 +++++++++++-------- 2 files changed, 44 insertions(+), 36 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4dc026fc5e0..ee18792924b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -421,6 +421,17 @@ jobs: echo "DIST_TAG=preview" >> $GITHUB_ENV fi + - name: 🧰 Enable corepack + run: corepack enable + + - name: 📥 Install dependencies + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro + run: yarn install --immutable + + - name: 🏗️ Build + working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro + run: yarn build + - name: 🏷️ Bump version and inject optionalDependencies working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro shell: bash @@ -440,17 +451,6 @@ jobs: ' package.json > package.json.tmp mv package.json.tmp package.json - - name: 🧰 Enable corepack - run: corepack enable - - - name: 📥 Install dependencies - working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro - run: yarn install --immutable - - - name: 🏗️ Build - working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro - run: yarn build - - name: 📦 Create tarball working-directory: src/Nitro/CommandLine/src/npm/chillicream-nitro run: npm pack diff --git a/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts b/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts index 595cb1006ec..e2ab5360d7c 100644 --- a/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts +++ b/src/Nitro/CommandLine/src/npm/chillicream-nitro/src/cli.ts @@ -2,40 +2,48 @@ import { spawn } from "node:child_process"; import { dirname, join } from "node:path"; import { fileURLToPath } from "node:url"; -import { familySync, MUSL } from "detect-libc"; +import { familySync, GLIBC, MUSL } from "detect-libc"; -function resolveBinary(): string | null { +function resolveCandidates(): string[] { const { platform, arch } = process; - let pkg: string | null; if (platform === "linux" && arch === "x64") { - pkg = - familySync() === MUSL - ? "@chillicream/nitro-linux-musl-x64" - : "@chillicream/nitro-linux-x64"; - } else { - const map: Record = { - "darwin-arm64": "@chillicream/nitro-osx-arm64", - "darwin-x64": "@chillicream/nitro-osx-x64", - "linux-arm64": "@chillicream/nitro-linux-arm64", - "win32-ia32": "@chillicream/nitro-win-x86", - "win32-x64": "@chillicream/nitro-win-x64", - }; - pkg = map[`${platform}-${arch}`] ?? null; + const libc = familySync(); + if (libc === MUSL) { + return ["@chillicream/nitro-linux-musl-x64"]; + } + if (libc === GLIBC) { + return ["@chillicream/nitro-linux-x64"]; + } + return [ + "@chillicream/nitro-linux-x64", + "@chillicream/nitro-linux-musl-x64", + ]; } - if (pkg === null) { - return null; - } + const map: Record = { + "darwin-arm64": "@chillicream/nitro-osx-arm64", + "darwin-x64": "@chillicream/nitro-osx-x64", + "linux-arm64": "@chillicream/nitro-linux-arm64", + "win32-ia32": "@chillicream/nitro-win-x86", + "win32-x64": "@chillicream/nitro-win-x64", + }; + const pkg = map[`${platform}-${arch}`]; + return pkg ? [pkg] : []; +} - const binaryName = platform === "win32" ? "nitro.exe" : "nitro"; +function resolveBinary(): string | null { + const binaryName = process.platform === "win32" ? "nitro.exe" : "nitro"; - try { - const pkgJson = fileURLToPath(import.meta.resolve(`${pkg}/package.json`)); - return join(dirname(pkgJson), binaryName); - } catch { - return null; + for (const pkg of resolveCandidates()) { + try { + const pkgJson = fileURLToPath(import.meta.resolve(`${pkg}/package.json`)); + return join(dirname(pkgJson), binaryName); + } catch { + // try next candidate + } } + return null; } function describePlatform(): string {