Skip to content

Commit

Permalink
Update dependency typescript to ^4.3.2 (#5848)
Browse files Browse the repository at this point in the history
* Update dependency typescript to ^4.3.2

* Fix some things

* Fix things

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: mitchellhamilton <mitchell@hamil.town>
  • Loading branch information
3 people committed Jun 16, 2021
1 parent 200f7af commit 4e5634b
Show file tree
Hide file tree
Showing 24 changed files with 46 additions and 55 deletions.
7 changes: 7 additions & 0 deletions .changeset/ninety-gifts-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@keystone-ui/fields': patch
'@keystone-ui/options': patch
'@keystone-next/keystone': patch
---

Updated TypeScript to 4.3.2
15 changes: 4 additions & 11 deletions design-system/packages/fields/src/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
/** @jsx jsx */
import { jsx, useTheme } from '@keystone-ui/core';
import ReactSelect, { Props, OptionsType, mergeStyles } from 'react-select';
import ReactSelect, { OptionsType, mergeStyles, NamedProps } from 'react-select';
import { useInputTokens } from './hooks/inputs';
import { WidthType } from './types';

type KnownKeys<T> = {
[K in keyof T]: string extends K ? never : number extends K ? never : K;
} extends { [_ in keyof T]: infer U }
? U
: never;

type Option = { label: string; value: string; isDisabled?: boolean };

// this removes [key: string]: any from Props
type BaseSelectProps = Pick<
Props<Option, boolean>,
Exclude<KnownKeys<Props>, 'value' | 'onChange' | 'isMulti' | 'isOptionDisabled'>
type BaseSelectProps = Omit<
NamedProps<Option, boolean>,
'value' | 'onChange' | 'isMulti' | 'isOptionDisabled'
> & { width?: WidthType };

export { components as selectComponents } from 'react-select';
Expand Down
19 changes: 7 additions & 12 deletions design-system/packages/options/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import { jsx, useTheme } from '@keystone-ui/core';
import { useIndicatorTokens } from '@keystone-ui/fields';
import { CheckIcon } from '@keystone-ui/icons/icons/CheckIcon';
import { useMemo } from 'react';
import ReactSelect, { OptionProps, components as reactSelectComponents, Props } from 'react-select';
import ReactSelect, {
OptionProps,
components as reactSelectComponents,
Props,
NamedProps,
} from 'react-select';

export const CheckMark = ({
isDisabled,
Expand Down Expand Up @@ -143,17 +148,7 @@ const defaultComponents = {
IndicatorSeparator: null,
};

type KnownKeys<T> = {
[K in keyof T]: string extends K ? never : number extends K ? never : K;
} extends { [_ in keyof T]: infer U }
? U
: never;

// this removes [key: string]: any from Props
type OptionsProps = Pick<
Props<{ label: string; value: string; isDisabled?: boolean }, boolean>,
KnownKeys<Props>
>;
type OptionsProps = NamedProps<{ label: string; value: string; isDisabled?: boolean }, boolean>;

export const Options = ({ components: propComponents, ...props }: OptionsProps) => {
const components = useMemo(
Expand Down
2 changes: 1 addition & 1 deletion design-system/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"tinycolor2": "^1.4.2"
},
"devDependencies": {
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"devDependencies": {
"start-server-and-test": "^1.12.5",
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion examples-staging/assets-cloud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dotenv": "^10.0.0"
},
"devDependencies": {
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion examples-staging/assets-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@keystone-next/keystone": "^20.0.0"
},
"devDependencies": {
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion examples-staging/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"react-dom": "^17.0.2"
},
"devDependencies": {
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion examples-staging/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"react-dom": "^17.0.2"
},
"devDependencies": {
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion examples-staging/ecommerce/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"devDependencies": {
"@keystone-next/test-utils-legacy": "^21.0.0",
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion examples-staging/embedded-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"react-dom": "^17.0.2"
},
"devDependencies": {
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion examples-staging/roles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"react-dom": "^17.0.2"
},
"devDependencies": {
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@keystone-next/keystone": "^20.0.0"
},
"devDependencies": {
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion examples/default-values/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@keystone-next/keystone": "^20.0.0"
},
"devDependencies": {
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion examples/extend-graphql-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@keystone-next/keystone": "^20.0.0"
},
"devDependencies": {
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion examples/json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@keystone-next/keystone": "^20.0.0"
},
"devDependencies": {
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion examples/task-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@keystone-next/keystone": "^20.0.0"
},
"devDependencies": {
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion examples/virtual-field/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@keystone-next/types": "^20.0.0"
},
"devDependencies": {
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion examples/with-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@keystone-next/keystone": "^20.0.0"
},
"devDependencies": {
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"engines": {
"node": "^12.20 || >= 14.13"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"remark-toc": "^5.1.1",
"rimraf": "^3.0.2",
"terminal-link-cli": "^3.0.0",
"typescript": "^4.2.4"
"typescript": "^4.3.2"
},
"prettier": {
"proseWrap": "preserve",
Expand Down
2 changes: 1 addition & 1 deletion packages-next/keystone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"serialize-error": "^8.1.0",
"source-map-support": "^0.5.19",
"stack-utils": "^2.0.3",
"typescript": "^4.2.4",
"typescript": "^4.3.2",
"uid-safe": "^2.1.5",
"uuid": "^8.3.2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,15 @@ export function getAdminMetaSchema({
types: schemaConfig.types.filter(x => x.name !== 'Query'),
query: new GraphQLObjectType({
...queryTypeConfig,
fields: () => ({
...(typeof queryTypeConfig.fields === 'function'
? queryTypeConfig.fields()
: queryTypeConfig.fields),
fields: {
...queryTypeConfig.fields,
keystone: {
type: KeystoneMeta.graphQLType,
resolve() {
return {};
},
},
}),
},
}),
});
}
Expand Down
8 changes: 3 additions & 5 deletions packages-next/keystone/src/session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,13 @@ export function sessionSchema(graphQLSchema: GraphQLSchema) {
});
const mutationType = new GraphQLObjectType({
...mutationTypeConfig,
fields: () => ({
...(typeof mutationTypeConfig.fields === 'function'
? mutationTypeConfig.fields()
: mutationTypeConfig.fields),
fields: {
...mutationTypeConfig.fields,
endSession: {
...endSessionField,
type: endSessionField.type.graphQLType,
},
}),
},
});
return new GraphQLSchema({
...schemaConfig,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12853,10 +12853,10 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@^4.2.4:
version "4.2.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961"
integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==
typescript@^4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805"
integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==

uid-safe@^2.1.5:
version "2.1.5"
Expand Down

1 comment on commit 4e5634b

@vercel
Copy link

@vercel vercel bot commented on 4e5634b Jun 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.