From 6d3331f802c45a545e9738f632bdcd9136ed2763 Mon Sep 17 00:00:00 2001 From: Richie Date: Fri, 5 Jun 2026 12:59:34 +1000 Subject: [PATCH] Configure GitHub Packages publishing Scope the package as @richiesnitch/ads3-design-system, add repository + publishConfig (GitHub Packages registry), and a publish-on-tag GitHub Actions workflow. Add react/react-dom as devDependencies so the library build runs in CI (they remain peerDependencies for consumers). Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/publish-package.yml | 37 +++++++++++++++++++++++++++ package-lock.json | 21 +++++++-------- package.json | 12 +++++++-- 3 files changed, 58 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/publish-package.yml diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 0000000..fed5780 --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,37 @@ +name: Publish package to GitHub Packages + +# Publishes @richiesnitch/ads3-design-system to GitHub Packages when a version +# tag (v*) is pushed, or on manual dispatch. Uses the workflow's built-in +# GITHUB_TOKEN (no PAT needed) — packages:write permission is granted below. +on: + push: + tags: + - "v*" + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: https://npm.pkg.github.com + + - name: Install dependencies + run: npm ci + + - name: Build library + run: npm run build:lib + + - name: Publish + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package-lock.json b/package-lock.json index 7034bdc..850ff1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "ads3-design-system", + "name": "@richiesnitch/ads3-design-system", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "ads3-design-system", + "name": "@richiesnitch/ads3-design-system", "version": "0.1.0", "dependencies": { "@floating-ui/react": "^0.27.19", @@ -41,6 +41,8 @@ "playwright": "^1.60.0", "prettier": "^3.8.3", "prettier-plugin-tailwindcss": "^0.8.0", + "react": "^19.2.7", + "react-dom": "^19.2.7", "storybook": "^10.4.0", "typescript": "~6.0.2", "typescript-eslint": "^8.59.2", @@ -49,7 +51,6 @@ "vitest": "^4.1.6" }, "peerDependencies": { - "lucide-react": "^1.16.0", "react": "^19.0.0", "react-dom": "^19.0.0" } @@ -6403,9 +6404,9 @@ "license": "MIT" }, "node_modules/react": { - "version": "19.2.6", - "resolved": "https://registry.npmjs.org/react/-/react-19.2.6.tgz", - "integrity": "sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==", + "version": "19.2.7", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.7.tgz", + "integrity": "sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -6444,15 +6445,15 @@ } }, "node_modules/react-dom": { - "version": "19.2.6", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.6.tgz", - "integrity": "sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g==", + "version": "19.2.7", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.7.tgz", + "integrity": "sha512-t0BRVXvbiE/o20Hfw669rLbMCDWtYZLvmJigy2f0MxsXF+71pxhR3xOkspmsO8h3ZlNzyibAmtCa3l4lYKk6gQ==", "license": "MIT", "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { - "react": "^19.2.6" + "react": "^19.2.7" } }, "node_modules/react-is": { diff --git a/package.json b/package.json index f6612f6..1c02195 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,14 @@ { - "name": "ads3-design-system", - "private": true, + "name": "@richiesnitch/ads3-design-system", "version": "0.1.0", "type": "module", + "repository": { + "type": "git", + "url": "git+https://github.com/Richiesnitch/ads3-design-system.git" + }, + "publishConfig": { + "registry": "https://npm.pkg.github.com" + }, "main": "./dist/index.js", "module": "./dist/index.js", "types": "./dist/src/index.d.ts", @@ -64,6 +70,8 @@ "playwright": "^1.60.0", "prettier": "^3.8.3", "prettier-plugin-tailwindcss": "^0.8.0", + "react": "^19.2.7", + "react-dom": "^19.2.7", "storybook": "^10.4.0", "typescript": "~6.0.2", "typescript-eslint": "^8.59.2",