Skip to content

Commit

Permalink
fix(nuxt): moduleRuntimeConfig and add migrate option to Drizzle module
Browse files Browse the repository at this point in the history
  • Loading branch information
productdevbook committed Mar 10, 2024
1 parent 1fb2681 commit a1a9b56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function generateModuleRuntimeConfig<T>(
...Object.entries(config).map(([key, value]) => {
return {
[key]: value === 'process'
? process.env[`NUXT_${snakeCase(`${projectName}_${moduleName}_${key}` as string).toUpperCase()}`] ?? (runtimeConfig.public as any)[projectName][moduleName][key] ?? defaultConfig[key] ?? ''
? process.env[`NUXT_${snakeCase(`${projectName}_${moduleName}_${key}` as string).toUpperCase()}`] ?? (runtimeConfig.public as any)[projectName]?.[moduleName]?.[key] ?? defaultConfig[key] ?? ''
: value,
}
}).reduce((acc, cur) => {
Expand Down
5 changes: 5 additions & 0 deletions packages/nuxt/src/runtime/modules/capacitor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ export default definePergelModule<CapacitorOptions, ResolvedCapacitorOptions>({
runTargetIOSSimulator: 'process',
runTargetAndroidEmulator: 'process',
runScheme: 'process',
default: {
runTargetIOSSimulator: 'iPhone 11',
runTargetAndroidEmulator: 'Pixel_3a_API_30',
runScheme: 'MyApp',
},
}, true)

const capacitorConfig = `import { type CapacitorConfig } from '@capacitor/cli';
Expand Down
1 change: 1 addition & 0 deletions packages/nuxt/src/runtime/modules/drizzle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default definePergelModule<DrizzleConfig, ResolvedDrizzleConfig>({
drop: true, // Drop database before migration
push: true, // Push database after migration
seed: true, // Seed database after migration
migrate: true, // Migrate database
mode: 'dev', // Development mode || 'production'
},
})
Expand Down

0 comments on commit a1a9b56

Please sign in to comment.