Skip to content

Commit

Permalink
Downgrade es target to 2021
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalLytek committed Feb 7, 2024
1 parent 89a2ad2 commit 4c053cc
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 208 deletions.
6 changes: 3 additions & 3 deletions docs/basics/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 1
---

:::info
Be aware that due to usage of some ES2022 and newer Node.js features, you also have to use **Node.js v16.13.0 or newer**.
Be aware that due to usage of some ES2021 and newer Node.js features, you also have to use **Node.js v16.13.0 or newer**.
:::

### TypeGraphQL
Expand Down Expand Up @@ -66,9 +66,9 @@ As prisma emits multiple files, make sure you have your tsconfig set properly to
```json {4}
{
"compilerOptions": {
"target": "es2022",
"target": "es2021",
"module": "commonjs",
"lib": ["es2022"],
"lib": ["es2021"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
Expand Down
4 changes: 2 additions & 2 deletions examples/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "es2022",
"target": "es2021",
"module": "commonjs",
"lib": ["es2022"],
"lib": ["es2021"],
"strict": true,
"esModuleInterop": true,
"experimentalDecorators": true,
Expand Down
4 changes: 2 additions & 2 deletions experiments/mongodb/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"compilerOptions": {
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "ES2022", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"target": "ES2021", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"lib": ["ES2022"], /* Specify library files to be included in the compilation. */
"lib": ["ES2021"], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
Expand Down
4 changes: 2 additions & 2 deletions experiments/postgres/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"compilerOptions": {
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "ES2022", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"target": "ES2021", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"lib": ["ES2022"], /* Specify library files to be included in the compilation. */
"lib": ["ES2021"], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
Expand Down
2 changes: 1 addition & 1 deletion src/generator/generate-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import { DMMF } from "./dmmf/types";
import { getBlocksToEmit } from "./emit-block";

const baseCompilerOptions: CompilerOptions = {
target: ScriptTarget.ES2022,
target: ScriptTarget.ES2021,
module: ModuleKind.CommonJS,
emitDecoratorMetadata: true,
experimentalDecorators: true,
Expand Down
126 changes: 0 additions & 126 deletions tests/functional/__snapshots__/crud.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -56,32 +56,17 @@ Array [
"floatField": true,
"intField": true,
},
"cursor": undefined,
"orderBy": Array [
UserOrderByWithRelationInput {
"floatField": undefined,
"idField": undefined,
"intField": "desc",
},
],
"skip": 1,
"take": 1,
"where": UserWhereInput {
"AND": undefined,
"NOT": undefined,
"OR": undefined,
"floatField": IntFilter {
"equals": undefined,
"gt": undefined,
"gte": undefined,
"in": undefined,
"lt": undefined,
"lte": 50,
"not": undefined,
"notIn": undefined,
},
"idField": undefined,
"intField": undefined,
},
},
],
Expand All @@ -105,32 +90,17 @@ Array [
"_count": Object {
"_all": true,
},
"cursor": undefined,
"orderBy": Array [
UserOrderByWithRelationInput {
"floatField": undefined,
"idField": undefined,
"intField": "desc",
},
],
"skip": 1,
"take": 1,
"where": UserWhereInput {
"AND": undefined,
"NOT": undefined,
"OR": undefined,
"floatField": IntFilter {
"equals": undefined,
"gt": undefined,
"gte": undefined,
"in": undefined,
"lt": undefined,
"lte": 50,
"not": undefined,
"notIn": undefined,
},
"idField": undefined,
"intField": undefined,
},
},
],
Expand Down Expand Up @@ -171,26 +141,10 @@ Array [
"by": Array [
"intField",
],
"having": undefined,
"orderBy": undefined,
"skip": undefined,
"take": undefined,
"where": UserWhereInput {
"AND": undefined,
"NOT": undefined,
"OR": undefined,
"floatField": IntFilter {
"equals": undefined,
"gt": undefined,
"gte": 0,
"in": undefined,
"lt": undefined,
"lte": undefined,
"not": undefined,
"notIn": undefined,
},
"idField": undefined,
"intField": undefined,
},
},
],
Expand All @@ -201,19 +155,13 @@ exports[`crud resolvers execution basic operations _count for relations should p
Array [
Array [
Object {
"cursor": undefined,
"distinct": undefined,
"include": Object {
"_count": Object {
"select": Object {
"secondModelsField": true,
},
},
},
"orderBy": undefined,
"skip": undefined,
"take": undefined,
"where": undefined,
},
],
]
Expand Down Expand Up @@ -258,12 +206,6 @@ Array [
Array [
Object {
"where": UserWhereUniqueInput {
"AND": undefined,
"NOT": undefined,
"OR": undefined,
"dateField": undefined,
"intIdField": undefined,
"optionalStringField": undefined,
"uniqueStringField": "unique",
},
},
Expand All @@ -285,22 +227,9 @@ Array [
Array [
Object {
"where": UserWhereInput {
"AND": undefined,
"NOT": undefined,
"OR": undefined,
"dateField": DateTimeFilter {
"equals": undefined,
"gt": undefined,
"gte": undefined,
"in": undefined,
"lt": undefined,
"lte": 2019-12-31T19:16:02.572Z,
"not": undefined,
"notIn": undefined,
},
"intIdField": undefined,
"optionalStringField": undefined,
"uniqueStringField": undefined,
},
},
],
Expand All @@ -319,35 +248,17 @@ exports[`crud resolvers execution basic operations should properly call PrismaCl
Array [
Array [
Object {
"cursor": undefined,
"distinct": undefined,
"orderBy": Array [
UserOrderByWithRelationInput {
"dateField": undefined,
"intIdField": "desc",
"optionalStringField": undefined,
"uniqueStringField": undefined,
},
],
"skip": 1,
"take": 1,
"where": UserWhereInput {
"AND": undefined,
"NOT": undefined,
"OR": undefined,
"dateField": DateTimeFilter {
"equals": undefined,
"gt": undefined,
"gte": undefined,
"in": undefined,
"lt": undefined,
"lte": 2019-12-31T19:16:02.572Z,
"not": undefined,
"notIn": undefined,
},
"intIdField": undefined,
"optionalStringField": undefined,
"uniqueStringField": undefined,
},
},
],
Expand All @@ -370,12 +281,6 @@ Array [
Array [
Object {
"where": UserWhereUniqueInput {
"AND": undefined,
"NOT": undefined,
"OR": undefined,
"dateField": undefined,
"intIdField": undefined,
"optionalStringField": undefined,
"uniqueStringField": "uniqueValue",
},
},
Expand All @@ -400,16 +305,8 @@ Array [
"dateField": DateTimeFieldUpdateOperationsInput {
"set": 2019-12-31T14:16:02.572Z,
},
"optionalStringField": undefined,
"uniqueStringField": undefined,
},
"where": UserWhereUniqueInput {
"AND": undefined,
"NOT": undefined,
"OR": undefined,
"dateField": undefined,
"intIdField": undefined,
"optionalStringField": undefined,
"uniqueStringField": "unique",
},
},
Expand All @@ -431,27 +328,12 @@ Array [
Array [
Object {
"data": UserUpdateManyMutationInput {
"dateField": undefined,
"optionalStringField": null,
"uniqueStringField": undefined,
},
"where": UserWhereInput {
"AND": undefined,
"NOT": undefined,
"OR": undefined,
"dateField": DateTimeFilter {
"equals": undefined,
"gt": undefined,
"gte": undefined,
"in": undefined,
"lt": undefined,
"lte": 2019-12-31T19:16:02.572Z,
"not": undefined,
"notIn": undefined,
},
"intIdField": undefined,
"optionalStringField": undefined,
"uniqueStringField": undefined,
},
},
],
Expand All @@ -476,17 +358,9 @@ Array [
"uniqueStringField": "unique",
},
"update": UserUpdateInput {
"dateField": undefined,
"optionalStringField": null,
"uniqueStringField": undefined,
},
"where": UserWhereUniqueInput {
"AND": undefined,
"NOT": undefined,
"OR": undefined,
"dateField": undefined,
"intIdField": undefined,
"optionalStringField": undefined,
"uniqueStringField": "unique",
},
},
Expand Down
20 changes: 0 additions & 20 deletions tests/functional/__snapshots__/custom-resolvers.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,17 @@ exports[`custom resolvers execution should be possible to use generated inputs,
Array [
Array [
FindManyPostArgs {
"cursor": undefined,
"distinct": undefined,
"orderBy": Array [
PostOrderByWithRelationInput {
"color": "desc",
"content": undefined,
"uuid": undefined,
},
],
"skip": 1,
"take": 1,
"where": PostWhereInput {
"AND": undefined,
"NOT": undefined,
"OR": undefined,
"color": undefined,
"content": StringFilter {
"contains": undefined,
"endsWith": undefined,
"equals": undefined,
"gt": undefined,
"gte": undefined,
"in": undefined,
"lt": undefined,
"lte": undefined,
"mode": undefined,
"not": undefined,
"notIn": undefined,
"startsWith": "Test",
},
"uuid": undefined,
},
},
],
Expand Down
6 changes: 0 additions & 6 deletions tests/functional/__snapshots__/reference-count.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ exports[`relation counts querying should properly call PrismaClient on getting r
Array [
Array [
Object {
"cursor": undefined,
"distinct": undefined,
"include": Object {
"_count": Object {
"select": Object {
Expand All @@ -19,10 +17,6 @@ Array [
},
},
},
"orderBy": undefined,
"skip": undefined,
"take": undefined,
"where": undefined,
},
],
]
Expand Down
Loading

0 comments on commit 4c053cc

Please sign in to comment.