-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: split config types to separate build (#10401)
* feat: split config types to separate build * chore: changeset * fix: drizzle property exports
- Loading branch information
1 parent
24ee74a
commit a084d8c
Showing
6 changed files
with
52 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@astrojs/db": patch | ||
--- | ||
|
||
Fix astro:db configuration types returning `any` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
// We want to avoid defineTable() and defineDb() import hints | ||
// from the runtime config export instead of astro:db. | ||
// We exclude runtime/config from the base types, | ||
// and generate to a separate _internal/ directory | ||
// for our virtual module (virtual.d.ts) to reference. | ||
"extends": "../../tsconfig.base.json", | ||
"files": ["./src/runtime/config.ts"], | ||
"compilerOptions": { | ||
"outDir": "./dist/_internal" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,33 @@ | ||
declare module 'astro:db' { | ||
export const sql: typeof import('./dist/runtime/config.js').sql; | ||
export const NOW: typeof import('./dist/runtime/config.js').NOW; | ||
export const TRUE: typeof import('./dist/runtime/config.js').TRUE; | ||
export const FALSE: typeof import('./dist/runtime/config.js').FALSE; | ||
export const column: typeof import('./dist/runtime/config.js').column; | ||
export const defineDb: typeof import('./dist/runtime/config.js').defineDb; | ||
export const defineTable: typeof import('./dist/runtime/config.js').defineTable; | ||
type RuntimeConfig = typeof import('./dist/_internal/runtime/config.js'); | ||
|
||
export const sql: RuntimeConfig['sql']; | ||
export const NOW: RuntimeConfig['NOW']; | ||
export const TRUE: RuntimeConfig['TRUE']; | ||
export const FALSE: RuntimeConfig['FALSE']; | ||
export const column: RuntimeConfig['column']; | ||
export const defineDb: RuntimeConfig['defineDb']; | ||
export const defineTable: RuntimeConfig['defineTable']; | ||
|
||
export const eq: RuntimeConfig['eq']; | ||
export const gt: RuntimeConfig['gt']; | ||
export const gte: RuntimeConfig['gte']; | ||
export const lt: RuntimeConfig['lt']; | ||
export const lte: RuntimeConfig['lte']; | ||
export const ne: RuntimeConfig['ne']; | ||
export const isNull: RuntimeConfig['isNull']; | ||
export const isNotNull: RuntimeConfig['isNotNull']; | ||
export const inArray: RuntimeConfig['inArray']; | ||
export const notInArray: RuntimeConfig['notInArray']; | ||
export const exists: RuntimeConfig['exists']; | ||
export const notExists: RuntimeConfig['notExists']; | ||
export const between: RuntimeConfig['between']; | ||
export const notBetween: RuntimeConfig['notBetween']; | ||
export const like: RuntimeConfig['like']; | ||
export const notIlike: RuntimeConfig['notIlike']; | ||
export const not: RuntimeConfig['not']; | ||
export const asc: RuntimeConfig['asc']; | ||
export const desc: RuntimeConfig['desc']; | ||
export const and: RuntimeConfig['and']; | ||
export const or: RuntimeConfig['or']; | ||
} |