fix(api): load Drizzle migrations at runtime (#2307)
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
# `@proj-airi/drizzle-migration`
|
||||
|
||||
Build-time package that compiles the SQL migrations from `server/apps/api/drizzle` into an importable module for the API runtime.
|
||||
|
||||
## Usage
|
||||
|
||||
The API imports the generated `migrations` value and applies it through the Drizzle browser migrator. Build the package from the repository root:
|
||||
|
||||
```sh
|
||||
pnpm -F @proj-airi/drizzle-migration build
|
||||
```
|
||||
|
||||
Use this package for API-owned Drizzle migration bundling. Runtime schemas remain in `server/apps/api/src/schemas`; shared browser or SDK contracts do not belong here.
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"name": "@proj-airi/drizzle-migration",
|
||||
"type": "module",
|
||||
"version": "0.11.3",
|
||||
"private": true,
|
||||
"description": "Drizzle migration for AIRI",
|
||||
"author": {
|
||||
"name": "Moeru AI Project AIRI Team",
|
||||
"email": "airi@moeru.ai",
|
||||
"url": "https://github.com/moeru-ai"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
}
|
||||
},
|
||||
"main": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.mts",
|
||||
"files": [
|
||||
"README.md",
|
||||
"dist",
|
||||
"package.json"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsdown"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@proj-airi/unplugin-drizzle-orm-migrations": "catalog:"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
export { default as migrations } from 'virtual:drizzle-migrations.sql'
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"lib": [
|
||||
"ESNext"
|
||||
],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"types": [
|
||||
"@proj-airi/unplugin-drizzle-orm-migrations/types"
|
||||
],
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"isolatedModules": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import DrizzleORMMigrations from '@proj-airi/unplugin-drizzle-orm-migrations/rollup'
|
||||
|
||||
import { defineConfig } from 'tsdown'
|
||||
|
||||
export default defineConfig({
|
||||
entry: [
|
||||
'src/index.ts',
|
||||
],
|
||||
dts: true,
|
||||
sourcemap: true,
|
||||
unused: true,
|
||||
fixedExtension: true,
|
||||
plugins: [
|
||||
DrizzleORMMigrations({
|
||||
root: '../../apps/api',
|
||||
}),
|
||||
],
|
||||
})
|
||||
@@ -1,7 +0,0 @@
|
||||
import { defineConfig } from 'vitest/config'
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
include: ['src/**/*.test.ts'],
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user