Skip to content

Commit 07778e4

Browse files
committed
fix: resolve npm install failure and update dependencies
- Remove postinstall script from nuxt-app that blocked npm ci - Add prepare:types script for manual IDE type generation - Update vue-i18n from v9 to v11 (v9/v10 deprecated) - Regenerate package-lock.json with Node 22 - Update nuxt-app README to match actual configuration
1 parent a508e7e commit 07778e4

4 files changed

Lines changed: 33858 additions & 35587 deletions

File tree

examples/nuxt-app/README.md

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,15 @@ examples/nuxt-app/
1111
│ ├── auth.vue # Centered layout for auth pages
1212
│ └── default.vue # Default application layout
1313
├── pages/
14-
│ ├── auth/
15-
│ │ ├── login.vue # Login flow
16-
│ │ ├── registration.vue
17-
│ │ ├── recovery.vue
18-
│ │ └── verification.vue
14+
│ ├── login.vue # Login flow
15+
│ ├── registration.vue # Registration flow
16+
│ ├── recovery.vue # Account recovery flow
17+
│ ├── verification.vue # Email verification flow
1918
│ ├── settings.vue # Protected settings page
19+
│ ├── session.vue # Session details page
2020
│ ├── error.vue # Error display page
2121
│ └── index.vue # Home page with session status
22-
├── nuxt.config.ts # Nuxt & Ory module configuration
23-
└── public/
24-
└── ory-logo.svg # Project logo
22+
└── nuxt.config.ts # Nuxt & Ory module configuration
2523
```
2624

2725
## Configuration
@@ -37,23 +35,22 @@ export default defineNuxtConfig({
3735
ory: {
3836
project: {
3937
// Localization
40-
default_locale: "es",
38+
default_locale: "en",
4139
locale_behavior: "force_default",
4240

4341
// Branding
4442
name: "Ory Nuxt Example",
45-
logo_light_url: "/ory-logo.svg",
4643

4744
// Feature flags
4845
registration_enabled: true,
4946
verification_enabled: true,
5047
recovery_enabled: true,
5148

5249
// UI URLs (must match your pages)
53-
login_ui_url: "/auth/login",
54-
registration_ui_url: "/auth/registration",
55-
verification_ui_url: "/auth/verification",
56-
recovery_ui_url: "/auth/recovery",
50+
login_ui_url: "/login",
51+
registration_ui_url: "/registration",
52+
verification_ui_url: "/verification",
53+
recovery_ui_url: "/recovery",
5754
settings_ui_url: "/settings",
5855
error_ui_url: "/error",
5956
default_redirect_url: "/",
@@ -99,31 +96,26 @@ export default defineNuxtConfig({
9996
### Theme Configuration (`assets/css/main.css`)
10097

10198
```css
102-
@import "tailwindcss";
99+
@import "@ory/elements-vue/theme/default/styles.css";
103100

104-
/* Scan @ory/elements-vue for Tailwind classes */
105-
@source "../../node_modules/@ory/elements-vue/dist/**/*.{js,mjs}";
101+
/* Include @ory/elements-vue components for Tailwind class scanning */
102+
@source "../../../../packages/elements-vue/dist/**/*.{js,mjs}";
106103

107-
/* Define CSS custom properties for theming */
108-
:root {
109-
--ui-50: #f8fafc;
110-
/* ... color palette ... */
111-
}
112-
113-
/* Map to Tailwind 4 theme */
114-
@theme {
115-
--color-button-primary-background-default: var(--interface-background-brand-primary);
116-
/* ... component tokens ... */
104+
/* Base styles */
105+
body {
106+
font-family: Inter, Helvetica, sans-serif;
107+
background-color: var(--ui-100);
108+
color: var(--ory-foreground-default);
117109
}
118110
```
119111

120-
The `@source` directive tells Tailwind to scan the Ory elements package for class names used in components.
112+
The `@import` imports the default Ory theme styles, while `@source` tells Tailwind to scan the Ory elements package for class names used in components.
121113

122114
## Using Ory Components
123115

124116
### Auth Pages
125117

126-
Import the flow component and use the corresponding composable:
118+
Import the flow component and use the corresponding composable (e.g., `pages/login.vue`):
127119

128120
```vue
129121
<script setup lang="ts">
@@ -163,7 +155,7 @@ const { data: session } = await useAsyncOrySession()
163155
Welcome back! Session ID: {{ session.id }}
164156
</div>
165157
<div v-else>
166-
<NuxtLink to="/auth/login">Login</NuxtLink>
158+
<NuxtLink to="/login">Login</NuxtLink>
167159
</div>
168160
</template>
169161
```
@@ -203,23 +195,28 @@ npm install
203195
# Build dependencies
204196
npm run build --workspace=@ory/elements-vue --workspace=@ory/nuxt
205197

198+
# (Optional) Generate Nuxt types for IDE support
199+
npm run prepare:types --workspace=nuxt-app
200+
206201
# Start the dev server
207202
npm run dev --workspace=nuxt-app
208203
```
209204

210205
The app will be available at http://localhost:3000.
211206

207+
> **Note:** The `prepare:types` script runs `nuxt prepare` to generate TypeScript declarations for better IDE support. This is optional as `nuxt dev` and `nuxt build` run it automatically.
208+
212209
## Internationalization (i18n)
213210

214-
The example uses Spanish (`es`) locale by default. To change the locale, update `nuxt.config.ts`:
211+
The example uses English (`en`) locale by default. To change the locale, update `nuxt.config.ts`:
215212

216213
```typescript
217214
ory: {
218215
project: {
219-
default_locale: "en", // or "fr", "de", etc.
216+
default_locale: "fr", // or "es", "de", etc.
220217
locale_behavior: "force_default",
221218
},
222219
}
223220
```
224221

225-
Available locales are defined in `@ory/elements-vue/locales`.
222+
Available locales are defined in `@ory/elements-vue`.

examples/nuxt-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dev": "nuxt dev",
88
"generate": "nuxt generate",
99
"preview": "nuxt preview",
10-
"postinstall": "nuxt prepare"
10+
"prepare:types": "nuxt prepare"
1111
},
1212
"dependencies": {
1313
"@ory/client-fetch": "1.21.5",

0 commit comments

Comments
 (0)