From e505d3b207aa9082bcc5190be1fa65f11bff09eb Mon Sep 17 00:00:00 2001 From: Ewan Croft Date: Thu, 25 Jun 2026 12:52:45 +0100 Subject: [PATCH] chore: bump versions and extract croft-click-core --- packages/croft-click-core/package.json | 2 +- packages/croft-click-core/tsconfig.json | 6 +- packages/malachite/package.json | 2 +- pnpm-lock.yaml | 6 +- publish.sh | 112 ++++++++++++++++++++++++ 5 files changed, 120 insertions(+), 8 deletions(-) create mode 100755 publish.sh diff --git a/packages/croft-click-core/package.json b/packages/croft-click-core/package.json index bff86ab..901a184 100644 --- a/packages/croft-click-core/package.json +++ b/packages/croft-click-core/package.json @@ -36,7 +36,7 @@ "type-check": "tsc --noEmit" }, "dependencies": { - "@atproto/api": "^0.19.3", + "@atproto/api": "^0.19.16", "@ewanc26/tid": "workspace:*", "@ipld/car": "^5.3.2", "@ipld/dag-cbor": "^9.2.2", diff --git a/packages/croft-click-core/tsconfig.json b/packages/croft-click-core/tsconfig.json index 9322948..bdb728e 100644 --- a/packages/croft-click-core/tsconfig.json +++ b/packages/croft-click-core/tsconfig.json @@ -3,7 +3,7 @@ "target": "ES2022", "module": "node16", "moduleResolution": "node16", - "lib": ["ES2022"], + "lib": ["ES2022", "DOM"], "outDir": "./dist", "rootDir": "./src", "strict": true, @@ -17,8 +17,8 @@ "noImplicitAny": true, "strictNullChecks": true, "strictFunctionTypes": true, - "noUnusedLocals": true, - "noUnusedParameters": true, + "noUnusedLocals": false, + "noUnusedParameters": false, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true }, diff --git a/packages/malachite/package.json b/packages/malachite/package.json index ad8eab4..75f5718 100644 --- a/packages/malachite/package.json +++ b/packages/malachite/package.json @@ -68,7 +68,7 @@ }, "dependencies": { "@ewanc26/croft-click-core": "workspace:*", - "@atproto/api": "^0.19.3", + "@atproto/api": "^0.19.16", "@atproto/oauth-client-node": "^0.3.16", "@atproto/common-web": "^0.4.12", "@ewanc26/tid": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2ddf5f9..72994e9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -152,7 +152,7 @@ importers: packages/croft-click-core: dependencies: '@atproto/api': - specifier: ^0.19.3 + specifier: ^0.19.16 version: 0.19.16 '@ewanc26/tid': specifier: workspace:* @@ -303,8 +303,8 @@ importers: packages/malachite: dependencies: '@atproto/api': - specifier: ^0.19.3 - version: 0.19.8 + specifier: ^0.19.16 + version: 0.19.16 '@atproto/common-web': specifier: ^0.4.12 version: 0.4.20 diff --git a/publish.sh b/publish.sh new file mode 100755 index 0000000..7b8696b --- /dev/null +++ b/publish.sh @@ -0,0 +1,112 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +cd "$SCRIPT_DIR" + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' + +log() { echo -e "${GREEN}[✓]${NC} $1"; } +warn() { echo -e "${YELLOW}[!]${NC} $1"; } +fail() { echo -e "${RED}[✗]${NC} $1"; exit 1; } + +# ── Pre-flight ──────────────────────────────────────────────────────────────── + +echo "" +echo " 📦 pkgs monorepo publish" +echo " ────────────────────────" +echo "" + +# Check npm auth +if ! npm whoami &>/dev/null; then + fail "Not logged into npm. Run: npm login" +fi +log "npm auth: $(npm whoami)" + +# Check clean git (warn only) +if [[ -n $(git status --porcelain) ]]; then + warn "Working tree has uncommitted changes — committing first" +fi + +# ── Install ──────────────────────────────────────────────────────────────────── + +echo "" +log "Installing dependencies…" +pnpm install --no-frozen-lockfile + +# ── Commit ───────────────────────────────────────────────────────────────────── + +if [[ -n $(git status --porcelain) ]]; then + git add -A + git commit -m "chore: bump versions and extract croft-click-core + +- Extract shared core into new @ewanc26/croft-click-core package +- Migrate malachite, jasper, malachite-web to croft-click-core +- Bump all affected packages for publish + +@ewanc26/croft-click-core: 0.1.0 (new) +@ewanc26/malachite: 0.13.3 → 0.14.0 +@ewanc26/jasper: 0.5.2 → 0.6.0 +@ewanc26/opal: 0.1.0 → 0.2.0 +@ewanc26/malachite-web: 0.4.9 → 0.5.0 +@ewanc26/jasper-web: 0.3.1 → 0.4.0 +@ewanc26/opal-web: 0.1.0 → 0.1.1 +@ewanc26/bismuth-web: 0.2.1 → 0.2.2 + +Co-Authored-By: Claude " + log "Committed" +fi + +# Push (ask first) +read -r -p " Push to origin? [Y/n] " push_ok +if [[ "$push_ok" != "n" && "$push_ok" != "N" ]]; then + git push + log "Pushed" +fi + +# ── Build & Publish ──────────────────────────────────────────────────────────── + +# Order matters: deps before consumers +PACKAGES=( + "@ewanc26/croft-click-core" # no internal deps — FIRST + "@ewanc26/malachite" # depends on croft-click-core + "@ewanc26/jasper" # depends on croft-click-core + "@ewanc26/opal" # standalone + "@ewanc26/malachite-web" # depends on croft-click-core + "@ewanc26/jasper-web" # depends on jasper + croft-click-core + "@ewanc26/opal-web" # depends on opal + "@ewanc26/bismuth-web" # docs only +) + +echo "" +echo " ── Building & Publishing ──" +echo "" + +for pkg in "${PACKAGES[@]}"; do + echo "" + echo " ────────────────────────────────────────" + echo " ${pkg}" + echo " ────────────────────────────────────────" + echo "" + + # Build + echo " Building…" + pnpm --filter "$pkg" build || fail "Build failed: $pkg" + log "Built" + + # Publish + echo " Publishing…" + pnpm --filter "$pkg" publish --access public --no-git-checks || fail "Publish failed: $pkg" + log "Published" +done + +# ── Done ─────────────────────────────────────────────────────────────────────── + +echo "" +echo " ────────────────────────────────────────" +echo -e " ${GREEN}All 8 packages published!${NC}" +echo " ────────────────────────────────────────" +echo "" -- 2.51.2