File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 * ------------------------------------------------------------
1616 */
1717
18- import type { DrizzleToZeroSchema , ZeroCustomType } from "drizzle-zero" ;
18+ import type { ZeroCustomType } from "drizzle-zero" ;
1919import type * as drizzleSchema from "./drizzle/schema" ;
20+ import type { DrizzleToZeroSchema } from "drizzle-zero" ;
2021
2122type ZeroSchema = DrizzleToZeroSchema < typeof drizzleSchema , "snake_case" > ;
2223
Original file line number Diff line number Diff line change 11{
22 "name" : " drizzle-zero" ,
3- "version" : " 0.11.0 " ,
3+ "version" : " 0.11.1 " ,
44 "description" : " Generate Zero schemas from Drizzle ORM schemas" ,
55 "type" : " module" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ export const getFullDrizzleSchemaFilePath = async ({
5757 drizzleKitConfigPath : string | undefined ;
5858 drizzleSchemaPath : string | undefined ;
5959} ) => {
60+ const typeModuleErrorMessage = `. You may need to add \` "type": "module" \` to your package.json.` ;
61+
6062 if ( drizzleSchemaPath ) {
6163 const fullPath = path . resolve ( process . cwd ( ) , drizzleSchemaPath ) ;
6264
@@ -120,7 +122,7 @@ export const getFullDrizzleSchemaFilePath = async ({
120122 } ;
121123 } catch ( error ) {
122124 console . error (
123- `❌ drizzle-zero: could not find Drizzle Kit config file at ${ drizzleKitConfigPath } ` ,
125+ `❌ drizzle-zero: could not find Drizzle Kit config file at ${ drizzleKitConfigPath } ${ typeModuleErrorMessage } ` ,
124126 error ,
125127 ) ;
126128 process . exit ( 1 ) ;
Original file line number Diff line number Diff line change @@ -166,9 +166,7 @@ export async function getGeneratedSchema({
166166
167167 zeroSchemaGenerated . formatText ( ) ;
168168
169- const organizedFile = zeroSchemaGenerated . organizeImports ( ) ;
170-
171- const file = organizedFile . getText ( ) ;
169+ const file = zeroSchemaGenerated . getText ( ) ;
172170
173171 return `/* eslint-disable */
174172/* tslint:disable */
You can’t perform that action at this time.
0 commit comments