From dd5e5e2a4ae8ae73cd7782715d76fcfc30baf358 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sun, 29 Mar 2026 19:02:54 -0700 Subject: [PATCH 1/7] Add GHA workflow to pretranspile package on release creation --- .github/stripAtomTranspilers.js | 14 +++++++++ .github/workflows/transpile.yml | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .github/stripAtomTranspilers.js create mode 100644 .github/workflows/transpile.yml diff --git a/.github/stripAtomTranspilers.js b/.github/stripAtomTranspilers.js new file mode 100644 index 0000000000..e7a24d857f --- /dev/null +++ b/.github/stripAtomTranspilers.js @@ -0,0 +1,14 @@ +/** + This small script strips the `atomTranspilers` key from the repos `package.json`. + Which prevents the editor (Pulsar) from trying to transpile the package at + startup time, which is unnecessary and redudant on a 'pretranspiled' tag of the + package. Should save some CPU cycles. +*/ + +const fs = require("node:fs"); + +const pkgJSON = JSON.parse(fs.readFileSync("./package.json", { encoding: "utf8" })); + +delete pkgJSON.atomTranspilers; + +fs.writeFileSync("./package.json", JSON.stringify(pkgJSON, null, 2) + '\n', { encoding: "utf8" }); diff --git a/.github/workflows/transpile.yml b/.github/workflows/transpile.yml new file mode 100644 index 0000000000..796cb4d018 --- /dev/null +++ b/.github/workflows/transpile.yml @@ -0,0 +1,53 @@ +name: Auto-Transpile + +on: + release: + types: [created] + workflow_dispatch: + +jobs: + transpile: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout Repo + uses: actions/checkout@v5 + - name: Setup NodeJS + uses: actions/setup-node@v6 + with: + node-version: ${{ vars.NODE_VERSION }} # Use org defined NODE_VERSION + - name: Install Dependencies + run: npm install --legacy-peer-deps + # The legacy-peer-deps flag matches how `pulsar -p install` behaves + - name: Install NPM Tooling + run: npm install -g @babel/cli @babel/core + - name: Log Globally installed NPM tooling + run: npm ls -g + - name: Log babel version + run: npx babel --version + - name: Setup Git User + run: | + git --version + git config --global user.name "Pulsar-Edit Bot" + git config --global user.email "" + - name: Find Current Version + run: | + NODE_PKG_VERSION=$(node -p "require('./package.json').version") + echo "NODE_PKG_VERSION=$NODE_PKG_VERSION" >> $GITHUB_ENV + - name: Create new pretranspiled branch + run: git switch -c v${{ env.NODE_PKG_VERSION }}-pretranspiled + - name: Transpile Source + run: ELECTRON_VERSION=30.5.1 babel lib -d lib --compact auto --source-type module + - name: Strip `atomTranspilers` from `package.json` + run: node ./.github/stripAtomTranspilers.js + - name: Commit changes + run: | + git add + git commit -m "Pretranspile package" + - name: Tag changes + run: git tag v${{ env.NODE_PKG_VERSION }}-pretranspiled + - name: Push branch to remote + run: git push -u origin v${{ env.NODE_PKG_VERSION }}-pretranspiled + - name: Push tag to remote + run: git push origin v${{ env.NODE_PKG_VERSION }}-pretranspiled From cfa8a6cfdd795c74653ead14a1f9b468eb99cf3b Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sun, 29 Mar 2026 19:09:06 -0700 Subject: [PATCH 2/7] Use top level defined `ELECTRON_VERSION` --- .github/workflows/transpile.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/transpile.yml b/.github/workflows/transpile.yml index 796cb4d018..b7cbbe5b61 100644 --- a/.github/workflows/transpile.yml +++ b/.github/workflows/transpile.yml @@ -5,6 +5,9 @@ on: types: [created] workflow_dispatch: +env: + ELECTRON_VERSION: 30.5.1 + jobs: transpile: runs-on: ubuntu-latest @@ -38,7 +41,7 @@ jobs: - name: Create new pretranspiled branch run: git switch -c v${{ env.NODE_PKG_VERSION }}-pretranspiled - name: Transpile Source - run: ELECTRON_VERSION=30.5.1 babel lib -d lib --compact auto --source-type module + run: ELECTRON_VERSION=${{ env.ELECTRON_VERSION }} babel lib -d lib --compact auto --source-type module - name: Strip `atomTranspilers` from `package.json` run: node ./.github/stripAtomTranspilers.js - name: Commit changes From 278a90152612efeb57b9f97769526679424020db Mon Sep 17 00:00:00 2001 From: confused_techie Date: Sun, 29 Mar 2026 20:03:57 -0700 Subject: [PATCH 3/7] Update .github/stripAtomTranspilers.js Co-authored-by: DeeDeeG --- .github/stripAtomTranspilers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/stripAtomTranspilers.js b/.github/stripAtomTranspilers.js index e7a24d857f..a90a8f059b 100644 --- a/.github/stripAtomTranspilers.js +++ b/.github/stripAtomTranspilers.js @@ -2,7 +2,7 @@ This small script strips the `atomTranspilers` key from the repos `package.json`. Which prevents the editor (Pulsar) from trying to transpile the package at startup time, which is unnecessary and redudant on a 'pretranspiled' tag of the - package. Should save some CPU cycles. + package. Should save some CPU cycles... and prevent errors if `devDependencies` aren't present. */ const fs = require("node:fs"); From 3c40099c0f990c9076f230bb727ab6826c8a085f Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Mon, 30 Mar 2026 17:49:52 -0700 Subject: [PATCH 4/7] Clarify branch name, don't push branch to remote --- .github/workflows/transpile.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/transpile.yml b/.github/workflows/transpile.yml index b7cbbe5b61..850cfbb036 100644 --- a/.github/workflows/transpile.yml +++ b/.github/workflows/transpile.yml @@ -39,7 +39,7 @@ jobs: NODE_PKG_VERSION=$(node -p "require('./package.json').version") echo "NODE_PKG_VERSION=$NODE_PKG_VERSION" >> $GITHUB_ENV - name: Create new pretranspiled branch - run: git switch -c v${{ env.NODE_PKG_VERSION }}-pretranspiled + run: git switch -c v${{ env.NODE_PKG_VERSION }}-pretranspiled-working-branch - name: Transpile Source run: ELECTRON_VERSION=${{ env.ELECTRON_VERSION }} babel lib -d lib --compact auto --source-type module - name: Strip `atomTranspilers` from `package.json` @@ -50,7 +50,5 @@ jobs: git commit -m "Pretranspile package" - name: Tag changes run: git tag v${{ env.NODE_PKG_VERSION }}-pretranspiled - - name: Push branch to remote - run: git push -u origin v${{ env.NODE_PKG_VERSION }}-pretranspiled - name: Push tag to remote run: git push origin v${{ env.NODE_PKG_VERSION }}-pretranspiled From 06987777d2174f11a4e0277a6119f236b0bf04a3 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Mon, 30 Mar 2026 18:18:00 -0700 Subject: [PATCH 5/7] Embrace full automation, create duel tags --- .github/workflows/transpile.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/transpile.yml b/.github/workflows/transpile.yml index 850cfbb036..b309cec80c 100644 --- a/.github/workflows/transpile.yml +++ b/.github/workflows/transpile.yml @@ -1,9 +1,21 @@ name: Auto-Transpile on: - release: - types: [created] workflow_dispatch: + inputs: + releaseType: + description: "The semver bump type for this release." + required: true + default: "patch" + type: choice + options: + - major + - minor + - patch + - premajor + - preminor + - prepatch + - prerelease env: ELECTRON_VERSION: 30.5.1 @@ -34,10 +46,22 @@ jobs: git --version git config --global user.name "Pulsar-Edit Bot" git config --global user.email "" + - name: Disable NPM Git tag creation on version bump + run: npm config set git-tag-version false + - name: Bump Version + run: npm version ${{ inputs.releaseType }} + - name: Commit changes + run: | + git add + git commit -m "Bump Version" - name: Find Current Version run: | NODE_PKG_VERSION=$(node -p "require('./package.json').version") echo "NODE_PKG_VERSION=$NODE_PKG_VERSION" >> $GITHUB_ENV + - name: Tag changes as base tag + run: git tag v${{ env.NODE_PKG_VERSION }} + - name: Push base tag to remote + run: git push oriign v${{ env.NODE_PKG_VERSION }} - name: Create new pretranspiled branch run: git switch -c v${{ env.NODE_PKG_VERSION }}-pretranspiled-working-branch - name: Transpile Source From 7b6ad4895761a13bb4793bdece7528c17113ced7 Mon Sep 17 00:00:00 2001 From: confused_techie Date: Mon, 30 Mar 2026 21:08:14 -0700 Subject: [PATCH 6/7] Update .github/workflows/transpile.yml Co-authored-by: DeeDeeG --- .github/workflows/transpile.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/transpile.yml b/.github/workflows/transpile.yml index b309cec80c..84a43ea0e4 100644 --- a/.github/workflows/transpile.yml +++ b/.github/workflows/transpile.yml @@ -60,8 +60,10 @@ jobs: echo "NODE_PKG_VERSION=$NODE_PKG_VERSION" >> $GITHUB_ENV - name: Tag changes as base tag run: git tag v${{ env.NODE_PKG_VERSION }} + - name: Push updated default branch to remote + run: git push - name: Push base tag to remote - run: git push oriign v${{ env.NODE_PKG_VERSION }} + run: git push origin v${{ env.NODE_PKG_VERSION }} - name: Create new pretranspiled branch run: git switch -c v${{ env.NODE_PKG_VERSION }}-pretranspiled-working-branch - name: Transpile Source From 8c63065e170c90abd715832a4a93802406b17526 Mon Sep 17 00:00:00 2001 From: confused_techie Date: Mon, 30 Mar 2026 21:09:54 -0700 Subject: [PATCH 7/7] Update .github/workflows/transpile.yml Co-authored-by: DeeDeeG --- .github/workflows/transpile.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/transpile.yml b/.github/workflows/transpile.yml index 84a43ea0e4..fd9ae2047d 100644 --- a/.github/workflows/transpile.yml +++ b/.github/workflows/transpile.yml @@ -50,14 +50,14 @@ jobs: run: npm config set git-tag-version false - name: Bump Version run: npm version ${{ inputs.releaseType }} - - name: Commit changes - run: | - git add - git commit -m "Bump Version" - name: Find Current Version run: | NODE_PKG_VERSION=$(node -p "require('./package.json').version") echo "NODE_PKG_VERSION=$NODE_PKG_VERSION" >> $GITHUB_ENV + - name: Commit changes + run: | + git add + git commit -m "Bump Version to v${{ env.NODE_PKG_VERSION }}" - name: Tag changes as base tag run: git tag v${{ env.NODE_PKG_VERSION }} - name: Push updated default branch to remote