From 7be75f71ff7d5264273b32524e803423705d793e Mon Sep 17 00:00:00 2001 From: Aboo Date: Fri, 27 Mar 2026 16:35:58 +1100 Subject: [PATCH 01/15] PAP-7012: prepare package for publication - Rename package to @pap.dev/workbench - Add build scripts using bun and configure dist directory for distribution - Set package type to module and add MIT license - Update .gitignore to exclude build artifacts --- .gitignore | 3 ++- packages/workbench-cli/package.json | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9177892..091dd18 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ package-lock.json .ck/* thoughts/ -node_modules \ No newline at end of file +node_modules +dist/ \ No newline at end of file diff --git a/packages/workbench-cli/package.json b/packages/workbench-cli/package.json index 9a7914e..bfd508c 100644 --- a/packages/workbench-cli/package.json +++ b/packages/workbench-cli/package.json @@ -1,8 +1,16 @@ { - "name": "workbench-cli", + "name": "@pap.dev/workbench", "version": "0.1.0", + "type": "module", "bin": { - "workbench": "./src/index.ts" + "workbench": "src/index.ts" + }, + "files": [ + "dist" + ], + "scripts": { + "build": "bun build ./src/index.ts --outdir ./dist --target node --banner '#!/usr/bin/env node'", + "prepublishOnly": "bun run build" }, "dependencies": { "@opentui/core": "^0.1.90", @@ -12,5 +20,6 @@ "@types/js-yaml": "^4.0.9", "@types/node": "^24.0.0", "typescript": "^5.0.0" - } + }, + "license": "MIT" } From b6f9dd48420f929d757d5e1467877ee6b31ab95a Mon Sep 17 00:00:00 2001 From: Aboo Date: Fri, 27 Mar 2026 17:10:38 +1100 Subject: [PATCH 02/15] PAP-7012: fix distribution entry point and switch target to bun - Point package binary to the compiled output in dist/ instead of source - Update build script and shebang to target the bun runtime instead of node - Bump version to 0.1.2 --- packages/workbench-cli/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/workbench-cli/package.json b/packages/workbench-cli/package.json index bfd508c..02220cd 100644 --- a/packages/workbench-cli/package.json +++ b/packages/workbench-cli/package.json @@ -1,15 +1,15 @@ { "name": "@pap.dev/workbench", - "version": "0.1.0", + "version": "0.1.2", "type": "module", "bin": { - "workbench": "src/index.ts" + "workbench": "dist/index.js" }, "files": [ "dist" ], "scripts": { - "build": "bun build ./src/index.ts --outdir ./dist --target node --banner '#!/usr/bin/env node'", + "build": "bun build ./src/index.ts --outdir ./dist --target bun --banner '#!/usr/bin/env bun'", "prepublishOnly": "bun run build" }, "dependencies": { From 73dc90cb51d03cb0aa1ebf88a3e5595fcd06fa68 Mon Sep 17 00:00:00 2001 From: Aboo Date: Fri, 27 Mar 2026 17:40:33 +1100 Subject: [PATCH 03/15] PAP-7012: add jsr configuration - Add jsr.json to support publishing the package to the JSR registry --- packages/workbench-cli/jsr.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 packages/workbench-cli/jsr.json diff --git a/packages/workbench-cli/jsr.json b/packages/workbench-cli/jsr.json new file mode 100644 index 0000000..aa13656 --- /dev/null +++ b/packages/workbench-cli/jsr.json @@ -0,0 +1,6 @@ +{ + "name": "@pap/workbench", + "version": "0.1.2", + "license": "MIT", + "exports": "./src/index.ts" +} \ No newline at end of file From 52b2ab14dd3bf565be88b7310edc268b8b31aa87 Mon Sep 17 00:00:00 2001 From: Aboo Date: Fri, 27 Mar 2026 17:47:47 +1100 Subject: [PATCH 04/15] PAP-7012: add README.md - Add documentation for the workbench-cli package, including installation, prerequisites, and usage instructions - Describe the interactive initialization process and configuration output --- packages/workbench-cli/README.md | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 packages/workbench-cli/README.md diff --git a/packages/workbench-cli/README.md b/packages/workbench-cli/README.md new file mode 100644 index 0000000..3a85218 --- /dev/null +++ b/packages/workbench-cli/README.md @@ -0,0 +1,39 @@ +# Workbench + +The `workbench` CLI provides a terminal UI for initializing the workbench repository. + +## Prerequisites + +- [Bun](https://bun.sh) installed +- [gh CLI](https://cli.github.com) installed and authenticated (`gh auth login`) + +## Installation + +To install dependencies and link the CLI locally: + +```bash +bun install +bun link +``` + +After linking, the `workbench` command will be available globally on your system. + +## Run (without installing) + +You can run the CLI directly from the source without linking: + +```bash +bun run src/index.ts +``` + +## Usage + +Run the `workbench` command from the workbench repository root. Select `init` to walk through the interactive setup: + +1. Select a GitHub organization or personal account. +2. Select code repositories (added as submodules under the `projects/` directory). +3. Select resource repositories (added as submodules under the `resources/` directory). +4. Configure the target branch per repository. +5. Optionally index with `ck`. + +After initialization, the selected configuration is written to `.workbench/config.yaml`. From e57f340c72705337c761a1ffb5b30975619789c7 Mon Sep 17 00:00:00 2001 From: Aboo Date: Fri, 27 Mar 2026 17:49:37 +1100 Subject: [PATCH 05/15] PAP-7012: sync jsr.json version with package.json - Add a version lifecycle script to automatically update the version in jsr.json whenever the package version is bumped - Ensure the updated jsr.json is staged during the versioning process --- packages/workbench-cli/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/workbench-cli/package.json b/packages/workbench-cli/package.json index 02220cd..3b619fb 100644 --- a/packages/workbench-cli/package.json +++ b/packages/workbench-cli/package.json @@ -9,6 +9,7 @@ "dist" ], "scripts": { + "version": "node -e \"const j=require('./jsr.json');j.version=require('./package.json').version;require('fs').writeFileSync('./jsr.json',JSON.stringify(j,null,2)+'\\n')\" && git add jsr.json", "build": "bun build ./src/index.ts --outdir ./dist --target bun --banner '#!/usr/bin/env bun'", "prepublishOnly": "bun run build" }, From 2716e105f3fc1903f747097c81eada4dc37f36c2 Mon Sep 17 00:00:00 2001 From: Aboo Date: Fri, 27 Mar 2026 18:06:51 +1100 Subject: [PATCH 06/15] PAP-7012: add postversion script for automatic tagging - Automatically create a git tag matching the new version after the versioning process is complete --- packages/workbench-cli/jsr.json | 2 +- packages/workbench-cli/package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/workbench-cli/jsr.json b/packages/workbench-cli/jsr.json index aa13656..ccf8939 100644 --- a/packages/workbench-cli/jsr.json +++ b/packages/workbench-cli/jsr.json @@ -3,4 +3,4 @@ "version": "0.1.2", "license": "MIT", "exports": "./src/index.ts" -} \ No newline at end of file +} diff --git a/packages/workbench-cli/package.json b/packages/workbench-cli/package.json index 3b619fb..c026534 100644 --- a/packages/workbench-cli/package.json +++ b/packages/workbench-cli/package.json @@ -10,6 +10,7 @@ ], "scripts": { "version": "node -e \"const j=require('./jsr.json');j.version=require('./package.json').version;require('fs').writeFileSync('./jsr.json',JSON.stringify(j,null,2)+'\\n')\" && git add jsr.json", + "postversion": "git add -A && git commit -m \"chore: bump version to $(node -e \"console.log(require('./package.json').version)\")\" && git tag v$(node -e \"console.log(require('./package.json').version)\")", "build": "bun build ./src/index.ts --outdir ./dist --target bun --banner '#!/usr/bin/env bun'", "prepublishOnly": "bun run build" }, From 7be3e888b43fc5c595d55e079998db26f121e400 Mon Sep 17 00:00:00 2001 From: Aboo Date: Fri, 27 Mar 2026 18:36:57 +1100 Subject: [PATCH 07/15] PAP-7012: add release scripts for version management - Add convenience scripts for patch, minor, and major version bumps - Ensure consistent commit messages when updating the package version --- packages/workbench-cli/package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/workbench-cli/package.json b/packages/workbench-cli/package.json index c026534..519dfe9 100644 --- a/packages/workbench-cli/package.json +++ b/packages/workbench-cli/package.json @@ -12,7 +12,10 @@ "version": "node -e \"const j=require('./jsr.json');j.version=require('./package.json').version;require('fs').writeFileSync('./jsr.json',JSON.stringify(j,null,2)+'\\n')\" && git add jsr.json", "postversion": "git add -A && git commit -m \"chore: bump version to $(node -e \"console.log(require('./package.json').version)\")\" && git tag v$(node -e \"console.log(require('./package.json').version)\")", "build": "bun build ./src/index.ts --outdir ./dist --target bun --banner '#!/usr/bin/env bun'", - "prepublishOnly": "bun run build" + "prepublishOnly": "bun run build", + "release:patch": "npm version patch --message 'chore: bump version to %s'", + "release:minor": "npm version minor --message 'chore: bump version to %s'", + "release:major": "npm version major --message 'chore: bump version to %s'" }, "dependencies": { "@opentui/core": "^0.1.90", From 525157fbdf359b9df543b8f41655e52094921044 Mon Sep 17 00:00:00 2001 From: Aboo Date: Fri, 27 Mar 2026 18:44:02 +1100 Subject: [PATCH 08/15] PAP-7012: add release script for automated versioning and pushing - Provide a script to orchestrate version bumping and pushing tags to origin - Include a confirmation prompt to prevent accidental releases and ensure the correct release type is selected --- packages/workbench-cli/scripts/release.sh | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 packages/workbench-cli/scripts/release.sh diff --git a/packages/workbench-cli/scripts/release.sh b/packages/workbench-cli/scripts/release.sh new file mode 100755 index 0000000..f9647a8 --- /dev/null +++ b/packages/workbench-cli/scripts/release.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +set -euo pipefail + +RELEASE_TYPE="${1:-patch}" + +if [[ "$RELEASE_TYPE" != "major" && "$RELEASE_TYPE" != "minor" && "$RELEASE_TYPE" != "patch" ]]; then + echo "Error: release type must be major, minor, or patch (got: '$RELEASE_TYPE')" + exit 1 +fi + +echo "This will:" +echo " 1. Bump the $RELEASE_TYPE version number" +echo " 2. Push main with the newly created tag to origin" +echo " 3. Trigger a release action" +echo "" +read -r -p "Do you want to continue? [y/N] " confirm + +if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then + echo "Aborted." + exit 0 +fi + +bun run "release:$RELEASE_TYPE" +git push origin main --tags From f182f87ccb760d9d7f2c7dfd91f3625fe1496c93 Mon Sep 17 00:00:00 2001 From: Aboo Date: Tue, 31 Mar 2026 14:15:31 +1100 Subject: [PATCH 09/15] PAP-7012: add github workflow for automated publishing - Automate the build and distribution of the workbench-cli package to npm and JSR - Trigger the workflow whenever a new version tag (v*) is pushed to the repository --- .github/workflows/publish.yaml | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..6728475 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,36 @@ +name: Publish + +on: + push: + tags: + - 'v*' + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write # required for JSR OIDC auth + + steps: + - uses: actions/checkout@v4 + + - uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + run: bun install + working-directory: packages/workbench-cli + + - name: Build + run: bun run build + working-directory: packages/workbench-cli + + - name: Publish to npm + run: npm publish --access public + working-directory: packages/workbench-cli + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Publish to JSR + run: bunx jsr publish --allow-slow-types + working-directory: packages/workbench-cli \ No newline at end of file From 5fa08bdb109d266aa37634133e8db403f1649db3 Mon Sep 17 00:00:00 2001 From: Aboo Date: Tue, 31 Mar 2026 14:16:07 +1100 Subject: [PATCH 10/15] temp --- .github/workflows/publish.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 6728475..7b04aef 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -4,6 +4,8 @@ on: push: tags: - 'v*' + branches: + - feature/pap-7012-publish-the-package jobs: publish: From c9e3a38f8e8ed39a1ebadfa3c238e447a3d2f939 Mon Sep 17 00:00:00 2001 From: Aboo Date: Tue, 31 Mar 2026 14:21:08 +1100 Subject: [PATCH 11/15] PAP-7012: configure node and npm registry for publishing - Set up Node.js v22 and configure the npm registry URL - Required for the npm publish step to execute correctly in the CI environment --- .github/workflows/publish.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 7b04aef..4f53e1b 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -27,6 +27,12 @@ jobs: run: bun run build working-directory: packages/workbench-cli + # Setup node for npm publish + - uses: actions/setup-node@v4 + with: + node-version: '22' + registry-url: 'https://registry.npmjs.org' + - name: Publish to npm run: npm publish --access public working-directory: packages/workbench-cli From 23813a85ea5d9d65570ba8c7290d6a802794fd42 Mon Sep 17 00:00:00 2001 From: Aboo Date: Tue, 31 Mar 2026 14:23:52 +1100 Subject: [PATCH 12/15] chore: bump version to 0.1.3 --- packages/workbench-cli/jsr.json | 2 +- packages/workbench-cli/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/workbench-cli/jsr.json b/packages/workbench-cli/jsr.json index ccf8939..6a0f4a7 100644 --- a/packages/workbench-cli/jsr.json +++ b/packages/workbench-cli/jsr.json @@ -1,6 +1,6 @@ { "name": "@pap/workbench", - "version": "0.1.2", + "version": "0.1.3", "license": "MIT", "exports": "./src/index.ts" } diff --git a/packages/workbench-cli/package.json b/packages/workbench-cli/package.json index 519dfe9..0374aa4 100644 --- a/packages/workbench-cli/package.json +++ b/packages/workbench-cli/package.json @@ -1,6 +1,6 @@ { "name": "@pap.dev/workbench", - "version": "0.1.2", + "version": "0.1.3", "type": "module", "bin": { "workbench": "dist/index.js" From b84f5ba972d5d1fe9a541cb71c3da866dda1e6c1 Mon Sep 17 00:00:00 2001 From: Aboo Date: Tue, 31 Mar 2026 14:25:33 +1100 Subject: [PATCH 13/15] Revert "temp" This reverts commit 5fa08bdb109d266aa37634133e8db403f1649db3. --- .github/workflows/publish.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 4f53e1b..1e911f1 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -4,8 +4,6 @@ on: push: tags: - 'v*' - branches: - - feature/pap-7012-publish-the-package jobs: publish: From 91d82d2e5a40b126df45a87d5f60a26f18727cce Mon Sep 17 00:00:00 2001 From: Aboo Date: Tue, 31 Mar 2026 14:30:10 +1100 Subject: [PATCH 14/15] PAP-7012: rename publish workflow to .yml - Rename the GitHub Actions workflow file extension from .yaml to .yml for consistency --- .github/workflows/{publish.yaml => publish.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{publish.yaml => publish.yml} (100%) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yml similarity index 100% rename from .github/workflows/publish.yaml rename to .github/workflows/publish.yml From 795bb566c84797eebf697c8305a0092fdf662438 Mon Sep 17 00:00:00 2001 From: Aboo Date: Tue, 31 Mar 2026 14:30:30 +1100 Subject: [PATCH 15/15] PAP-7012: add CI workflow for workbench-cli - Validate pull requests with changes in the workbench-cli package - Perform type checking, build, and a smoke test using Bun --- .github/workflows/ci-workbench-cli.yml | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/ci-workbench-cli.yml diff --git a/.github/workflows/ci-workbench-cli.yml b/.github/workflows/ci-workbench-cli.yml new file mode 100644 index 0000000..7f42ac6 --- /dev/null +++ b/.github/workflows/ci-workbench-cli.yml @@ -0,0 +1,33 @@ +name: CI — workbench-cli + +on: + pull_request: + branches: + - main + paths: + - 'packages/workbench-cli/**' + +jobs: + validate: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + run: bun install + working-directory: packages/workbench-cli + + - name: Type check + run: bun tsc --noEmit + working-directory: packages/workbench-cli + + - name: Build + run: bun run build + working-directory: packages/workbench-cli + + - name: Smoke test + run: ./dist/index.js --help || true + working-directory: packages/workbench-cli \ No newline at end of file