Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Schema: refactor property signature APIs, closes #648 #649

Merged
merged 31 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0523dde
Schema: refactor property signature APIs, closes #648
gcanti Dec 10, 2023
1aacaaa
fix dtslint
gcanti Dec 10, 2023
ee6211e
chore
gcanti Dec 11, 2023
3d88d7f
Schema: add `nullish` / `optionFromNullish`
gcanti Dec 13, 2023
6a274c4
Schema: add `optionalNullableToOption`
gcanti Dec 13, 2023
b2d347d
Schema: add `optionalExactNullableToOption`
gcanti Dec 13, 2023
5a75687
Schema: add `optionalNullableWithDefault`
gcanti Dec 13, 2023
dd9d9d3
Schema: add `optionalExactNullableWithDefault`
gcanti Dec 13, 2023
b3c9df7
chore
gcanti Dec 13, 2023
9fa112d
Merge branch 'main' into 648-tmp
gcanti Dec 13, 2023
5537da1
merge optional and optionalExact
gcanti Dec 13, 2023
4362bd8
merge optionalExactToOption and optionalToOption
gcanti Dec 13, 2023
93fc592
merge optionalExactNullableToOption and optionalNullableToOption
gcanti Dec 13, 2023
5b7bafc
merge optionalExactWithDefault and optionalWithDefault and merge opti…
gcanti Dec 13, 2023
d6e842e
update docs
gcanti Dec 13, 2023
77e2358
add orUndefined
gcanti Dec 14, 2023
b9ac7d6
Merge branch 'main' into 648
gcanti Dec 14, 2023
cb0036e
dtslint: more tests
gcanti Dec 14, 2023
5b3acb9
merge optionalNullableWithDefault with optionalWithDefault
gcanti Dec 14, 2023
6390c63
merge optionalNullableToOption with optionalToOption
gcanti Dec 14, 2023
eb2297a
Schema: replace `propertySignature` constructor with `propertySignatu…
gcanti Dec 14, 2023
5889010
Merge branch 'main' into 648
gcanti Dec 14, 2023
5cbf29e
fox dtslint
gcanti Dec 14, 2023
ac0375b
merge optionalWithDefault with optional
gcanti Dec 14, 2023
a728746
format dtslint file
gcanti Dec 14, 2023
4d8fd30
merge optionalToOption into optional
gcanti Dec 14, 2023
0224efc
Arbitrary: should throw on declarations without annotations
gcanti Dec 15, 2023
af2ce9f
Schema: fix declarations (`type` field)
gcanti Dec 15, 2023
0da600c
add Upgrade Guide
gcanti Dec 15, 2023
12041b4
replace `toOption: true` with `as: "Option"`
gcanti Dec 15, 2023
3ea61c3
Merge branch 'main' into 648
gcanti Dec 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chilled-jars-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/schema": minor
---

Arbitrary: should throw on declarations without annotations
5 changes: 5 additions & 0 deletions .changeset/dirty-taxis-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/schema": patch
---

Schema: fix declarations (`type` field)
11 changes: 11 additions & 0 deletions .changeset/four-suits-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@effect/schema": minor
---

Schema: refactor `S.optional` API.

Upgrade Guide:

- `S.optional(schema, { exact: true })` replaces the old `S.optional(schema)`
- `S.optional(schema, { exact: true, default: () => A })` replaces the old `S.optional(schema).withDefault(() => A)`
- `S.optional(schema, { exact: true, as: "Option" })` replaces the old `S.optional(schema).toOption()`
5 changes: 5 additions & 0 deletions .changeset/fuzzy-waves-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/schema": patch
---

Schema: add `nullish`
5 changes: 5 additions & 0 deletions .changeset/silent-paws-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/schema": patch
---

Schema: add `orUndefined`
5 changes: 5 additions & 0 deletions .changeset/six-maps-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/schema": minor
---

Schema: replace `propertySignature` constructor with `propertySignatureAnnotations` combinator
34 changes: 17 additions & 17 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
/* eslint-disable no-undef */
module.exports = {
ignorePatterns: ["dist", "build", "dtslint", "*.mjs", "docs", "*.md"],
ignorePatterns: ["dist", "build", "*.mjs", "*.cjs", "docs", "*.md"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2018,
sourceType: "module"
sourceType: "module",
},
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
"@typescript-eslint/parser": [".ts", ".tsx"],
},
"import/resolver": {
typescript: {
alwaysTryTypes: true
}
}
alwaysTryTypes: true,
},
},
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@effect/recommended"
"plugin:@effect/recommended",
],
plugins: [
"deprecation",
"import",
"sort-destructure-keys",
"simple-import-sort",
"codegen"
"codegen",
],
rules: {
"codegen/codegen": "error",
Expand All @@ -50,7 +50,7 @@ module.exports = {
"deprecation/deprecation": "off",
"@typescript-eslint/array-type": [
"warn",
{ default: "generic", readonly: "generic" }
{ default: "generic", readonly: "generic" },
],
"@typescript-eslint/member-delimiter-style": 0,
"@typescript-eslint/no-non-null-assertion": "off",
Expand All @@ -62,8 +62,8 @@ module.exports = {
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_"
}
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/camelcase": "off",
Expand All @@ -83,9 +83,9 @@ module.exports = {
quoteStyle: "alwaysDouble",
trailingCommas: "never",
operatorPosition: "maintain",
"arrowFunction.useParentheses": "force"
}
}
]
}
}
"arrowFunction.useParentheses": "force",
},
},
],
},
};
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.importModuleSpecifier": "project-relative",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.enablePromptUseWorkspaceTsdk": true,
"editor.formatOnSave": true,
"eslint.format.enable": true,
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "vscode.json-language-features"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
Expand Down
Loading
Loading