diff --git a/.changeset/many-boxes-beg.md b/.changeset/many-boxes-beg.md new file mode 100644 index 00000000000..53dc02b70e7 --- /dev/null +++ b/.changeset/many-boxes-beg.md @@ -0,0 +1,5 @@ +--- +"@clerk/astro": patch +--- + +Remove `@nanostores/react` from depedency. diff --git a/.changeset/ten-planes-run.md b/.changeset/ten-planes-run.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/ten-planes-run.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/integration/presets/envs.ts b/integration/presets/envs.ts index 5d62e882059..54724dc005d 100644 --- a/integration/presets/envs.ts +++ b/integration/presets/envs.ts @@ -44,8 +44,6 @@ const withEmailLinks = environmentConfig() const withCustomRoles = environmentConfig() .setId('withCustomRoles') .setEnvVariable('public', 'CLERK_TELEMETRY_DISABLED', true) - // Temporarily use the stage api until the custom roles feature is released to prod - .setEnvVariable('private', 'CLERK_API_URL', 'https://api.clerkstage.dev') .setEnvVariable('private', 'CLERK_SECRET_KEY', envKeys['with-custom-roles'].sk) .setEnvVariable('public', 'CLERK_PUBLISHABLE_KEY', envKeys['with-custom-roles'].pk) .setEnvVariable('public', 'CLERK_SIGN_IN_URL', '/sign-in') diff --git a/integration/presets/longRunningApps.ts b/integration/presets/longRunningApps.ts index b13eafeefac..e6077faa291 100644 --- a/integration/presets/longRunningApps.ts +++ b/integration/presets/longRunningApps.ts @@ -23,7 +23,7 @@ export const createLongRunningApps = () => { { id: 'next.appRouter.withCustomRoles', config: next.appRouter, env: envs.withCustomRoles }, { id: 'quickstart.next.appRouter', config: next.appRouterQuickstart, env: envs.withEmailCodesQuickstart }, { id: 'elements.next.appRouter', config: elements.nextAppRouter, env: envs.withEmailCodes }, - { id: 'astro.node.withEmailCodes', config: astro.node, env: envs.withEmailCodes }, + { id: 'astro.node.withCustomRoles', config: astro.node, env: envs.withCustomRoles }, ] as const; const apps = configs.map(longRunningApplication); diff --git a/integration/templates/astro-node/src/components/page-with-user.tsx b/integration/templates/astro-node/src/components/page-with-user.tsx new file mode 100644 index 00000000000..547c01ee7b9 --- /dev/null +++ b/integration/templates/astro-node/src/components/page-with-user.tsx @@ -0,0 +1,17 @@ +import React, { type PropsWithChildren, useSyncExternalStore } from 'react'; +import { UserProfile } from '@clerk/astro/client/react'; +import { $userStore } from '@clerk/astro/client/stores'; + +export function PageWithUser({ children }: PropsWithChildren) { + const user = useSyncExternalStore($userStore.listen, $userStore.get, $userStore.get); + + return ( + <> +

My name is: {user?.firstName}

+
+ +
+ {children} + + ); +} diff --git a/integration/templates/astro-node/src/layouts/Protected.astro b/integration/templates/astro-node/src/layouts/Protected.astro deleted file mode 100644 index a36699ec99d..00000000000 --- a/integration/templates/astro-node/src/layouts/Protected.astro +++ /dev/null @@ -1,5 +0,0 @@ ---- -const { userId } = Astro.locals.auth() ---- - -{userId && } diff --git a/integration/templates/astro-node/src/layouts/Streaming.astro b/integration/templates/astro-node/src/layouts/Streaming.astro index 326f15f02a9..e19b870db3c 100644 --- a/integration/templates/astro-node/src/layouts/Streaming.astro +++ b/integration/templates/astro-node/src/layouts/Streaming.astro @@ -2,7 +2,7 @@ await new Promise((res) => setTimeout(() => { res(undefined); - }, 1000), + }, 4000), ); --- diff --git a/integration/templates/astro-node/src/layouts/react/Layout.astro b/integration/templates/astro-node/src/layouts/react/Layout.astro new file mode 100644 index 00000000000..84f6aedcff8 --- /dev/null +++ b/integration/templates/astro-node/src/layouts/react/Layout.astro @@ -0,0 +1,143 @@ +--- +interface Props { + title: string; +} + +const { title } = Astro.props; + +import { SignedIn, SignedOut, UserButton } from "@clerk/astro/client/react"; +import { LanguagePicker } from "../../components/LanguagePicker"; +--- + + + + + + + + + + {title} + + +
+
+
+ + + + +
+ + + + + + + + + +
+
+
+
+
+ +
+ + + diff --git a/integration/templates/astro-node/src/pages/index.astro b/integration/templates/astro-node/src/pages/index.astro index ae6a9ed78b6..b3d2a4e0a19 100644 --- a/integration/templates/astro-node/src/pages/index.astro +++ b/integration/templates/astro-node/src/pages/index.astro @@ -3,7 +3,7 @@ import Layout from "../layouts/Layout.astro"; import Card from "../components/Card.astro"; import SignOutButton from "../lib/astro-components/SignOutButton.astro"; -import { SignedIn, SignedOut } from "@clerk/astro/client/react"; +import { SignedIn, SignedOut } from "@clerk/astro/components/control"; import { OrganizationSwitcher } from "@clerk/astro/components/interactive"; --- @@ -24,17 +24,12 @@ import { OrganizationSwitcher } from "@clerk/astro/components/interactive";
-

- To get started, open the directory src/pages in your project.
- Code Challenge: Tweak the "Welcome to Astro" message above. -