Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Schema: refactor property signature APIs, closes #648 (#649)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti authored Dec 20, 2023
1 parent e9f8cb7 commit d80b933
Show file tree
Hide file tree
Showing 43 changed files with 1,142 additions and 593 deletions.
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

0 comments on commit d80b933

Please sign in to comment.