Skip to content

Commit

Permalink
Bump TypeScript min requirement to version 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti authored and tim-smart committed Apr 12, 2024
1 parent 038c344 commit 6f86463
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-pianos-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect": minor
---

Bump TypeScript min requirement to version 5.4
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Welcome to Effect, a powerful TypeScript framework that provides a fully-fledged

# Requirements

- TypeScript 5.0 or newer
- TypeScript 5.4 or newer
- The `strict` flag enabled in your `tsconfig.json` file

```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@edge-runtime/vm": "^3.2.0",
"@effect/build-utils": "^0.7.6",
"@effect/docgen": "^0.3.8",
"@effect/dtslint": "^0.0.5",
"@effect/dtslint": "^0.1.0",
"@effect/eslint-plugin": "^0.1.2",
"@effect/language-service": "^0.1.0",
"@types/node": "^20.11.30",
Expand Down
25 changes: 15 additions & 10 deletions packages/schema/dtslint/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1059,13 +1059,19 @@ S.asSchema(S.extend(S.struct({ a: S.string }), S.union(S.struct({ b: S.number })
// $ExpectType extend<struct<{ a: $string; }>, union<[struct<{ b: $number; }>, struct<{ c: $boolean; }>]>>
S.extend(S.struct({ a: S.string }), S.union(S.struct({ b: S.number }), S.struct({ c: S.boolean })))

// TODO: rises an error in TypeScript@5.0
// // $ExpectType Schema<{ readonly [x: string]: string; readonly a: string; readonly b: string; readonly c: string; }, { readonly [x: string]: string; readonly a: string; readonly b: string; readonly c: string; }, never>
// pipe(
// S.struct({ a: S.string, b: S.string }),
// S.extend(S.struct({ c: S.string })),
// S.extend(S.record(S.string, S.string))
// )
// $ExpectType Schema<{ readonly [x: string]: string; readonly a: string; readonly b: string; readonly c: string; }, { readonly [x: string]: string; readonly a: string; readonly b: string; readonly c: string; }, never>
S.asSchema(pipe(
S.struct({ a: S.string, b: S.string }),
S.extend(S.struct({ c: S.string })),
S.extend(S.record(S.string, S.string))
))

// $ExpectType extend<extend<struct<{ a: $string; b: $string; }>, struct<{ c: $string; }>>, record<$string, $string>>
pipe(
S.struct({ a: S.string, b: S.string }),
S.extend(S.struct({ c: S.string })),
S.extend(S.record(S.string, S.string))
)

// ---------------------------------------------
// suspend
Expand Down Expand Up @@ -1346,9 +1352,8 @@ S.asSchema(S.extend(S.mutable(S.struct({ a: S.string })), S.struct({ b: S.number
// $ExpectType Schema<{ [x: string]: string; a: string; }, { [x: string]: string; a: string; }, never>
S.asSchema(S.extend(S.mutable(S.struct({ a: S.string })), S.mutable(S.record(S.string, S.string))))

// TODO: rises an error in TypeScript@5.0
// // $ExpectType Schema<{ readonly [x: string]: string; a: string; }, { readonly [x: string]: string; a: string; }, never>
// S.asSchema(S.extend(S.mutable(S.struct({ a: S.string })), S.record(S.string, S.string)))
// $ExpectType Schema<{ readonly [x: string]: string; a: string; }, { readonly [x: string]: string; a: string; }, never>
S.asSchema(S.extend(S.mutable(S.struct({ a: S.string })), S.record(S.string, S.string)))

// ---------------------------------------------
// transform
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6f86463

Please sign in to comment.