-
Notifications
You must be signed in to change notification settings - Fork 445
feat(nuxt): Add support for keyless mode #7844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
b943873
feat(nuxt): Introduce keyless mode
wobsoriano 01c26c4
chore: clean up keyless logic
wobsoriano e80b974
chore: remove unused type
wobsoriano ac444ee
chore: add changeset
wobsoriano f8e080d
Merge branch 'main' into rob/nuxt-keyless
wobsoriano 2ae15e6
fix(nuxt): add missing tsup entry points for keyless mode files
wobsoriano 6e0497f
fix(integration): update nuxt template to 4.4.2
wobsoriano 7134248
Merge branch 'main' into rob/nuxt-keyless
wobsoriano e476a00
test: bump nuxt template versions
wobsoriano 4c3d660
chore: remove unused files
wobsoriano 71566de
fix(integration): run pnpm install after pkglab add to fix dependency…
wobsoriano 587cf4f
revert: remove pnpm install after pkglab add
wobsoriano 72fa493
test fix
wobsoriano 9bd3d89
Merge branch 'main' into rob/nuxt-keyless
wobsoriano 1f723b6
fix: Move runtime config imports
wobsoriano 5f8e1cc
chore: remove compat and unused await
wobsoriano b5653fa
fix(nuxt): support NUXT_CLERK_API_URL for private runtime config
wobsoriano a1223fe
fix(nuxt): move apiUrl from public to private runtime config
wobsoriano 836c54d
fix(nuxt): restore apiUrl as public runtime config
wobsoriano 9e8186d
revert: restore original integration env settings
wobsoriano 61070c1
fix(nuxt): move apiUrl and apiVersion to private runtime config
wobsoriano c7f39e9
fix(nuxt): deprecate NUXT_PUBLIC_CLERK_API_URL in favor of NUXT_CLERK…
wobsoriano 3416006
Merge branch 'main' into rob/nuxt-keyless
wobsoriano d29eba9
chore: add changeset
wobsoriano ad8328e
Merge branch 'main' into rob/nuxt-keyless
wobsoriano ec0db85
Merge branch 'main' into rob/nuxt-keyless
wobsoriano c37d62c
refactor(nuxt): use ClerkKeylessContext type in plugin
wobsoriano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@clerk/nuxt": minor | ||
| --- | ||
|
|
||
| Introduce Keyless quickstart for Nuxt. This allows the Clerk SDK to be used without having to sign up and paste your keys manually. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@clerk/astro": patch | ||
| "@clerk/react-router": patch | ||
| --- | ||
|
|
||
| Simplified keyless service initialization. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import { test } from '@playwright/test'; | ||
|
|
||
| import type { Application } from '../../models/application'; | ||
| import { appConfigs } from '../../presets'; | ||
| import { | ||
| testClaimedAppWithMissingKeys, | ||
| testKeylessRemovedAfterEnvAndRestart, | ||
| testToggleCollapsePopoverAndClaim, | ||
| } from '../../testUtils/keylessHelpers'; | ||
|
|
||
| const commonSetup = appConfigs.nuxt.node.clone(); | ||
|
|
||
| test.describe('Keyless mode @nuxt', () => { | ||
| test.describe.configure({ mode: 'serial' }); | ||
| test.setTimeout(90_000); | ||
|
|
||
| test.use({ | ||
| extraHTTPHeaders: { | ||
| 'x-vercel-protection-bypass': process.env.VERCEL_AUTOMATION_BYPASS_SECRET || '', | ||
| }, | ||
| }); | ||
|
|
||
| let app: Application; | ||
| let dashboardUrl = 'https://dashboard.clerk.com/'; | ||
|
|
||
| test.beforeAll(async () => { | ||
| app = await commonSetup.commit(); | ||
| await app.setup(); | ||
| await app.withEnv(appConfigs.envs.withKeyless); | ||
| if (appConfigs.envs.withKeyless.privateVariables.get('CLERK_API_URL')?.includes('clerkstage')) { | ||
| dashboardUrl = 'https://dashboard.clerkstage.dev/'; | ||
| } | ||
| await app.dev(); | ||
| }); | ||
|
|
||
| test.afterAll(async () => { | ||
| // Keep files for debugging | ||
| await app?.teardown(); | ||
| }); | ||
|
|
||
| test('Toggle collapse popover and claim.', async ({ page, context }) => { | ||
| await testToggleCollapsePopoverAndClaim({ page, context, app, dashboardUrl, framework: 'nuxt' }); | ||
| }); | ||
|
|
||
| test('Lands on claimed application with missing explicit keys, expanded by default, click to get keys from dashboard.', async ({ | ||
| page, | ||
| context, | ||
| }) => { | ||
| await testClaimedAppWithMissingKeys({ page, context, app, dashboardUrl }); | ||
| }); | ||
|
|
||
| test('Keyless popover is removed after adding keys to .env and restarting.', async ({ page, context }) => { | ||
| await testKeylessRemovedAfterEnvAndRestart({ page, context, app }); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import * as fs from 'node:fs'; | ||
| import * as path from 'node:path'; | ||
|
|
||
| import { createNodeFileStorage, type KeylessStorage } from '@clerk/shared/keyless'; | ||
|
|
||
| export type { KeylessStorage }; | ||
|
|
||
| export interface FileStorageOptions { | ||
| cwd?: () => string; | ||
| } | ||
|
|
||
| export function createFileStorage(options: FileStorageOptions = {}): KeylessStorage { | ||
| const { cwd = () => process.cwd() } = options; | ||
|
|
||
| return createNodeFileStorage(fs, path, { | ||
| cwd, | ||
| frameworkPackageName: '@clerk/nuxt', | ||
| }); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.