diff --git a/.changeset/cyan-pianos-sin.md b/.changeset/cyan-pianos-sin.md new file mode 100644 index 0000000000..2bff7e7bfd --- /dev/null +++ b/.changeset/cyan-pianos-sin.md @@ -0,0 +1,5 @@ +--- +"effect": minor +--- + +Bump TypeScript min requirement to version 5.4 diff --git a/README.md b/README.md index a619e65fde..c1cffff65f 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/package.json b/package.json index 3e6e1bff3c..4513cce4d3 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/schema/dtslint/Schema.ts b/packages/schema/dtslint/Schema.ts index face5e9186..995296256a 100644 --- a/packages/schema/dtslint/Schema.ts +++ b/packages/schema/dtslint/Schema.ts @@ -1059,13 +1059,19 @@ S.asSchema(S.extend(S.struct({ a: S.string }), S.union(S.struct({ b: S.number }) // $ExpectType extend, 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, 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 @@ -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 diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0cac2c07b7..1716a57808 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,8 +53,8 @@ importers: specifier: ^0.3.8 version: 0.3.8(tsx@4.7.1)(typescript@5.4.3) '@effect/dtslint': - specifier: ^0.0.5 - version: 0.0.5(typescript@5.4.3) + specifier: ^0.1.0 + version: 0.1.0(typescript@5.4.3) '@effect/eslint-plugin': specifier: ^0.1.2 version: 0.1.2 @@ -1283,8 +1283,8 @@ packages: typescript: 5.4.3 dev: true - /@effect/dtslint@0.0.5(typescript@5.4.3): - resolution: {integrity: sha512-LdVs+At5SBnWBIHeeeQozIfyx5/5Iv82wwtp63R/Lxq3X48yB7suug47x0nDSjJ/Xb82Lyihb2WJGzk5E1OgIw==} + /@effect/dtslint@0.1.0(typescript@5.4.3): + resolution: {integrity: sha512-PNdoBeyA7v+LRhri+3GF0bXzya4v+skh8euiYKLLxDxJ/ymryn9y1XBJBdPYzvYFmatELNWCBlas/ZZ7AbCQVg==} hasBin: true peerDependencies: typescript: ^5.x @@ -7349,7 +7349,7 @@ packages: peerDependencies: typescript: '>=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 4.0.0-dev' dependencies: - '@babel/code-frame': 7.23.5 + '@babel/code-frame': 7.24.2 builtin-modules: 1.1.1 chalk: 2.4.2 commander: 2.20.3