package.json type=module, tsconfig module/moduleResolution=NodeNext, target es2022, explicit .js on all relative imports. Center: jsonwebtoken & bcryptjs switched to default imports (ESM/CJS interop). Verified: builds, boots, full auth + plugin round-trip work under ESM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
17 lines
448 B
TypeScript
17 lines
448 B
TypeScript
import 'reflect-metadata';
|
|
import { DataSource, DataSourceOptions } from 'typeorm';
|
|
import { buildTypeOrmConfig } from './database.config.js';
|
|
|
|
const cfg = buildTypeOrmConfig();
|
|
|
|
const options: DataSourceOptions = {
|
|
...(cfg as Record<string, unknown>),
|
|
type: 'mysql',
|
|
migrations: ['src/migrations/*.{ts,js}'],
|
|
synchronize: false,
|
|
} as DataSourceOptions;
|
|
|
|
export const AppDataSource = new DataSource(options);
|
|
|
|
export default AppDataSource;
|