From 7e6f0830263f00b7c5eaf306f172b26880fc72ac Mon Sep 17 00:00:00 2001 From: Samuel Cormier-Iijima Date: Mon, 4 May 2026 20:46:41 -0400 Subject: [PATCH 1/3] chore(npm): rename package to @fellowapp/lightningcss for GH Packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub Packages requires scoped names matching the publishing org. Rename the top-level package and the eleven platform-specific binary packages from 'lightningcss[-platform]' to '@fellowapp/lightningcss[-platform]', update node/index.js to require the scoped platform package at runtime, and point publishConfig.registry at https://npm.pkg.github.com. Drop CLI packaging from build-npm.js — the fork is consumed as a library (via Vite/lightningcss-napi), not as a CLI, and the per-platform CLI bundles are dead weight. Version bumped to 1.32.0-fellow.0 so the fork doesn't shadow upstream. --- node/index.js | 2 +- package.json | 13 +++++----- scripts/build-npm.js | 59 +++----------------------------------------- 3 files changed, 11 insertions(+), 63 deletions(-) diff --git a/node/index.js b/node/index.js index 6fe25aef4..a17f56e04 100644 --- a/node/index.js +++ b/node/index.js @@ -15,7 +15,7 @@ if (process.platform === 'linux') { let native; try { - native = require(`lightningcss-${parts.join('-')}`); + native = require(`@fellowapp/lightningcss-${parts.join('-')}`); } catch (err) { native = require(`../lightningcss.${parts.join('-')}.node`); } diff --git a/package.json b/package.json index 02b427aa3..25bc02bf2 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "lightningcss", - "version": "1.32.0", + "name": "@fellowapp/lightningcss", + "version": "1.32.0-fellow.0", "license": "MPL-2.0", - "description": "A CSS parser, transformer, and minifier written in Rust", + "description": "Fellow fork of lightningcss — a CSS parser, transformer, and minifier written in Rust, with css-loader/postcss-modules-compatible scoped-name hashing.", "main": "node/index.js", "types": "node/index.d.ts", "exports": { @@ -16,7 +16,8 @@ "types": false }, "publishConfig": { - "access": "public" + "access": "public", + "registry": "https://npm.pkg.github.com" }, "funding": { "type": "opencollective", @@ -24,7 +25,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/parcel-bundler/lightningcss.git" + "url": "https://github.com/fellowapp/lightningcss.git" }, "engines": { "node": ">= 12.0.0" @@ -79,7 +80,7 @@ "uvu": "^0.5.6" }, "resolutions": { - "lightningcss": "link:." + "@fellowapp/lightningcss": "link:." }, "scripts": { "prepare": "patch-package", diff --git a/scripts/build-npm.js b/scripts/build-npm.js index ef447a7ea..ade965203 100644 --- a/scripts/build-npm.js +++ b/scripts/build-npm.js @@ -58,7 +58,6 @@ const sysToNodePlatform = { }; let optionalDependencies = {}; -let cliOptionalDependencies = {}; try { fs.mkdirSync(dir + '/npm'); @@ -78,38 +77,17 @@ for (let triple of triples) { } buildNode(triple.name, cpu, os, libc, t); - buildCLI(triple.name, cpu, os, libc, t); } pkg.optionalDependencies = optionalDependencies; fs.writeFileSync(`${dir}/package.json`, JSON.stringify(pkg, false, 2) + '\n'); -let cliPkg = { ...pkg }; -cliPkg.name += '-cli'; -cliPkg.bin = { - 'lightningcss': 'lightningcss' -}; -delete cliPkg.main; -delete cliPkg.napi; -delete cliPkg.exports; -delete cliPkg.devDependencies; -delete cliPkg.targets; -delete cliPkg.types; -cliPkg.files = ['lightningcss', 'postinstall.js']; -cliPkg.optionalDependencies = cliOptionalDependencies; -cliPkg.scripts = { - postinstall: 'node postinstall.js' -}; - -fs.writeFileSync(`${dir}/cli/package.json`, JSON.stringify(cliPkg, false, 2) + '\n'); -fs.copyFileSync(`${dir}/README.md`, `${dir}/cli/README.md`); -fs.copyFileSync(`${dir}/LICENSE`, `${dir}/cli/LICENSE`); - function buildNode(triple, cpu, os, libc, t) { let name = `lightningcss.${t}.node`; let pkg2 = { ...pkg }; - pkg2.name += '-' + t; + // Each platform package is published as @fellowapp/lightningcss-. + pkg2.name = '@fellowapp/lightningcss-' + t; pkg2.os = [os]; pkg2.cpu = [cpu]; if (libc) { @@ -133,38 +111,7 @@ function buildNode(triple, cpu, os, libc, t) { } catch (err) { } fs.writeFileSync(`${dir}/npm/node-${t}/package.json`, JSON.stringify(pkg2, false, 2) + '\n'); fs.copyFileSync(`${dir}/artifacts/bindings-${triple}/${name}`, `${dir}/npm/node-${t}/${name}`); - fs.writeFileSync(`${dir}/npm/node-${t}/README.md`, `This is the ${triple} build of lightningcss. See https://github.com/parcel-bundler/lightningcss for details.`); + fs.writeFileSync(`${dir}/npm/node-${t}/README.md`, `This is the ${triple} build of @fellowapp/lightningcss. See https://github.com/fellowapp/lightningcss for details.`); fs.copyFileSync(`${dir}/LICENSE`, `${dir}/npm/node-${t}/LICENSE`); } -function buildCLI(triple, cpu, os, libc, t) { - let binary = os === 'win32' ? 'lightningcss.exe' : 'lightningcss'; - let pkg2 = { ...pkg }; - pkg2.name += '-cli-' + t; - pkg2.os = [os]; - pkg2.cpu = [cpu]; - pkg2.files = [binary]; - if (libc) { - pkg2.libc = [libc]; - } - delete pkg2.main; - delete pkg2.exports; - delete pkg2.napi; - delete pkg2.devDependencies; - delete pkg2.dependencies; - delete pkg2.optionalDependencies; - delete pkg2.targets; - delete pkg2.scripts; - delete pkg2.types; - - cliOptionalDependencies[pkg2.name] = pkg.version; - - try { - fs.mkdirSync(dir + '/npm/cli-' + t); - } catch (err) { } - fs.writeFileSync(`${dir}/npm/cli-${t}/package.json`, JSON.stringify(pkg2, false, 2) + '\n'); - fs.copyFileSync(`${dir}/artifacts/bindings-${triple}/${binary}`, `${dir}/npm/cli-${t}/${binary}`); - fs.chmodSync(`${dir}/npm/cli-${t}/${binary}`, 0o755); // Ensure execute bit is set. - fs.writeFileSync(`${dir}/npm/cli-${t}/README.md`, `This is the ${triple} build of lightningcss-cli. See https://github.com/parcel-bundler/lightningcss for details.`); - fs.copyFileSync(`${dir}/LICENSE`, `${dir}/npm/cli-${t}/LICENSE`); -} From a559fac10591fd2ad910588c3d97006dab890200 Mon Sep 17 00:00:00 2001 From: Samuel Cormier-Iijima Date: Mon, 4 May 2026 20:47:58 -0400 Subject: [PATCH 2/3] ci: add release-fellowapp workflow to publish to GitHub Packages Adapted from .github/workflows/release.yml. Builds the same matrix of platform-specific .node binaries (10 targets: macOS x64/arm64, Windows x64/arm64, Linux x64/arm64 gnu+musl, Linux armv7, Android arm64) and publishes them to GitHub Packages as @fellowapp/lightningcss-, plus the main @fellowapp/lightningcss package. Differences from the upstream workflow: - Triggered on workflow_dispatch only (no automated tag-based release). - Drops FreeBSD and wasm targets (not needed for the Vite-via-napi use case). - Drops CLI build/publish (the fork is consumed as a library). - Authenticates with GITHUB_TOKEN against npm.pkg.github.com via setup-node's registry-url + scope inputs. - Requires permissions: { packages: write, contents: read } on the release job. --- .github/workflows/release-fellowapp.yml | 166 ++++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 .github/workflows/release-fellowapp.yml diff --git a/.github/workflows/release-fellowapp.yml b/.github/workflows/release-fellowapp.yml new file mode 100644 index 000000000..911f34dc7 --- /dev/null +++ b/.github/workflows/release-fellowapp.yml @@ -0,0 +1,166 @@ +name: release-fellowapp +# Build platform-specific .node binaries and publish the Fellow fork to +# GitHub Packages as @fellowapp/lightningcss + @fellowapp/lightningcss-. +# Triggered manually via workflow_dispatch. +on: + workflow_dispatch: + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + target: x86_64-pc-windows-msvc + - os: windows-latest + target: aarch64-pc-windows-msvc + - os: macos-latest + target: x86_64-apple-darwin + strip: strip -x + + name: build-${{ matrix.target }} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: dtolnay/rust-toolchain@stable + - run: rustup target add ${{ matrix.target }} + - uses: bahmutov/npm-install@v1.8.32 + - name: Build release + run: yarn build-release + env: + RUST_TARGET: ${{ matrix.target }} + - name: Strip debug symbols + if: ${{ matrix.strip }} + run: ${{ matrix.strip }} *.node + - uses: actions/upload-artifact@v4 + with: + name: bindings-${{ matrix.target }} + path: '*.node' + + build-apple-silicon: + name: build-apple-silicon + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: dtolnay/rust-toolchain@stable + - run: rustup target add aarch64-apple-darwin + - uses: bahmutov/npm-install@v1.8.32 + - name: Build release + run: yarn build-release + env: + RUST_TARGET: aarch64-apple-darwin + JEMALLOC_SYS_WITH_LG_PAGE: 14 + - name: Strip debug symbols + run: strip -x *.node + - uses: actions/upload-artifact@v4 + with: + name: bindings-aarch64-apple-darwin + path: '*.node' + + build-linux: + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-unknown-linux-gnu + strip: strip + image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian + setup: npm install --global yarn@1 + - target: aarch64-unknown-linux-gnu + strip: llvm-strip + image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 + - target: aarch64-linux-android + strip: llvm-strip + image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 + - target: armv7-unknown-linux-gnueabihf + strip: llvm-strip + image: ghcr.io/napi-rs/napi-rs/nodejs-rust@sha256:c22284b2d79092d3e885f64ede00f6afdeb2ccef7e2b6e78be52e7909091cd57 + - target: aarch64-unknown-linux-musl + image: ghcr.io/napi-rs/napi-rs/nodejs-rust@sha256:78c9ab1f117f8c535b93c4b91a2f19063dda6e4dba48a6187df49810625992c1 + strip: aarch64-linux-musl-strip + - target: x86_64-unknown-linux-musl + image: ghcr.io/napi-rs/napi-rs/nodejs-rust@sha256:78c9ab1f117f8c535b93c4b91a2f19063dda6e4dba48a6187df49810625992c1 + strip: strip + + name: build-${{ matrix.target }} + runs-on: ubuntu-latest + container: + image: ${{ matrix.image }} + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: dtolnay/rust-toolchain@stable + - name: Setup Android NDK + if: ${{ matrix.target == 'aarch64-linux-android' }} + run: | + sudo apt update && sudo apt install unzip -y + cd /tmp + wget -q https://dl.google.com/android/repository/android-ndk-r28-linux.zip -O /tmp/ndk.zip + unzip ndk.zip + - name: Setup cross compile toolchain + if: ${{ matrix.setup }} + run: ${{ matrix.setup }} + - run: rustup target add ${{ matrix.target }} + - uses: bahmutov/npm-install@v1.8.32 + - name: Build release + run: yarn build-release + env: + ANDROID_NDK_LATEST_HOME: /tmp/android-ndk-r28 + RUST_TARGET: ${{ matrix.target }} + - name: Strip debug symbols + if: ${{ matrix.strip }} + run: ${{ matrix.strip }} *.node + - uses: actions/upload-artifact@v4 + with: + name: bindings-${{ matrix.target }} + path: '*.node' + + release: + runs-on: ubuntu-latest + name: Publish to GitHub Packages + needs: + - build + - build-linux + - build-apple-silicon + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + registry-url: https://npm.pkg.github.com + scope: '@fellowapp' + - uses: bahmutov/npm-install@v1.8.32 + - uses: actions/download-artifact@v4 + with: + path: artifacts + - name: Show artifacts + run: ls -R artifacts + - name: Build npm packages + run: node scripts/build-npm.js + - name: Publish platform packages + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + for pkg in npm/*; do + echo "Publishing $pkg..." + (cd "$pkg" && npm publish) + done + - name: Publish main package + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "Publishing @fellowapp/lightningcss..." + npm publish From a15504b7f23703acb4dcf88ee3634b510e07d18a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 May 2026 00:50:56 +0000 Subject: [PATCH 3/3] Bump rand from 0.8.5 to 0.8.6 Bumps [rand](https://github.com/rust-random/rand) from 0.8.5 to 0.8.6. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/0.8.6/CHANGELOG.md) - [Commits](https://github.com/rust-random/rand/compare/0.8.5...0.8.6) --- updated-dependencies: - dependency-name: rand dependency-version: 0.8.6 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bb5be2b1d..1ed9e0d9b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1276,9 +1276,9 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "rand" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" dependencies = [ "rand_core", ]