From d2bceb6237b625344eb149f236fadd1e1acb05e9 Mon Sep 17 00:00:00 2001 From: Jeefos Date: Wed, 1 Apr 2026 22:59:48 -0400 Subject: [PATCH 1/2] added page slot names --- .github/workflows/release.yml | 31 -------------------------- package.json | 3 --- src/types.ts | 41 +++++++++++++++++++++++++++++------ 3 files changed, 34 insertions(+), 41 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a7adcc..bdddaab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,6 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - packages: write steps: - uses: actions/checkout@v4 @@ -22,7 +21,6 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 - registry-url: https://npm.pkg.github.com cache: pnpm - name: Install dependencies @@ -34,35 +32,6 @@ jobs: - name: Build run: pnpm build - - name: Extract version from tag - id: version - run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT - - - name: Prepare package for publish - run: | - node -e " - const fs = require('fs'); - const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8')); - pkg.version = '${{ steps.version.outputs.version }}'; - pkg.exports = { - '.': { - import: './dist/index.mjs', - require: './dist/index.cjs', - types: './dist/index.d.ts' - } - }; - pkg.main = './dist/index.cjs'; - pkg.module = './dist/index.mjs'; - pkg.types = './dist/index.d.ts'; - pkg.files = ['dist']; - fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2) + '\n'); - " - - - name: Publish to GitHub Packages - run: pnpm publish --no-git-checks --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Create GitHub release uses: softprops/action-gh-release@v2 with: diff --git a/package.json b/package.json index 8a83553..e19458d 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,6 @@ "type": "git", "url": "https://github.com/kleffio/plugin-sdk-js.git" }, - "publishConfig": { - "registry": "https://npm.pkg.github.com" - }, "exports": { ".": "./src/index.ts" }, diff --git a/src/types.ts b/src/types.ts index 7c4156b..b6d0858 100644 --- a/src/types.ts +++ b/src/types.ts @@ -7,12 +7,39 @@ import type { ComponentType } from "react"; * Plugins register components into these slots. */ export type SlotName = - | "navbar.item" // sidebar nav link - | "page" // full page rendered at /p/ - | "dashboard.widget" // widget on the dashboard - | "settings.section" // section appended to the settings page - | "topbar.right" // element in the top bar (right side) - | "global.provider" // React provider wrapping the entire app + | "navbar.item" // sidebar nav link + | "page" // full page rendered at / + | "dashboard.top" // above dashboard content + | "dashboard.header" // title + subtitle block — replaces default if provided + | "dashboard.metrics" // the 4 metric cards — replaces default if provided + | "dashboard.widget" // injection: widget between metrics and tabs + | "dashboard.servers-tab" // the servers tab content — replaces default if provided + | "dashboard.activity-tab" // the activity tab content — replaces default if provided + | "dashboard.bottom" // below dashboard content + | "servers.top" // above servers content + | "servers.header" // title + new server button — replaces default if provided + | "servers.list" // the server card grid — replaces default if provided + | "servers.bottom" // below servers content + | "billing.top" // above billing content + | "billing.header" // title + subtitle block — replaces default if provided + | "billing.plan" // the current plan card — replaces default if provided + | "billing.invoices" // the invoice table — replaces default if provided + | "billing.bottom" // below billing content + | "settings.top" // above settings content + | "settings.header" // title + subtitle block — replaces default if provided + | "settings.profile" // the profile card — replaces default if provided + | "settings.org" // the organization card — replaces default if provided + | "settings.section" // injection: section between org card and danger zone + | "settings.bottom" // below settings content + | "admin.top" // above admin content + | "admin.header" // title + subtitle block — replaces default if provided + | "admin.metrics" // the 3 metric cards — replaces default if provided + | "admin.cards" // grid wrapper containing users + orgs cards — replaces default if provided + | "admin.users" // the users card — replaces default if provided + | "admin.orgs" // the organizations card — replaces default if provided + | "admin.bottom" // below admin content + | "topbar.right" // element in the top bar (right side) + | "global.provider" // React provider wrapping the entire app | (string & {}); // extensible — allow custom slot names export interface SlotRegistration { @@ -32,7 +59,7 @@ export interface SlotRegistration { * label: string, icon: string (lucide icon name), href: string * * For "page" slots, recognised keys: - * path: string (e.g. "/components" → served at /p/components) + * path: string (e.g. "/components" → served at /components) */ props?: Record; } From e1ce0d28e9b3a3f045fa9bc96216eee6f1a5f720 Mon Sep 17 00:00:00 2001 From: Jeefos Date: Wed, 1 Apr 2026 23:04:21 -0400 Subject: [PATCH 2/2] fix --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bdddaab..8a7adcc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + packages: write steps: - uses: actions/checkout@v4 @@ -21,6 +22,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 + registry-url: https://npm.pkg.github.com cache: pnpm - name: Install dependencies @@ -32,6 +34,35 @@ jobs: - name: Build run: pnpm build + - name: Extract version from tag + id: version + run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT + + - name: Prepare package for publish + run: | + node -e " + const fs = require('fs'); + const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8')); + pkg.version = '${{ steps.version.outputs.version }}'; + pkg.exports = { + '.': { + import: './dist/index.mjs', + require: './dist/index.cjs', + types: './dist/index.d.ts' + } + }; + pkg.main = './dist/index.cjs'; + pkg.module = './dist/index.mjs'; + pkg.types = './dist/index.d.ts'; + pkg.files = ['dist']; + fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2) + '\n'); + " + + - name: Publish to GitHub Packages + run: pnpm publish --no-git-checks --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create GitHub release uses: softprops/action-gh-release@v2 with: