Skip to content

Commit b011267

Browse files
ymc9DoctorFTB
andauthored
fix: PR mege issues (#41)
* chore: remove unused spaces * chore(sdk): move libraries from v2 * chore: remove some libraries, use local-helpers from sdk * fix: PR merge issues * update * update * update * update --------- Co-authored-by: FTB_lag <[email protected]>
1 parent 7bb9639 commit b011267

File tree

12 files changed

+8
-1162
lines changed

12 files changed

+8
-1162
lines changed

packages/runtime/src/client/functions.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { invariant, capitalize, uncapitalize } from '@zenstackhq/common-helpers';
1+
import { invariant, lowerCaseFirst, upperCaseFirst } from '@zenstackhq/common-helpers';
22
import { sql, ValueNode, type Expression, type ExpressionBuilder } from 'kysely';
33
import { match } from 'ts-pattern';
44
import type { ZModelFunction, ZModelFunctionContext } from './options';
@@ -132,10 +132,8 @@ function processCasing(casing: Expression<any>, result: string, model: string) {
132132
.with('original', () => model)
133133
.with('upper', () => result.toUpperCase())
134134
.with('lower', () => result.toLowerCase())
135-
.with('
136-
137-
', () => capitalize(result))
138-
.with('uncapitalize', () => uncapitalize(result))
135+
.with('capitalize', () => upperCaseFirst(result))
136+
.with('uncapitalize', () => lowerCaseFirst(result))
139137
.otherwise(() => {
140138
throw new Error(
141139
`Invalid casing value: ${opNode.value}. Must be "original", "upper", "lower", "capitalize", or "uncapitalize".`,

packages/runtime/src/plugins/policy/expression-transformer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { invariant } from '@zenstackhq/common-helpers';
2-
import type { OperandExpression } from 'kysely';
32
import {
43
AliasNode,
54
BinaryOperationNode,

packages/runtime/test/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { invariant } from '@zenstackhq/common-helpers';
22
import { loadDocument } from '@zenstackhq/language';
33
import { PrismaSchemaGenerator } from '@zenstackhq/sdk';
4-
import { invariant } from '@zenstackhq/sdk/local-helpers';
54
import { generateTsSchema } from '@zenstackhq/testtools';
65
import SQLite from 'better-sqlite3';
76
import { execSync } from 'node:child_process';

packages/sdk/package.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@
3535
"types": "./dist/schema.d.cts",
3636
"default": "./dist/schema.cjs"
3737
}
38-
},
39-
"./local-helpers": {
40-
"import": {
41-
"types": "./dist/local-helpers.d.ts",
42-
"default": "./dist/local-helpers.js"
43-
},
44-
"require": {
45-
"types": "./dist/local-helpers.d.cts",
46-
"default": "./dist/local-helpers.cjs"
47-
}
4838
}
4939
},
5040
"dependencies": {

packages/sdk/src/local-helpers/index.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/sdk/src/local-helpers/is-plain-object.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

packages/sdk/src/local-helpers/lower-case-first.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/sdk/src/local-helpers/tiny-invariant.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/sdk/src/local-helpers/upper-case-first.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import path from 'node:path';
3939
import { match } from 'ts-pattern';
4040
import * as ts from 'typescript';
4141
import { ModelUtils } from '.';
42-
import { invariant } from './local-helpers';
4342
import { getAttribute, getAuthDecl, hasAttribute, isIdField, isUniqueField } from './model-utils';
4443

4544
export class TsSchemaGenerator {

0 commit comments

Comments
 (0)