Skip to content

Commit 8b4d280

Browse files
ymc9claude
andauthored
chore: exclude ZenStack-generated files from prettier formatting (#2786)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent ca71e07 commit 8b4d280

19 files changed

Lines changed: 645 additions & 908 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ If applicable, add screenshots to help explain your problem.
1414

1515
**Environment (please complete the following information):**
1616

17-
- ZenStack version: [e.g., 3.1.0]
18-
- Database type: [e.g. Postgresql]
19-
- Node.js/Bun version: [e.g., 20.0.0]
20-
- Package manager: [e.g., npm, yarn, pnpm]
17+
- ZenStack version: [e.g., 3.1.0]
18+
- Database type: [e.g. Postgresql]
19+
- Node.js/Bun version: [e.g., 20.0.0]
20+
- Package manager: [e.g., npm, yarn, pnpm]
2121

2222
**Additional context**
2323
Add any other context about the problem here.

.prettierignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
packages/language/src/generated/**
2+
3+
# ZenStack CLI generated files (schema.ts, schema-lite.ts, models.ts, input.ts)
24
**/test/**/schema.ts
5+
**/test/**/schema-lite.ts
36
**/test/**/models.ts
47
**/test/**/input.ts
58
samples/**/schema.ts
9+
samples/**/schema-lite.ts
610
samples/**/models.ts
711
samples/**/input.ts
8-
tests/e2e/**/schema.ts
9-
tests/e2e/**/models.ts
10-
tests/e2e/**/input.ts
12+
tests/**/schema.ts
13+
tests/**/schema-lite.ts
14+
tests/**/models.ts
15+
tests/**/input.ts

CODE_OF_CONDUCT.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
- Demonstrating empathy and kindness toward other people
21-
- Being respectful of differing opinions, viewpoints, and experiences
22-
- Giving and gracefully accepting constructive feedback
23-
- Accepting responsibility and apologizing to those affected by our mistakes,
24-
and learning from the experience
25-
- Focusing on what is best not just for us as individuals, but for the
26-
overall community
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
- Focusing on what is best not just for us as individuals, but for the
26+
overall community
2727

2828
Examples of unacceptable behavior include:
2929

30-
- The use of sexualized language or imagery, and sexual attention or
31-
advances of any kind
32-
- Trolling, insulting or derogatory comments, and personal or political attacks
33-
- Public or private harassment
34-
- Publishing others' private information, such as a physical or email
35-
address, without their explicit permission
36-
- Other conduct which could reasonably be considered inappropriate in a
37-
professional setting
30+
- The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
3838

3939
## Enforcement Responsibilities
4040

packages/cli/src/actions/pull/provider/postgresql.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ export const postgresql: IntrospectionProvider = {
184184
const pg = await loadPackage('pg');
185185
const ClientClass: typeof PgClient = pg?.Client || pg?.default?.Client;
186186
if (!ClientClass) {
187-
throw new CliError('Package "pg" is required for PostgreSQL support. Please install it with: npm install pg');
187+
throw new CliError(
188+
'Package "pg" is required for PostgreSQL support. Please install it with: npm install pg',
189+
);
188190
}
189191
const client = new ClientClass({ connectionString });
190192
await client.connect();

packages/cli/src/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,7 @@ Arguments following -- are passed to the seed script. E.g.: "zen db seed -- --us
284284
}),
285285
)
286286
.addOption(
287-
new Option(
288-
'--introspect',
289-
'Introspect the database to generate a schema when no schema file is found',
290-
),
287+
new Option('--introspect', 'Introspect the database to generate a schema when no schema file is found'),
291288
)
292289
.addOption(noVersionCheckOption)
293290
.action(proxyAction);

packages/clients/fetch-client/test/schemas/basic/schema-lite.ts

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,89 +5,91 @@
55

66
/* eslint-disable */
77

8-
import { type SchemaDef, type FieldDefault, ExpressionUtils } from '@zenstackhq/schema';
8+
import { type SchemaDef, type FieldDefault, ExpressionUtils } from "@zenstackhq/schema";
99
export class SchemaType implements SchemaDef {
1010
provider = {
11-
type: 'sqlite',
11+
type: "sqlite"
1212
} as const;
1313
models = {
1414
User: {
15-
name: 'User',
15+
name: "User",
1616
fields: {
1717
id: {
18-
name: 'id',
19-
type: 'String',
18+
name: "id",
19+
type: "String",
2020
id: true,
21-
default: ExpressionUtils.call('cuid') as FieldDefault,
21+
default: ExpressionUtils.call("cuid") as FieldDefault
2222
},
2323
email: {
24-
name: 'email',
25-
type: 'String',
26-
unique: true,
24+
name: "email",
25+
type: "String",
26+
unique: true
2727
},
2828
name: {
29-
name: 'name',
30-
type: 'String',
31-
optional: true,
29+
name: "name",
30+
type: "String",
31+
optional: true
3232
},
3333
posts: {
34-
name: 'posts',
35-
type: 'Post',
34+
name: "posts",
35+
type: "Post",
3636
array: true,
37-
relation: { opposite: 'author' },
38-
},
37+
relation: { opposite: "author" }
38+
}
3939
},
40-
idFields: ['id'],
40+
idFields: ["id"],
4141
uniqueFields: {
42-
id: { type: 'String' },
43-
email: { type: 'String' },
44-
},
42+
id: { type: "String" },
43+
email: { type: "String" }
44+
}
4545
},
4646
Post: {
47-
name: 'Post',
47+
name: "Post",
4848
fields: {
4949
id: {
50-
name: 'id',
51-
type: 'String',
50+
name: "id",
51+
type: "String",
5252
id: true,
53-
default: ExpressionUtils.call('cuid') as FieldDefault,
53+
default: ExpressionUtils.call("cuid") as FieldDefault
5454
},
5555
title: {
56-
name: 'title',
57-
type: 'String',
56+
name: "title",
57+
type: "String"
5858
},
5959
author: {
60-
name: 'author',
61-
type: 'User',
60+
name: "author",
61+
type: "User",
6262
optional: true,
63-
relation: { opposite: 'posts', fields: ['authorId'], references: ['id'] },
63+
relation: { opposite: "posts", fields: ["authorId"], references: ["id"] }
6464
},
6565
authorId: {
66-
name: 'authorId',
67-
type: 'String',
66+
name: "authorId",
67+
type: "String",
6868
optional: true,
69-
foreignKeyFor: ['author'] as readonly string[],
70-
},
69+
foreignKeyFor: [
70+
"author"
71+
] as readonly string[]
72+
}
7173
},
72-
idFields: ['id'],
74+
idFields: ["id"],
7375
uniqueFields: {
74-
id: { type: 'String' },
75-
},
76-
},
76+
id: { type: "String" }
77+
}
78+
}
7779
} as const;
78-
authType = 'User' as const;
80+
authType = "User" as const;
7981
procedures = {
8082
getStats: {
8183
params: {},
82-
returnType: 'Int',
84+
returnType: "Int"
8385
},
8486
sendNotification: {
8587
params: {
86-
message: { name: 'message', type: 'String' },
88+
message: { name: "message", type: "String" }
8789
},
88-
returnType: 'Boolean',
89-
mutation: true,
90-
},
90+
returnType: "Boolean",
91+
mutation: true
92+
}
9193
} as const;
9294
plugins = {};
9395
}

packages/clients/fetch-client/test/schemas/no-procs/schema-lite.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@
55

66
/* eslint-disable */
77

8-
import { type SchemaDef, type FieldDefault, ExpressionUtils } from '@zenstackhq/schema';
8+
import { type SchemaDef, type FieldDefault, ExpressionUtils } from "@zenstackhq/schema";
99
export class SchemaType implements SchemaDef {
1010
provider = {
11-
type: 'sqlite',
11+
type: "sqlite"
1212
} as const;
1313
models = {
1414
Item: {
15-
name: 'Item',
15+
name: "Item",
1616
fields: {
1717
id: {
18-
name: 'id',
19-
type: 'String',
18+
name: "id",
19+
type: "String",
2020
id: true,
21-
default: ExpressionUtils.call('cuid') as FieldDefault,
22-
},
21+
default: ExpressionUtils.call("cuid") as FieldDefault
22+
}
2323
},
24-
idFields: ['id'],
24+
idFields: ["id"],
2525
uniqueFields: {
26-
id: { type: 'String' },
27-
},
28-
},
26+
id: { type: "String" }
27+
}
28+
}
2929
} as const;
3030
plugins = {};
3131
}

0 commit comments

Comments
 (0)