Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/actions/pack-sample/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Pack Sample App
description: >
Packages a sample app into a standalone zip using pnpm pack, which
rewrites workspace:* and catalog: references to real npm versions.
Requires the pnpm workspace to be installed before this action runs.

inputs:
sdk:
description: SDK slug matching the samples/ subdirectory (e.g. react, browser, node)
required: true
version:
description: Version being released (e.g. 1.2.3), used to name the zip file
required: true

outputs:
archive:
description: Filename of the produced zip (relative to the workspace root)
value: ${{ steps.pack.outputs.archive }}

runs:
using: composite
steps:
- name: Pack
id: pack
shell: bash
run: |
SDK="${{ inputs.sdk }}"
VERSION="${{ inputs.version }}"
DEST_DIR="$(pwd)"
FOLDER="thunderid-${SDK}-sdk-sample-v${VERSION}"
ARCHIVE="${FOLDER}.zip"

PACK_DIR="$(mktemp -d)"
trap 'rm -rf "$PACK_DIR"' EXIT

cd "samples/${SDK}/quickstart"
pnpm pack --pack-destination "${PACK_DIR}"
cd "${DEST_DIR}"

tgz=$(ls "${PACK_DIR}"/*.tgz | head -1)
if [ -z "$tgz" ]; then
echo "Error: pnpm pack did not produce a .tgz for ${SDK}"
exit 1
fi

tar xzf "$tgz"
mv package "${FOLDER}"
(find "${FOLDER}" | sort | zip "${ARCHIVE}" -@)
rm -rf "${FOLDER}"

echo "archive=${ARCHIVE}" >> "$GITHUB_OUTPUT"
4 changes: 2 additions & 2 deletions .github/workflows/pr-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
run: pnpm format:check

- name: 🧹 Lint
run: pnpm --filter '!./packages/**' lint
run: pnpm --filter '!./packages/**' --filter '!./samples/**' lint

- name: 🧪 Test
run: pnpm --filter '!./packages/**' test
run: pnpm --filter '!./packages/**' --filter '!./samples/**' test
136 changes: 136 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 🚀 Create GitHub Release
env:
GH_TOKEN: ${{ secrets.THUNDERID_AUTOMATION_BOT }}
run: |
gh release create "sdk/javascript/v${{ steps.bump.outputs.version }}" \
--title "ThunderID JavaScript SDK v${{ steps.bump.outputs.version }}" \
--generate-notes

# ── Level 1: depends on javascript ─────────────────────────────────────────
release-browser:
name: 🌐 Release @thunderid/browser
Expand Down Expand Up @@ -221,6 +229,22 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 📦 Pack Sample
id: pack
uses: ./.github/actions/pack-sample
with:
sdk: browser
version: ${{ steps.bump.outputs.version }}

- name: 🚀 Create GitHub Release
env:
GH_TOKEN: ${{ secrets.THUNDERID_AUTOMATION_BOT }}
run: |
gh release create "sdk/browser/v${{ steps.bump.outputs.version }}" \
--title "ThunderID Browser SDK v${{ steps.bump.outputs.version }}" \
--generate-notes \
"${{ steps.pack.outputs.archive }}"

release-node:
name: 🟢 Release @thunderid/node
needs: [validate, release-javascript]
Expand Down Expand Up @@ -278,6 +302,22 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 📦 Pack Sample
id: pack
uses: ./.github/actions/pack-sample
with:
sdk: node
version: ${{ steps.bump.outputs.version }}

- name: 🚀 Create GitHub Release
env:
GH_TOKEN: ${{ secrets.THUNDERID_AUTOMATION_BOT }}
run: |
gh release create "sdk/node/v${{ steps.bump.outputs.version }}" \
--title "ThunderID Node SDK v${{ steps.bump.outputs.version }}" \
--generate-notes \
"${{ steps.pack.outputs.archive }}"

# ── Level 2: depends on browser / node ─────────────────────────────────────
release-express:
name: 🚂 Release @thunderid/express
Expand Down Expand Up @@ -336,6 +376,22 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 📦 Pack Sample
id: pack
uses: ./.github/actions/pack-sample
with:
sdk: express
version: ${{ steps.bump.outputs.version }}

- name: 🚀 Create GitHub Release
env:
GH_TOKEN: ${{ secrets.THUNDERID_AUTOMATION_BOT }}
run: |
gh release create "sdk/express/v${{ steps.bump.outputs.version }}" \
--title "ThunderID Express SDK v${{ steps.bump.outputs.version }}" \
--generate-notes \
"${{ steps.pack.outputs.archive }}"

release-react:
name: ⚛️ Release @thunderid/react
needs: [validate, release-browser]
Expand Down Expand Up @@ -393,6 +449,22 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 📦 Pack Sample
id: pack
uses: ./.github/actions/pack-sample
with:
sdk: react
version: ${{ steps.bump.outputs.version }}

- name: 🚀 Create GitHub Release
env:
GH_TOKEN: ${{ secrets.THUNDERID_AUTOMATION_BOT }}
run: |
gh release create "sdk/react/v${{ steps.bump.outputs.version }}" \
--title "ThunderID React SDK v${{ steps.bump.outputs.version }}" \
--generate-notes \
"${{ steps.pack.outputs.archive }}"

release-vue:
name: 🟩 Release @thunderid/vue
needs: [validate, release-browser]
Expand Down Expand Up @@ -450,6 +522,22 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 📦 Pack Sample
id: pack
uses: ./.github/actions/pack-sample
with:
sdk: vue
version: ${{ steps.bump.outputs.version }}

- name: 🚀 Create GitHub Release
env:
GH_TOKEN: ${{ secrets.THUNDERID_AUTOMATION_BOT }}
run: |
gh release create "sdk/vue/v${{ steps.bump.outputs.version }}" \
--title "ThunderID Vue SDK v${{ steps.bump.outputs.version }}" \
--generate-notes \
"${{ steps.pack.outputs.archive }}"

# ── Level 3: depends on react / node+react / browser+node+vue ──────────────
release-react-router:
name: 🔀 Release @thunderid/react-router
Expand Down Expand Up @@ -508,6 +596,14 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 🚀 Create GitHub Release
env:
GH_TOKEN: ${{ secrets.THUNDERID_AUTOMATION_BOT }}
run: |
gh release create "sdk/react-router/v${{ steps.bump.outputs.version }}" \
--title "ThunderID React Router SDK v${{ steps.bump.outputs.version }}" \
--generate-notes

release-tanstack-router:
name: 🔱 Release @thunderid/tanstack-router
needs: [validate, release-react]
Expand Down Expand Up @@ -565,6 +661,14 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 🚀 Create GitHub Release
env:
GH_TOKEN: ${{ secrets.THUNDERID_AUTOMATION_BOT }}
run: |
gh release create "sdk/tanstack-router/v${{ steps.bump.outputs.version }}" \
--title "ThunderID TanStack Router SDK v${{ steps.bump.outputs.version }}" \
--generate-notes

release-nextjs:
name: ▲ Release @thunderid/nextjs
needs: [validate, release-node, release-react]
Expand Down Expand Up @@ -622,6 +726,22 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 📦 Pack Sample
id: pack
uses: ./.github/actions/pack-sample
with:
sdk: nextjs
version: ${{ steps.bump.outputs.version }}

- name: 🚀 Create GitHub Release
env:
GH_TOKEN: ${{ secrets.THUNDERID_AUTOMATION_BOT }}
run: |
gh release create "sdk/nextjs/v${{ steps.bump.outputs.version }}" \
--title "ThunderID Next.js SDK v${{ steps.bump.outputs.version }}" \
--generate-notes \
"${{ steps.pack.outputs.archive }}"

release-nuxt:
name: 💚 Release @thunderid/nuxt
needs: [validate, release-browser, release-node, release-vue]
Expand Down Expand Up @@ -678,3 +798,19 @@ jobs:
working-directory: packages/nuxt
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 📦 Pack Sample
id: pack
uses: ./.github/actions/pack-sample
with:
sdk: nuxt
version: ${{ steps.bump.outputs.version }}

- name: 🚀 Create GitHub Release
env:
GH_TOKEN: ${{ secrets.THUNDERID_AUTOMATION_BOT }}
run: |
gh release create "sdk/nuxt/v${{ steps.bump.outputs.version }}" \
--title "ThunderID Nuxt SDK v${{ steps.bump.outputs.version }}" \
--generate-notes \
"${{ steps.pack.outputs.archive }}"
6 changes: 6 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ export default [
ignores: ['dist/**', 'build/**', 'node_modules/**', 'coverage/**'],
},
...thunderIdPlugin.configs.typescript,
{
files: ['samples/**'],
rules: {
'@thunderid/copyright-header': 'off',
},
},
];
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
},
"devDependencies": {
"nx": "22.7.5",
"@thunderid/eslint-plugin": "catalog:",
"eslint": "catalog:",
"prettier": "catalog:",
"rimraf": "catalog:",
Expand Down
17 changes: 0 additions & 17 deletions packages/javascript/src/ThunderIDJavaScriptClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import {Crypto} from './models/crypto';
import {ExtendedAuthorizeRequestUrlParams} from './models/oauth-request';
import {OIDCDiscoveryApiResponse} from './models/oidc-discovery';
import {OIDCEndpoints} from './models/oidc-endpoints';
import {AllOrganizationsApiResponse, Organization} from './models/organization';
import {SessionData, UserSession} from './models/session';
import {Storage, TemporaryStore} from './models/store';
import {IdToken, TokenExchangeRequestConfig, TokenResponse} from './models/token';
Expand Down Expand Up @@ -312,22 +311,6 @@ class ThunderIDJavaScriptClient<T = Config> implements ThunderIDClient<T> {
throw new Error('Method not implemented.');
}

public switchOrganization(_organization: Organization, _sessionId?: string): Promise<TokenResponse | Response> {
throw new Error('Method not implemented.');
}

public getCurrentOrganization(_sessionId?: string): Promise<Organization | null> {
throw new Error('Method not implemented.');
}

public getAllOrganizations(_options?: any, _sessionId?: string): Promise<AllOrganizationsApiResponse> {
throw new Error('Method not implemented.');
}

public getMyOrganizations(_options?: any, _sessionId?: string): Promise<Organization[]> {
throw new Error('Method not implemented.');
}

public getUserProfile(_options?: any): Promise<UserProfile> {
throw new Error('Method not implemented.');
}
Expand Down
Loading
Loading