Skip to content
This repository was archived by the owner on Mar 1, 2026. It is now read-only.

Commit 5d1053f

Browse files
Copilotymc9claude[bot]
authored
fix(schema): use type-only imports to prevent bundling server dependencies in client code (#668)
* Initial plan * Fix: Change ModelResult/TypeDefResult imports to type-only imports in ts-schema-generator Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com> * Regenerate test schemas with type-only imports Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com> * Fix: Update bun runtime models.ts to use type-only imports Co-authored-by: Yiming Cao <ymc9@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Yiming Cao <ymc9@users.noreply.github.com>
1 parent 080114b commit 5d1053f

File tree

24 files changed

+26
-26
lines changed

24 files changed

+26
-26
lines changed

packages/sdk/src/ts-schema-generator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,18 +1359,18 @@ export class TsSchemaGenerator {
13591359
ts.factory.createImportDeclaration(
13601360
undefined,
13611361
ts.factory.createImportClause(
1362-
false,
1362+
true,
13631363
undefined,
13641364
ts.factory.createNamedImports([
13651365
ts.factory.createImportSpecifier(
1366-
true,
1366+
false,
13671367
undefined,
13681368
ts.factory.createIdentifier(`ModelResult as $ModelResult`),
13691369
),
13701370
...(model.declarations.some(isTypeDef)
13711371
? [
13721372
ts.factory.createImportSpecifier(
1373-
true,
1373+
false,
13741374
undefined,
13751375
ts.factory.createIdentifier(`TypeDefResult as $TypeDefResult`),
13761376
),

samples/orm/zenstack/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* eslint-disable */
77

88
import { schema as $schema, type SchemaType as $Schema } from "./schema";
9-
import { type ModelResult as $ModelResult, type TypeDefResult as $TypeDefResult } from "@zenstackhq/orm";
9+
import type { ModelResult as $ModelResult, TypeDefResult as $TypeDefResult } from "@zenstackhq/orm";
1010
/**
1111
* User model
1212
*/

tests/e2e/apps/rally/zenstack/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* eslint-disable */
77

88
import { schema as $schema, type SchemaType as $Schema } from "./schema";
9-
import { type ModelResult as $ModelResult } from "@zenstackhq/orm";
9+
import type { ModelResult as $ModelResult } from "@zenstackhq/orm";
1010
export type Account = $ModelResult<$Schema, "Account">;
1111
export type User = $ModelResult<$Schema, "User">;
1212
export type VerificationToken = $ModelResult<$Schema, "VerificationToken">;

tests/e2e/github-repos/cal.com/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* eslint-disable */
77

88
import { schema as $schema, type SchemaType as $Schema } from "./schema";
9-
import { type ModelResult as $ModelResult } from "@zenstackhq/orm";
9+
import type { ModelResult as $ModelResult } from "@zenstackhq/orm";
1010
export type Host = $ModelResult<$Schema, "Host">;
1111
export type CalVideoSettings = $ModelResult<$Schema, "CalVideoSettings">;
1212
export type EventType = $ModelResult<$Schema, "EventType">;

tests/e2e/github-repos/formbricks/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* eslint-disable */
77

88
import { schema as $schema, type SchemaType as $Schema } from "./schema";
9-
import { type ModelResult as $ModelResult } from "@zenstackhq/orm";
9+
import type { ModelResult as $ModelResult } from "@zenstackhq/orm";
1010
/**
1111
* Represents a webhook endpoint for receiving survey-related events.
1212
* Webhooks can be configured to receive notifications about response creation, updates, and completion.

tests/e2e/github-repos/trigger.dev/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* eslint-disable */
77

88
import { schema as $schema, type SchemaType as $Schema } from "./schema";
9-
import { type ModelResult as $ModelResult } from "@zenstackhq/orm";
9+
import type { ModelResult as $ModelResult } from "@zenstackhq/orm";
1010
export type User = $ModelResult<$Schema, "User">;
1111
export type InvitationCode = $ModelResult<$Schema, "InvitationCode">;
1212
/**

tests/e2e/orm/plugin-infra/ext-query-args/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
/* eslint-disable */
77

88
import { type SchemaType as $Schema } from "./schema";
9-
import { type ModelResult as $ModelResult } from "@zenstackhq/orm";
9+
import type { ModelResult as $ModelResult } from "@zenstackhq/orm";
1010
export type User = $ModelResult<$Schema, "User">;

tests/e2e/orm/schemas/auth-type/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* eslint-disable */
77

88
import { type SchemaType as $Schema } from "./schema";
9-
import { type ModelResult as $ModelResult, type TypeDefResult as $TypeDefResult } from "@zenstackhq/orm";
9+
import type { ModelResult as $ModelResult, TypeDefResult as $TypeDefResult } from "@zenstackhq/orm";
1010
export type Foo = $ModelResult<$Schema, "Foo">;
1111
export type Permission = $TypeDefResult<$Schema, "Permission">;
1212
export type Auth = $TypeDefResult<$Schema, "Auth">;

tests/e2e/orm/schemas/basic/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* eslint-disable */
77

88
import { schema as $schema, type SchemaType as $Schema } from "./schema";
9-
import { type ModelResult as $ModelResult, type TypeDefResult as $TypeDefResult } from "@zenstackhq/orm";
9+
import type { ModelResult as $ModelResult, TypeDefResult as $TypeDefResult } from "@zenstackhq/orm";
1010
export type User = $ModelResult<$Schema, "User">;
1111
export type Post = $ModelResult<$Schema, "Post">;
1212
export type Comment = $ModelResult<$Schema, "Comment">;

tests/e2e/orm/schemas/default-auth/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* eslint-disable */
77

88
import { type SchemaType as $Schema } from "./schema";
9-
import { type ModelResult as $ModelResult } from "@zenstackhq/orm";
9+
import type { ModelResult as $ModelResult } from "@zenstackhq/orm";
1010
export type User = $ModelResult<$Schema, "User">;
1111
export type Profile = $ModelResult<$Schema, "Profile">;
1212
export type Address = $ModelResult<$Schema, "Address">;

0 commit comments

Comments
 (0)