From 296d7ba1f058f5535c073f55c9fb244eaf52410f Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Fri, 5 May 2023 07:40:45 +0100 Subject: [PATCH 001/186] Added missing stackblitz scripts --- package.json | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e867c1e..f5d41c8 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,21 @@ "e-26": "npm run exercise -- 26", "s-26": "npm run solution -- 26", "e-28": "npm run exercise -- 28", - "s-28": "npm run solution -- 28" + "s-28": "npm run solution -- 28", + "e-12": "npm run exercise -- 12", + "s-12": "npm run solution -- 12", + "e-14": "npm run exercise -- 14", + "s-14": "npm run solution -- 14", + "e-32": "npm run exercise -- 32", + "s-32": "npm run solution -- 32", + "e-33": "npm run exercise -- 33", + "s-33": "npm run solution -- 33", + "e-34": "npm run exercise -- 34", + "s-34": "npm run solution -- 34", + "e-35": "npm run exercise -- 35", + "s-35": "npm run solution -- 35", + "e-39": "npm run exercise -- 39", + "s-39": "npm run solution -- 39" }, "dependencies": { "@types/express": "^4.17.13", @@ -50,4 +64,4 @@ "react-dom": "^18.2.0", "zod": "^3.17.10" } -} +} \ No newline at end of file From bd5987dbc2fe5de24af05c2a2f27542265bec208 Mon Sep 17 00:00:00 2001 From: apo1798 Date: Fri, 5 May 2023 23:30:20 +0800 Subject: [PATCH 002/186] change into onClick prop name in exercise 07 --- src/02-components/07-typing-onclick-handlers.problem.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/02-components/07-typing-onclick-handlers.problem.tsx b/src/02-components/07-typing-onclick-handlers.problem.tsx index 7c758ab..cf81da5 100644 --- a/src/02-components/07-typing-onclick-handlers.problem.tsx +++ b/src/02-components/07-typing-onclick-handlers.problem.tsx @@ -1,13 +1,13 @@ -import React from "react"; +import React from 'react'; interface ButtonProps { className: string; children: React.ReactNode; } -export const Button = ({ children, className, onChange }: ButtonProps) => { +export const Button = ({ children, className, onClick }: ButtonProps) => { return ( - ); From 2dd29c03bc73b6fb979f32cdda4170df7e41565d Mon Sep 17 00:00:00 2001 From: qq <79323963+rainyEra@users.noreply.github.com> Date: Sat, 6 May 2023 09:03:35 +0300 Subject: [PATCH 003/186] Update 07-typing-onclick-handlers.problem.tsx onChange to OnClick Button element --- src/02-components/07-typing-onclick-handlers.problem.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/02-components/07-typing-onclick-handlers.problem.tsx b/src/02-components/07-typing-onclick-handlers.problem.tsx index 7c758ab..a60e25d 100644 --- a/src/02-components/07-typing-onclick-handlers.problem.tsx +++ b/src/02-components/07-typing-onclick-handlers.problem.tsx @@ -5,9 +5,9 @@ interface ButtonProps { children: React.ReactNode; } -export const Button = ({ children, className, onChange }: ButtonProps) => { +export const Button = ({ children, className, onClick }: ButtonProps) => { return ( - ); From b289651a57a92de064262e59733d92f4cec6702f Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Tue, 9 May 2023 14:14:12 +0100 Subject: [PATCH 004/186] Fixed 31 --- ...ponents-vs-passing-react-nodes.problem.tsx | 36 +++++++++++++++++++ ...ents-vs-passing-react-nodes.solution.1.tsx | 36 +++++++++++++++++++ ...ents-vs-passing-react-nodes.solution.2.tsx | 36 +++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.solution.1.tsx create mode 100644 src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.solution.2.tsx diff --git a/src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.problem.tsx b/src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.problem.tsx index e69de29..e88422a 100644 --- a/src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.problem.tsx +++ b/src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.problem.tsx @@ -0,0 +1,36 @@ +import { Equal, Expect } from "../helpers/type-utils"; + +interface TableProps { + renderRow: React.ReactNode; +} + +const Table = (props: TableProps) => { + return
{[0, 1, 3].map(props.renderRow)}
; +}; + +export const Parent = () => { + return ( + <> + { + type test = Expect>; + return
{index}
; + }} + /> +
{ + return null; + }} + /> +
} + /> +
{ + return index; + }} + /> + + ); +}; diff --git a/src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.solution.1.tsx b/src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.solution.1.tsx new file mode 100644 index 0000000..bc04410 --- /dev/null +++ b/src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.solution.1.tsx @@ -0,0 +1,36 @@ +import { Equal, Expect } from "../helpers/type-utils"; + +interface TableProps { + renderRow: React.FC; +} + +const Table = (props: TableProps) => { + return
{[0, 1, 3].map(props.renderRow)}
; +}; + +export const Parent = () => { + return ( + <> +
{ + type test = Expect>; + return
{index}
; + }} + /> +
{ + return null; + }} + /> +
} + /> +
{ + return index; + }} + /> + + ); +}; diff --git a/src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.solution.2.tsx b/src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.solution.2.tsx new file mode 100644 index 0000000..d83fb6e --- /dev/null +++ b/src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.solution.2.tsx @@ -0,0 +1,36 @@ +import { Equal, Expect } from "../helpers/type-utils"; + +interface TableProps { + renderRow: (rowIndex: number) => React.ReactNode; +} + +const Table = (props: TableProps) => { + return
{[0, 1, 3].map(props.renderRow)}
; +}; + +export const Parent = () => { + return ( + <> +
{ + type test = Expect>; + return
{index}
; + }} + /> +
{ + return null; + }} + /> +
} + /> +
{ + return index; + }} + /> + + ); +}; From 125d4086ae7ae0ae14507f601141c26e9dd84198 Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Tue, 9 May 2023 14:15:50 +0100 Subject: [PATCH 005/186] Reordering --- ...rops.problem.tsx => 22-discriminated-union-props.problem.tsx} | 0 ...ps.solution.tsx => 22-discriminated-union-props.solution.tsx} | 0 .../22-understanding-react-type-helpers.explainer.ts | 1 - ...lem.tsx => 23-destructuring-discriminated-unions.problem.tsx} | 0 ....tsx => 23-destructuring-discriminated-unions.solution.1.tsx} | 0 ....tsx => 23-destructuring-discriminated-unions.solution.2.tsx} | 0 ...sx => 24-discriminated-union-props-with-booleans.problem.tsx} | 0 ...m.tsx => 25-discriminated-union-with-other-props.problem.tsx} | 0 ....tsx => 25-discriminated-union-with-other-props.solution.tsx} | 0 ...problem.tsx => 26-either-all-these-props-or-none.problem.tsx} | 0 ...on.1.tsx => 26-either-all-these-props-or-none.solution.1.tsx} | 0 ...on.2.tsx => 26-either-all-these-props-or-none.solution.2.tsx} | 0 ...on.3.tsx => 26-either-all-these-props-or-none.solution.3.tsx} | 0 ...-passing-react-components-vs-passing-react-nodes.problem.tsx} | 0 ...ssing-react-components-vs-passing-react-nodes.solution.1.tsx} | 0 ...ssing-react-components-vs-passing-react-nodes.solution.2.tsx} | 0 ...custom-hooks.problem.ts => 31-typing-custom-hooks.problem.ts} | 0 ...-hooks.solution.1.ts => 31-typing-custom-hooks.solution.1.ts} | 0 ...-hooks.solution.2.ts => 31-typing-custom-hooks.solution.2.ts} | 0 ...-hooks.solution.3.ts => 31-typing-custom-hooks.solution.3.ts} | 0 ...le-return-type.problem.ts => 32-tuple-return-type.problem.ts} | 0 ...urn-type.solution.1.ts => 32-tuple-return-type.solution.1.ts} | 0 ...urn-type.solution.2.ts => 32-tuple-return-type.solution.2.ts} | 0 .../{34-generic-hooks.problem.ts => 33-generic-hooks.problem.ts} | 0 ...eneric-hooks.solution.1.ts => 33-generic-hooks.solution.1.ts} | 0 ...eneric-hooks.solution.2.ts => 33-generic-hooks.solution.2.ts} | 0 ...eneric-hooks.solution.3.ts => 33-generic-hooks.solution.3.ts} | 0 ...eneric-hooks.solution.4.ts => 33-generic-hooks.solution.4.ts} | 0 ...eneric-hooks.solution.5.ts => 33-generic-hooks.solution.5.ts} | 0 ...e-hook.problem.ts => 34-generic-localstorage-hook.problem.ts} | 0 ...hook.solution.ts => 34-generic-localstorage-hook.solution.ts} | 0 ...lem.tsx => 35-generic-localstorage-hook-with-zod.problem.tsx} | 0 ...on.tsx => 35-generic-localstorage-hook-with-zod.solution.tsx} | 0 ...in-usestate.problem.tsx => 36-unions-in-usestate.problem.tsx} | 0 ...-usestate.solution.tsx => 36-unions-in-usestate.solution.tsx} | 0 ...oblem.tsx => 37-discriminated-unions-in-usestate.problem.tsx} | 0 ...tion.tsx => 37-discriminated-unions-in-usestate.solution.tsx} | 0 ... 38-discriminated-union-returns-from-custom-hooks.problem.ts} | 0 ...tsx => 39-discriminated-tuples-from-custom-hooks.problem.tsx} | 0 ...sx => 39-discriminated-tuples-from-custom-hooks.solution.tsx} | 0 ...iner.ts => 40-understand-react-namespace-export.explainer.ts} | 0 ....explainer.tsx => 41-understanding-jsx-element.explainer.tsx} | 0 ...ldren.problem.tsx => 42-strongly-typing-children.problem.tsx} | 0 ...xplainer.ts => 43-how-does-react-represent-html.explainer.ts} | 0 ...r.ts => 43-understanding-jsx-intrinsic-elements.explainer.ts} | 0 ...element.problem.tsx => 44-add-new-global-element.problem.tsx} | 0 ....problem.tsx => 45-add-attribute-to-all-elements.problem.tsx} | 0 ...roblem.tsx => 46-add-attribute-to-audio-elements.problem.tsx} | 0 ....problem.tsx => 47-add-attribute-to-div-elements.problem.tsx} | 0 ...eneric-context.problem.tsx => 48-generic-context.problem.tsx} | 0 ...components.problem.tsx => 49-compound-components.problem.tsx} | 0 .../{51-forward-ref.problem.tsx => 50-forward-ref.problem.tsx} | 0 .../{52-hoc-problem.tsx => 51-hoc-problem.tsx} | 0 .../{53-as-prop.problem.tsx => 52-as-prop.problem.tsx} | 0 .../{53-as-prop.solution.1.tsx => 52-as-prop.solution.1.tsx} | 0 .../{53-as-prop.solution.2.tsx => 52-as-prop.solution.2.tsx} | 0 ...problem.tsx => 53-as-prop-with-custom-components.problem.tsx} | 0 ...lution.tsx => 53-as-prop-with-custom-components.solution.tsx} | 0 .../{55-render-props.problem.tsx => 54-render-props.problem.tsx} | 0 ...ics.problem.tsx => 55-render-props-with-generics.problem.tsx} | 0 ...m.tsx => 56-record-of-components-with-same-props.problem.tsx} | 0 ...eact-hook-form.problem.tsx => 57-react-hook-form.problem.tsx} | 0 .../{59-react-query.problem.tsx => 58-react-query.problem.tsx} | 0 ...60-redux-toolkit.problem.tsx => 59-redux-toolkit.problem.tsx} | 0 .../{61-zustand.problem.tsx => 60-zustand.problem.tsx} | 0 ...problem.tsx => 61-reusable-form-library-with-zod.problem.tsx} | 0 66 files changed, 1 deletion(-) rename src/04-advanced-components/{23-discriminated-union-props.problem.tsx => 22-discriminated-union-props.problem.tsx} (100%) rename src/04-advanced-components/{23-discriminated-union-props.solution.tsx => 22-discriminated-union-props.solution.tsx} (100%) delete mode 100644 src/04-advanced-components/22-understanding-react-type-helpers.explainer.ts rename src/04-advanced-components/{24-destructuring-discriminated-unions.problem.tsx => 23-destructuring-discriminated-unions.problem.tsx} (100%) rename src/04-advanced-components/{24-destructuring-discriminated-unions.solution.1.tsx => 23-destructuring-discriminated-unions.solution.1.tsx} (100%) rename src/04-advanced-components/{24-destructuring-discriminated-unions.solution.2.tsx => 23-destructuring-discriminated-unions.solution.2.tsx} (100%) rename src/04-advanced-components/{25-discriminated-union-props-with-booleans.problem.tsx => 24-discriminated-union-props-with-booleans.problem.tsx} (100%) rename src/04-advanced-components/{26-discriminated-union-with-other-props.problem.tsx => 25-discriminated-union-with-other-props.problem.tsx} (100%) rename src/04-advanced-components/{26-discriminated-union-with-other-props.solution.tsx => 25-discriminated-union-with-other-props.solution.tsx} (100%) rename src/04-advanced-components/{27-either-all-these-props-or-none.problem.tsx => 26-either-all-these-props-or-none.problem.tsx} (100%) rename src/04-advanced-components/{27-either-all-these-props-or-none.solution.1.tsx => 26-either-all-these-props-or-none.solution.1.tsx} (100%) rename src/04-advanced-components/{27-either-all-these-props-or-none.solution.2.tsx => 26-either-all-these-props-or-none.solution.2.tsx} (100%) rename src/04-advanced-components/{27-either-all-these-props-or-none.solution.3.tsx => 26-either-all-these-props-or-none.solution.3.tsx} (100%) rename src/04-advanced-components/{31-passing-react-components-vs-passing-react-nodes.problem.tsx => 27-passing-react-components-vs-passing-react-nodes.problem.tsx} (100%) rename src/04-advanced-components/{31-passing-react-components-vs-passing-react-nodes.solution.1.tsx => 27-passing-react-components-vs-passing-react-nodes.solution.1.tsx} (100%) rename src/04-advanced-components/{31-passing-react-components-vs-passing-react-nodes.solution.2.tsx => 27-passing-react-components-vs-passing-react-nodes.solution.2.tsx} (100%) rename src/05-advanced-hooks/{32-typing-custom-hooks.problem.ts => 31-typing-custom-hooks.problem.ts} (100%) rename src/05-advanced-hooks/{32-typing-custom-hooks.solution.1.ts => 31-typing-custom-hooks.solution.1.ts} (100%) rename src/05-advanced-hooks/{32-typing-custom-hooks.solution.2.ts => 31-typing-custom-hooks.solution.2.ts} (100%) rename src/05-advanced-hooks/{32-typing-custom-hooks.solution.3.ts => 31-typing-custom-hooks.solution.3.ts} (100%) rename src/05-advanced-hooks/{33-tuple-return-type.problem.ts => 32-tuple-return-type.problem.ts} (100%) rename src/05-advanced-hooks/{33-tuple-return-type.solution.1.ts => 32-tuple-return-type.solution.1.ts} (100%) rename src/05-advanced-hooks/{33-tuple-return-type.solution.2.ts => 32-tuple-return-type.solution.2.ts} (100%) rename src/05-advanced-hooks/{34-generic-hooks.problem.ts => 33-generic-hooks.problem.ts} (100%) rename src/05-advanced-hooks/{34-generic-hooks.solution.1.ts => 33-generic-hooks.solution.1.ts} (100%) rename src/05-advanced-hooks/{34-generic-hooks.solution.2.ts => 33-generic-hooks.solution.2.ts} (100%) rename src/05-advanced-hooks/{34-generic-hooks.solution.3.ts => 33-generic-hooks.solution.3.ts} (100%) rename src/05-advanced-hooks/{34-generic-hooks.solution.4.ts => 33-generic-hooks.solution.4.ts} (100%) rename src/05-advanced-hooks/{34-generic-hooks.solution.5.ts => 33-generic-hooks.solution.5.ts} (100%) rename src/05-advanced-hooks/{35-generic-localstorage-hook.problem.ts => 34-generic-localstorage-hook.problem.ts} (100%) rename src/05-advanced-hooks/{35-generic-localstorage-hook.solution.ts => 34-generic-localstorage-hook.solution.ts} (100%) rename src/05-advanced-hooks/{36-generic-localstorage-hook-with-zod.problem.tsx => 35-generic-localstorage-hook-with-zod.problem.tsx} (100%) rename src/05-advanced-hooks/{36-generic-localstorage-hook-with-zod.solution.tsx => 35-generic-localstorage-hook-with-zod.solution.tsx} (100%) rename src/05-advanced-hooks/{37-unions-in-usestate.problem.tsx => 36-unions-in-usestate.problem.tsx} (100%) rename src/05-advanced-hooks/{37-unions-in-usestate.solution.tsx => 36-unions-in-usestate.solution.tsx} (100%) rename src/05-advanced-hooks/{38-discriminated-unions-in-usestate.problem.tsx => 37-discriminated-unions-in-usestate.problem.tsx} (100%) rename src/05-advanced-hooks/{38-discriminated-unions-in-usestate.solution.tsx => 37-discriminated-unions-in-usestate.solution.tsx} (100%) rename src/05-advanced-hooks/{39-discriminated-union-returns-from-custom-hooks.problem.ts => 38-discriminated-union-returns-from-custom-hooks.problem.ts} (100%) rename src/05-advanced-hooks/{40-discriminated-tuples-from-custom-hooks.problem.tsx => 39-discriminated-tuples-from-custom-hooks.problem.tsx} (100%) rename src/05-advanced-hooks/{40-discriminated-tuples-from-custom-hooks.solution.tsx => 39-discriminated-tuples-from-custom-hooks.solution.tsx} (100%) rename src/06-types-deep-dive/{41-understand-react-namespace-export.explainer.ts => 40-understand-react-namespace-export.explainer.ts} (100%) rename src/06-types-deep-dive/{42-understanding-jsx-element.explainer.tsx => 41-understanding-jsx-element.explainer.tsx} (100%) rename src/06-types-deep-dive/{43-strongly-typing-children.problem.tsx => 42-strongly-typing-children.problem.tsx} (100%) rename src/06-types-deep-dive/{44-how-does-react-represent-html.explainer.ts => 43-how-does-react-represent-html.explainer.ts} (100%) rename src/06-types-deep-dive/{44-understanding-jsx-intrinsic-elements.explainer.ts => 43-understanding-jsx-intrinsic-elements.explainer.ts} (100%) rename src/06-types-deep-dive/{45-add-new-global-element.problem.tsx => 44-add-new-global-element.problem.tsx} (100%) rename src/06-types-deep-dive/{46-add-attribute-to-all-elements.problem.tsx => 45-add-attribute-to-all-elements.problem.tsx} (100%) rename src/06-types-deep-dive/{47-add-attribute-to-audio-elements.problem.tsx => 46-add-attribute-to-audio-elements.problem.tsx} (100%) rename src/06-types-deep-dive/{48-add-attribute-to-div-elements.problem.tsx => 47-add-attribute-to-div-elements.problem.tsx} (100%) rename src/07-advanced-patterns/{49-generic-context.problem.tsx => 48-generic-context.problem.tsx} (100%) rename src/07-advanced-patterns/{50-compound-components.problem.tsx => 49-compound-components.problem.tsx} (100%) rename src/07-advanced-patterns/{51-forward-ref.problem.tsx => 50-forward-ref.problem.tsx} (100%) rename src/07-advanced-patterns/{52-hoc-problem.tsx => 51-hoc-problem.tsx} (100%) rename src/07-advanced-patterns/{53-as-prop.problem.tsx => 52-as-prop.problem.tsx} (100%) rename src/07-advanced-patterns/{53-as-prop.solution.1.tsx => 52-as-prop.solution.1.tsx} (100%) rename src/07-advanced-patterns/{53-as-prop.solution.2.tsx => 52-as-prop.solution.2.tsx} (100%) rename src/07-advanced-patterns/{54-as-prop-with-custom-components.problem.tsx => 53-as-prop-with-custom-components.problem.tsx} (100%) rename src/07-advanced-patterns/{54-as-prop-with-custom-components.solution.tsx => 53-as-prop-with-custom-components.solution.tsx} (100%) rename src/07-advanced-patterns/{55-render-props.problem.tsx => 54-render-props.problem.tsx} (100%) rename src/07-advanced-patterns/{56-render-props-with-generics.problem.tsx => 55-render-props-with-generics.problem.tsx} (100%) rename src/07-advanced-patterns/{57-record-of-components-with-same-props.problem.tsx => 56-record-of-components-with-same-props.problem.tsx} (100%) rename src/08-external-libraries/{58-react-hook-form.problem.tsx => 57-react-hook-form.problem.tsx} (100%) rename src/08-external-libraries/{59-react-query.problem.tsx => 58-react-query.problem.tsx} (100%) rename src/08-external-libraries/{60-redux-toolkit.problem.tsx => 59-redux-toolkit.problem.tsx} (100%) rename src/08-external-libraries/{61-zustand.problem.tsx => 60-zustand.problem.tsx} (100%) rename src/08-external-libraries/{62-reusable-form-library-with-zod.problem.tsx => 61-reusable-form-library-with-zod.problem.tsx} (100%) diff --git a/src/04-advanced-components/23-discriminated-union-props.problem.tsx b/src/04-advanced-components/22-discriminated-union-props.problem.tsx similarity index 100% rename from src/04-advanced-components/23-discriminated-union-props.problem.tsx rename to src/04-advanced-components/22-discriminated-union-props.problem.tsx diff --git a/src/04-advanced-components/23-discriminated-union-props.solution.tsx b/src/04-advanced-components/22-discriminated-union-props.solution.tsx similarity index 100% rename from src/04-advanced-components/23-discriminated-union-props.solution.tsx rename to src/04-advanced-components/22-discriminated-union-props.solution.tsx diff --git a/src/04-advanced-components/22-understanding-react-type-helpers.explainer.ts b/src/04-advanced-components/22-understanding-react-type-helpers.explainer.ts deleted file mode 100644 index db34608..0000000 --- a/src/04-advanced-components/22-understanding-react-type-helpers.explainer.ts +++ /dev/null @@ -1 +0,0 @@ -// React.ComponentProps diff --git a/src/04-advanced-components/24-destructuring-discriminated-unions.problem.tsx b/src/04-advanced-components/23-destructuring-discriminated-unions.problem.tsx similarity index 100% rename from src/04-advanced-components/24-destructuring-discriminated-unions.problem.tsx rename to src/04-advanced-components/23-destructuring-discriminated-unions.problem.tsx diff --git a/src/04-advanced-components/24-destructuring-discriminated-unions.solution.1.tsx b/src/04-advanced-components/23-destructuring-discriminated-unions.solution.1.tsx similarity index 100% rename from src/04-advanced-components/24-destructuring-discriminated-unions.solution.1.tsx rename to src/04-advanced-components/23-destructuring-discriminated-unions.solution.1.tsx diff --git a/src/04-advanced-components/24-destructuring-discriminated-unions.solution.2.tsx b/src/04-advanced-components/23-destructuring-discriminated-unions.solution.2.tsx similarity index 100% rename from src/04-advanced-components/24-destructuring-discriminated-unions.solution.2.tsx rename to src/04-advanced-components/23-destructuring-discriminated-unions.solution.2.tsx diff --git a/src/04-advanced-components/25-discriminated-union-props-with-booleans.problem.tsx b/src/04-advanced-components/24-discriminated-union-props-with-booleans.problem.tsx similarity index 100% rename from src/04-advanced-components/25-discriminated-union-props-with-booleans.problem.tsx rename to src/04-advanced-components/24-discriminated-union-props-with-booleans.problem.tsx diff --git a/src/04-advanced-components/26-discriminated-union-with-other-props.problem.tsx b/src/04-advanced-components/25-discriminated-union-with-other-props.problem.tsx similarity index 100% rename from src/04-advanced-components/26-discriminated-union-with-other-props.problem.tsx rename to src/04-advanced-components/25-discriminated-union-with-other-props.problem.tsx diff --git a/src/04-advanced-components/26-discriminated-union-with-other-props.solution.tsx b/src/04-advanced-components/25-discriminated-union-with-other-props.solution.tsx similarity index 100% rename from src/04-advanced-components/26-discriminated-union-with-other-props.solution.tsx rename to src/04-advanced-components/25-discriminated-union-with-other-props.solution.tsx diff --git a/src/04-advanced-components/27-either-all-these-props-or-none.problem.tsx b/src/04-advanced-components/26-either-all-these-props-or-none.problem.tsx similarity index 100% rename from src/04-advanced-components/27-either-all-these-props-or-none.problem.tsx rename to src/04-advanced-components/26-either-all-these-props-or-none.problem.tsx diff --git a/src/04-advanced-components/27-either-all-these-props-or-none.solution.1.tsx b/src/04-advanced-components/26-either-all-these-props-or-none.solution.1.tsx similarity index 100% rename from src/04-advanced-components/27-either-all-these-props-or-none.solution.1.tsx rename to src/04-advanced-components/26-either-all-these-props-or-none.solution.1.tsx diff --git a/src/04-advanced-components/27-either-all-these-props-or-none.solution.2.tsx b/src/04-advanced-components/26-either-all-these-props-or-none.solution.2.tsx similarity index 100% rename from src/04-advanced-components/27-either-all-these-props-or-none.solution.2.tsx rename to src/04-advanced-components/26-either-all-these-props-or-none.solution.2.tsx diff --git a/src/04-advanced-components/27-either-all-these-props-or-none.solution.3.tsx b/src/04-advanced-components/26-either-all-these-props-or-none.solution.3.tsx similarity index 100% rename from src/04-advanced-components/27-either-all-these-props-or-none.solution.3.tsx rename to src/04-advanced-components/26-either-all-these-props-or-none.solution.3.tsx diff --git a/src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.problem.tsx b/src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx similarity index 100% rename from src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.problem.tsx rename to src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx diff --git a/src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.solution.1.tsx b/src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.solution.1.tsx similarity index 100% rename from src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.solution.1.tsx rename to src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.solution.1.tsx diff --git a/src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.solution.2.tsx b/src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.solution.2.tsx similarity index 100% rename from src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.solution.2.tsx rename to src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.solution.2.tsx diff --git a/src/05-advanced-hooks/32-typing-custom-hooks.problem.ts b/src/05-advanced-hooks/31-typing-custom-hooks.problem.ts similarity index 100% rename from src/05-advanced-hooks/32-typing-custom-hooks.problem.ts rename to src/05-advanced-hooks/31-typing-custom-hooks.problem.ts diff --git a/src/05-advanced-hooks/32-typing-custom-hooks.solution.1.ts b/src/05-advanced-hooks/31-typing-custom-hooks.solution.1.ts similarity index 100% rename from src/05-advanced-hooks/32-typing-custom-hooks.solution.1.ts rename to src/05-advanced-hooks/31-typing-custom-hooks.solution.1.ts diff --git a/src/05-advanced-hooks/32-typing-custom-hooks.solution.2.ts b/src/05-advanced-hooks/31-typing-custom-hooks.solution.2.ts similarity index 100% rename from src/05-advanced-hooks/32-typing-custom-hooks.solution.2.ts rename to src/05-advanced-hooks/31-typing-custom-hooks.solution.2.ts diff --git a/src/05-advanced-hooks/32-typing-custom-hooks.solution.3.ts b/src/05-advanced-hooks/31-typing-custom-hooks.solution.3.ts similarity index 100% rename from src/05-advanced-hooks/32-typing-custom-hooks.solution.3.ts rename to src/05-advanced-hooks/31-typing-custom-hooks.solution.3.ts diff --git a/src/05-advanced-hooks/33-tuple-return-type.problem.ts b/src/05-advanced-hooks/32-tuple-return-type.problem.ts similarity index 100% rename from src/05-advanced-hooks/33-tuple-return-type.problem.ts rename to src/05-advanced-hooks/32-tuple-return-type.problem.ts diff --git a/src/05-advanced-hooks/33-tuple-return-type.solution.1.ts b/src/05-advanced-hooks/32-tuple-return-type.solution.1.ts similarity index 100% rename from src/05-advanced-hooks/33-tuple-return-type.solution.1.ts rename to src/05-advanced-hooks/32-tuple-return-type.solution.1.ts diff --git a/src/05-advanced-hooks/33-tuple-return-type.solution.2.ts b/src/05-advanced-hooks/32-tuple-return-type.solution.2.ts similarity index 100% rename from src/05-advanced-hooks/33-tuple-return-type.solution.2.ts rename to src/05-advanced-hooks/32-tuple-return-type.solution.2.ts diff --git a/src/05-advanced-hooks/34-generic-hooks.problem.ts b/src/05-advanced-hooks/33-generic-hooks.problem.ts similarity index 100% rename from src/05-advanced-hooks/34-generic-hooks.problem.ts rename to src/05-advanced-hooks/33-generic-hooks.problem.ts diff --git a/src/05-advanced-hooks/34-generic-hooks.solution.1.ts b/src/05-advanced-hooks/33-generic-hooks.solution.1.ts similarity index 100% rename from src/05-advanced-hooks/34-generic-hooks.solution.1.ts rename to src/05-advanced-hooks/33-generic-hooks.solution.1.ts diff --git a/src/05-advanced-hooks/34-generic-hooks.solution.2.ts b/src/05-advanced-hooks/33-generic-hooks.solution.2.ts similarity index 100% rename from src/05-advanced-hooks/34-generic-hooks.solution.2.ts rename to src/05-advanced-hooks/33-generic-hooks.solution.2.ts diff --git a/src/05-advanced-hooks/34-generic-hooks.solution.3.ts b/src/05-advanced-hooks/33-generic-hooks.solution.3.ts similarity index 100% rename from src/05-advanced-hooks/34-generic-hooks.solution.3.ts rename to src/05-advanced-hooks/33-generic-hooks.solution.3.ts diff --git a/src/05-advanced-hooks/34-generic-hooks.solution.4.ts b/src/05-advanced-hooks/33-generic-hooks.solution.4.ts similarity index 100% rename from src/05-advanced-hooks/34-generic-hooks.solution.4.ts rename to src/05-advanced-hooks/33-generic-hooks.solution.4.ts diff --git a/src/05-advanced-hooks/34-generic-hooks.solution.5.ts b/src/05-advanced-hooks/33-generic-hooks.solution.5.ts similarity index 100% rename from src/05-advanced-hooks/34-generic-hooks.solution.5.ts rename to src/05-advanced-hooks/33-generic-hooks.solution.5.ts diff --git a/src/05-advanced-hooks/35-generic-localstorage-hook.problem.ts b/src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts similarity index 100% rename from src/05-advanced-hooks/35-generic-localstorage-hook.problem.ts rename to src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts diff --git a/src/05-advanced-hooks/35-generic-localstorage-hook.solution.ts b/src/05-advanced-hooks/34-generic-localstorage-hook.solution.ts similarity index 100% rename from src/05-advanced-hooks/35-generic-localstorage-hook.solution.ts rename to src/05-advanced-hooks/34-generic-localstorage-hook.solution.ts diff --git a/src/05-advanced-hooks/36-generic-localstorage-hook-with-zod.problem.tsx b/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx similarity index 100% rename from src/05-advanced-hooks/36-generic-localstorage-hook-with-zod.problem.tsx rename to src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx diff --git a/src/05-advanced-hooks/36-generic-localstorage-hook-with-zod.solution.tsx b/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.solution.tsx similarity index 100% rename from src/05-advanced-hooks/36-generic-localstorage-hook-with-zod.solution.tsx rename to src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.solution.tsx diff --git a/src/05-advanced-hooks/37-unions-in-usestate.problem.tsx b/src/05-advanced-hooks/36-unions-in-usestate.problem.tsx similarity index 100% rename from src/05-advanced-hooks/37-unions-in-usestate.problem.tsx rename to src/05-advanced-hooks/36-unions-in-usestate.problem.tsx diff --git a/src/05-advanced-hooks/37-unions-in-usestate.solution.tsx b/src/05-advanced-hooks/36-unions-in-usestate.solution.tsx similarity index 100% rename from src/05-advanced-hooks/37-unions-in-usestate.solution.tsx rename to src/05-advanced-hooks/36-unions-in-usestate.solution.tsx diff --git a/src/05-advanced-hooks/38-discriminated-unions-in-usestate.problem.tsx b/src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx similarity index 100% rename from src/05-advanced-hooks/38-discriminated-unions-in-usestate.problem.tsx rename to src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx diff --git a/src/05-advanced-hooks/38-discriminated-unions-in-usestate.solution.tsx b/src/05-advanced-hooks/37-discriminated-unions-in-usestate.solution.tsx similarity index 100% rename from src/05-advanced-hooks/38-discriminated-unions-in-usestate.solution.tsx rename to src/05-advanced-hooks/37-discriminated-unions-in-usestate.solution.tsx diff --git a/src/05-advanced-hooks/39-discriminated-union-returns-from-custom-hooks.problem.ts b/src/05-advanced-hooks/38-discriminated-union-returns-from-custom-hooks.problem.ts similarity index 100% rename from src/05-advanced-hooks/39-discriminated-union-returns-from-custom-hooks.problem.ts rename to src/05-advanced-hooks/38-discriminated-union-returns-from-custom-hooks.problem.ts diff --git a/src/05-advanced-hooks/40-discriminated-tuples-from-custom-hooks.problem.tsx b/src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx similarity index 100% rename from src/05-advanced-hooks/40-discriminated-tuples-from-custom-hooks.problem.tsx rename to src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx diff --git a/src/05-advanced-hooks/40-discriminated-tuples-from-custom-hooks.solution.tsx b/src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.solution.tsx similarity index 100% rename from src/05-advanced-hooks/40-discriminated-tuples-from-custom-hooks.solution.tsx rename to src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.solution.tsx diff --git a/src/06-types-deep-dive/41-understand-react-namespace-export.explainer.ts b/src/06-types-deep-dive/40-understand-react-namespace-export.explainer.ts similarity index 100% rename from src/06-types-deep-dive/41-understand-react-namespace-export.explainer.ts rename to src/06-types-deep-dive/40-understand-react-namespace-export.explainer.ts diff --git a/src/06-types-deep-dive/42-understanding-jsx-element.explainer.tsx b/src/06-types-deep-dive/41-understanding-jsx-element.explainer.tsx similarity index 100% rename from src/06-types-deep-dive/42-understanding-jsx-element.explainer.tsx rename to src/06-types-deep-dive/41-understanding-jsx-element.explainer.tsx diff --git a/src/06-types-deep-dive/43-strongly-typing-children.problem.tsx b/src/06-types-deep-dive/42-strongly-typing-children.problem.tsx similarity index 100% rename from src/06-types-deep-dive/43-strongly-typing-children.problem.tsx rename to src/06-types-deep-dive/42-strongly-typing-children.problem.tsx diff --git a/src/06-types-deep-dive/44-how-does-react-represent-html.explainer.ts b/src/06-types-deep-dive/43-how-does-react-represent-html.explainer.ts similarity index 100% rename from src/06-types-deep-dive/44-how-does-react-represent-html.explainer.ts rename to src/06-types-deep-dive/43-how-does-react-represent-html.explainer.ts diff --git a/src/06-types-deep-dive/44-understanding-jsx-intrinsic-elements.explainer.ts b/src/06-types-deep-dive/43-understanding-jsx-intrinsic-elements.explainer.ts similarity index 100% rename from src/06-types-deep-dive/44-understanding-jsx-intrinsic-elements.explainer.ts rename to src/06-types-deep-dive/43-understanding-jsx-intrinsic-elements.explainer.ts diff --git a/src/06-types-deep-dive/45-add-new-global-element.problem.tsx b/src/06-types-deep-dive/44-add-new-global-element.problem.tsx similarity index 100% rename from src/06-types-deep-dive/45-add-new-global-element.problem.tsx rename to src/06-types-deep-dive/44-add-new-global-element.problem.tsx diff --git a/src/06-types-deep-dive/46-add-attribute-to-all-elements.problem.tsx b/src/06-types-deep-dive/45-add-attribute-to-all-elements.problem.tsx similarity index 100% rename from src/06-types-deep-dive/46-add-attribute-to-all-elements.problem.tsx rename to src/06-types-deep-dive/45-add-attribute-to-all-elements.problem.tsx diff --git a/src/06-types-deep-dive/47-add-attribute-to-audio-elements.problem.tsx b/src/06-types-deep-dive/46-add-attribute-to-audio-elements.problem.tsx similarity index 100% rename from src/06-types-deep-dive/47-add-attribute-to-audio-elements.problem.tsx rename to src/06-types-deep-dive/46-add-attribute-to-audio-elements.problem.tsx diff --git a/src/06-types-deep-dive/48-add-attribute-to-div-elements.problem.tsx b/src/06-types-deep-dive/47-add-attribute-to-div-elements.problem.tsx similarity index 100% rename from src/06-types-deep-dive/48-add-attribute-to-div-elements.problem.tsx rename to src/06-types-deep-dive/47-add-attribute-to-div-elements.problem.tsx diff --git a/src/07-advanced-patterns/49-generic-context.problem.tsx b/src/07-advanced-patterns/48-generic-context.problem.tsx similarity index 100% rename from src/07-advanced-patterns/49-generic-context.problem.tsx rename to src/07-advanced-patterns/48-generic-context.problem.tsx diff --git a/src/07-advanced-patterns/50-compound-components.problem.tsx b/src/07-advanced-patterns/49-compound-components.problem.tsx similarity index 100% rename from src/07-advanced-patterns/50-compound-components.problem.tsx rename to src/07-advanced-patterns/49-compound-components.problem.tsx diff --git a/src/07-advanced-patterns/51-forward-ref.problem.tsx b/src/07-advanced-patterns/50-forward-ref.problem.tsx similarity index 100% rename from src/07-advanced-patterns/51-forward-ref.problem.tsx rename to src/07-advanced-patterns/50-forward-ref.problem.tsx diff --git a/src/07-advanced-patterns/52-hoc-problem.tsx b/src/07-advanced-patterns/51-hoc-problem.tsx similarity index 100% rename from src/07-advanced-patterns/52-hoc-problem.tsx rename to src/07-advanced-patterns/51-hoc-problem.tsx diff --git a/src/07-advanced-patterns/53-as-prop.problem.tsx b/src/07-advanced-patterns/52-as-prop.problem.tsx similarity index 100% rename from src/07-advanced-patterns/53-as-prop.problem.tsx rename to src/07-advanced-patterns/52-as-prop.problem.tsx diff --git a/src/07-advanced-patterns/53-as-prop.solution.1.tsx b/src/07-advanced-patterns/52-as-prop.solution.1.tsx similarity index 100% rename from src/07-advanced-patterns/53-as-prop.solution.1.tsx rename to src/07-advanced-patterns/52-as-prop.solution.1.tsx diff --git a/src/07-advanced-patterns/53-as-prop.solution.2.tsx b/src/07-advanced-patterns/52-as-prop.solution.2.tsx similarity index 100% rename from src/07-advanced-patterns/53-as-prop.solution.2.tsx rename to src/07-advanced-patterns/52-as-prop.solution.2.tsx diff --git a/src/07-advanced-patterns/54-as-prop-with-custom-components.problem.tsx b/src/07-advanced-patterns/53-as-prop-with-custom-components.problem.tsx similarity index 100% rename from src/07-advanced-patterns/54-as-prop-with-custom-components.problem.tsx rename to src/07-advanced-patterns/53-as-prop-with-custom-components.problem.tsx diff --git a/src/07-advanced-patterns/54-as-prop-with-custom-components.solution.tsx b/src/07-advanced-patterns/53-as-prop-with-custom-components.solution.tsx similarity index 100% rename from src/07-advanced-patterns/54-as-prop-with-custom-components.solution.tsx rename to src/07-advanced-patterns/53-as-prop-with-custom-components.solution.tsx diff --git a/src/07-advanced-patterns/55-render-props.problem.tsx b/src/07-advanced-patterns/54-render-props.problem.tsx similarity index 100% rename from src/07-advanced-patterns/55-render-props.problem.tsx rename to src/07-advanced-patterns/54-render-props.problem.tsx diff --git a/src/07-advanced-patterns/56-render-props-with-generics.problem.tsx b/src/07-advanced-patterns/55-render-props-with-generics.problem.tsx similarity index 100% rename from src/07-advanced-patterns/56-render-props-with-generics.problem.tsx rename to src/07-advanced-patterns/55-render-props-with-generics.problem.tsx diff --git a/src/07-advanced-patterns/57-record-of-components-with-same-props.problem.tsx b/src/07-advanced-patterns/56-record-of-components-with-same-props.problem.tsx similarity index 100% rename from src/07-advanced-patterns/57-record-of-components-with-same-props.problem.tsx rename to src/07-advanced-patterns/56-record-of-components-with-same-props.problem.tsx diff --git a/src/08-external-libraries/58-react-hook-form.problem.tsx b/src/08-external-libraries/57-react-hook-form.problem.tsx similarity index 100% rename from src/08-external-libraries/58-react-hook-form.problem.tsx rename to src/08-external-libraries/57-react-hook-form.problem.tsx diff --git a/src/08-external-libraries/59-react-query.problem.tsx b/src/08-external-libraries/58-react-query.problem.tsx similarity index 100% rename from src/08-external-libraries/59-react-query.problem.tsx rename to src/08-external-libraries/58-react-query.problem.tsx diff --git a/src/08-external-libraries/60-redux-toolkit.problem.tsx b/src/08-external-libraries/59-redux-toolkit.problem.tsx similarity index 100% rename from src/08-external-libraries/60-redux-toolkit.problem.tsx rename to src/08-external-libraries/59-redux-toolkit.problem.tsx diff --git a/src/08-external-libraries/61-zustand.problem.tsx b/src/08-external-libraries/60-zustand.problem.tsx similarity index 100% rename from src/08-external-libraries/61-zustand.problem.tsx rename to src/08-external-libraries/60-zustand.problem.tsx diff --git a/src/08-external-libraries/62-reusable-form-library-with-zod.problem.tsx b/src/08-external-libraries/61-reusable-form-library-with-zod.problem.tsx similarity index 100% rename from src/08-external-libraries/62-reusable-form-library-with-zod.problem.tsx rename to src/08-external-libraries/61-reusable-form-library-with-zod.problem.tsx From 08a2c0ff3a5c08cae7aae1f583bbfb09f19231be Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Tue, 9 May 2023 14:29:55 +0100 Subject: [PATCH 006/186] Fixed broken CI --- scripts/tests/__snapshots__/all.test.ts.snap | 428 ++++++++++--------- scripts/tests/all.test.ts | 10 + scripts/tests/cleanVitestOutput.ts | 2 +- tsconfig.json | 2 +- 4 files changed, 235 insertions(+), 207 deletions(-) diff --git a/scripts/tests/__snapshots__/all.test.ts.snap b/scripts/tests/__snapshots__/all.test.ts.snap index 73d3d60..79df451 100644 --- a/scripts/tests/__snapshots__/all.test.ts.snap +++ b/scripts/tests/__snapshots__/all.test.ts.snap @@ -13,7 +13,7 @@ src/02-components/05-typing-components-as-functions.problem.tsx(17,8): error TS2 src/02-components/06-typing-children.problem.tsx(4,25): error TS2339: Property 'children' does not exist on type '{}'. src/02-components/06-typing-children.problem.tsx(10,8): error TS2578: Unused '@ts-expect-error' directive. src/02-components/06-typing-children.problem.tsx(12,8): error TS2559: Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes'. -src/02-components/07-typing-onclick-handlers.problem.tsx(8,47): error TS2339: Property 'onChange' does not exist on type 'ButtonProps'. +src/02-components/07-typing-onclick-handlers.problem.tsx(8,47): error TS2339: Property 'onClick' does not exist on type 'ButtonProps'. src/02-components/08-using-html-props.problem.tsx(3,26): error TS2339: Property 'className' does not exist on type '{}'. src/02-components/08-using-html-props.problem.tsx(10,18): error TS2322: Type '{ onClick: () => void; type: string; }' is not assignable to type 'IntrinsicAttributes'. Property 'onClick' does not exist on type 'IntrinsicAttributes'. @@ -60,49 +60,61 @@ src/03-hooks/21-use-reducer.problem.ts(17,22): error TS2344: Type 'false' does n src/03-hooks/21-use-reducer.problem.ts(21,1): error TS2578: Unused '@ts-expect-error' directive. src/03-hooks/21-use-reducer.problem.ts(24,1): error TS2578: Unused '@ts-expect-error' directive. src/03-hooks/21-use-reducer.problem.ts(27,1): error TS2578: Unused '@ts-expect-error' directive. -src/04-advanced-components/23-discriminated-union-props.problem.tsx(27,9): error TS2578: Unused '@ts-expect-error' directive. -src/04-advanced-components/24-destructuring-discriminated-unions.problem.tsx(13,34): error TS2339: Property 'title' does not exist on type 'ModalProps'. -src/04-advanced-components/24-destructuring-discriminated-unions.solution.1.tsx(17,31): error TS2339: Property 'title' does not exist on type '{} | { title: string; }'. +src/04-advanced-components/22-discriminated-union-props.problem.tsx(27,9): error TS2578: Unused '@ts-expect-error' directive. +src/04-advanced-components/23-destructuring-discriminated-unions.problem.tsx(13,34): error TS2339: Property 'title' does not exist on type 'ModalProps'. +src/04-advanced-components/23-destructuring-discriminated-unions.solution.1.tsx(17,31): error TS2339: Property 'title' does not exist on type '{} | { title: string; }'. Property 'title' does not exist on type '{}'. -src/04-advanced-components/26-discriminated-union-with-other-props.problem.tsx(24,9): error TS2322: Type '{ buttonColor: string; variant: \\"no-title\\"; title: string; }' is not assignable to type 'IntrinsicAttributes & ModalProps'. +src/04-advanced-components/25-discriminated-union-with-other-props.problem.tsx(24,9): error TS2322: Type '{ buttonColor: string; variant: \\"no-title\\"; title: string; }' is not assignable to type 'IntrinsicAttributes & ModalProps'. Property 'buttonColor' does not exist on type 'IntrinsicAttributes & { variant: \\"no-title\\"; }'. -src/04-advanced-components/26-discriminated-union-with-other-props.problem.tsx(26,9): error TS2578: Unused '@ts-expect-error' directive. -src/04-advanced-components/26-discriminated-union-with-other-props.problem.tsx(29,44): error TS2322: Type '{ variant: \\"title\\"; title: string; buttonColor: string; }' is not assignable to type 'IntrinsicAttributes & ModalProps'. +src/04-advanced-components/25-discriminated-union-with-other-props.problem.tsx(26,9): error TS2578: Unused '@ts-expect-error' directive. +src/04-advanced-components/25-discriminated-union-with-other-props.problem.tsx(29,44): error TS2322: Type '{ variant: \\"title\\"; title: string; buttonColor: string; }' is not assignable to type 'IntrinsicAttributes & ModalProps'. Property 'buttonColor' does not exist on type 'IntrinsicAttributes & { variant: \\"title\\"; title: string; }'. -src/04-advanced-components/27-either-all-these-props-or-none.problem.tsx(30,8): error TS2578: Unused '@ts-expect-error' directive. -src/04-advanced-components/27-either-all-these-props-or-none.problem.tsx(33,8): error TS2578: Unused '@ts-expect-error' directive. +src/04-advanced-components/26-either-all-these-props-or-none.problem.tsx(30,8): error TS2578: Unused '@ts-expect-error' directive. +src/04-advanced-components/26-either-all-these-props-or-none.problem.tsx(33,8): error TS2578: Unused '@ts-expect-error' directive. +src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx(8,30): error TS2345: Argument of type 'ReactNode' is not assignable to parameter of type '(value: number, index: number, array: number[]) => ReactNode'. + Type 'undefined' is not assignable to type '(value: number, index: number, array: number[]) => ReactNode'. +src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx(15,19): error TS2322: Type '(index: any) => Element' is not assignable to type 'ReactNode'. +src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx(15,21): error TS7006: Parameter 'index' implicitly has an 'any' type. +src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx(16,30): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx(21,19): error TS2322: Type '(index: any) => null' is not assignable to type 'ReactNode'. +src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx(21,21): error TS7006: Parameter 'index' implicitly has an 'any' type. +src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx(26,9): error TS2578: Unused '@ts-expect-error' directive. +src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx(30,9): error TS2322: Type '(index: any) => any' is not assignable to type 'ReactNode'. +src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx(30,21): error TS7006: Parameter 'index' implicitly has an 'any' type. +src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.solution.1.tsx(30,9): error TS2322: Type '(index: number) => number' is not assignable to type 'FC'. + Type 'number' is not assignable to type 'ReactElement'. src/04-advanced-components/28-generic-props.problem.tsx(38,9): error TS2578: Unused '@ts-expect-error' directive. src/04-advanced-components/28-generic-props.problem.tsx(50,17): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/32-typing-custom-hooks.problem.ts(4,23): error TS7006: Parameter 'defaultId' implicitly has an 'any' type. -src/05-advanced-hooks/32-typing-custom-hooks.problem.ts(10,22): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/33-tuple-return-type.problem.ts(13,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/33-tuple-return-type.problem.ts(14,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/34-generic-hooks.problem.ts(16,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/34-generic-hooks.problem.ts(18,5): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/34-generic-hooks.problem.ts(28,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/34-generic-hooks.problem.ts(29,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/35-generic-localstorage-hook.problem.ts(15,30): error TS2558: Expected 0 type arguments, but got 1. -src/05-advanced-hooks/35-generic-localstorage-hook.problem.ts(22,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/35-generic-localstorage-hook.problem.ts(28,5): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/36-generic-localstorage-hook-with-zod.problem.tsx(28,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/36-generic-localstorage-hook-with-zod.problem.tsx(34,5): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/37-unions-in-usestate.problem.tsx(49,3): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/37-unions-in-usestate.problem.tsx(66,22): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/38-discriminated-unions-in-usestate.problem.tsx(37,3): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/38-discriminated-unions-in-usestate.problem.tsx(40,3): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/38-discriminated-unions-in-usestate.problem.tsx(43,3): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/40-discriminated-tuples-from-custom-hooks.problem.tsx(31,25): error TS18048: 'value' is possibly 'undefined'. -src/05-advanced-hooks/40-discriminated-tuples-from-custom-hooks.problem.tsx(31,31): error TS2339: Property 'message' does not exist on type 'Error | { title: string; }'. +src/05-advanced-hooks/31-typing-custom-hooks.problem.ts(4,23): error TS7006: Parameter 'defaultId' implicitly has an 'any' type. +src/05-advanced-hooks/31-typing-custom-hooks.problem.ts(10,22): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/32-tuple-return-type.problem.ts(13,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/32-tuple-return-type.problem.ts(14,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/33-generic-hooks.problem.ts(16,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/33-generic-hooks.problem.ts(18,5): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/33-generic-hooks.problem.ts(28,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/33-generic-hooks.problem.ts(29,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts(15,30): error TS2558: Expected 0 type arguments, but got 1. +src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts(22,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts(28,5): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx(28,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx(34,5): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/36-unions-in-usestate.problem.tsx(49,3): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/36-unions-in-usestate.problem.tsx(66,22): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx(37,3): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx(40,3): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx(43,3): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx(31,25): error TS18048: 'value' is possibly 'undefined'. +src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx(31,31): error TS2339: Property 'message' does not exist on type 'Error | { title: string; }'. Property 'message' does not exist on type '{ title: string; }'. -src/05-advanced-hooks/40-discriminated-tuples-from-custom-hooks.problem.tsx(34,16): error TS18048: 'value' is possibly 'undefined'. -src/05-advanced-hooks/40-discriminated-tuples-from-custom-hooks.problem.tsx(34,22): error TS2339: Property 'title' does not exist on type 'Error | { title: string; }'. +src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx(34,16): error TS18048: 'value' is possibly 'undefined'. +src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx(34,22): error TS2339: Property 'title' does not exist on type 'Error | { title: string; }'. Property 'title' does not exist on type 'Error'. -src/06-types-deep-dive/48-add-attribute-to-div-elements.problem.tsx(6,7): error TS2717: Subsequent property declarations must have the same type. Property 'div' must be of type 'DetailedHTMLProps, HTMLDivElement>', but here has type 'ClassAttributes & HTMLAttributes & { something?: string | undefined; }'. -src/06-types-deep-dive/48-add-attribute-to-div-elements.problem.tsx(13,30): error TS2322: Type '{ something: string; }' is not assignable to type 'DetailedHTMLProps, HTMLDivElement>'. +src/06-types-deep-dive/47-add-attribute-to-div-elements.problem.tsx(6,7): error TS2717: Subsequent property declarations must have the same type. Property 'div' must be of type 'DetailedHTMLProps, HTMLDivElement>', but here has type 'ClassAttributes & HTMLAttributes & { something?: string | undefined; }'. +src/06-types-deep-dive/47-add-attribute-to-div-elements.problem.tsx(13,30): error TS2322: Type '{ something: string; }' is not assignable to type 'DetailedHTMLProps, HTMLDivElement>'. Property 'something' does not exist on type 'DetailedHTMLProps, HTMLDivElement>'. -src/07-advanced-patterns/53-as-prop.solution.1.tsx(18,5): error TS2322: Type '{ as: \\"div\\"; href: string; }' is not assignable to type 'IntrinsicAttributes & AsProps'. +src/07-advanced-patterns/52-as-prop.solution.1.tsx(18,5): error TS2322: Type '{ as: \\"div\\"; href: string; }' is not assignable to type 'IntrinsicAttributes & AsProps'. Property 'href' does not exist on type 'IntrinsicAttributes & { as: \\"div\\"; } & ClassAttributes & HTMLAttributes'. Did you mean 'ref'? -src/07-advanced-patterns/54-as-prop-with-custom-components.problem.tsx(12,35): error TS2322: Type '{ as: (props: { href: string; children?: ReactNode; }) => Element; href: string; }' is not assignable to type 'IntrinsicAttributes & { as: any; }'. +src/07-advanced-patterns/53-as-prop-with-custom-components.problem.tsx(12,35): error TS2322: Type '{ as: (props: { href: string; children?: ReactNode; }) => Element; href: string; }' is not assignable to type 'IntrinsicAttributes & { as: any; }'. Property 'href' does not exist on type 'IntrinsicAttributes & { as: any; }'. ," `; @@ -114,500 +126,506 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` { "assertionResults": [], "message": "No test found in suite src/01-introduction/01-react-in-typescript.explainer.tsx", - "name": "src/01-introduction/01-react-in-typescript.explainer.tsx", + "name": "/src/01-introduction/01-react-in-typescript.explainer.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/01-introduction/02-typescript-in-react-frameworks.explainer.ts", - "name": "src/01-introduction/02-typescript-in-react-frameworks.explainer.ts", + "name": "/src/01-introduction/02-typescript-in-react-frameworks.explainer.ts", "status": "passed", }, { "assertionResults": [], "message": "Transform failed with 1 error: -/Users/matt/repos/ts/react-typescript-tutorial/src/01-introduction/03-navigating-jsx-types.problem.tsx:5:21: ERROR: Unexpected \\"}\\"", - "name": "src/01-introduction/03-navigating-jsx-types.problem.tsx", +/src/01-introduction/03-navigating-jsx-types.problem.tsx:5:21: ERROR: Unexpected \\"}\\"", + "name": "/src/01-introduction/03-navigating-jsx-types.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/01-introduction/03-navigating-jsx-types.solution.tsx", - "name": "src/01-introduction/03-navigating-jsx-types.solution.tsx", + "name": "/src/01-introduction/03-navigating-jsx-types.solution.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/04-typing-components.problem.tsx", - "name": "src/02-components/04-typing-components.problem.tsx", + "name": "/src/02-components/04-typing-components.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/04-typing-components.solution.1.tsx", - "name": "src/02-components/04-typing-components.solution.1.tsx", + "name": "/src/02-components/04-typing-components.solution.1.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/04-typing-components.solution.2.tsx", - "name": "src/02-components/04-typing-components.solution.2.tsx", + "name": "/src/02-components/04-typing-components.solution.2.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/04-typing-components.solution.3.tsx", - "name": "src/02-components/04-typing-components.solution.3.tsx", + "name": "/src/02-components/04-typing-components.solution.3.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/04-typing-components.solution.4.tsx", - "name": "src/02-components/04-typing-components.solution.4.tsx", + "name": "/src/02-components/04-typing-components.solution.4.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/05-typing-components-as-functions.problem.tsx", - "name": "src/02-components/05-typing-components-as-functions.problem.tsx", + "name": "/src/02-components/05-typing-components-as-functions.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/05-typing-components-as-functions.solution.tsx", - "name": "src/02-components/05-typing-components-as-functions.solution.tsx", + "name": "/src/02-components/05-typing-components-as-functions.solution.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/06-typing-children.problem.tsx", - "name": "src/02-components/06-typing-children.problem.tsx", + "name": "/src/02-components/06-typing-children.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/06-typing-children.solution.tsx", - "name": "src/02-components/06-typing-children.solution.tsx", + "name": "/src/02-components/06-typing-children.solution.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/07-typing-onclick-handlers.problem.tsx", - "name": "src/02-components/07-typing-onclick-handlers.problem.tsx", + "name": "/src/02-components/07-typing-onclick-handlers.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/07-typing-onclick-handlers.solution.tsx", - "name": "src/02-components/07-typing-onclick-handlers.solution.tsx", + "name": "/src/02-components/07-typing-onclick-handlers.solution.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/08-using-html-props.problem.tsx", - "name": "src/02-components/08-using-html-props.problem.tsx", + "name": "/src/02-components/08-using-html-props.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/08-using-html-props.solution.1.tsx", - "name": "src/02-components/08-using-html-props.solution.1.tsx", + "name": "/src/02-components/08-using-html-props.solution.1.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/08-using-html-props.solution.2.tsx", - "name": "src/02-components/08-using-html-props.solution.2.tsx", + "name": "/src/02-components/08-using-html-props.solution.2.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/09-html-props-with-one-changed.problem.tsx", - "name": "src/02-components/09-html-props-with-one-changed.problem.tsx", + "name": "/src/02-components/09-html-props-with-one-changed.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/09-html-props-with-one-changed.solution.1.tsx", - "name": "src/02-components/09-html-props-with-one-changed.solution.1.tsx", + "name": "/src/02-components/09-html-props-with-one-changed.solution.1.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/09-html-props-with-one-changed.solution.2.tsx", - "name": "src/02-components/09-html-props-with-one-changed.solution.2.tsx", + "name": "/src/02-components/09-html-props-with-one-changed.solution.2.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/09-html-props-with-one-changed.solution.3.tsx", - "name": "src/02-components/09-html-props-with-one-changed.solution.3.tsx", + "name": "/src/02-components/09-html-props-with-one-changed.solution.3.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/09-html-props-with-one-changed.solution.4.tsx", - "name": "src/02-components/09-html-props-with-one-changed.solution.4.tsx", + "name": "/src/02-components/09-html-props-with-one-changed.solution.4.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/10-extracting-props-from-custom-components.problem.tsx", - "name": "src/02-components/10-extracting-props-from-custom-components.problem.tsx", + "name": "/src/02-components/10-extracting-props-from-custom-components.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/02-components/10-extracting-props-from-custom-components.solution.tsx", - "name": "src/02-components/10-extracting-props-from-custom-components.solution.tsx", + "name": "/src/02-components/10-extracting-props-from-custom-components.solution.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/11-use-state.problem.tsx", - "name": "src/03-hooks/11-use-state.problem.tsx", + "name": "/src/03-hooks/11-use-state.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/11-use-state.solution.tsx", - "name": "src/03-hooks/11-use-state.solution.tsx", + "name": "/src/03-hooks/11-use-state.solution.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/12-use-state-with-undefined.problem.ts", - "name": "src/03-hooks/12-use-state-with-undefined.problem.ts", + "name": "/src/03-hooks/12-use-state-with-undefined.problem.ts", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/12-use-state-with-undefined.solution.1.ts", - "name": "src/03-hooks/12-use-state-with-undefined.solution.1.ts", + "name": "/src/03-hooks/12-use-state-with-undefined.solution.1.ts", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/12-use-state-with-undefined.solution.2.ts", - "name": "src/03-hooks/12-use-state-with-undefined.solution.2.ts", + "name": "/src/03-hooks/12-use-state-with-undefined.solution.2.ts", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/13-use-state-excess-properties.problem.tsx", - "name": "src/03-hooks/13-use-state-excess-properties.problem.tsx", + "name": "/src/03-hooks/13-use-state-excess-properties.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/13-use-state-excess-properties.solution.tsx", - "name": "src/03-hooks/13-use-state-excess-properties.solution.tsx", + "name": "/src/03-hooks/13-use-state-excess-properties.solution.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/14-use-effect.problem.ts", - "name": "src/03-hooks/14-use-effect.problem.ts", + "name": "/src/03-hooks/14-use-effect.problem.ts", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/14-use-effect.solution.ts", - "name": "src/03-hooks/14-use-effect.solution.ts", + "name": "/src/03-hooks/14-use-effect.solution.ts", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/15-use-callback.problem.tsx", - "name": "src/03-hooks/15-use-callback.problem.tsx", + "name": "/src/03-hooks/15-use-callback.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/15-use-callback.solution.tsx", - "name": "src/03-hooks/15-use-callback.solution.tsx", + "name": "/src/03-hooks/15-use-callback.solution.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/16-use-memo.problem.tsx", - "name": "src/03-hooks/16-use-memo.problem.tsx", + "name": "/src/03-hooks/16-use-memo.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/16-use-memo.solution.1.tsx", - "name": "src/03-hooks/16-use-memo.solution.1.tsx", + "name": "/src/03-hooks/16-use-memo.solution.1.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/16-use-memo.solution.2.tsx", - "name": "src/03-hooks/16-use-memo.solution.2.tsx", + "name": "/src/03-hooks/16-use-memo.solution.2.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/16-use-memo.solution.3.tsx", - "name": "src/03-hooks/16-use-memo.solution.3.tsx", + "name": "/src/03-hooks/16-use-memo.solution.3.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/17-use-ref-basics.problem.tsx", - "name": "src/03-hooks/17-use-ref-basics.problem.tsx", + "name": "/src/03-hooks/17-use-ref-basics.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/17-use-ref-basics.solution.tsx", - "name": "src/03-hooks/17-use-ref-basics.solution.tsx", + "name": "/src/03-hooks/17-use-ref-basics.solution.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "src/03-hooks/18-element-refs.explainer.tsx", + "name": "/src/03-hooks/18-element-refs.explainer.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/19-use-ref-with-elements.problem.tsx", - "name": "src/03-hooks/19-use-ref-with-elements.problem.tsx", + "name": "/src/03-hooks/19-use-ref-with-elements.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/19-use-ref-with-elements.solution.tsx", - "name": "src/03-hooks/19-use-ref-with-elements.solution.tsx", + "name": "/src/03-hooks/19-use-ref-with-elements.solution.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/20-why-is-my-ref-readonly.problem.tsx", - "name": "src/03-hooks/20-why-is-my-ref-readonly.problem.tsx", + "name": "/src/03-hooks/20-why-is-my-ref-readonly.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/03-hooks/20-why-is-my-ref-readonly.solution.tsx", - "name": "src/03-hooks/20-why-is-my-ref-readonly.solution.tsx", + "name": "/src/03-hooks/20-why-is-my-ref-readonly.solution.tsx", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useReducer')", - "name": "src/03-hooks/21-use-reducer.problem.ts", + "name": "/src/03-hooks/21-use-reducer.problem.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useReducer')", - "name": "src/03-hooks/21-use-reducer.solution.1.ts", + "name": "/src/03-hooks/21-use-reducer.solution.1.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useReducer')", - "name": "src/03-hooks/21-use-reducer.solution.2.ts", + "name": "/src/03-hooks/21-use-reducer.solution.2.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useReducer')", - "name": "src/03-hooks/21-use-reducer.solution.3.ts", + "name": "/src/03-hooks/21-use-reducer.solution.3.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/22-understanding-react-type-helpers.explainer.ts", - "name": "src/04-advanced-components/22-understanding-react-type-helpers.explainer.ts", + "message": "No test found in suite src/04-advanced-components/22-discriminated-union-props.problem.tsx", + "name": "/src/04-advanced-components/22-discriminated-union-props.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/23-discriminated-union-props.problem.tsx", - "name": "src/04-advanced-components/23-discriminated-union-props.problem.tsx", + "message": "No test found in suite src/04-advanced-components/22-discriminated-union-props.solution.tsx", + "name": "/src/04-advanced-components/22-discriminated-union-props.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/23-discriminated-union-props.solution.tsx", - "name": "src/04-advanced-components/23-discriminated-union-props.solution.tsx", + "message": "No test found in suite src/04-advanced-components/23-destructuring-discriminated-unions.problem.tsx", + "name": "/src/04-advanced-components/23-destructuring-discriminated-unions.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/24-destructuring-discriminated-unions.problem.tsx", - "name": "src/04-advanced-components/24-destructuring-discriminated-unions.problem.tsx", + "message": "No test found in suite src/04-advanced-components/23-destructuring-discriminated-unions.solution.1.tsx", + "name": "/src/04-advanced-components/23-destructuring-discriminated-unions.solution.1.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/24-destructuring-discriminated-unions.solution.1.tsx", - "name": "src/04-advanced-components/24-destructuring-discriminated-unions.solution.1.tsx", + "message": "No test found in suite src/04-advanced-components/23-destructuring-discriminated-unions.solution.2.tsx", + "name": "/src/04-advanced-components/23-destructuring-discriminated-unions.solution.2.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/24-destructuring-discriminated-unions.solution.2.tsx", - "name": "src/04-advanced-components/24-destructuring-discriminated-unions.solution.2.tsx", + "message": "No test found in suite src/04-advanced-components/24-discriminated-union-props-with-booleans.problem.tsx", + "name": "/src/04-advanced-components/24-discriminated-union-props-with-booleans.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/25-discriminated-union-props-with-booleans.problem.tsx", - "name": "src/04-advanced-components/25-discriminated-union-props-with-booleans.problem.tsx", + "message": "No test found in suite src/04-advanced-components/25-discriminated-union-with-other-props.problem.tsx", + "name": "/src/04-advanced-components/25-discriminated-union-with-other-props.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/26-discriminated-union-with-other-props.problem.tsx", - "name": "src/04-advanced-components/26-discriminated-union-with-other-props.problem.tsx", + "message": "No test found in suite src/04-advanced-components/25-discriminated-union-with-other-props.solution.tsx", + "name": "/src/04-advanced-components/25-discriminated-union-with-other-props.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/26-discriminated-union-with-other-props.solution.tsx", - "name": "src/04-advanced-components/26-discriminated-union-with-other-props.solution.tsx", + "message": "No test found in suite src/04-advanced-components/26-either-all-these-props-or-none.problem.tsx", + "name": "/src/04-advanced-components/26-either-all-these-props-or-none.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/27-either-all-these-props-or-none.problem.tsx", - "name": "src/04-advanced-components/27-either-all-these-props-or-none.problem.tsx", + "message": "No test found in suite src/04-advanced-components/26-either-all-these-props-or-none.solution.1.tsx", + "name": "/src/04-advanced-components/26-either-all-these-props-or-none.solution.1.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/27-either-all-these-props-or-none.solution.1.tsx", - "name": "src/04-advanced-components/27-either-all-these-props-or-none.solution.1.tsx", + "message": "No test found in suite src/04-advanced-components/26-either-all-these-props-or-none.solution.2.tsx", + "name": "/src/04-advanced-components/26-either-all-these-props-or-none.solution.2.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/27-either-all-these-props-or-none.solution.2.tsx", - "name": "src/04-advanced-components/27-either-all-these-props-or-none.solution.2.tsx", + "message": "No test found in suite src/04-advanced-components/26-either-all-these-props-or-none.solution.3.tsx", + "name": "/src/04-advanced-components/26-either-all-these-props-or-none.solution.3.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/27-either-all-these-props-or-none.solution.3.tsx", - "name": "src/04-advanced-components/27-either-all-these-props-or-none.solution.3.tsx", + "message": "No test found in suite src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx", + "name": "/src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx", + "status": "passed", + }, + { + "assertionResults": [], + "message": "No test found in suite src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.solution.1.tsx", + "name": "/src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.solution.1.tsx", + "status": "passed", + }, + { + "assertionResults": [], + "message": "No test found in suite src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.solution.2.tsx", + "name": "/src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.solution.2.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/04-advanced-components/28-generic-props.problem.tsx", - "name": "src/04-advanced-components/28-generic-props.problem.tsx", + "name": "/src/04-advanced-components/28-generic-props.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/04-advanced-components/28-generic-props.solution.tsx", - "name": "src/04-advanced-components/28-generic-props.solution.tsx", + "name": "/src/04-advanced-components/28-generic-props.solution.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/04-advanced-components/29-generics-vs-discriminated-unions.problem.tsx", - "name": "src/04-advanced-components/29-generics-vs-discriminated-unions.problem.tsx", + "name": "/src/04-advanced-components/29-generics-vs-discriminated-unions.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/04-advanced-components/29-generics-vs-discriminated-unions.solution.tsx", - "name": "src/04-advanced-components/29-generics-vs-discriminated-unions.solution.tsx", + "name": "/src/04-advanced-components/29-generics-vs-discriminated-unions.solution.tsx", "status": "passed", }, { "assertionResults": [], "message": "No test found in suite src/04-advanced-components/30-variants-with-classnames.problem.tsx", - "name": "src/04-advanced-components/30-variants-with-classnames.problem.tsx", - "status": "passed", - }, - { - "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.problem.tsx", - "name": "src/04-advanced-components/31-passing-react-components-vs-passing-react-nodes.problem.tsx", + "name": "/src/04-advanced-components/30-variants-with-classnames.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/32-typing-custom-hooks.problem.ts", - "name": "src/05-advanced-hooks/32-typing-custom-hooks.problem.ts", + "message": "No test found in suite src/05-advanced-hooks/31-typing-custom-hooks.problem.ts", + "name": "/src/05-advanced-hooks/31-typing-custom-hooks.problem.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/32-typing-custom-hooks.solution.1.ts", - "name": "src/05-advanced-hooks/32-typing-custom-hooks.solution.1.ts", + "message": "No test found in suite src/05-advanced-hooks/31-typing-custom-hooks.solution.1.ts", + "name": "/src/05-advanced-hooks/31-typing-custom-hooks.solution.1.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/32-typing-custom-hooks.solution.2.ts", - "name": "src/05-advanced-hooks/32-typing-custom-hooks.solution.2.ts", + "message": "No test found in suite src/05-advanced-hooks/31-typing-custom-hooks.solution.2.ts", + "name": "/src/05-advanced-hooks/31-typing-custom-hooks.solution.2.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/32-typing-custom-hooks.solution.3.ts", - "name": "src/05-advanced-hooks/32-typing-custom-hooks.solution.3.ts", + "message": "No test found in suite src/05-advanced-hooks/31-typing-custom-hooks.solution.3.ts", + "name": "/src/05-advanced-hooks/31-typing-custom-hooks.solution.3.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "src/05-advanced-hooks/33-tuple-return-type.problem.ts", + "name": "/src/05-advanced-hooks/32-tuple-return-type.problem.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "src/05-advanced-hooks/33-tuple-return-type.solution.1.ts", + "name": "/src/05-advanced-hooks/32-tuple-return-type.solution.1.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "src/05-advanced-hooks/33-tuple-return-type.solution.2.ts", + "name": "/src/05-advanced-hooks/32-tuple-return-type.solution.2.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "src/05-advanced-hooks/34-generic-hooks.problem.ts", + "name": "/src/05-advanced-hooks/33-generic-hooks.problem.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "src/05-advanced-hooks/34-generic-hooks.solution.1.ts", + "name": "/src/05-advanced-hooks/33-generic-hooks.solution.1.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "src/05-advanced-hooks/34-generic-hooks.solution.2.ts", + "name": "/src/05-advanced-hooks/33-generic-hooks.solution.2.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "src/05-advanced-hooks/34-generic-hooks.solution.3.ts", + "name": "/src/05-advanced-hooks/33-generic-hooks.solution.3.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "src/05-advanced-hooks/34-generic-hooks.solution.4.ts", + "name": "/src/05-advanced-hooks/33-generic-hooks.solution.4.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "src/05-advanced-hooks/34-generic-hooks.solution.5.ts", + "name": "/src/05-advanced-hooks/33-generic-hooks.solution.5.ts", "status": "passed", }, { @@ -632,7 +650,7 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, ], "message": "", - "name": "src/05-advanced-hooks/35-generic-localstorage-hook.problem.ts", + "name": "/src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts", "status": "passed", }, { @@ -657,7 +675,7 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, ], "message": "", - "name": "src/05-advanced-hooks/35-generic-localstorage-hook.solution.ts", + "name": "/src/05-advanced-hooks/34-generic-localstorage-hook.solution.ts", "status": "passed", }, { @@ -682,7 +700,7 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, ], "message": "", - "name": "src/05-advanced-hooks/36-generic-localstorage-hook-with-zod.problem.tsx", + "name": "/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx", "status": "passed", }, { @@ -707,205 +725,205 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, ], "message": "", - "name": "src/05-advanced-hooks/36-generic-localstorage-hook-with-zod.solution.tsx", + "name": "/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/37-unions-in-usestate.problem.tsx", - "name": "src/05-advanced-hooks/37-unions-in-usestate.problem.tsx", + "message": "No test found in suite src/05-advanced-hooks/36-unions-in-usestate.problem.tsx", + "name": "/src/05-advanced-hooks/36-unions-in-usestate.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/37-unions-in-usestate.solution.tsx", - "name": "src/05-advanced-hooks/37-unions-in-usestate.solution.tsx", + "message": "No test found in suite src/05-advanced-hooks/36-unions-in-usestate.solution.tsx", + "name": "/src/05-advanced-hooks/36-unions-in-usestate.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/38-discriminated-unions-in-usestate.problem.tsx", - "name": "src/05-advanced-hooks/38-discriminated-unions-in-usestate.problem.tsx", + "message": "No test found in suite src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx", + "name": "/src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/38-discriminated-unions-in-usestate.solution.tsx", - "name": "src/05-advanced-hooks/38-discriminated-unions-in-usestate.solution.tsx", + "message": "No test found in suite src/05-advanced-hooks/37-discriminated-unions-in-usestate.solution.tsx", + "name": "/src/05-advanced-hooks/37-discriminated-unions-in-usestate.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/39-discriminated-union-returns-from-custom-hooks.problem.ts", - "name": "src/05-advanced-hooks/39-discriminated-union-returns-from-custom-hooks.problem.ts", + "message": "No test found in suite src/05-advanced-hooks/38-discriminated-union-returns-from-custom-hooks.problem.ts", + "name": "/src/05-advanced-hooks/38-discriminated-union-returns-from-custom-hooks.problem.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/40-discriminated-tuples-from-custom-hooks.problem.tsx", - "name": "src/05-advanced-hooks/40-discriminated-tuples-from-custom-hooks.problem.tsx", + "message": "No test found in suite src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx", + "name": "/src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/40-discriminated-tuples-from-custom-hooks.solution.tsx", - "name": "src/05-advanced-hooks/40-discriminated-tuples-from-custom-hooks.solution.tsx", + "message": "No test found in suite src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.solution.tsx", + "name": "/src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/41-understand-react-namespace-export.explainer.ts", - "name": "src/06-types-deep-dive/41-understand-react-namespace-export.explainer.ts", + "message": "No test found in suite src/06-types-deep-dive/40-understand-react-namespace-export.explainer.ts", + "name": "/src/06-types-deep-dive/40-understand-react-namespace-export.explainer.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/42-understanding-jsx-element.explainer.tsx", - "name": "src/06-types-deep-dive/42-understanding-jsx-element.explainer.tsx", + "message": "No test found in suite src/06-types-deep-dive/41-understanding-jsx-element.explainer.tsx", + "name": "/src/06-types-deep-dive/41-understanding-jsx-element.explainer.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/43-strongly-typing-children.problem.tsx", - "name": "src/06-types-deep-dive/43-strongly-typing-children.problem.tsx", + "message": "No test found in suite src/06-types-deep-dive/42-strongly-typing-children.problem.tsx", + "name": "/src/06-types-deep-dive/42-strongly-typing-children.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/44-how-does-react-represent-html.explainer.ts", - "name": "src/06-types-deep-dive/44-how-does-react-represent-html.explainer.ts", + "message": "No test found in suite src/06-types-deep-dive/43-how-does-react-represent-html.explainer.ts", + "name": "/src/06-types-deep-dive/43-how-does-react-represent-html.explainer.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/44-understanding-jsx-intrinsic-elements.explainer.ts", - "name": "src/06-types-deep-dive/44-understanding-jsx-intrinsic-elements.explainer.ts", + "message": "No test found in suite src/06-types-deep-dive/43-understanding-jsx-intrinsic-elements.explainer.ts", + "name": "/src/06-types-deep-dive/43-understanding-jsx-intrinsic-elements.explainer.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/45-add-new-global-element.problem.tsx", - "name": "src/06-types-deep-dive/45-add-new-global-element.problem.tsx", + "message": "No test found in suite src/06-types-deep-dive/44-add-new-global-element.problem.tsx", + "name": "/src/06-types-deep-dive/44-add-new-global-element.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "src/06-types-deep-dive/46-add-attribute-to-all-elements.problem.tsx", + "name": "/src/06-types-deep-dive/45-add-attribute-to-all-elements.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "src/06-types-deep-dive/47-add-attribute-to-audio-elements.problem.tsx", + "name": "/src/06-types-deep-dive/46-add-attribute-to-audio-elements.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "src/06-types-deep-dive/48-add-attribute-to-div-elements.problem.tsx", + "name": "/src/06-types-deep-dive/47-add-attribute-to-div-elements.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/49-generic-context.problem.tsx", - "name": "src/07-advanced-patterns/49-generic-context.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/48-generic-context.problem.tsx", + "name": "/src/07-advanced-patterns/48-generic-context.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/50-compound-components.problem.tsx", - "name": "src/07-advanced-patterns/50-compound-components.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/49-compound-components.problem.tsx", + "name": "/src/07-advanced-patterns/49-compound-components.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/51-forward-ref.problem.tsx", - "name": "src/07-advanced-patterns/51-forward-ref.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/50-forward-ref.problem.tsx", + "name": "/src/07-advanced-patterns/50-forward-ref.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/52-hoc-problem.tsx", - "name": "src/07-advanced-patterns/52-hoc-problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/51-hoc-problem.tsx", + "name": "/src/07-advanced-patterns/51-hoc-problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "src/07-advanced-patterns/53-as-prop.problem.tsx", + "name": "/src/07-advanced-patterns/52-as-prop.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "src/07-advanced-patterns/53-as-prop.solution.1.tsx", + "name": "/src/07-advanced-patterns/52-as-prop.solution.1.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "src/07-advanced-patterns/53-as-prop.solution.2.tsx", + "name": "/src/07-advanced-patterns/52-as-prop.solution.2.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/54-as-prop-with-custom-components.problem.tsx", - "name": "src/07-advanced-patterns/54-as-prop-with-custom-components.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/53-as-prop-with-custom-components.problem.tsx", + "name": "/src/07-advanced-patterns/53-as-prop-with-custom-components.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/54-as-prop-with-custom-components.solution.tsx", - "name": "src/07-advanced-patterns/54-as-prop-with-custom-components.solution.tsx", + "message": "No test found in suite src/07-advanced-patterns/53-as-prop-with-custom-components.solution.tsx", + "name": "/src/07-advanced-patterns/53-as-prop-with-custom-components.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/55-render-props.problem.tsx", - "name": "src/07-advanced-patterns/55-render-props.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/54-render-props.problem.tsx", + "name": "/src/07-advanced-patterns/54-render-props.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/56-render-props-with-generics.problem.tsx", - "name": "src/07-advanced-patterns/56-render-props-with-generics.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/55-render-props-with-generics.problem.tsx", + "name": "/src/07-advanced-patterns/55-render-props-with-generics.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/57-record-of-components-with-same-props.problem.tsx", - "name": "src/07-advanced-patterns/57-record-of-components-with-same-props.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/56-record-of-components-with-same-props.problem.tsx", + "name": "/src/07-advanced-patterns/56-record-of-components-with-same-props.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/58-react-hook-form.problem.tsx", - "name": "src/08-external-libraries/58-react-hook-form.problem.tsx", + "message": "No test found in suite src/08-external-libraries/57-react-hook-form.problem.tsx", + "name": "/src/08-external-libraries/57-react-hook-form.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/59-react-query.problem.tsx", - "name": "src/08-external-libraries/59-react-query.problem.tsx", + "message": "No test found in suite src/08-external-libraries/58-react-query.problem.tsx", + "name": "/src/08-external-libraries/58-react-query.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/60-redux-toolkit.problem.tsx", - "name": "src/08-external-libraries/60-redux-toolkit.problem.tsx", + "message": "No test found in suite src/08-external-libraries/59-redux-toolkit.problem.tsx", + "name": "/src/08-external-libraries/59-redux-toolkit.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/61-zustand.problem.tsx", - "name": "src/08-external-libraries/61-zustand.problem.tsx", + "message": "No test found in suite src/08-external-libraries/60-zustand.problem.tsx", + "name": "/src/08-external-libraries/60-zustand.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/62-reusable-form-library-with-zod.problem.tsx", - "name": "src/08-external-libraries/62-reusable-form-library-with-zod.problem.tsx", + "message": "No test found in suite src/08-external-libraries/61-reusable-form-library-with-zod.problem.tsx", + "name": "/src/08-external-libraries/61-reusable-form-library-with-zod.problem.tsx", "status": "passed", }, ], diff --git a/scripts/tests/all.test.ts b/scripts/tests/all.test.ts index a7867de..48f44e4 100644 --- a/scripts/tests/all.test.ts +++ b/scripts/tests/all.test.ts @@ -5,6 +5,12 @@ import { cleanVitestOutput } from "./cleanVitestOutput"; const rootFolder = path.resolve(__dirname, "../.."); +console.log(rootFolder); + +const sanitizeForRegex = (str: string) => { + return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string +}; + describe("tsc", async () => { it("Should have the correct TypeScript errors", () => { let result: string; @@ -17,6 +23,8 @@ describe("tsc", async () => { result = error.output.toString(); } + result = result.replace(new RegExp(sanitizeForRegex(rootFolder), "g"), ""); + expect(result).toMatchSnapshot(); }); }); @@ -34,6 +42,8 @@ describe("vitest", async () => { result = error.output.toString(); } + result = result.replace(new RegExp(sanitizeForRegex(rootFolder), "g"), ""); + expect( cleanVitestOutput(result, { rootFolder, diff --git a/scripts/tests/cleanVitestOutput.ts b/scripts/tests/cleanVitestOutput.ts index 61c4d4f..81efa6b 100644 --- a/scripts/tests/cleanVitestOutput.ts +++ b/scripts/tests/cleanVitestOutput.ts @@ -48,7 +48,7 @@ export const cleanVitestOutput = ( delete testResult.endTime; delete testResult.duration; - testResult.name = path.relative(context.rootFolder, testResult.name); + // testResult.name = path.relative(context.rootFolder, testResult.name); testResult.assertionResults.forEach((assertionResult) => { delete assertionResult.duration; diff --git a/tsconfig.json b/tsconfig.json index da4fcdb..add5bfc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,4 +17,4 @@ "include": [ "src" ] -} +} \ No newline at end of file From 35c0d182f99d5e2dcbdf5af26d7ca56d44cdcfa4 Mon Sep 17 00:00:00 2001 From: Vojta Holik Date: Tue, 9 May 2023 17:58:09 +0200 Subject: [PATCH 007/186] feat(readme): add new banner image --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a732e8..9c239fe 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -beginner typescript tutorial +React with TypeScript, tutorial by Matt Pocock ## Quickstart From d81457c0352755d04dc0ea394a598365a4bcebbb Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Tue, 9 May 2023 17:08:08 +0100 Subject: [PATCH 008/186] WIP --- .../30-variants-with-classnames.problem.tsx | 36 +++++++++++++++- .../30-variants-with-classnames.solution.tsx | 30 ++++++++++++++ ...30.5-prop-groups-with-variants.problem.tsx | 41 +++++++++++++++++++ ...ric-localstorage-hook-with-zod.problem.tsx | 2 - ...ic-localstorage-hook-with-zod.solution.tsx | 2 - 5 files changed, 106 insertions(+), 5 deletions(-) create mode 100644 src/04-advanced-components/30-variants-with-classnames.solution.tsx create mode 100644 src/04-advanced-components/30.5-prop-groups-with-variants.problem.tsx diff --git a/src/04-advanced-components/30-variants-with-classnames.problem.tsx b/src/04-advanced-components/30-variants-with-classnames.problem.tsx index a681fe5..ad71401 100644 --- a/src/04-advanced-components/30-variants-with-classnames.problem.tsx +++ b/src/04-advanced-components/30-variants-with-classnames.problem.tsx @@ -1 +1,35 @@ -// keyof/typeof/as const +const classNamesMap = { + primary: "bg-blue-500 text-white", + secondary: "bg-gray-200 text-black", + success: "bg-green-500 text-white", +}; + +type ButtonProps = { + /** + * This isn't ideal - we have to manually sync + * the type of variant with the object above. + * + * How do we type this so that there's a single + * source of truth for the variant? + */ + variant: "primary" | "secondary" | "success"; +}; + +export const Button = (props: ButtonProps) => { + return ; +}; + +const Parent = () => { + return ( + <> + + + + + {/* @ts-expect-error */} + + {/* @ts-expect-error */} + + + ); +}; diff --git a/src/04-advanced-components/30-variants-with-classnames.solution.tsx b/src/04-advanced-components/30-variants-with-classnames.solution.tsx new file mode 100644 index 0000000..eddbe0e --- /dev/null +++ b/src/04-advanced-components/30-variants-with-classnames.solution.tsx @@ -0,0 +1,30 @@ +// keyof/typeof/as const + +const classNamesMap = { + primary: "bg-blue-500 text-white", + secondary: "bg-gray-200 text-black", + success: "bg-green-500 text-white", +}; + +type ButtonProps = { + variant: keyof typeof classNamesMap; +}; + +export const Button = (props: ButtonProps) => { + return ; +}; + +const Parent = () => { + return ( + <> + + + + + {/* @ts-expect-error */} + + {/* @ts-expect-error */} + + + ); +}; diff --git a/src/04-advanced-components/30.5-prop-groups-with-variants.problem.tsx b/src/04-advanced-components/30.5-prop-groups-with-variants.problem.tsx new file mode 100644 index 0000000..df9b2d7 --- /dev/null +++ b/src/04-advanced-components/30.5-prop-groups-with-variants.problem.tsx @@ -0,0 +1,41 @@ +// WIP + +import { ComponentProps } from "react"; + +const buttonPropsMap = { + reset: { + className: "bg-blue-500 text-white", + type: "reset", + }, + submit: { + className: "bg-gray-200 text-black", + type: "submit", + }, + next: { + className: "bg-green-500 text-white", + type: "button", + }, +} satisfies Record>; + +type ButtonProps = { + variant: keyof typeof buttonPropsMap; +}; + +export const Button = (props: ButtonProps) => { + return ; +}; + +const Parent = () => { + return ( + <> + + + + + {/* @ts-expect-error */} + + {/* @ts-expect-error */} + + + ); +}; diff --git a/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx b/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx index 08be80c..5937374 100644 --- a/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx +++ b/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx @@ -1,5 +1,3 @@ -// TODO - fix tests - import { it } from "vitest"; import { Equal, Expect } from "../helpers/type-utils"; import { z } from "zod"; diff --git a/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.solution.tsx b/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.solution.tsx index 54a57ae..fcb8410 100644 --- a/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.solution.tsx +++ b/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.solution.tsx @@ -1,5 +1,3 @@ -// TODO - fix tests - import { it } from "vitest"; import { Equal, Expect } from "../helpers/type-utils"; import { z } from "zod"; From ef9d8181a731008843b7aaf7266437bb5d384a18 Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Tue, 9 May 2023 17:09:04 +0100 Subject: [PATCH 009/186] Fixed cross-env and changed readme --- README.md | 4 -- package-lock.json | 126 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 11 ++-- 3 files changed, 132 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9c239fe..b4cd134 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,6 @@ npm run exercise 01 npm run solution 01 ``` -## Video Walkthrough - -I walked through the first few exercises on [VSCode's live stream](https://www.youtube.com/watch?v=p6dO9u0M7MQ)! The plan for these exercises is to develop them into a full workshop, and then bundle them into the full video course - [Total TypeScript](https://totaltypescript.com). - ## How to take the course You'll notice that the course is split into exercises. Each exercise is split into a `*.problem.ts` and a `*.solution.ts`. diff --git a/package-lock.json b/package-lock.json index 2ba5016..92d6dc4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@types/express": "^4.17.13", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", + "cross-env": "^7.0.3", "express": "^4.18.1", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -527,6 +528,23 @@ "version": "1.0.6", "license": "MIT" }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-fetch": { "version": "3.1.5", "dev": true, @@ -535,6 +553,19 @@ "node-fetch": "2.6.7" } }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/cssstyle": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", @@ -1221,6 +1252,11 @@ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -1557,6 +1593,14 @@ "node": ">= 0.8" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, "node_modules/path-parse": { "version": "1.0.7", "dev": true, @@ -1954,6 +1998,25 @@ "version": "1.2.0", "license": "ISC" }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, "node_modules/side-channel": { "version": "1.0.4", "license": "MIT", @@ -2567,6 +2630,20 @@ "webidl-conversions": "^3.0.0" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/why-is-node-running": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", @@ -3023,6 +3100,14 @@ "cookie-signature": { "version": "1.0.6" }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "requires": { + "cross-spawn": "^7.0.1" + } + }, "cross-fetch": { "version": "3.1.5", "dev": true, @@ -3030,6 +3115,16 @@ "node-fetch": "2.6.7" } }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, "cssstyle": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", @@ -3508,6 +3603,11 @@ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3731,6 +3831,11 @@ "parseurl": { "version": "1.3.3" }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, "path-parse": { "version": "1.0.7", "dev": true @@ -3981,6 +4086,19 @@ "setprototypeof": { "version": "1.2.0" }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, "side-channel": { "version": "1.0.4", "requires": { @@ -4357,6 +4475,14 @@ "webidl-conversions": "^3.0.0" } }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + }, "why-is-node-running": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", diff --git a/package.json b/package.json index f5d41c8..3303f1c 100644 --- a/package.json +++ b/package.json @@ -7,17 +7,17 @@ "devDependencies": { "chokidar": "^3.5.3", "cross-fetch": "^3.1.5", - "typescript": "^5.0.3", + "fast-glob": "^3.2.12", "jsdom": "^21.1.1", "prettier": "^2.8.7", + "typescript": "^5.0.3", "vite-tsconfig-paths": "^4.0.7", - "vitest": "^0.29.8", - "fast-glob": "^3.2.12" + "vitest": "^0.29.8" }, "scripts": { "exercise": "node scripts/exercise.js", "e": "npm run exercise", - "solution": "SOLUTION=true node scripts/exercise.js", + "solution": "cross-env SOLUTION=true node scripts/exercise.js", "s": "npm run solution", "ci": "(cd scripts/tests && npx vitest run)", "update-snapshots": "(cd scripts/tests && npx vitest run -u)", @@ -59,9 +59,10 @@ "@types/express": "^4.17.13", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", + "cross-env": "^7.0.3", "express": "^4.18.1", "react": "^18.2.0", "react-dom": "^18.2.0", "zod": "^3.17.10" } -} \ No newline at end of file +} From cff97b276abdec0cd90d29ef9e74dad58dd83c7e Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Wed, 10 May 2023 08:22:36 +0100 Subject: [PATCH 010/186] Updated snapshots --- scripts/tests/__snapshots__/all.test.ts.snap | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/tests/__snapshots__/all.test.ts.snap b/scripts/tests/__snapshots__/all.test.ts.snap index 79df451..ca54c6d 100644 --- a/scripts/tests/__snapshots__/all.test.ts.snap +++ b/scripts/tests/__snapshots__/all.test.ts.snap @@ -96,8 +96,8 @@ src/05-advanced-hooks/33-generic-hooks.problem.ts(29,10): error TS2344: Type 'fa src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts(15,30): error TS2558: Expected 0 type arguments, but got 1. src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts(22,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts(28,5): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx(28,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx(34,5): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx(26,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx(32,5): error TS2578: Unused '@ts-expect-error' directive. src/05-advanced-hooks/36-unions-in-usestate.problem.tsx(49,3): error TS2578: Unused '@ts-expect-error' directive. src/05-advanced-hooks/36-unions-in-usestate.problem.tsx(66,22): error TS2344: Type 'false' does not satisfy the constraint 'true'. src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx(37,3): error TS2578: Unused '@ts-expect-error' directive. @@ -550,6 +550,19 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` "name": "/src/04-advanced-components/30-variants-with-classnames.problem.tsx", "status": "passed", }, + { + "assertionResults": [], + "message": "No test found in suite src/04-advanced-components/30-variants-with-classnames.solution.tsx", + "name": "/src/04-advanced-components/30-variants-with-classnames.solution.tsx", + "status": "passed", + }, + { + "assertionResults": [], + "message": "Transform failed with 1 error: +/src/04-advanced-components/30.5-prop-groups-with-variants.problem.tsx:18:2: ERROR: Expected \\";\\" but found \\"satisfies\\"", + "name": "/src/04-advanced-components/30.5-prop-groups-with-variants.problem.tsx", + "status": "passed", + }, { "assertionResults": [], "message": "No test found in suite src/05-advanced-hooks/31-typing-custom-hooks.problem.ts", From ed6608846f6ff88498258d53e8ce235dda1c35b7 Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Thu, 11 May 2023 12:08:03 +0100 Subject: [PATCH 011/186] Added 33.5 and completed 30.5 --- ...30.5-prop-groups-with-variants.problem.tsx | 4 +- ...5-prop-groups-with-variants.solution.1.tsx | 39 +++++++++++++++++ ...5-prop-groups-with-variants.solution.2.tsx | 39 +++++++++++++++++ ...3.5-function-overloads-in-hooks.problem.ts | 35 +++++++++++++++ ...-function-overloads-in-hooks.solution.1.ts | 43 +++++++++++++++++++ ...-function-overloads-in-hooks.solution.2.ts | 42 ++++++++++++++++++ 6 files changed, 199 insertions(+), 3 deletions(-) create mode 100644 src/04-advanced-components/30.5-prop-groups-with-variants.solution.1.tsx create mode 100644 src/04-advanced-components/30.5-prop-groups-with-variants.solution.2.tsx create mode 100644 src/05-advanced-hooks/33.5-function-overloads-in-hooks.problem.ts create mode 100644 src/05-advanced-hooks/33.5-function-overloads-in-hooks.solution.1.ts create mode 100644 src/05-advanced-hooks/33.5-function-overloads-in-hooks.solution.2.ts diff --git a/src/04-advanced-components/30.5-prop-groups-with-variants.problem.tsx b/src/04-advanced-components/30.5-prop-groups-with-variants.problem.tsx index df9b2d7..ea7573d 100644 --- a/src/04-advanced-components/30.5-prop-groups-with-variants.problem.tsx +++ b/src/04-advanced-components/30.5-prop-groups-with-variants.problem.tsx @@ -1,5 +1,3 @@ -// WIP - import { ComponentProps } from "react"; const buttonPropsMap = { @@ -15,7 +13,7 @@ const buttonPropsMap = { className: "bg-green-500 text-white", type: "button", }, -} satisfies Record>; +}; type ButtonProps = { variant: keyof typeof buttonPropsMap; diff --git a/src/04-advanced-components/30.5-prop-groups-with-variants.solution.1.tsx b/src/04-advanced-components/30.5-prop-groups-with-variants.solution.1.tsx new file mode 100644 index 0000000..c9389dc --- /dev/null +++ b/src/04-advanced-components/30.5-prop-groups-with-variants.solution.1.tsx @@ -0,0 +1,39 @@ +import { ComponentProps } from "react"; + +const buttonPropsMap: Record> = { + reset: { + className: "bg-blue-500 text-white", + type: "reset", + }, + submit: { + className: "bg-gray-200 text-black", + type: "submit", + }, + next: { + className: "bg-green-500 text-white", + type: "button", + }, +}; + +type ButtonProps = { + variant: keyof typeof buttonPropsMap; +}; + +export const Button = (props: ButtonProps) => { + return ; +}; + +const Parent = () => { + return ( + <> + + + + + {/* @ts-expect-error */} + + {/* @ts-expect-error */} + + + ); +}; diff --git a/src/04-advanced-components/30.5-prop-groups-with-variants.solution.2.tsx b/src/04-advanced-components/30.5-prop-groups-with-variants.solution.2.tsx new file mode 100644 index 0000000..bd57e13 --- /dev/null +++ b/src/04-advanced-components/30.5-prop-groups-with-variants.solution.2.tsx @@ -0,0 +1,39 @@ +import { ComponentProps } from "react"; + +const buttonPropsMap = { + reset: { + className: "bg-blue-500 text-white", + type: "reset", + }, + submit: { + className: "bg-gray-200 text-black", + type: "submit", + }, + next: { + className: "bg-green-500 text-white", + type: "button", + }, +} satisfies Record>; + +type ButtonProps = { + variant: keyof typeof buttonPropsMap; +}; + +export const Button = (props: ButtonProps) => { + return ; +}; + +const Parent = () => { + return ( + <> + + + + + {/* @ts-expect-error */} + + {/* @ts-expect-error */} + + + ); +}; diff --git a/src/05-advanced-hooks/33.5-function-overloads-in-hooks.problem.ts b/src/05-advanced-hooks/33.5-function-overloads-in-hooks.problem.ts new file mode 100644 index 0000000..23703a6 --- /dev/null +++ b/src/05-advanced-hooks/33.5-function-overloads-in-hooks.problem.ts @@ -0,0 +1,35 @@ +import { useState } from "react"; +import { Equal, Expect } from "../helpers/type-utils"; + +export const useStateAsObject = (initial: T) => { + const [value, set] = useState(initial); + + return { + value, + set, + }; +}; + +const example = useStateAsObject({ name: "Matt" }); + +type ExampleTests = [ + Expect>, + Expect< + Equal< + typeof example.set, + React.Dispatch> + > + >, +]; + +const num = useStateAsObject(); + +type NumTests = [ + Expect>, + Expect< + Equal< + typeof num.set, + React.Dispatch> + > + >, +]; diff --git a/src/05-advanced-hooks/33.5-function-overloads-in-hooks.solution.1.ts b/src/05-advanced-hooks/33.5-function-overloads-in-hooks.solution.1.ts new file mode 100644 index 0000000..2cdeedf --- /dev/null +++ b/src/05-advanced-hooks/33.5-function-overloads-in-hooks.solution.1.ts @@ -0,0 +1,43 @@ +import { useState } from "react"; +import { Equal, Expect } from "../helpers/type-utils"; + +export function useStateAsObject(): { + value: T | undefined; + set: React.Dispatch>; +}; +export function useStateAsObject(initial: T): { + value: T; + set: React.Dispatch>; +}; +export function useStateAsObject(initial?: T) { + const [value, set] = useState(initial); + + return { + value, + set, + }; +} + +const example = useStateAsObject({ name: "Matt" }); + +type ExampleTests = [ + Expect>, + Expect< + Equal< + typeof example.set, + React.Dispatch> + > + >, +]; + +const num = useStateAsObject(); + +type NumTests = [ + Expect>, + Expect< + Equal< + typeof num.set, + React.Dispatch> + > + >, +]; diff --git a/src/05-advanced-hooks/33.5-function-overloads-in-hooks.solution.2.ts b/src/05-advanced-hooks/33.5-function-overloads-in-hooks.solution.2.ts new file mode 100644 index 0000000..2e58922 --- /dev/null +++ b/src/05-advanced-hooks/33.5-function-overloads-in-hooks.solution.2.ts @@ -0,0 +1,42 @@ +import { useState } from "react"; +import { Equal, Expect } from "../helpers/type-utils"; + +type UseStateReturnValue = { + value: T; + set: React.Dispatch>; +}; + +export function useStateAsObject(): UseStateReturnValue; +export function useStateAsObject(initial: T): UseStateReturnValue; +export function useStateAsObject(initial?: T) { + const [value, set] = useState(initial); + + return { + value, + set, + }; +} + +const example = useStateAsObject({ name: "Matt" }); + +type ExampleTests = [ + Expect>, + Expect< + Equal< + typeof example.set, + React.Dispatch> + > + >, +]; + +const num = useStateAsObject(); + +type NumTests = [ + Expect>, + Expect< + Equal< + typeof num.set, + React.Dispatch> + > + >, +]; From 9474019c424dd077a0dabbaaa287644ccc05e470 Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Thu, 11 May 2023 12:08:59 +0100 Subject: [PATCH 012/186] Reordering --- scripts/tests/__snapshots__/all.test.ts.snap | 257 ++++++++++-------- ... 31-prop-groups-with-variants.problem.tsx} | 0 ...-prop-groups-with-variants.solution.1.tsx} | 0 ...-prop-groups-with-variants.solution.2.tsx} | 0 ...m.ts => 32-typing-custom-hooks.problem.ts} | 0 ...s => 32-typing-custom-hooks.solution.1.ts} | 0 ...s => 32-typing-custom-hooks.solution.2.ts} | 0 ...s => 32-typing-custom-hooks.solution.3.ts} | 0 ...lem.ts => 33-tuple-return-type.problem.ts} | 0 ....ts => 33-tuple-return-type.solution.1.ts} | 0 ....ts => 33-tuple-return-type.solution.2.ts} | 0 ...problem.ts => 34-generic-hooks.problem.ts} | 0 ...on.1.ts => 34-generic-hooks.solution.1.ts} | 0 ...on.2.ts => 34-generic-hooks.solution.2.ts} | 0 ...on.3.ts => 34-generic-hooks.solution.3.ts} | 0 ...on.4.ts => 34-generic-hooks.solution.4.ts} | 0 ...on.5.ts => 34-generic-hooks.solution.5.ts} | 0 ...35-function-overloads-in-hooks.problem.ts} | 0 ...function-overloads-in-hooks.solution.1.ts} | 0 ...function-overloads-in-hooks.solution.2.ts} | 0 ...> 36-generic-localstorage-hook.problem.ts} | 0 ... 36-generic-localstorage-hook.solution.ts} | 0 ...ic-localstorage-hook-with-zod.problem.tsx} | 0 ...c-localstorage-hook-with-zod.solution.tsx} | 0 ....tsx => 38-unions-in-usestate.problem.tsx} | 0 ...tsx => 38-unions-in-usestate.solution.tsx} | 0 ...criminated-unions-in-usestate.problem.tsx} | 0 ...riminated-unions-in-usestate.solution.tsx} | 0 ...nion-returns-from-custom-hooks.problem.ts} | 0 ...ated-tuples-from-custom-hooks.problem.tsx} | 0 ...ted-tuples-from-custom-hooks.solution.tsx} | 0 ...stand-react-namespace-export.explainer.ts} | 0 ...3-understanding-jsx-element.explainer.tsx} | 0 ...> 44-strongly-typing-children.problem.tsx} | 0 ...ow-does-react-represent-html.explainer.ts} | 0 ...nding-jsx-intrinsic-elements.explainer.ts} | 0 ... => 46-add-new-global-element.problem.tsx} | 0 ...add-attribute-to-all-elements.problem.tsx} | 0 ...d-attribute-to-audio-elements.problem.tsx} | 0 ...add-attribute-to-div-elements.problem.tsx} | 0 ...lem.tsx => 50-generic-context.problem.tsx} | 0 ...tsx => 51-compound-components.problem.tsx} | 0 ...problem.tsx => 52-forward-ref.problem.tsx} | 0 ...{51-hoc-problem.tsx => 53-hoc-problem.tsx} | 0 ...rop.problem.tsx => 54-as-prop.problem.tsx} | 0 ...lution.1.tsx => 54-as-prop.solution.1.tsx} | 0 ...lution.2.tsx => 54-as-prop.solution.2.tsx} | 0 ...s-prop-with-custom-components.problem.tsx} | 0 ...-prop-with-custom-components.solution.tsx} | 0 ...roblem.tsx => 56-render-props.problem.tsx} | 0 ...57-render-props-with-generics.problem.tsx} | 0 ...of-components-with-same-props.problem.tsx} | 0 ...lem.tsx => 59-react-hook-form.problem.tsx} | 0 ...problem.tsx => 60-react-query.problem.tsx} | 0 ...oblem.tsx => 61-redux-toolkit.problem.tsx} | 0 ...and.problem.tsx => 62-zustand.problem.tsx} | 0 ...eusable-form-library-with-zod.problem.tsx} | 0 57 files changed, 148 insertions(+), 109 deletions(-) rename src/04-advanced-components/{30.5-prop-groups-with-variants.problem.tsx => 31-prop-groups-with-variants.problem.tsx} (100%) rename src/04-advanced-components/{30.5-prop-groups-with-variants.solution.1.tsx => 31-prop-groups-with-variants.solution.1.tsx} (100%) rename src/04-advanced-components/{30.5-prop-groups-with-variants.solution.2.tsx => 31-prop-groups-with-variants.solution.2.tsx} (100%) rename src/05-advanced-hooks/{31-typing-custom-hooks.problem.ts => 32-typing-custom-hooks.problem.ts} (100%) rename src/05-advanced-hooks/{31-typing-custom-hooks.solution.1.ts => 32-typing-custom-hooks.solution.1.ts} (100%) rename src/05-advanced-hooks/{31-typing-custom-hooks.solution.2.ts => 32-typing-custom-hooks.solution.2.ts} (100%) rename src/05-advanced-hooks/{31-typing-custom-hooks.solution.3.ts => 32-typing-custom-hooks.solution.3.ts} (100%) rename src/05-advanced-hooks/{32-tuple-return-type.problem.ts => 33-tuple-return-type.problem.ts} (100%) rename src/05-advanced-hooks/{32-tuple-return-type.solution.1.ts => 33-tuple-return-type.solution.1.ts} (100%) rename src/05-advanced-hooks/{32-tuple-return-type.solution.2.ts => 33-tuple-return-type.solution.2.ts} (100%) rename src/05-advanced-hooks/{33-generic-hooks.problem.ts => 34-generic-hooks.problem.ts} (100%) rename src/05-advanced-hooks/{33-generic-hooks.solution.1.ts => 34-generic-hooks.solution.1.ts} (100%) rename src/05-advanced-hooks/{33-generic-hooks.solution.2.ts => 34-generic-hooks.solution.2.ts} (100%) rename src/05-advanced-hooks/{33-generic-hooks.solution.3.ts => 34-generic-hooks.solution.3.ts} (100%) rename src/05-advanced-hooks/{33-generic-hooks.solution.4.ts => 34-generic-hooks.solution.4.ts} (100%) rename src/05-advanced-hooks/{33-generic-hooks.solution.5.ts => 34-generic-hooks.solution.5.ts} (100%) rename src/05-advanced-hooks/{33.5-function-overloads-in-hooks.problem.ts => 35-function-overloads-in-hooks.problem.ts} (100%) rename src/05-advanced-hooks/{33.5-function-overloads-in-hooks.solution.1.ts => 35-function-overloads-in-hooks.solution.1.ts} (100%) rename src/05-advanced-hooks/{33.5-function-overloads-in-hooks.solution.2.ts => 35-function-overloads-in-hooks.solution.2.ts} (100%) rename src/05-advanced-hooks/{34-generic-localstorage-hook.problem.ts => 36-generic-localstorage-hook.problem.ts} (100%) rename src/05-advanced-hooks/{34-generic-localstorage-hook.solution.ts => 36-generic-localstorage-hook.solution.ts} (100%) rename src/05-advanced-hooks/{35-generic-localstorage-hook-with-zod.problem.tsx => 37-generic-localstorage-hook-with-zod.problem.tsx} (100%) rename src/05-advanced-hooks/{35-generic-localstorage-hook-with-zod.solution.tsx => 37-generic-localstorage-hook-with-zod.solution.tsx} (100%) rename src/05-advanced-hooks/{36-unions-in-usestate.problem.tsx => 38-unions-in-usestate.problem.tsx} (100%) rename src/05-advanced-hooks/{36-unions-in-usestate.solution.tsx => 38-unions-in-usestate.solution.tsx} (100%) rename src/05-advanced-hooks/{37-discriminated-unions-in-usestate.problem.tsx => 39-discriminated-unions-in-usestate.problem.tsx} (100%) rename src/05-advanced-hooks/{37-discriminated-unions-in-usestate.solution.tsx => 39-discriminated-unions-in-usestate.solution.tsx} (100%) rename src/05-advanced-hooks/{38-discriminated-union-returns-from-custom-hooks.problem.ts => 40-discriminated-union-returns-from-custom-hooks.problem.ts} (100%) rename src/05-advanced-hooks/{39-discriminated-tuples-from-custom-hooks.problem.tsx => 41-discriminated-tuples-from-custom-hooks.problem.tsx} (100%) rename src/05-advanced-hooks/{39-discriminated-tuples-from-custom-hooks.solution.tsx => 41-discriminated-tuples-from-custom-hooks.solution.tsx} (100%) rename src/06-types-deep-dive/{40-understand-react-namespace-export.explainer.ts => 42-understand-react-namespace-export.explainer.ts} (100%) rename src/06-types-deep-dive/{41-understanding-jsx-element.explainer.tsx => 43-understanding-jsx-element.explainer.tsx} (100%) rename src/06-types-deep-dive/{42-strongly-typing-children.problem.tsx => 44-strongly-typing-children.problem.tsx} (100%) rename src/06-types-deep-dive/{43-how-does-react-represent-html.explainer.ts => 45-how-does-react-represent-html.explainer.ts} (100%) rename src/06-types-deep-dive/{43-understanding-jsx-intrinsic-elements.explainer.ts => 45-understanding-jsx-intrinsic-elements.explainer.ts} (100%) rename src/06-types-deep-dive/{44-add-new-global-element.problem.tsx => 46-add-new-global-element.problem.tsx} (100%) rename src/06-types-deep-dive/{45-add-attribute-to-all-elements.problem.tsx => 47-add-attribute-to-all-elements.problem.tsx} (100%) rename src/06-types-deep-dive/{46-add-attribute-to-audio-elements.problem.tsx => 48-add-attribute-to-audio-elements.problem.tsx} (100%) rename src/06-types-deep-dive/{47-add-attribute-to-div-elements.problem.tsx => 49-add-attribute-to-div-elements.problem.tsx} (100%) rename src/07-advanced-patterns/{48-generic-context.problem.tsx => 50-generic-context.problem.tsx} (100%) rename src/07-advanced-patterns/{49-compound-components.problem.tsx => 51-compound-components.problem.tsx} (100%) rename src/07-advanced-patterns/{50-forward-ref.problem.tsx => 52-forward-ref.problem.tsx} (100%) rename src/07-advanced-patterns/{51-hoc-problem.tsx => 53-hoc-problem.tsx} (100%) rename src/07-advanced-patterns/{52-as-prop.problem.tsx => 54-as-prop.problem.tsx} (100%) rename src/07-advanced-patterns/{52-as-prop.solution.1.tsx => 54-as-prop.solution.1.tsx} (100%) rename src/07-advanced-patterns/{52-as-prop.solution.2.tsx => 54-as-prop.solution.2.tsx} (100%) rename src/07-advanced-patterns/{53-as-prop-with-custom-components.problem.tsx => 55-as-prop-with-custom-components.problem.tsx} (100%) rename src/07-advanced-patterns/{53-as-prop-with-custom-components.solution.tsx => 55-as-prop-with-custom-components.solution.tsx} (100%) rename src/07-advanced-patterns/{54-render-props.problem.tsx => 56-render-props.problem.tsx} (100%) rename src/07-advanced-patterns/{55-render-props-with-generics.problem.tsx => 57-render-props-with-generics.problem.tsx} (100%) rename src/07-advanced-patterns/{56-record-of-components-with-same-props.problem.tsx => 58-record-of-components-with-same-props.problem.tsx} (100%) rename src/08-external-libraries/{57-react-hook-form.problem.tsx => 59-react-hook-form.problem.tsx} (100%) rename src/08-external-libraries/{58-react-query.problem.tsx => 60-react-query.problem.tsx} (100%) rename src/08-external-libraries/{59-redux-toolkit.problem.tsx => 61-redux-toolkit.problem.tsx} (100%) rename src/08-external-libraries/{60-zustand.problem.tsx => 62-zustand.problem.tsx} (100%) rename src/08-external-libraries/{61-reusable-form-library-with-zod.problem.tsx => 63-reusable-form-library-with-zod.problem.tsx} (100%) diff --git a/scripts/tests/__snapshots__/all.test.ts.snap b/scripts/tests/__snapshots__/all.test.ts.snap index ca54c6d..c8eee20 100644 --- a/scripts/tests/__snapshots__/all.test.ts.snap +++ b/scripts/tests/__snapshots__/all.test.ts.snap @@ -85,36 +85,45 @@ src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.so Type 'number' is not assignable to type 'ReactElement'. src/04-advanced-components/28-generic-props.problem.tsx(38,9): error TS2578: Unused '@ts-expect-error' directive. src/04-advanced-components/28-generic-props.problem.tsx(50,17): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/31-typing-custom-hooks.problem.ts(4,23): error TS7006: Parameter 'defaultId' implicitly has an 'any' type. -src/05-advanced-hooks/31-typing-custom-hooks.problem.ts(10,22): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/32-tuple-return-type.problem.ts(13,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/32-tuple-return-type.problem.ts(14,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/33-generic-hooks.problem.ts(16,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/33-generic-hooks.problem.ts(18,5): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/33-generic-hooks.problem.ts(28,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/33-generic-hooks.problem.ts(29,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts(15,30): error TS2558: Expected 0 type arguments, but got 1. -src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts(22,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts(28,5): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx(26,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx(32,5): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/36-unions-in-usestate.problem.tsx(49,3): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/36-unions-in-usestate.problem.tsx(66,22): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx(37,3): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx(40,3): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx(43,3): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx(31,25): error TS18048: 'value' is possibly 'undefined'. -src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx(31,31): error TS2339: Property 'message' does not exist on type 'Error | { title: string; }'. +src/04-advanced-components/31-prop-groups-with-variants.problem.tsx(23,11): error TS2322: Type '{ children: string; className: string; type: string; } | { children: string; className: string; type: string; } | { children: string; className: string; type: string; }' is not assignable to type 'DetailedHTMLProps, HTMLButtonElement>'. + Type '{ children: string; className: string; type: string; }' is not assignable to type 'DetailedHTMLProps, HTMLButtonElement>'. + Type '{ children: string; className: string; type: string; }' is not assignable to type 'ButtonHTMLAttributes'. + Types of property 'type' are incompatible. + Type 'string' is not assignable to type '\\"button\\" | \\"submit\\" | \\"reset\\" | undefined'. +src/04-advanced-components/31-prop-groups-with-variants.solution.1.tsx(33,8): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/32-typing-custom-hooks.problem.ts(4,23): error TS7006: Parameter 'defaultId' implicitly has an 'any' type. +src/05-advanced-hooks/32-typing-custom-hooks.problem.ts(10,22): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/33-tuple-return-type.problem.ts(13,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/33-tuple-return-type.problem.ts(14,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/34-generic-hooks.problem.ts(16,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/34-generic-hooks.problem.ts(18,5): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/34-generic-hooks.problem.ts(28,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/34-generic-hooks.problem.ts(29,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/35-function-overloads-in-hooks.problem.ts(25,13): error TS2554: Expected 1 arguments, but got 0. +src/05-advanced-hooks/35-function-overloads-in-hooks.problem.ts(28,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/35-function-overloads-in-hooks.problem.ts(30,5): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/36-generic-localstorage-hook.problem.ts(15,30): error TS2558: Expected 0 type arguments, but got 1. +src/05-advanced-hooks/36-generic-localstorage-hook.problem.ts(22,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/36-generic-localstorage-hook.problem.ts(28,5): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.problem.tsx(26,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.problem.tsx(32,5): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/38-unions-in-usestate.problem.tsx(49,3): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/38-unions-in-usestate.problem.tsx(66,22): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/39-discriminated-unions-in-usestate.problem.tsx(37,3): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/39-discriminated-unions-in-usestate.problem.tsx(40,3): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/39-discriminated-unions-in-usestate.problem.tsx(43,3): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx(31,25): error TS18048: 'value' is possibly 'undefined'. +src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx(31,31): error TS2339: Property 'message' does not exist on type 'Error | { title: string; }'. Property 'message' does not exist on type '{ title: string; }'. -src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx(34,16): error TS18048: 'value' is possibly 'undefined'. -src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx(34,22): error TS2339: Property 'title' does not exist on type 'Error | { title: string; }'. +src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx(34,16): error TS18048: 'value' is possibly 'undefined'. +src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx(34,22): error TS2339: Property 'title' does not exist on type 'Error | { title: string; }'. Property 'title' does not exist on type 'Error'. -src/06-types-deep-dive/47-add-attribute-to-div-elements.problem.tsx(6,7): error TS2717: Subsequent property declarations must have the same type. Property 'div' must be of type 'DetailedHTMLProps, HTMLDivElement>', but here has type 'ClassAttributes & HTMLAttributes & { something?: string | undefined; }'. -src/06-types-deep-dive/47-add-attribute-to-div-elements.problem.tsx(13,30): error TS2322: Type '{ something: string; }' is not assignable to type 'DetailedHTMLProps, HTMLDivElement>'. +src/06-types-deep-dive/49-add-attribute-to-div-elements.problem.tsx(6,7): error TS2717: Subsequent property declarations must have the same type. Property 'div' must be of type 'DetailedHTMLProps, HTMLDivElement>', but here has type 'ClassAttributes & HTMLAttributes & { something?: string | undefined; }'. +src/06-types-deep-dive/49-add-attribute-to-div-elements.problem.tsx(13,30): error TS2322: Type '{ something: string; }' is not assignable to type 'DetailedHTMLProps, HTMLDivElement>'. Property 'something' does not exist on type 'DetailedHTMLProps, HTMLDivElement>'. -src/07-advanced-patterns/52-as-prop.solution.1.tsx(18,5): error TS2322: Type '{ as: \\"div\\"; href: string; }' is not assignable to type 'IntrinsicAttributes & AsProps'. +src/07-advanced-patterns/54-as-prop.solution.1.tsx(18,5): error TS2322: Type '{ as: \\"div\\"; href: string; }' is not assignable to type 'IntrinsicAttributes & AsProps'. Property 'href' does not exist on type 'IntrinsicAttributes & { as: \\"div\\"; } & ClassAttributes & HTMLAttributes'. Did you mean 'ref'? -src/07-advanced-patterns/53-as-prop-with-custom-components.problem.tsx(12,35): error TS2322: Type '{ as: (props: { href: string; children?: ReactNode; }) => Element; href: string; }' is not assignable to type 'IntrinsicAttributes & { as: any; }'. +src/07-advanced-patterns/55-as-prop-with-custom-components.problem.tsx(12,35): error TS2322: Type '{ as: (props: { href: string; children?: ReactNode; }) => Element; href: string; }' is not assignable to type 'IntrinsicAttributes & { as: any; }'. Property 'href' does not exist on type 'IntrinsicAttributes & { as: any; }'. ," `; @@ -556,89 +565,119 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` "name": "/src/04-advanced-components/30-variants-with-classnames.solution.tsx", "status": "passed", }, + { + "assertionResults": [], + "message": "No test found in suite src/04-advanced-components/31-prop-groups-with-variants.problem.tsx", + "name": "/src/04-advanced-components/31-prop-groups-with-variants.problem.tsx", + "status": "passed", + }, + { + "assertionResults": [], + "message": "No test found in suite src/04-advanced-components/31-prop-groups-with-variants.solution.1.tsx", + "name": "/src/04-advanced-components/31-prop-groups-with-variants.solution.1.tsx", + "status": "passed", + }, { "assertionResults": [], "message": "Transform failed with 1 error: -/src/04-advanced-components/30.5-prop-groups-with-variants.problem.tsx:18:2: ERROR: Expected \\";\\" but found \\"satisfies\\"", - "name": "/src/04-advanced-components/30.5-prop-groups-with-variants.problem.tsx", +/src/04-advanced-components/31-prop-groups-with-variants.solution.2.tsx:16:2: ERROR: Expected \\";\\" but found \\"satisfies\\"", + "name": "/src/04-advanced-components/31-prop-groups-with-variants.solution.2.tsx", + "status": "passed", + }, + { + "assertionResults": [], + "message": "No test found in suite src/05-advanced-hooks/32-typing-custom-hooks.problem.ts", + "name": "/src/05-advanced-hooks/32-typing-custom-hooks.problem.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/31-typing-custom-hooks.problem.ts", - "name": "/src/05-advanced-hooks/31-typing-custom-hooks.problem.ts", + "message": "No test found in suite src/05-advanced-hooks/32-typing-custom-hooks.solution.1.ts", + "name": "/src/05-advanced-hooks/32-typing-custom-hooks.solution.1.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/31-typing-custom-hooks.solution.1.ts", - "name": "/src/05-advanced-hooks/31-typing-custom-hooks.solution.1.ts", + "message": "No test found in suite src/05-advanced-hooks/32-typing-custom-hooks.solution.2.ts", + "name": "/src/05-advanced-hooks/32-typing-custom-hooks.solution.2.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/31-typing-custom-hooks.solution.2.ts", - "name": "/src/05-advanced-hooks/31-typing-custom-hooks.solution.2.ts", + "message": "No test found in suite src/05-advanced-hooks/32-typing-custom-hooks.solution.3.ts", + "name": "/src/05-advanced-hooks/32-typing-custom-hooks.solution.3.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/31-typing-custom-hooks.solution.3.ts", - "name": "/src/05-advanced-hooks/31-typing-custom-hooks.solution.3.ts", + "message": "Cannot read properties of null (reading 'useState')", + "name": "/src/05-advanced-hooks/33-tuple-return-type.problem.ts", + "status": "passed", + }, + { + "assertionResults": [], + "message": "Cannot read properties of null (reading 'useState')", + "name": "/src/05-advanced-hooks/33-tuple-return-type.solution.1.ts", + "status": "passed", + }, + { + "assertionResults": [], + "message": "Cannot read properties of null (reading 'useState')", + "name": "/src/05-advanced-hooks/33-tuple-return-type.solution.2.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/32-tuple-return-type.problem.ts", + "name": "/src/05-advanced-hooks/34-generic-hooks.problem.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/32-tuple-return-type.solution.1.ts", + "name": "/src/05-advanced-hooks/34-generic-hooks.solution.1.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/32-tuple-return-type.solution.2.ts", + "name": "/src/05-advanced-hooks/34-generic-hooks.solution.2.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/33-generic-hooks.problem.ts", + "name": "/src/05-advanced-hooks/34-generic-hooks.solution.3.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/33-generic-hooks.solution.1.ts", + "name": "/src/05-advanced-hooks/34-generic-hooks.solution.4.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/33-generic-hooks.solution.2.ts", + "name": "/src/05-advanced-hooks/34-generic-hooks.solution.5.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/33-generic-hooks.solution.3.ts", + "name": "/src/05-advanced-hooks/35-function-overloads-in-hooks.problem.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/33-generic-hooks.solution.4.ts", + "name": "/src/05-advanced-hooks/35-function-overloads-in-hooks.solution.1.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/33-generic-hooks.solution.5.ts", + "name": "/src/05-advanced-hooks/35-function-overloads-in-hooks.solution.2.ts", "status": "passed", }, { @@ -663,7 +702,7 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, ], "message": "", - "name": "/src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts", + "name": "/src/05-advanced-hooks/36-generic-localstorage-hook.problem.ts", "status": "passed", }, { @@ -688,7 +727,7 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, ], "message": "", - "name": "/src/05-advanced-hooks/34-generic-localstorage-hook.solution.ts", + "name": "/src/05-advanced-hooks/36-generic-localstorage-hook.solution.ts", "status": "passed", }, { @@ -713,7 +752,7 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, ], "message": "", - "name": "/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx", + "name": "/src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.problem.tsx", "status": "passed", }, { @@ -738,205 +777,205 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, ], "message": "", - "name": "/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.solution.tsx", + "name": "/src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/36-unions-in-usestate.problem.tsx", - "name": "/src/05-advanced-hooks/36-unions-in-usestate.problem.tsx", + "message": "No test found in suite src/05-advanced-hooks/38-unions-in-usestate.problem.tsx", + "name": "/src/05-advanced-hooks/38-unions-in-usestate.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/36-unions-in-usestate.solution.tsx", - "name": "/src/05-advanced-hooks/36-unions-in-usestate.solution.tsx", + "message": "No test found in suite src/05-advanced-hooks/38-unions-in-usestate.solution.tsx", + "name": "/src/05-advanced-hooks/38-unions-in-usestate.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx", - "name": "/src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx", + "message": "No test found in suite src/05-advanced-hooks/39-discriminated-unions-in-usestate.problem.tsx", + "name": "/src/05-advanced-hooks/39-discriminated-unions-in-usestate.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/37-discriminated-unions-in-usestate.solution.tsx", - "name": "/src/05-advanced-hooks/37-discriminated-unions-in-usestate.solution.tsx", + "message": "No test found in suite src/05-advanced-hooks/39-discriminated-unions-in-usestate.solution.tsx", + "name": "/src/05-advanced-hooks/39-discriminated-unions-in-usestate.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/38-discriminated-union-returns-from-custom-hooks.problem.ts", - "name": "/src/05-advanced-hooks/38-discriminated-union-returns-from-custom-hooks.problem.ts", + "message": "No test found in suite src/05-advanced-hooks/40-discriminated-union-returns-from-custom-hooks.problem.ts", + "name": "/src/05-advanced-hooks/40-discriminated-union-returns-from-custom-hooks.problem.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx", - "name": "/src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx", + "message": "No test found in suite src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx", + "name": "/src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.solution.tsx", - "name": "/src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.solution.tsx", + "message": "No test found in suite src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.solution.tsx", + "name": "/src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/40-understand-react-namespace-export.explainer.ts", - "name": "/src/06-types-deep-dive/40-understand-react-namespace-export.explainer.ts", + "message": "No test found in suite src/06-types-deep-dive/42-understand-react-namespace-export.explainer.ts", + "name": "/src/06-types-deep-dive/42-understand-react-namespace-export.explainer.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/41-understanding-jsx-element.explainer.tsx", - "name": "/src/06-types-deep-dive/41-understanding-jsx-element.explainer.tsx", + "message": "No test found in suite src/06-types-deep-dive/43-understanding-jsx-element.explainer.tsx", + "name": "/src/06-types-deep-dive/43-understanding-jsx-element.explainer.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/42-strongly-typing-children.problem.tsx", - "name": "/src/06-types-deep-dive/42-strongly-typing-children.problem.tsx", + "message": "No test found in suite src/06-types-deep-dive/44-strongly-typing-children.problem.tsx", + "name": "/src/06-types-deep-dive/44-strongly-typing-children.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/43-how-does-react-represent-html.explainer.ts", - "name": "/src/06-types-deep-dive/43-how-does-react-represent-html.explainer.ts", + "message": "No test found in suite src/06-types-deep-dive/45-how-does-react-represent-html.explainer.ts", + "name": "/src/06-types-deep-dive/45-how-does-react-represent-html.explainer.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/43-understanding-jsx-intrinsic-elements.explainer.ts", - "name": "/src/06-types-deep-dive/43-understanding-jsx-intrinsic-elements.explainer.ts", + "message": "No test found in suite src/06-types-deep-dive/45-understanding-jsx-intrinsic-elements.explainer.ts", + "name": "/src/06-types-deep-dive/45-understanding-jsx-intrinsic-elements.explainer.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/44-add-new-global-element.problem.tsx", - "name": "/src/06-types-deep-dive/44-add-new-global-element.problem.tsx", + "message": "No test found in suite src/06-types-deep-dive/46-add-new-global-element.problem.tsx", + "name": "/src/06-types-deep-dive/46-add-new-global-element.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "/src/06-types-deep-dive/45-add-attribute-to-all-elements.problem.tsx", + "name": "/src/06-types-deep-dive/47-add-attribute-to-all-elements.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "/src/06-types-deep-dive/46-add-attribute-to-audio-elements.problem.tsx", + "name": "/src/06-types-deep-dive/48-add-attribute-to-audio-elements.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "/src/06-types-deep-dive/47-add-attribute-to-div-elements.problem.tsx", + "name": "/src/06-types-deep-dive/49-add-attribute-to-div-elements.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/48-generic-context.problem.tsx", - "name": "/src/07-advanced-patterns/48-generic-context.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/50-generic-context.problem.tsx", + "name": "/src/07-advanced-patterns/50-generic-context.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/49-compound-components.problem.tsx", - "name": "/src/07-advanced-patterns/49-compound-components.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/51-compound-components.problem.tsx", + "name": "/src/07-advanced-patterns/51-compound-components.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/50-forward-ref.problem.tsx", - "name": "/src/07-advanced-patterns/50-forward-ref.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/52-forward-ref.problem.tsx", + "name": "/src/07-advanced-patterns/52-forward-ref.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/51-hoc-problem.tsx", - "name": "/src/07-advanced-patterns/51-hoc-problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/53-hoc-problem.tsx", + "name": "/src/07-advanced-patterns/53-hoc-problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "/src/07-advanced-patterns/52-as-prop.problem.tsx", + "name": "/src/07-advanced-patterns/54-as-prop.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "/src/07-advanced-patterns/52-as-prop.solution.1.tsx", + "name": "/src/07-advanced-patterns/54-as-prop.solution.1.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "/src/07-advanced-patterns/52-as-prop.solution.2.tsx", + "name": "/src/07-advanced-patterns/54-as-prop.solution.2.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/53-as-prop-with-custom-components.problem.tsx", - "name": "/src/07-advanced-patterns/53-as-prop-with-custom-components.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/55-as-prop-with-custom-components.problem.tsx", + "name": "/src/07-advanced-patterns/55-as-prop-with-custom-components.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/53-as-prop-with-custom-components.solution.tsx", - "name": "/src/07-advanced-patterns/53-as-prop-with-custom-components.solution.tsx", + "message": "No test found in suite src/07-advanced-patterns/55-as-prop-with-custom-components.solution.tsx", + "name": "/src/07-advanced-patterns/55-as-prop-with-custom-components.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/54-render-props.problem.tsx", - "name": "/src/07-advanced-patterns/54-render-props.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/56-render-props.problem.tsx", + "name": "/src/07-advanced-patterns/56-render-props.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/55-render-props-with-generics.problem.tsx", - "name": "/src/07-advanced-patterns/55-render-props-with-generics.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/57-render-props-with-generics.problem.tsx", + "name": "/src/07-advanced-patterns/57-render-props-with-generics.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/56-record-of-components-with-same-props.problem.tsx", - "name": "/src/07-advanced-patterns/56-record-of-components-with-same-props.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/58-record-of-components-with-same-props.problem.tsx", + "name": "/src/07-advanced-patterns/58-record-of-components-with-same-props.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/57-react-hook-form.problem.tsx", - "name": "/src/08-external-libraries/57-react-hook-form.problem.tsx", + "message": "No test found in suite src/08-external-libraries/59-react-hook-form.problem.tsx", + "name": "/src/08-external-libraries/59-react-hook-form.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/58-react-query.problem.tsx", - "name": "/src/08-external-libraries/58-react-query.problem.tsx", + "message": "No test found in suite src/08-external-libraries/60-react-query.problem.tsx", + "name": "/src/08-external-libraries/60-react-query.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/59-redux-toolkit.problem.tsx", - "name": "/src/08-external-libraries/59-redux-toolkit.problem.tsx", + "message": "No test found in suite src/08-external-libraries/61-redux-toolkit.problem.tsx", + "name": "/src/08-external-libraries/61-redux-toolkit.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/60-zustand.problem.tsx", - "name": "/src/08-external-libraries/60-zustand.problem.tsx", + "message": "No test found in suite src/08-external-libraries/62-zustand.problem.tsx", + "name": "/src/08-external-libraries/62-zustand.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/61-reusable-form-library-with-zod.problem.tsx", - "name": "/src/08-external-libraries/61-reusable-form-library-with-zod.problem.tsx", + "message": "No test found in suite src/08-external-libraries/63-reusable-form-library-with-zod.problem.tsx", + "name": "/src/08-external-libraries/63-reusable-form-library-with-zod.problem.tsx", "status": "passed", }, ], diff --git a/src/04-advanced-components/30.5-prop-groups-with-variants.problem.tsx b/src/04-advanced-components/31-prop-groups-with-variants.problem.tsx similarity index 100% rename from src/04-advanced-components/30.5-prop-groups-with-variants.problem.tsx rename to src/04-advanced-components/31-prop-groups-with-variants.problem.tsx diff --git a/src/04-advanced-components/30.5-prop-groups-with-variants.solution.1.tsx b/src/04-advanced-components/31-prop-groups-with-variants.solution.1.tsx similarity index 100% rename from src/04-advanced-components/30.5-prop-groups-with-variants.solution.1.tsx rename to src/04-advanced-components/31-prop-groups-with-variants.solution.1.tsx diff --git a/src/04-advanced-components/30.5-prop-groups-with-variants.solution.2.tsx b/src/04-advanced-components/31-prop-groups-with-variants.solution.2.tsx similarity index 100% rename from src/04-advanced-components/30.5-prop-groups-with-variants.solution.2.tsx rename to src/04-advanced-components/31-prop-groups-with-variants.solution.2.tsx diff --git a/src/05-advanced-hooks/31-typing-custom-hooks.problem.ts b/src/05-advanced-hooks/32-typing-custom-hooks.problem.ts similarity index 100% rename from src/05-advanced-hooks/31-typing-custom-hooks.problem.ts rename to src/05-advanced-hooks/32-typing-custom-hooks.problem.ts diff --git a/src/05-advanced-hooks/31-typing-custom-hooks.solution.1.ts b/src/05-advanced-hooks/32-typing-custom-hooks.solution.1.ts similarity index 100% rename from src/05-advanced-hooks/31-typing-custom-hooks.solution.1.ts rename to src/05-advanced-hooks/32-typing-custom-hooks.solution.1.ts diff --git a/src/05-advanced-hooks/31-typing-custom-hooks.solution.2.ts b/src/05-advanced-hooks/32-typing-custom-hooks.solution.2.ts similarity index 100% rename from src/05-advanced-hooks/31-typing-custom-hooks.solution.2.ts rename to src/05-advanced-hooks/32-typing-custom-hooks.solution.2.ts diff --git a/src/05-advanced-hooks/31-typing-custom-hooks.solution.3.ts b/src/05-advanced-hooks/32-typing-custom-hooks.solution.3.ts similarity index 100% rename from src/05-advanced-hooks/31-typing-custom-hooks.solution.3.ts rename to src/05-advanced-hooks/32-typing-custom-hooks.solution.3.ts diff --git a/src/05-advanced-hooks/32-tuple-return-type.problem.ts b/src/05-advanced-hooks/33-tuple-return-type.problem.ts similarity index 100% rename from src/05-advanced-hooks/32-tuple-return-type.problem.ts rename to src/05-advanced-hooks/33-tuple-return-type.problem.ts diff --git a/src/05-advanced-hooks/32-tuple-return-type.solution.1.ts b/src/05-advanced-hooks/33-tuple-return-type.solution.1.ts similarity index 100% rename from src/05-advanced-hooks/32-tuple-return-type.solution.1.ts rename to src/05-advanced-hooks/33-tuple-return-type.solution.1.ts diff --git a/src/05-advanced-hooks/32-tuple-return-type.solution.2.ts b/src/05-advanced-hooks/33-tuple-return-type.solution.2.ts similarity index 100% rename from src/05-advanced-hooks/32-tuple-return-type.solution.2.ts rename to src/05-advanced-hooks/33-tuple-return-type.solution.2.ts diff --git a/src/05-advanced-hooks/33-generic-hooks.problem.ts b/src/05-advanced-hooks/34-generic-hooks.problem.ts similarity index 100% rename from src/05-advanced-hooks/33-generic-hooks.problem.ts rename to src/05-advanced-hooks/34-generic-hooks.problem.ts diff --git a/src/05-advanced-hooks/33-generic-hooks.solution.1.ts b/src/05-advanced-hooks/34-generic-hooks.solution.1.ts similarity index 100% rename from src/05-advanced-hooks/33-generic-hooks.solution.1.ts rename to src/05-advanced-hooks/34-generic-hooks.solution.1.ts diff --git a/src/05-advanced-hooks/33-generic-hooks.solution.2.ts b/src/05-advanced-hooks/34-generic-hooks.solution.2.ts similarity index 100% rename from src/05-advanced-hooks/33-generic-hooks.solution.2.ts rename to src/05-advanced-hooks/34-generic-hooks.solution.2.ts diff --git a/src/05-advanced-hooks/33-generic-hooks.solution.3.ts b/src/05-advanced-hooks/34-generic-hooks.solution.3.ts similarity index 100% rename from src/05-advanced-hooks/33-generic-hooks.solution.3.ts rename to src/05-advanced-hooks/34-generic-hooks.solution.3.ts diff --git a/src/05-advanced-hooks/33-generic-hooks.solution.4.ts b/src/05-advanced-hooks/34-generic-hooks.solution.4.ts similarity index 100% rename from src/05-advanced-hooks/33-generic-hooks.solution.4.ts rename to src/05-advanced-hooks/34-generic-hooks.solution.4.ts diff --git a/src/05-advanced-hooks/33-generic-hooks.solution.5.ts b/src/05-advanced-hooks/34-generic-hooks.solution.5.ts similarity index 100% rename from src/05-advanced-hooks/33-generic-hooks.solution.5.ts rename to src/05-advanced-hooks/34-generic-hooks.solution.5.ts diff --git a/src/05-advanced-hooks/33.5-function-overloads-in-hooks.problem.ts b/src/05-advanced-hooks/35-function-overloads-in-hooks.problem.ts similarity index 100% rename from src/05-advanced-hooks/33.5-function-overloads-in-hooks.problem.ts rename to src/05-advanced-hooks/35-function-overloads-in-hooks.problem.ts diff --git a/src/05-advanced-hooks/33.5-function-overloads-in-hooks.solution.1.ts b/src/05-advanced-hooks/35-function-overloads-in-hooks.solution.1.ts similarity index 100% rename from src/05-advanced-hooks/33.5-function-overloads-in-hooks.solution.1.ts rename to src/05-advanced-hooks/35-function-overloads-in-hooks.solution.1.ts diff --git a/src/05-advanced-hooks/33.5-function-overloads-in-hooks.solution.2.ts b/src/05-advanced-hooks/35-function-overloads-in-hooks.solution.2.ts similarity index 100% rename from src/05-advanced-hooks/33.5-function-overloads-in-hooks.solution.2.ts rename to src/05-advanced-hooks/35-function-overloads-in-hooks.solution.2.ts diff --git a/src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts b/src/05-advanced-hooks/36-generic-localstorage-hook.problem.ts similarity index 100% rename from src/05-advanced-hooks/34-generic-localstorage-hook.problem.ts rename to src/05-advanced-hooks/36-generic-localstorage-hook.problem.ts diff --git a/src/05-advanced-hooks/34-generic-localstorage-hook.solution.ts b/src/05-advanced-hooks/36-generic-localstorage-hook.solution.ts similarity index 100% rename from src/05-advanced-hooks/34-generic-localstorage-hook.solution.ts rename to src/05-advanced-hooks/36-generic-localstorage-hook.solution.ts diff --git a/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx b/src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.problem.tsx similarity index 100% rename from src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.problem.tsx rename to src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.problem.tsx diff --git a/src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.solution.tsx b/src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.solution.tsx similarity index 100% rename from src/05-advanced-hooks/35-generic-localstorage-hook-with-zod.solution.tsx rename to src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.solution.tsx diff --git a/src/05-advanced-hooks/36-unions-in-usestate.problem.tsx b/src/05-advanced-hooks/38-unions-in-usestate.problem.tsx similarity index 100% rename from src/05-advanced-hooks/36-unions-in-usestate.problem.tsx rename to src/05-advanced-hooks/38-unions-in-usestate.problem.tsx diff --git a/src/05-advanced-hooks/36-unions-in-usestate.solution.tsx b/src/05-advanced-hooks/38-unions-in-usestate.solution.tsx similarity index 100% rename from src/05-advanced-hooks/36-unions-in-usestate.solution.tsx rename to src/05-advanced-hooks/38-unions-in-usestate.solution.tsx diff --git a/src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx b/src/05-advanced-hooks/39-discriminated-unions-in-usestate.problem.tsx similarity index 100% rename from src/05-advanced-hooks/37-discriminated-unions-in-usestate.problem.tsx rename to src/05-advanced-hooks/39-discriminated-unions-in-usestate.problem.tsx diff --git a/src/05-advanced-hooks/37-discriminated-unions-in-usestate.solution.tsx b/src/05-advanced-hooks/39-discriminated-unions-in-usestate.solution.tsx similarity index 100% rename from src/05-advanced-hooks/37-discriminated-unions-in-usestate.solution.tsx rename to src/05-advanced-hooks/39-discriminated-unions-in-usestate.solution.tsx diff --git a/src/05-advanced-hooks/38-discriminated-union-returns-from-custom-hooks.problem.ts b/src/05-advanced-hooks/40-discriminated-union-returns-from-custom-hooks.problem.ts similarity index 100% rename from src/05-advanced-hooks/38-discriminated-union-returns-from-custom-hooks.problem.ts rename to src/05-advanced-hooks/40-discriminated-union-returns-from-custom-hooks.problem.ts diff --git a/src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx b/src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx similarity index 100% rename from src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.problem.tsx rename to src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx diff --git a/src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.solution.tsx b/src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.solution.tsx similarity index 100% rename from src/05-advanced-hooks/39-discriminated-tuples-from-custom-hooks.solution.tsx rename to src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.solution.tsx diff --git a/src/06-types-deep-dive/40-understand-react-namespace-export.explainer.ts b/src/06-types-deep-dive/42-understand-react-namespace-export.explainer.ts similarity index 100% rename from src/06-types-deep-dive/40-understand-react-namespace-export.explainer.ts rename to src/06-types-deep-dive/42-understand-react-namespace-export.explainer.ts diff --git a/src/06-types-deep-dive/41-understanding-jsx-element.explainer.tsx b/src/06-types-deep-dive/43-understanding-jsx-element.explainer.tsx similarity index 100% rename from src/06-types-deep-dive/41-understanding-jsx-element.explainer.tsx rename to src/06-types-deep-dive/43-understanding-jsx-element.explainer.tsx diff --git a/src/06-types-deep-dive/42-strongly-typing-children.problem.tsx b/src/06-types-deep-dive/44-strongly-typing-children.problem.tsx similarity index 100% rename from src/06-types-deep-dive/42-strongly-typing-children.problem.tsx rename to src/06-types-deep-dive/44-strongly-typing-children.problem.tsx diff --git a/src/06-types-deep-dive/43-how-does-react-represent-html.explainer.ts b/src/06-types-deep-dive/45-how-does-react-represent-html.explainer.ts similarity index 100% rename from src/06-types-deep-dive/43-how-does-react-represent-html.explainer.ts rename to src/06-types-deep-dive/45-how-does-react-represent-html.explainer.ts diff --git a/src/06-types-deep-dive/43-understanding-jsx-intrinsic-elements.explainer.ts b/src/06-types-deep-dive/45-understanding-jsx-intrinsic-elements.explainer.ts similarity index 100% rename from src/06-types-deep-dive/43-understanding-jsx-intrinsic-elements.explainer.ts rename to src/06-types-deep-dive/45-understanding-jsx-intrinsic-elements.explainer.ts diff --git a/src/06-types-deep-dive/44-add-new-global-element.problem.tsx b/src/06-types-deep-dive/46-add-new-global-element.problem.tsx similarity index 100% rename from src/06-types-deep-dive/44-add-new-global-element.problem.tsx rename to src/06-types-deep-dive/46-add-new-global-element.problem.tsx diff --git a/src/06-types-deep-dive/45-add-attribute-to-all-elements.problem.tsx b/src/06-types-deep-dive/47-add-attribute-to-all-elements.problem.tsx similarity index 100% rename from src/06-types-deep-dive/45-add-attribute-to-all-elements.problem.tsx rename to src/06-types-deep-dive/47-add-attribute-to-all-elements.problem.tsx diff --git a/src/06-types-deep-dive/46-add-attribute-to-audio-elements.problem.tsx b/src/06-types-deep-dive/48-add-attribute-to-audio-elements.problem.tsx similarity index 100% rename from src/06-types-deep-dive/46-add-attribute-to-audio-elements.problem.tsx rename to src/06-types-deep-dive/48-add-attribute-to-audio-elements.problem.tsx diff --git a/src/06-types-deep-dive/47-add-attribute-to-div-elements.problem.tsx b/src/06-types-deep-dive/49-add-attribute-to-div-elements.problem.tsx similarity index 100% rename from src/06-types-deep-dive/47-add-attribute-to-div-elements.problem.tsx rename to src/06-types-deep-dive/49-add-attribute-to-div-elements.problem.tsx diff --git a/src/07-advanced-patterns/48-generic-context.problem.tsx b/src/07-advanced-patterns/50-generic-context.problem.tsx similarity index 100% rename from src/07-advanced-patterns/48-generic-context.problem.tsx rename to src/07-advanced-patterns/50-generic-context.problem.tsx diff --git a/src/07-advanced-patterns/49-compound-components.problem.tsx b/src/07-advanced-patterns/51-compound-components.problem.tsx similarity index 100% rename from src/07-advanced-patterns/49-compound-components.problem.tsx rename to src/07-advanced-patterns/51-compound-components.problem.tsx diff --git a/src/07-advanced-patterns/50-forward-ref.problem.tsx b/src/07-advanced-patterns/52-forward-ref.problem.tsx similarity index 100% rename from src/07-advanced-patterns/50-forward-ref.problem.tsx rename to src/07-advanced-patterns/52-forward-ref.problem.tsx diff --git a/src/07-advanced-patterns/51-hoc-problem.tsx b/src/07-advanced-patterns/53-hoc-problem.tsx similarity index 100% rename from src/07-advanced-patterns/51-hoc-problem.tsx rename to src/07-advanced-patterns/53-hoc-problem.tsx diff --git a/src/07-advanced-patterns/52-as-prop.problem.tsx b/src/07-advanced-patterns/54-as-prop.problem.tsx similarity index 100% rename from src/07-advanced-patterns/52-as-prop.problem.tsx rename to src/07-advanced-patterns/54-as-prop.problem.tsx diff --git a/src/07-advanced-patterns/52-as-prop.solution.1.tsx b/src/07-advanced-patterns/54-as-prop.solution.1.tsx similarity index 100% rename from src/07-advanced-patterns/52-as-prop.solution.1.tsx rename to src/07-advanced-patterns/54-as-prop.solution.1.tsx diff --git a/src/07-advanced-patterns/52-as-prop.solution.2.tsx b/src/07-advanced-patterns/54-as-prop.solution.2.tsx similarity index 100% rename from src/07-advanced-patterns/52-as-prop.solution.2.tsx rename to src/07-advanced-patterns/54-as-prop.solution.2.tsx diff --git a/src/07-advanced-patterns/53-as-prop-with-custom-components.problem.tsx b/src/07-advanced-patterns/55-as-prop-with-custom-components.problem.tsx similarity index 100% rename from src/07-advanced-patterns/53-as-prop-with-custom-components.problem.tsx rename to src/07-advanced-patterns/55-as-prop-with-custom-components.problem.tsx diff --git a/src/07-advanced-patterns/53-as-prop-with-custom-components.solution.tsx b/src/07-advanced-patterns/55-as-prop-with-custom-components.solution.tsx similarity index 100% rename from src/07-advanced-patterns/53-as-prop-with-custom-components.solution.tsx rename to src/07-advanced-patterns/55-as-prop-with-custom-components.solution.tsx diff --git a/src/07-advanced-patterns/54-render-props.problem.tsx b/src/07-advanced-patterns/56-render-props.problem.tsx similarity index 100% rename from src/07-advanced-patterns/54-render-props.problem.tsx rename to src/07-advanced-patterns/56-render-props.problem.tsx diff --git a/src/07-advanced-patterns/55-render-props-with-generics.problem.tsx b/src/07-advanced-patterns/57-render-props-with-generics.problem.tsx similarity index 100% rename from src/07-advanced-patterns/55-render-props-with-generics.problem.tsx rename to src/07-advanced-patterns/57-render-props-with-generics.problem.tsx diff --git a/src/07-advanced-patterns/56-record-of-components-with-same-props.problem.tsx b/src/07-advanced-patterns/58-record-of-components-with-same-props.problem.tsx similarity index 100% rename from src/07-advanced-patterns/56-record-of-components-with-same-props.problem.tsx rename to src/07-advanced-patterns/58-record-of-components-with-same-props.problem.tsx diff --git a/src/08-external-libraries/57-react-hook-form.problem.tsx b/src/08-external-libraries/59-react-hook-form.problem.tsx similarity index 100% rename from src/08-external-libraries/57-react-hook-form.problem.tsx rename to src/08-external-libraries/59-react-hook-form.problem.tsx diff --git a/src/08-external-libraries/58-react-query.problem.tsx b/src/08-external-libraries/60-react-query.problem.tsx similarity index 100% rename from src/08-external-libraries/58-react-query.problem.tsx rename to src/08-external-libraries/60-react-query.problem.tsx diff --git a/src/08-external-libraries/59-redux-toolkit.problem.tsx b/src/08-external-libraries/61-redux-toolkit.problem.tsx similarity index 100% rename from src/08-external-libraries/59-redux-toolkit.problem.tsx rename to src/08-external-libraries/61-redux-toolkit.problem.tsx diff --git a/src/08-external-libraries/60-zustand.problem.tsx b/src/08-external-libraries/62-zustand.problem.tsx similarity index 100% rename from src/08-external-libraries/60-zustand.problem.tsx rename to src/08-external-libraries/62-zustand.problem.tsx diff --git a/src/08-external-libraries/61-reusable-form-library-with-zod.problem.tsx b/src/08-external-libraries/63-reusable-form-library-with-zod.problem.tsx similarity index 100% rename from src/08-external-libraries/61-reusable-form-library-with-zod.problem.tsx rename to src/08-external-libraries/63-reusable-form-library-with-zod.problem.tsx From 7ef83f8369c205227d7f3527002928c67edf8f31 Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Thu, 11 May 2023 12:20:29 +0100 Subject: [PATCH 013/186] Added required context pattern --- .../50-generic-context.problem.tsx | 0 .../50-required-context.problem.tsx | 68 +++++++++++++++++++ .../50-required-context.solution.1.tsx | 68 +++++++++++++++++++ .../50-required-context.solution.2.tsx | 68 +++++++++++++++++++ 4 files changed, 204 insertions(+) delete mode 100644 src/07-advanced-patterns/50-generic-context.problem.tsx create mode 100644 src/07-advanced-patterns/50-required-context.problem.tsx create mode 100644 src/07-advanced-patterns/50-required-context.solution.1.tsx create mode 100644 src/07-advanced-patterns/50-required-context.solution.2.tsx diff --git a/src/07-advanced-patterns/50-generic-context.problem.tsx b/src/07-advanced-patterns/50-generic-context.problem.tsx deleted file mode 100644 index e69de29..0000000 diff --git a/src/07-advanced-patterns/50-required-context.problem.tsx b/src/07-advanced-patterns/50-required-context.problem.tsx new file mode 100644 index 0000000..9c9fa02 --- /dev/null +++ b/src/07-advanced-patterns/50-required-context.problem.tsx @@ -0,0 +1,68 @@ +import React from "react"; +import { Equal, Expect } from "../helpers/type-utils"; + +const createGenericContext = () => { + const context = React.createContext(null); + + const useContext = () => { + const contextValue = React.useContext(context); + + if (contextValue === null) { + throw new Error("Context value is null"); + } + + return contextValue; + }; + + return [useContext, context.Provider] as const; +}; + +const [useUser, UserProvider] = createGenericContext<{ + name: string; +}>(); + +const [useTheme, ThemeProvider] = createGenericContext<{ + primaryColor: string; +}>(); + +const Child = () => { + const user = useUser(); + + type test = Expect< + Equal< + typeof user, + { + name: string; + } + > + >; + + const theme = useTheme(); + + type test2 = Expect< + Equal< + typeof theme, + { + primaryColor: string; + } + > + >; + + return null; +}; + +const Parent = () => { + return ( + <> + + + + + + + ); +}; diff --git a/src/07-advanced-patterns/50-required-context.solution.1.tsx b/src/07-advanced-patterns/50-required-context.solution.1.tsx new file mode 100644 index 0000000..5a054f6 --- /dev/null +++ b/src/07-advanced-patterns/50-required-context.solution.1.tsx @@ -0,0 +1,68 @@ +import React from "react"; +import { Equal, Expect } from "../helpers/type-utils"; + +const createGenericContext = () => { + const context = React.createContext(null); + + const useContext = () => { + const contextValue = React.useContext(context); + + if (contextValue === null) { + throw new Error("Context value is null"); + } + + return contextValue; + }; + + return [useContext, context.Provider] as const; +}; + +const [useUser, UserProvider] = createGenericContext<{ + name: string; +}>(); + +const [useTheme, ThemeProvider] = createGenericContext<{ + primaryColor: string; +}>(); + +const Child = () => { + const user = useUser(); + + type test = Expect< + Equal< + typeof user, + { + name: string; + } + > + >; + + const theme = useTheme(); + + type test2 = Expect< + Equal< + typeof theme, + { + primaryColor: string; + } + > + >; + + return null; +}; + +const Parent = () => { + return ( + <> + + + + + + + ); +}; diff --git a/src/07-advanced-patterns/50-required-context.solution.2.tsx b/src/07-advanced-patterns/50-required-context.solution.2.tsx new file mode 100644 index 0000000..ec60018 --- /dev/null +++ b/src/07-advanced-patterns/50-required-context.solution.2.tsx @@ -0,0 +1,68 @@ +import React from "react"; +import { Equal, Expect } from "../helpers/type-utils"; + +const createGenericContext = (): [() => T, React.Provider] => { + const context = React.createContext(null); + + const useContext = (): T => { + const contextValue = React.useContext(context); + + if (contextValue === null) { + throw new Error("Context value is null"); + } + + return contextValue; + }; + + return [useContext, context.Provider]; +}; + +const [useUser, UserProvider] = createGenericContext<{ + name: string; +}>(); + +const [useTheme, ThemeProvider] = createGenericContext<{ + primaryColor: string; +}>(); + +const Child = () => { + const user = useUser(); + + type test = Expect< + Equal< + typeof user, + { + name: string; + } + > + >; + + const theme = useTheme(); + + type test2 = Expect< + Equal< + typeof theme, + { + primaryColor: string; + } + > + >; + + return null; +}; + +const Parent = () => { + return ( + <> + + + + + + + ); +}; From 3babb438d3d337ccb9c0c4b69518778a0ebdc070 Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Thu, 11 May 2023 14:59:12 +0100 Subject: [PATCH 014/186] More tweaks and changes --- .../50-required-context.problem.tsx | 6 ++-- .../50-required-context.solution.1.tsx | 6 ++-- .../50-required-context.solution.2.tsx | 6 ++-- ...forward-ref-with-generics.explainer.1.tsx} | 16 +++++----- ...-forward-ref-with-generics.explainer.2.tsx | 31 +++++++++++++++++++ .../54-as-prop.problem.tsx | 20 +++++++----- .../54-as-prop.solution.1.tsx | 2 +- .../54-as-prop.solution.2.tsx | 15 +++++++-- ...as-prop-with-custom-components.problem.tsx | 6 ++-- ...s-prop-with-custom-components.solution.tsx | 8 ++++- 10 files changed, 85 insertions(+), 31 deletions(-) rename src/07-advanced-patterns/{52-forward-ref.problem.tsx => 52-forward-ref-with-generics.explainer.1.tsx} (61%) create mode 100644 src/07-advanced-patterns/52-forward-ref-with-generics.explainer.2.tsx diff --git a/src/07-advanced-patterns/50-required-context.problem.tsx b/src/07-advanced-patterns/50-required-context.problem.tsx index 9c9fa02..61436c6 100644 --- a/src/07-advanced-patterns/50-required-context.problem.tsx +++ b/src/07-advanced-patterns/50-required-context.problem.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Equal, Expect } from "../helpers/type-utils"; -const createGenericContext = () => { +const createRequiredContext = () => { const context = React.createContext(null); const useContext = () => { @@ -17,11 +17,11 @@ const createGenericContext = () => { return [useContext, context.Provider] as const; }; -const [useUser, UserProvider] = createGenericContext<{ +const [useUser, UserProvider] = createRequiredContext<{ name: string; }>(); -const [useTheme, ThemeProvider] = createGenericContext<{ +const [useTheme, ThemeProvider] = createRequiredContext<{ primaryColor: string; }>(); diff --git a/src/07-advanced-patterns/50-required-context.solution.1.tsx b/src/07-advanced-patterns/50-required-context.solution.1.tsx index 5a054f6..8e6a29f 100644 --- a/src/07-advanced-patterns/50-required-context.solution.1.tsx +++ b/src/07-advanced-patterns/50-required-context.solution.1.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Equal, Expect } from "../helpers/type-utils"; -const createGenericContext = () => { +const createRequiredContext = () => { const context = React.createContext(null); const useContext = () => { @@ -17,11 +17,11 @@ const createGenericContext = () => { return [useContext, context.Provider] as const; }; -const [useUser, UserProvider] = createGenericContext<{ +const [useUser, UserProvider] = createRequiredContext<{ name: string; }>(); -const [useTheme, ThemeProvider] = createGenericContext<{ +const [useTheme, ThemeProvider] = createRequiredContext<{ primaryColor: string; }>(); diff --git a/src/07-advanced-patterns/50-required-context.solution.2.tsx b/src/07-advanced-patterns/50-required-context.solution.2.tsx index ec60018..2418dbb 100644 --- a/src/07-advanced-patterns/50-required-context.solution.2.tsx +++ b/src/07-advanced-patterns/50-required-context.solution.2.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Equal, Expect } from "../helpers/type-utils"; -const createGenericContext = (): [() => T, React.Provider] => { +const createRequiredContext = (): [() => T, React.Provider] => { const context = React.createContext(null); const useContext = (): T => { @@ -17,11 +17,11 @@ const createGenericContext = (): [() => T, React.Provider] => { return [useContext, context.Provider]; }; -const [useUser, UserProvider] = createGenericContext<{ +const [useUser, UserProvider] = createRequiredContext<{ name: string; }>(); -const [useTheme, ThemeProvider] = createGenericContext<{ +const [useTheme, ThemeProvider] = createRequiredContext<{ primaryColor: string; }>(); diff --git a/src/07-advanced-patterns/52-forward-ref.problem.tsx b/src/07-advanced-patterns/52-forward-ref-with-generics.explainer.1.tsx similarity index 61% rename from src/07-advanced-patterns/52-forward-ref.problem.tsx rename to src/07-advanced-patterns/52-forward-ref-with-generics.explainer.1.tsx index 31e7f20..bccbc84 100644 --- a/src/07-advanced-patterns/52-forward-ref.problem.tsx +++ b/src/07-advanced-patterns/52-forward-ref-with-generics.explainer.1.tsx @@ -1,4 +1,5 @@ import { ForwardedRef, forwardRef } from "react"; +import { Equal, Expect } from "../helpers/type-utils"; type Props = { data: T[]; @@ -11,19 +12,20 @@ type Props = { // ): (props: P & React.RefAttributes) => React.ReactElement | null; // } -export const Table = forwardRef( - (props: Props, ref: ForwardedRef) => { - return null; - }, -); +export const Table = (props: Props, ref: ForwardedRef) => { + return null; +}; + +const ForwardReffedTable = forwardRef(Table); const Parent = () => { return ( -
{ + type test = Expect>; return
123
; }} - >
+ > ); }; diff --git a/src/07-advanced-patterns/52-forward-ref-with-generics.explainer.2.tsx b/src/07-advanced-patterns/52-forward-ref-with-generics.explainer.2.tsx new file mode 100644 index 0000000..4990089 --- /dev/null +++ b/src/07-advanced-patterns/52-forward-ref-with-generics.explainer.2.tsx @@ -0,0 +1,31 @@ +import { ForwardedRef, forwardRef } from "react"; +import { Equal, Expect } from "../helpers/type-utils"; + +type Props = { + data: T[]; + renderRow: (item: T) => React.ReactNode; +}; + +/** + * It even works across module boundaries! + * + * Try uncommenting the declare module section in + * explainer.1.tsx, and watch the error below go away. + */ +export const Table = (props: Props, ref: ForwardedRef) => { + return null; +}; + +const ForwardReffedTable = forwardRef(Table); + +const Parent = () => { + return ( + { + type test = Expect>; + return
123
; + }} + >
+ ); +}; diff --git a/src/07-advanced-patterns/54-as-prop.problem.tsx b/src/07-advanced-patterns/54-as-prop.problem.tsx index 8a13a33..6aeeeca 100644 --- a/src/07-advanced-patterns/54-as-prop.problem.tsx +++ b/src/07-advanced-patterns/54-as-prop.problem.tsx @@ -1,12 +1,16 @@ -type AsProps = { - [K in keyof JSX.IntrinsicElements]: { - as: K; - } & JSX.IntrinsicElements[K]; -}[keyof JSX.IntrinsicElements]; - -export const Component = (props: AsProps) => { +export const Component = (props: any) => { const Comp = props.as; return ; }; -const yeah = ; +// Should work, and you should get autocomplete on the +// props for the 'a' tag +const example1 = ; + +const example2 = ( + +); diff --git a/src/07-advanced-patterns/54-as-prop.solution.1.tsx b/src/07-advanced-patterns/54-as-prop.solution.1.tsx index d9f8022..a081ed2 100644 --- a/src/07-advanced-patterns/54-as-prop.solution.1.tsx +++ b/src/07-advanced-patterns/54-as-prop.solution.1.tsx @@ -14,7 +14,7 @@ const example1 = ; const example2 = ( ); diff --git a/src/07-advanced-patterns/54-as-prop.solution.2.tsx b/src/07-advanced-patterns/54-as-prop.solution.2.tsx index 026d148..8129267 100644 --- a/src/07-advanced-patterns/54-as-prop.solution.2.tsx +++ b/src/07-advanced-patterns/54-as-prop.solution.2.tsx @@ -4,7 +4,18 @@ export const Component = ( } & JSX.IntrinsicElements[TAs], ) => { const Comp = props.as as string; - return ; + + // In this version, we can remove the 'as any' because + // TypeScript is able to keep up with the inference + return ; }; -const yeah = ; +const example1 = ; + +const example2 = ( + +); diff --git a/src/07-advanced-patterns/55-as-prop-with-custom-components.problem.tsx b/src/07-advanced-patterns/55-as-prop-with-custom-components.problem.tsx index 467182b..e19c44a 100644 --- a/src/07-advanced-patterns/55-as-prop-with-custom-components.problem.tsx +++ b/src/07-advanced-patterns/55-as-prop-with-custom-components.problem.tsx @@ -1,12 +1,12 @@ import React from "react"; -export const Component = (props: { as: any }) => { +export const Component = (props: { as: unknown }) => { const Comp = props.as; - return ; + return ; }; const Link = (props: { href: string; children?: React.ReactNode }) => { return {props.children}; }; -const yeah = ; +; diff --git a/src/07-advanced-patterns/55-as-prop-with-custom-components.solution.tsx b/src/07-advanced-patterns/55-as-prop-with-custom-components.solution.tsx index 7d189dc..7d51e2f 100644 --- a/src/07-advanced-patterns/55-as-prop-with-custom-components.solution.tsx +++ b/src/07-advanced-patterns/55-as-prop-with-custom-components.solution.tsx @@ -8,7 +8,13 @@ export const Component = < } & ComponentProps, ) => { const Comp = props.as; - return ; + return ( + + ); }; const Link = (props: { href: string; children?: React.ReactNode }) => { From f0f992aa157341f33a599fc6cb26cf6c75a5da6c Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Thu, 11 May 2023 16:51:22 +0100 Subject: [PATCH 015/186] Added total-typescript CLI --- package-lock.json | 169 +++++++++------------------------- package.json | 152 ++++++++++++++++++++++-------- scripts/exercise.js | 79 ---------------- scripts/prepare-stackblitz.js | 36 -------- scripts/tests/all.test.ts | 2 - 5 files changed, 156 insertions(+), 282 deletions(-) delete mode 100644 scripts/exercise.js delete mode 100644 scripts/prepare-stackblitz.js diff --git a/package-lock.json b/package-lock.json index 92d6dc4..199b979 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,16 +12,14 @@ "@types/express": "^4.17.13", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", - "cross-env": "^7.0.3", "express": "^4.18.1", "react": "^18.2.0", "react-dom": "^18.2.0", "zod": "^3.17.10" }, "devDependencies": { - "chokidar": "^3.5.3", + "@total-typescript/exercise-cli": "0.1.0", "cross-fetch": "^3.1.5", - "fast-glob": "^3.2.12", "jsdom": "^21.1.1", "prettier": "^2.8.7", "typescript": "^5.0.3", @@ -73,6 +71,20 @@ "node": ">= 10" } }, + "node_modules/@total-typescript/exercise-cli": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@total-typescript/exercise-cli/-/exercise-cli-0.1.0.tgz", + "integrity": "sha512-A6DpA9BK88sdhgyH/Qy/rrFwnu93Eh0OQd/oOb/4dSVxNIfvJ155CsBCEtKyp5iM2QKfIHYNfdJFcPut090esQ==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.3", + "commander": "^10.0.1", + "fast-glob": "^3.2.12" + }, + "bin": { + "tt-cli": "dist/bin.js" + } + }, "node_modules/@types/body-parser": { "version": "1.19.2", "license": "MIT", @@ -500,6 +512,15 @@ "node": ">= 0.8" } }, + "node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "engines": { + "node": ">=14" + } + }, "node_modules/content-disposition": { "version": "0.5.4", "license": "MIT", @@ -528,23 +549,6 @@ "version": "1.0.6", "license": "MIT" }, - "node_modules/cross-env": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", - "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", - "dependencies": { - "cross-spawn": "^7.0.1" - }, - "bin": { - "cross-env": "src/bin/cross-env.js", - "cross-env-shell": "src/bin/cross-env-shell.js" - }, - "engines": { - "node": ">=10.14", - "npm": ">=6", - "yarn": ">=1" - } - }, "node_modules/cross-fetch": { "version": "3.1.5", "dev": true, @@ -553,19 +557,6 @@ "node-fetch": "2.6.7" } }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/cssstyle": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", @@ -1252,11 +1243,6 @@ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -1593,14 +1579,6 @@ "node": ">= 0.8" } }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "engines": { - "node": ">=8" - } - }, "node_modules/path-parse": { "version": "1.0.7", "dev": true, @@ -1998,25 +1976,6 @@ "version": "1.2.0", "license": "ISC" }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "engines": { - "node": ">=8" - } - }, "node_modules/side-channel": { "version": "1.0.4", "license": "MIT", @@ -2630,20 +2589,6 @@ "webidl-conversions": "^3.0.0" } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/why-is-node-running": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", @@ -2758,6 +2703,17 @@ "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, + "@total-typescript/exercise-cli": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@total-typescript/exercise-cli/-/exercise-cli-0.1.0.tgz", + "integrity": "sha512-A6DpA9BK88sdhgyH/Qy/rrFwnu93Eh0OQd/oOb/4dSVxNIfvJ155CsBCEtKyp5iM2QKfIHYNfdJFcPut090esQ==", + "dev": true, + "requires": { + "chokidar": "^3.5.3", + "commander": "^10.0.1", + "fast-glob": "^3.2.12" + } + }, "@types/body-parser": { "version": "1.19.2", "requires": { @@ -3085,6 +3041,12 @@ "delayed-stream": "~1.0.0" } }, + "commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true + }, "content-disposition": { "version": "0.5.4", "requires": { @@ -3100,14 +3062,6 @@ "cookie-signature": { "version": "1.0.6" }, - "cross-env": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", - "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", - "requires": { - "cross-spawn": "^7.0.1" - } - }, "cross-fetch": { "version": "3.1.5", "dev": true, @@ -3115,16 +3069,6 @@ "node-fetch": "2.6.7" } }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, "cssstyle": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", @@ -3603,11 +3547,6 @@ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3831,11 +3770,6 @@ "parseurl": { "version": "1.3.3" }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" - }, "path-parse": { "version": "1.0.7", "dev": true @@ -4086,19 +4020,6 @@ "setprototypeof": { "version": "1.2.0" }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" - }, "side-channel": { "version": "1.0.4", "requires": { @@ -4475,14 +4396,6 @@ "webidl-conversions": "^3.0.0" } }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "requires": { - "isexe": "^2.0.0" - } - }, "why-is-node-running": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", diff --git a/package.json b/package.json index 3303f1c..f4eccac 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,8 @@ "author": "Matt Pocock ", "license": "GPL", "devDependencies": { - "chokidar": "^3.5.3", + "@total-typescript/exercise-cli": "0.1.0", "cross-fetch": "^3.1.5", - "fast-glob": "^3.2.12", "jsdom": "^21.1.1", "prettier": "^2.8.7", "typescript": "^5.0.3", @@ -15,54 +14,133 @@ "vitest": "^0.29.8" }, "scripts": { - "exercise": "node scripts/exercise.js", + "exercise": "tt-cli run", "e": "npm run exercise", - "solution": "cross-env SOLUTION=true node scripts/exercise.js", + "solution": "tt-cli run --solution", "s": "npm run solution", "ci": "(cd scripts/tests && npx vitest run)", "update-snapshots": "(cd scripts/tests && npx vitest run -u)", - "prepare": "node ./scripts/prepare-stackblitz.js", - "e-09": "npm run exercise -- 09", - "s-09": "npm run solution -- 09", - "e-10": "npm run exercise -- 10", - "s-10": "npm run solution -- 10", + "prepare": "tt-cli prepare-stackblitz", + "e-09": "tt-cli run 09", + "s-09": "tt-cli run 09 --solution", + "e-10": "tt-cli run 10", + "s-10": "tt-cli run 10 --solution", "e-18": "npm run exercise -- 18", "s-18": "npm run solution -- 18", - "e-19": "npm run exercise -- 19", - "s-19": "npm run solution -- 19", - "e-20": "npm run exercise -- 20", - "s-20": "npm run solution -- 20", - "e-21": "npm run exercise -- 21", - "s-21": "npm run solution -- 21", - "e-22": "npm run exercise -- 22", - "s-22": "npm run solution -- 22", - "e-26": "npm run exercise -- 26", - "s-26": "npm run solution -- 26", - "e-28": "npm run exercise -- 28", - "s-28": "npm run solution -- 28", - "e-12": "npm run exercise -- 12", - "s-12": "npm run solution -- 12", - "e-14": "npm run exercise -- 14", - "s-14": "npm run solution -- 14", - "e-32": "npm run exercise -- 32", - "s-32": "npm run solution -- 32", - "e-33": "npm run exercise -- 33", - "s-33": "npm run solution -- 33", - "e-34": "npm run exercise -- 34", - "s-34": "npm run solution -- 34", - "e-35": "npm run exercise -- 35", - "s-35": "npm run solution -- 35", - "e-39": "npm run exercise -- 39", - "s-39": "npm run solution -- 39" + "e-19": "tt-cli run 19", + "s-19": "tt-cli run 19 --solution", + "e-20": "tt-cli run 20", + "s-20": "tt-cli run 20 --solution", + "e-21": "tt-cli run 21", + "s-21": "tt-cli run 21 --solution", + "e-22": "tt-cli run 22", + "s-22": "tt-cli run 22 --solution", + "e-26": "tt-cli run 26", + "s-26": "tt-cli run 26 --solution", + "e-28": "tt-cli run 28", + "s-28": "tt-cli run 28 --solution", + "e-12": "tt-cli run 12", + "s-12": "tt-cli run 12 --solution", + "e-14": "tt-cli run 14", + "s-14": "tt-cli run 14 --solution", + "e-32": "tt-cli run 32", + "s-32": "tt-cli run 32 --solution", + "e-33": "tt-cli run 33", + "s-33": "tt-cli run 33 --solution", + "e-34": "tt-cli run 34", + "s-34": "tt-cli run 34 --solution", + "e-35": "tt-cli run 35", + "s-35": "tt-cli run 35 --solution", + "e-39": "tt-cli run 39", + "s-39": "tt-cli run 39 --solution", + "e-36": "tt-cli run 36", + "s-36": "tt-cli run 36 --solution", + "e-40": "tt-cli run 40", + "s-40": "tt-cli run 40 --solution", + "e-03": "tt-cli run 03", + "s-03": "tt-cli run 03 --solution", + "e-04": "tt-cli run 04", + "s-04": "tt-cli run 04 --solution", + "e-05": "tt-cli run 05", + "s-05": "tt-cli run 05 --solution", + "e-06": "tt-cli run 06", + "s-06": "tt-cli run 06 --solution", + "e-07": "tt-cli run 07", + "s-07": "tt-cli run 07 --solution", + "e-08": "tt-cli run 08", + "s-08": "tt-cli run 08 --solution", + "e-11": "tt-cli run 11", + "s-11": "tt-cli run 11 --solution", + "e-13": "tt-cli run 13", + "s-13": "tt-cli run 13 --solution", + "e-15": "tt-cli run 15", + "s-15": "tt-cli run 15 --solution", + "e-16": "tt-cli run 16", + "s-16": "tt-cli run 16 --solution", + "e-17": "tt-cli run 17", + "s-17": "tt-cli run 17 --solution", + "e-23": "tt-cli run 23", + "s-23": "tt-cli run 23 --solution", + "e-24": "tt-cli run 24", + "s-24": "tt-cli run 24 --solution", + "e-25": "tt-cli run 25", + "s-25": "tt-cli run 25 --solution", + "e-27": "tt-cli run 27", + "s-27": "tt-cli run 27 --solution", + "e-29": "tt-cli run 29", + "s-29": "tt-cli run 29 --solution", + "e-30": "tt-cli run 30", + "s-30": "tt-cli run 30 --solution", + "e-31": "tt-cli run 31", + "s-31": "tt-cli run 31 --solution", + "e-37": "tt-cli run 37", + "s-37": "tt-cli run 37 --solution", + "e-38": "tt-cli run 38", + "s-38": "tt-cli run 38 --solution", + "e-41": "tt-cli run 41", + "s-41": "tt-cli run 41 --solution", + "e-44": "tt-cli run 44", + "s-44": "tt-cli run 44 --solution", + "e-46": "tt-cli run 46", + "s-46": "tt-cli run 46 --solution", + "e-47": "tt-cli run 47", + "s-47": "tt-cli run 47 --solution", + "e-48": "tt-cli run 48", + "s-48": "tt-cli run 48 --solution", + "e-49": "tt-cli run 49", + "s-49": "tt-cli run 49 --solution", + "e-50": "tt-cli run 50", + "s-50": "tt-cli run 50 --solution", + "e-51": "tt-cli run 51", + "s-51": "tt-cli run 51 --solution", + "e-54": "tt-cli run 54", + "s-54": "tt-cli run 54 --solution", + "e-55": "tt-cli run 55", + "s-55": "tt-cli run 55 --solution", + "e-56": "tt-cli run 56", + "s-56": "tt-cli run 56 --solution", + "e-57": "tt-cli run 57", + "s-57": "tt-cli run 57 --solution", + "e-58": "tt-cli run 58", + "s-58": "tt-cli run 58 --solution", + "e-59": "tt-cli run 59", + "s-59": "tt-cli run 59 --solution", + "e-60": "tt-cli run 60", + "s-60": "tt-cli run 60 --solution", + "e-61": "tt-cli run 61", + "s-61": "tt-cli run 61 --solution", + "e-62": "tt-cli run 62", + "s-62": "tt-cli run 62 --solution", + "e-63": "tt-cli run 63", + "s-63": "tt-cli run 63 --solution" }, "dependencies": { "@types/express": "^4.17.13", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", - "cross-env": "^7.0.3", "express": "^4.18.1", "react": "^18.2.0", "react-dom": "^18.2.0", "zod": "^3.17.10" } -} +} \ No newline at end of file diff --git a/scripts/exercise.js b/scripts/exercise.js deleted file mode 100644 index 051ea41..0000000 --- a/scripts/exercise.js +++ /dev/null @@ -1,79 +0,0 @@ -const { execSync } = require("child_process"); -const fs = require("fs"); -const path = require("path"); -const chokidar = require("chokidar"); -const fg = require("fast-glob"); -const tsconfig = require("../tsconfig.json"); - -const compilerOptions = Object.entries(tsconfig.compilerOptions) - .map(([key, value]) => { - if (typeof value === "boolean") { - if (value) { - return `--${key}`; - } - return ""; - } - - if (Array.isArray(value)) { - return `--${key} ${value.join(" ")}`; - } - - return `--${key} ${JSON.stringify(value)}`; - }) - .join(" "); - -const srcPath = path.resolve(__dirname, "../src"); - -const [, , exercise] = process.argv; - -if (!exercise) { - console.log("Please specify an exercise"); - process.exit(1); -} - -const allExercises = fg.sync( - path.join(srcPath, "**", "**.{ts,tsx}").replace(/\\/g, "/"), -); - -let pathIndicator = ".problem."; - -if (process.env.SOLUTION) { - pathIndicator = ".solution."; -} - -const exerciseFile = allExercises.find((e) => { - const base = path.parse(e).base; - return base.startsWith(exercise) && base.includes(pathIndicator); -}); - -if (!exerciseFile) { - console.log(`Exercise ${exercise} not found`); - process.exit(1); -} - -// One-liner for current directory -chokidar.watch(exerciseFile).on("all", (event, path) => { - const fileContents = fs.readFileSync(exerciseFile, "utf8"); - - const containsVitest = - fileContents.includes(`from "vitest"`) || - fileContents.includes(`from 'vitest'`); - try { - console.clear(); - if (containsVitest) { - console.log("Running tests..."); - execSync(`vitest run "${exerciseFile}" --passWithNoTests`, { - stdio: "inherit", - }); - } - console.log("Checking types..."); - const cmd = `tsc "${exerciseFile}" ${compilerOptions}`; - - execSync(cmd, { - stdio: "inherit", - }); - console.log("Typecheck complete. You finished the exercise!"); - } catch (e) { - console.log("Failed. Try again!"); - } -}); diff --git a/scripts/prepare-stackblitz.js b/scripts/prepare-stackblitz.js deleted file mode 100644 index e08fad7..0000000 --- a/scripts/prepare-stackblitz.js +++ /dev/null @@ -1,36 +0,0 @@ -const fs = require("fs"); -const path = require("path"); -const fg = require("fast-glob"); - -/** - * Adds a bunch of scripts, like e-01, e-02 to package.json - * so that StackBlitz can run them programmatically via URL - * commands - */ - -const packageJsonPath = path.resolve(__dirname, "../package.json"); -const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8")); - -const srcPath = path.resolve(__dirname, "../src"); -const allExercises = fg.sync( - path.join(srcPath, "**", "**.ts").replace(/\\/g, "/"), -); -const exerciseFiles = allExercises.filter((exercise) => - exercise.includes(".problem."), -); -const exerciseNames = exerciseFiles.map( - (exercise) => path.parse(exercise).base.split("-")[0], -); - -const newPackageJson = Object.assign({}, packageJson); - -newPackageJson.scripts = { - ...packageJson.scripts, -}; - -exerciseNames.forEach((exercise) => { - newPackageJson.scripts[`e-${exercise}`] = `npm run exercise -- ${exercise}`; - newPackageJson.scripts[`s-${exercise}`] = `npm run solution -- ${exercise}`; -}); - -fs.writeFileSync(packageJsonPath, JSON.stringify(newPackageJson, null, 2)); diff --git a/scripts/tests/all.test.ts b/scripts/tests/all.test.ts index 48f44e4..fe5ea8d 100644 --- a/scripts/tests/all.test.ts +++ b/scripts/tests/all.test.ts @@ -5,8 +5,6 @@ import { cleanVitestOutput } from "./cleanVitestOutput"; const rootFolder = path.resolve(__dirname, "../.."); -console.log(rootFolder); - const sanitizeForRegex = (str: string) => { return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string }; From b6ccda0a020882996814adbc671682e33c9cda9a Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Wed, 17 May 2023 11:21:24 +0100 Subject: [PATCH 016/186] Partial autocomplete added --- ...em.tsx => 24-discriminated-union-with-other-props.problem.tsx} | 0 ...n.tsx => 24-discriminated-union-with-other-props.solution.tsx} | 0 ....problem.tsx => 25-either-all-these-props-or-none.problem.tsx} | 0 ...ion.1.tsx => 25-either-all-these-props-or-none.solution.1.tsx} | 0 ...ion.2.tsx => 25-either-all-these-props-or-none.solution.2.tsx} | 0 ...ion.3.tsx => 25-either-all-these-props-or-none.solution.3.tsx} | 0 ...h-booleans.problem.tsx => 26-partial-autocomplete.problem.tsx} | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename src/04-advanced-components/{25-discriminated-union-with-other-props.problem.tsx => 24-discriminated-union-with-other-props.problem.tsx} (100%) rename src/04-advanced-components/{25-discriminated-union-with-other-props.solution.tsx => 24-discriminated-union-with-other-props.solution.tsx} (100%) rename src/04-advanced-components/{26-either-all-these-props-or-none.problem.tsx => 25-either-all-these-props-or-none.problem.tsx} (100%) rename src/04-advanced-components/{26-either-all-these-props-or-none.solution.1.tsx => 25-either-all-these-props-or-none.solution.1.tsx} (100%) rename src/04-advanced-components/{26-either-all-these-props-or-none.solution.2.tsx => 25-either-all-these-props-or-none.solution.2.tsx} (100%) rename src/04-advanced-components/{26-either-all-these-props-or-none.solution.3.tsx => 25-either-all-these-props-or-none.solution.3.tsx} (100%) rename src/04-advanced-components/{24-discriminated-union-props-with-booleans.problem.tsx => 26-partial-autocomplete.problem.tsx} (100%) diff --git a/src/04-advanced-components/25-discriminated-union-with-other-props.problem.tsx b/src/04-advanced-components/24-discriminated-union-with-other-props.problem.tsx similarity index 100% rename from src/04-advanced-components/25-discriminated-union-with-other-props.problem.tsx rename to src/04-advanced-components/24-discriminated-union-with-other-props.problem.tsx diff --git a/src/04-advanced-components/25-discriminated-union-with-other-props.solution.tsx b/src/04-advanced-components/24-discriminated-union-with-other-props.solution.tsx similarity index 100% rename from src/04-advanced-components/25-discriminated-union-with-other-props.solution.tsx rename to src/04-advanced-components/24-discriminated-union-with-other-props.solution.tsx diff --git a/src/04-advanced-components/26-either-all-these-props-or-none.problem.tsx b/src/04-advanced-components/25-either-all-these-props-or-none.problem.tsx similarity index 100% rename from src/04-advanced-components/26-either-all-these-props-or-none.problem.tsx rename to src/04-advanced-components/25-either-all-these-props-or-none.problem.tsx diff --git a/src/04-advanced-components/26-either-all-these-props-or-none.solution.1.tsx b/src/04-advanced-components/25-either-all-these-props-or-none.solution.1.tsx similarity index 100% rename from src/04-advanced-components/26-either-all-these-props-or-none.solution.1.tsx rename to src/04-advanced-components/25-either-all-these-props-or-none.solution.1.tsx diff --git a/src/04-advanced-components/26-either-all-these-props-or-none.solution.2.tsx b/src/04-advanced-components/25-either-all-these-props-or-none.solution.2.tsx similarity index 100% rename from src/04-advanced-components/26-either-all-these-props-or-none.solution.2.tsx rename to src/04-advanced-components/25-either-all-these-props-or-none.solution.2.tsx diff --git a/src/04-advanced-components/26-either-all-these-props-or-none.solution.3.tsx b/src/04-advanced-components/25-either-all-these-props-or-none.solution.3.tsx similarity index 100% rename from src/04-advanced-components/26-either-all-these-props-or-none.solution.3.tsx rename to src/04-advanced-components/25-either-all-these-props-or-none.solution.3.tsx diff --git a/src/04-advanced-components/24-discriminated-union-props-with-booleans.problem.tsx b/src/04-advanced-components/26-partial-autocomplete.problem.tsx similarity index 100% rename from src/04-advanced-components/24-discriminated-union-props-with-booleans.problem.tsx rename to src/04-advanced-components/26-partial-autocomplete.problem.tsx From c5411e651014a4928aeb9b05c47bd12593fa431a Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Mon, 22 May 2023 12:18:49 +0100 Subject: [PATCH 017/186] WIP --- .../34-discriminated-unions-with-booleans.problem.ts | 1 + .../{34-generic-hooks.problem.ts => 35-generic-hooks.problem.ts} | 0 ...eneric-hooks.solution.1.ts => 35-generic-hooks.solution.1.ts} | 0 ...eneric-hooks.solution.2.ts => 35-generic-hooks.solution.2.ts} | 0 ...eneric-hooks.solution.3.ts => 35-generic-hooks.solution.3.ts} | 0 ...eneric-hooks.solution.4.ts => 35-generic-hooks.solution.4.ts} | 0 ...eneric-hooks.solution.5.ts => 35-generic-hooks.solution.5.ts} | 0 ...ooks.problem.ts => 36-function-overloads-in-hooks.problem.ts} | 0 ...olution.1.ts => 36-function-overloads-in-hooks.solution.1.ts} | 0 ...olution.2.ts => 36-function-overloads-in-hooks.solution.2.ts} | 0 ...e-hook.problem.ts => 37-generic-localstorage-hook.problem.ts} | 0 ...hook.solution.ts => 37-generic-localstorage-hook.solution.ts} | 0 ...lem.tsx => 38-generic-localstorage-hook-with-zod.problem.tsx} | 0 ...on.tsx => 38-generic-localstorage-hook-with-zod.solution.tsx} | 0 ...in-usestate.problem.tsx => 39-unions-in-usestate.problem.tsx} | 0 ...-usestate.solution.tsx => 39-unions-in-usestate.solution.tsx} | 0 ...oblem.tsx => 40-discriminated-unions-in-usestate.problem.tsx} | 0 ...tion.tsx => 40-discriminated-unions-in-usestate.solution.tsx} | 0 ... 41-discriminated-union-returns-from-custom-hooks.problem.ts} | 0 ...tsx => 42-discriminated-tuples-from-custom-hooks.problem.tsx} | 0 ...sx => 42-discriminated-tuples-from-custom-hooks.solution.tsx} | 0 ...iner.ts => 43-understand-react-namespace-export.explainer.ts} | 0 ....explainer.tsx => 44-understanding-jsx-element.explainer.tsx} | 0 ...ldren.problem.tsx => 45-strongly-typing-children.problem.tsx} | 0 ...xplainer.ts => 46-how-does-react-represent-html.explainer.ts} | 0 ...r.ts => 46-understanding-jsx-intrinsic-elements.explainer.ts} | 0 ...element.problem.tsx => 47-add-new-global-element.problem.tsx} | 0 ....problem.tsx => 48-add-attribute-to-all-elements.problem.tsx} | 0 ...roblem.tsx => 49-add-attribute-to-audio-elements.problem.tsx} | 0 ....problem.tsx => 50-add-attribute-to-div-elements.problem.tsx} | 0 ...uired-context.problem.tsx => 51-required-context.problem.tsx} | 0 ...context.solution.1.tsx => 51-required-context.solution.1.tsx} | 0 ...context.solution.2.tsx => 51-required-context.solution.2.tsx} | 0 ...components.problem.tsx => 52-compound-components.problem.tsx} | 0 ...lainer.1.tsx => 53-forward-ref-with-generics.explainer.1.tsx} | 0 ...lainer.2.tsx => 53-forward-ref-with-generics.explainer.2.tsx} | 0 .../{53-hoc-problem.tsx => 54-hoc-problem.tsx} | 0 .../{54-as-prop.problem.tsx => 55-as-prop.problem.tsx} | 0 .../{54-as-prop.solution.1.tsx => 55-as-prop.solution.1.tsx} | 0 .../{54-as-prop.solution.2.tsx => 55-as-prop.solution.2.tsx} | 0 ...problem.tsx => 56-as-prop-with-custom-components.problem.tsx} | 0 ...lution.tsx => 56-as-prop-with-custom-components.solution.tsx} | 0 .../{56-render-props.problem.tsx => 57-render-props.problem.tsx} | 0 ...ics.problem.tsx => 58-render-props-with-generics.problem.tsx} | 0 ...m.tsx => 59-record-of-components-with-same-props.problem.tsx} | 0 ...eact-hook-form.problem.tsx => 60-react-hook-form.problem.tsx} | 0 .../{60-react-query.problem.tsx => 61-react-query.problem.tsx} | 0 ...61-redux-toolkit.problem.tsx => 62-redux-toolkit.problem.tsx} | 0 .../{62-zustand.problem.tsx => 63-zustand.problem.tsx} | 0 ...problem.tsx => 64-reusable-form-library-with-zod.problem.tsx} | 0 50 files changed, 1 insertion(+) create mode 100644 src/05-advanced-hooks/34-discriminated-unions-with-booleans.problem.ts rename src/05-advanced-hooks/{34-generic-hooks.problem.ts => 35-generic-hooks.problem.ts} (100%) rename src/05-advanced-hooks/{34-generic-hooks.solution.1.ts => 35-generic-hooks.solution.1.ts} (100%) rename src/05-advanced-hooks/{34-generic-hooks.solution.2.ts => 35-generic-hooks.solution.2.ts} (100%) rename src/05-advanced-hooks/{34-generic-hooks.solution.3.ts => 35-generic-hooks.solution.3.ts} (100%) rename src/05-advanced-hooks/{34-generic-hooks.solution.4.ts => 35-generic-hooks.solution.4.ts} (100%) rename src/05-advanced-hooks/{34-generic-hooks.solution.5.ts => 35-generic-hooks.solution.5.ts} (100%) rename src/05-advanced-hooks/{35-function-overloads-in-hooks.problem.ts => 36-function-overloads-in-hooks.problem.ts} (100%) rename src/05-advanced-hooks/{35-function-overloads-in-hooks.solution.1.ts => 36-function-overloads-in-hooks.solution.1.ts} (100%) rename src/05-advanced-hooks/{35-function-overloads-in-hooks.solution.2.ts => 36-function-overloads-in-hooks.solution.2.ts} (100%) rename src/05-advanced-hooks/{36-generic-localstorage-hook.problem.ts => 37-generic-localstorage-hook.problem.ts} (100%) rename src/05-advanced-hooks/{36-generic-localstorage-hook.solution.ts => 37-generic-localstorage-hook.solution.ts} (100%) rename src/05-advanced-hooks/{37-generic-localstorage-hook-with-zod.problem.tsx => 38-generic-localstorage-hook-with-zod.problem.tsx} (100%) rename src/05-advanced-hooks/{37-generic-localstorage-hook-with-zod.solution.tsx => 38-generic-localstorage-hook-with-zod.solution.tsx} (100%) rename src/05-advanced-hooks/{38-unions-in-usestate.problem.tsx => 39-unions-in-usestate.problem.tsx} (100%) rename src/05-advanced-hooks/{38-unions-in-usestate.solution.tsx => 39-unions-in-usestate.solution.tsx} (100%) rename src/05-advanced-hooks/{39-discriminated-unions-in-usestate.problem.tsx => 40-discriminated-unions-in-usestate.problem.tsx} (100%) rename src/05-advanced-hooks/{39-discriminated-unions-in-usestate.solution.tsx => 40-discriminated-unions-in-usestate.solution.tsx} (100%) rename src/05-advanced-hooks/{40-discriminated-union-returns-from-custom-hooks.problem.ts => 41-discriminated-union-returns-from-custom-hooks.problem.ts} (100%) rename src/05-advanced-hooks/{41-discriminated-tuples-from-custom-hooks.problem.tsx => 42-discriminated-tuples-from-custom-hooks.problem.tsx} (100%) rename src/05-advanced-hooks/{41-discriminated-tuples-from-custom-hooks.solution.tsx => 42-discriminated-tuples-from-custom-hooks.solution.tsx} (100%) rename src/06-types-deep-dive/{42-understand-react-namespace-export.explainer.ts => 43-understand-react-namespace-export.explainer.ts} (100%) rename src/06-types-deep-dive/{43-understanding-jsx-element.explainer.tsx => 44-understanding-jsx-element.explainer.tsx} (100%) rename src/06-types-deep-dive/{44-strongly-typing-children.problem.tsx => 45-strongly-typing-children.problem.tsx} (100%) rename src/06-types-deep-dive/{45-how-does-react-represent-html.explainer.ts => 46-how-does-react-represent-html.explainer.ts} (100%) rename src/06-types-deep-dive/{45-understanding-jsx-intrinsic-elements.explainer.ts => 46-understanding-jsx-intrinsic-elements.explainer.ts} (100%) rename src/06-types-deep-dive/{46-add-new-global-element.problem.tsx => 47-add-new-global-element.problem.tsx} (100%) rename src/06-types-deep-dive/{47-add-attribute-to-all-elements.problem.tsx => 48-add-attribute-to-all-elements.problem.tsx} (100%) rename src/06-types-deep-dive/{48-add-attribute-to-audio-elements.problem.tsx => 49-add-attribute-to-audio-elements.problem.tsx} (100%) rename src/06-types-deep-dive/{49-add-attribute-to-div-elements.problem.tsx => 50-add-attribute-to-div-elements.problem.tsx} (100%) rename src/07-advanced-patterns/{50-required-context.problem.tsx => 51-required-context.problem.tsx} (100%) rename src/07-advanced-patterns/{50-required-context.solution.1.tsx => 51-required-context.solution.1.tsx} (100%) rename src/07-advanced-patterns/{50-required-context.solution.2.tsx => 51-required-context.solution.2.tsx} (100%) rename src/07-advanced-patterns/{51-compound-components.problem.tsx => 52-compound-components.problem.tsx} (100%) rename src/07-advanced-patterns/{52-forward-ref-with-generics.explainer.1.tsx => 53-forward-ref-with-generics.explainer.1.tsx} (100%) rename src/07-advanced-patterns/{52-forward-ref-with-generics.explainer.2.tsx => 53-forward-ref-with-generics.explainer.2.tsx} (100%) rename src/07-advanced-patterns/{53-hoc-problem.tsx => 54-hoc-problem.tsx} (100%) rename src/07-advanced-patterns/{54-as-prop.problem.tsx => 55-as-prop.problem.tsx} (100%) rename src/07-advanced-patterns/{54-as-prop.solution.1.tsx => 55-as-prop.solution.1.tsx} (100%) rename src/07-advanced-patterns/{54-as-prop.solution.2.tsx => 55-as-prop.solution.2.tsx} (100%) rename src/07-advanced-patterns/{55-as-prop-with-custom-components.problem.tsx => 56-as-prop-with-custom-components.problem.tsx} (100%) rename src/07-advanced-patterns/{55-as-prop-with-custom-components.solution.tsx => 56-as-prop-with-custom-components.solution.tsx} (100%) rename src/07-advanced-patterns/{56-render-props.problem.tsx => 57-render-props.problem.tsx} (100%) rename src/07-advanced-patterns/{57-render-props-with-generics.problem.tsx => 58-render-props-with-generics.problem.tsx} (100%) rename src/07-advanced-patterns/{58-record-of-components-with-same-props.problem.tsx => 59-record-of-components-with-same-props.problem.tsx} (100%) rename src/08-external-libraries/{59-react-hook-form.problem.tsx => 60-react-hook-form.problem.tsx} (100%) rename src/08-external-libraries/{60-react-query.problem.tsx => 61-react-query.problem.tsx} (100%) rename src/08-external-libraries/{61-redux-toolkit.problem.tsx => 62-redux-toolkit.problem.tsx} (100%) rename src/08-external-libraries/{62-zustand.problem.tsx => 63-zustand.problem.tsx} (100%) rename src/08-external-libraries/{63-reusable-form-library-with-zod.problem.tsx => 64-reusable-form-library-with-zod.problem.tsx} (100%) diff --git a/src/05-advanced-hooks/34-discriminated-unions-with-booleans.problem.ts b/src/05-advanced-hooks/34-discriminated-unions-with-booleans.problem.ts new file mode 100644 index 0000000..70b786d --- /dev/null +++ b/src/05-advanced-hooks/34-discriminated-unions-with-booleans.problem.ts @@ -0,0 +1 @@ +// TODO diff --git a/src/05-advanced-hooks/34-generic-hooks.problem.ts b/src/05-advanced-hooks/35-generic-hooks.problem.ts similarity index 100% rename from src/05-advanced-hooks/34-generic-hooks.problem.ts rename to src/05-advanced-hooks/35-generic-hooks.problem.ts diff --git a/src/05-advanced-hooks/34-generic-hooks.solution.1.ts b/src/05-advanced-hooks/35-generic-hooks.solution.1.ts similarity index 100% rename from src/05-advanced-hooks/34-generic-hooks.solution.1.ts rename to src/05-advanced-hooks/35-generic-hooks.solution.1.ts diff --git a/src/05-advanced-hooks/34-generic-hooks.solution.2.ts b/src/05-advanced-hooks/35-generic-hooks.solution.2.ts similarity index 100% rename from src/05-advanced-hooks/34-generic-hooks.solution.2.ts rename to src/05-advanced-hooks/35-generic-hooks.solution.2.ts diff --git a/src/05-advanced-hooks/34-generic-hooks.solution.3.ts b/src/05-advanced-hooks/35-generic-hooks.solution.3.ts similarity index 100% rename from src/05-advanced-hooks/34-generic-hooks.solution.3.ts rename to src/05-advanced-hooks/35-generic-hooks.solution.3.ts diff --git a/src/05-advanced-hooks/34-generic-hooks.solution.4.ts b/src/05-advanced-hooks/35-generic-hooks.solution.4.ts similarity index 100% rename from src/05-advanced-hooks/34-generic-hooks.solution.4.ts rename to src/05-advanced-hooks/35-generic-hooks.solution.4.ts diff --git a/src/05-advanced-hooks/34-generic-hooks.solution.5.ts b/src/05-advanced-hooks/35-generic-hooks.solution.5.ts similarity index 100% rename from src/05-advanced-hooks/34-generic-hooks.solution.5.ts rename to src/05-advanced-hooks/35-generic-hooks.solution.5.ts diff --git a/src/05-advanced-hooks/35-function-overloads-in-hooks.problem.ts b/src/05-advanced-hooks/36-function-overloads-in-hooks.problem.ts similarity index 100% rename from src/05-advanced-hooks/35-function-overloads-in-hooks.problem.ts rename to src/05-advanced-hooks/36-function-overloads-in-hooks.problem.ts diff --git a/src/05-advanced-hooks/35-function-overloads-in-hooks.solution.1.ts b/src/05-advanced-hooks/36-function-overloads-in-hooks.solution.1.ts similarity index 100% rename from src/05-advanced-hooks/35-function-overloads-in-hooks.solution.1.ts rename to src/05-advanced-hooks/36-function-overloads-in-hooks.solution.1.ts diff --git a/src/05-advanced-hooks/35-function-overloads-in-hooks.solution.2.ts b/src/05-advanced-hooks/36-function-overloads-in-hooks.solution.2.ts similarity index 100% rename from src/05-advanced-hooks/35-function-overloads-in-hooks.solution.2.ts rename to src/05-advanced-hooks/36-function-overloads-in-hooks.solution.2.ts diff --git a/src/05-advanced-hooks/36-generic-localstorage-hook.problem.ts b/src/05-advanced-hooks/37-generic-localstorage-hook.problem.ts similarity index 100% rename from src/05-advanced-hooks/36-generic-localstorage-hook.problem.ts rename to src/05-advanced-hooks/37-generic-localstorage-hook.problem.ts diff --git a/src/05-advanced-hooks/36-generic-localstorage-hook.solution.ts b/src/05-advanced-hooks/37-generic-localstorage-hook.solution.ts similarity index 100% rename from src/05-advanced-hooks/36-generic-localstorage-hook.solution.ts rename to src/05-advanced-hooks/37-generic-localstorage-hook.solution.ts diff --git a/src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.problem.tsx b/src/05-advanced-hooks/38-generic-localstorage-hook-with-zod.problem.tsx similarity index 100% rename from src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.problem.tsx rename to src/05-advanced-hooks/38-generic-localstorage-hook-with-zod.problem.tsx diff --git a/src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.solution.tsx b/src/05-advanced-hooks/38-generic-localstorage-hook-with-zod.solution.tsx similarity index 100% rename from src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.solution.tsx rename to src/05-advanced-hooks/38-generic-localstorage-hook-with-zod.solution.tsx diff --git a/src/05-advanced-hooks/38-unions-in-usestate.problem.tsx b/src/05-advanced-hooks/39-unions-in-usestate.problem.tsx similarity index 100% rename from src/05-advanced-hooks/38-unions-in-usestate.problem.tsx rename to src/05-advanced-hooks/39-unions-in-usestate.problem.tsx diff --git a/src/05-advanced-hooks/38-unions-in-usestate.solution.tsx b/src/05-advanced-hooks/39-unions-in-usestate.solution.tsx similarity index 100% rename from src/05-advanced-hooks/38-unions-in-usestate.solution.tsx rename to src/05-advanced-hooks/39-unions-in-usestate.solution.tsx diff --git a/src/05-advanced-hooks/39-discriminated-unions-in-usestate.problem.tsx b/src/05-advanced-hooks/40-discriminated-unions-in-usestate.problem.tsx similarity index 100% rename from src/05-advanced-hooks/39-discriminated-unions-in-usestate.problem.tsx rename to src/05-advanced-hooks/40-discriminated-unions-in-usestate.problem.tsx diff --git a/src/05-advanced-hooks/39-discriminated-unions-in-usestate.solution.tsx b/src/05-advanced-hooks/40-discriminated-unions-in-usestate.solution.tsx similarity index 100% rename from src/05-advanced-hooks/39-discriminated-unions-in-usestate.solution.tsx rename to src/05-advanced-hooks/40-discriminated-unions-in-usestate.solution.tsx diff --git a/src/05-advanced-hooks/40-discriminated-union-returns-from-custom-hooks.problem.ts b/src/05-advanced-hooks/41-discriminated-union-returns-from-custom-hooks.problem.ts similarity index 100% rename from src/05-advanced-hooks/40-discriminated-union-returns-from-custom-hooks.problem.ts rename to src/05-advanced-hooks/41-discriminated-union-returns-from-custom-hooks.problem.ts diff --git a/src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx b/src/05-advanced-hooks/42-discriminated-tuples-from-custom-hooks.problem.tsx similarity index 100% rename from src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx rename to src/05-advanced-hooks/42-discriminated-tuples-from-custom-hooks.problem.tsx diff --git a/src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.solution.tsx b/src/05-advanced-hooks/42-discriminated-tuples-from-custom-hooks.solution.tsx similarity index 100% rename from src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.solution.tsx rename to src/05-advanced-hooks/42-discriminated-tuples-from-custom-hooks.solution.tsx diff --git a/src/06-types-deep-dive/42-understand-react-namespace-export.explainer.ts b/src/06-types-deep-dive/43-understand-react-namespace-export.explainer.ts similarity index 100% rename from src/06-types-deep-dive/42-understand-react-namespace-export.explainer.ts rename to src/06-types-deep-dive/43-understand-react-namespace-export.explainer.ts diff --git a/src/06-types-deep-dive/43-understanding-jsx-element.explainer.tsx b/src/06-types-deep-dive/44-understanding-jsx-element.explainer.tsx similarity index 100% rename from src/06-types-deep-dive/43-understanding-jsx-element.explainer.tsx rename to src/06-types-deep-dive/44-understanding-jsx-element.explainer.tsx diff --git a/src/06-types-deep-dive/44-strongly-typing-children.problem.tsx b/src/06-types-deep-dive/45-strongly-typing-children.problem.tsx similarity index 100% rename from src/06-types-deep-dive/44-strongly-typing-children.problem.tsx rename to src/06-types-deep-dive/45-strongly-typing-children.problem.tsx diff --git a/src/06-types-deep-dive/45-how-does-react-represent-html.explainer.ts b/src/06-types-deep-dive/46-how-does-react-represent-html.explainer.ts similarity index 100% rename from src/06-types-deep-dive/45-how-does-react-represent-html.explainer.ts rename to src/06-types-deep-dive/46-how-does-react-represent-html.explainer.ts diff --git a/src/06-types-deep-dive/45-understanding-jsx-intrinsic-elements.explainer.ts b/src/06-types-deep-dive/46-understanding-jsx-intrinsic-elements.explainer.ts similarity index 100% rename from src/06-types-deep-dive/45-understanding-jsx-intrinsic-elements.explainer.ts rename to src/06-types-deep-dive/46-understanding-jsx-intrinsic-elements.explainer.ts diff --git a/src/06-types-deep-dive/46-add-new-global-element.problem.tsx b/src/06-types-deep-dive/47-add-new-global-element.problem.tsx similarity index 100% rename from src/06-types-deep-dive/46-add-new-global-element.problem.tsx rename to src/06-types-deep-dive/47-add-new-global-element.problem.tsx diff --git a/src/06-types-deep-dive/47-add-attribute-to-all-elements.problem.tsx b/src/06-types-deep-dive/48-add-attribute-to-all-elements.problem.tsx similarity index 100% rename from src/06-types-deep-dive/47-add-attribute-to-all-elements.problem.tsx rename to src/06-types-deep-dive/48-add-attribute-to-all-elements.problem.tsx diff --git a/src/06-types-deep-dive/48-add-attribute-to-audio-elements.problem.tsx b/src/06-types-deep-dive/49-add-attribute-to-audio-elements.problem.tsx similarity index 100% rename from src/06-types-deep-dive/48-add-attribute-to-audio-elements.problem.tsx rename to src/06-types-deep-dive/49-add-attribute-to-audio-elements.problem.tsx diff --git a/src/06-types-deep-dive/49-add-attribute-to-div-elements.problem.tsx b/src/06-types-deep-dive/50-add-attribute-to-div-elements.problem.tsx similarity index 100% rename from src/06-types-deep-dive/49-add-attribute-to-div-elements.problem.tsx rename to src/06-types-deep-dive/50-add-attribute-to-div-elements.problem.tsx diff --git a/src/07-advanced-patterns/50-required-context.problem.tsx b/src/07-advanced-patterns/51-required-context.problem.tsx similarity index 100% rename from src/07-advanced-patterns/50-required-context.problem.tsx rename to src/07-advanced-patterns/51-required-context.problem.tsx diff --git a/src/07-advanced-patterns/50-required-context.solution.1.tsx b/src/07-advanced-patterns/51-required-context.solution.1.tsx similarity index 100% rename from src/07-advanced-patterns/50-required-context.solution.1.tsx rename to src/07-advanced-patterns/51-required-context.solution.1.tsx diff --git a/src/07-advanced-patterns/50-required-context.solution.2.tsx b/src/07-advanced-patterns/51-required-context.solution.2.tsx similarity index 100% rename from src/07-advanced-patterns/50-required-context.solution.2.tsx rename to src/07-advanced-patterns/51-required-context.solution.2.tsx diff --git a/src/07-advanced-patterns/51-compound-components.problem.tsx b/src/07-advanced-patterns/52-compound-components.problem.tsx similarity index 100% rename from src/07-advanced-patterns/51-compound-components.problem.tsx rename to src/07-advanced-patterns/52-compound-components.problem.tsx diff --git a/src/07-advanced-patterns/52-forward-ref-with-generics.explainer.1.tsx b/src/07-advanced-patterns/53-forward-ref-with-generics.explainer.1.tsx similarity index 100% rename from src/07-advanced-patterns/52-forward-ref-with-generics.explainer.1.tsx rename to src/07-advanced-patterns/53-forward-ref-with-generics.explainer.1.tsx diff --git a/src/07-advanced-patterns/52-forward-ref-with-generics.explainer.2.tsx b/src/07-advanced-patterns/53-forward-ref-with-generics.explainer.2.tsx similarity index 100% rename from src/07-advanced-patterns/52-forward-ref-with-generics.explainer.2.tsx rename to src/07-advanced-patterns/53-forward-ref-with-generics.explainer.2.tsx diff --git a/src/07-advanced-patterns/53-hoc-problem.tsx b/src/07-advanced-patterns/54-hoc-problem.tsx similarity index 100% rename from src/07-advanced-patterns/53-hoc-problem.tsx rename to src/07-advanced-patterns/54-hoc-problem.tsx diff --git a/src/07-advanced-patterns/54-as-prop.problem.tsx b/src/07-advanced-patterns/55-as-prop.problem.tsx similarity index 100% rename from src/07-advanced-patterns/54-as-prop.problem.tsx rename to src/07-advanced-patterns/55-as-prop.problem.tsx diff --git a/src/07-advanced-patterns/54-as-prop.solution.1.tsx b/src/07-advanced-patterns/55-as-prop.solution.1.tsx similarity index 100% rename from src/07-advanced-patterns/54-as-prop.solution.1.tsx rename to src/07-advanced-patterns/55-as-prop.solution.1.tsx diff --git a/src/07-advanced-patterns/54-as-prop.solution.2.tsx b/src/07-advanced-patterns/55-as-prop.solution.2.tsx similarity index 100% rename from src/07-advanced-patterns/54-as-prop.solution.2.tsx rename to src/07-advanced-patterns/55-as-prop.solution.2.tsx diff --git a/src/07-advanced-patterns/55-as-prop-with-custom-components.problem.tsx b/src/07-advanced-patterns/56-as-prop-with-custom-components.problem.tsx similarity index 100% rename from src/07-advanced-patterns/55-as-prop-with-custom-components.problem.tsx rename to src/07-advanced-patterns/56-as-prop-with-custom-components.problem.tsx diff --git a/src/07-advanced-patterns/55-as-prop-with-custom-components.solution.tsx b/src/07-advanced-patterns/56-as-prop-with-custom-components.solution.tsx similarity index 100% rename from src/07-advanced-patterns/55-as-prop-with-custom-components.solution.tsx rename to src/07-advanced-patterns/56-as-prop-with-custom-components.solution.tsx diff --git a/src/07-advanced-patterns/56-render-props.problem.tsx b/src/07-advanced-patterns/57-render-props.problem.tsx similarity index 100% rename from src/07-advanced-patterns/56-render-props.problem.tsx rename to src/07-advanced-patterns/57-render-props.problem.tsx diff --git a/src/07-advanced-patterns/57-render-props-with-generics.problem.tsx b/src/07-advanced-patterns/58-render-props-with-generics.problem.tsx similarity index 100% rename from src/07-advanced-patterns/57-render-props-with-generics.problem.tsx rename to src/07-advanced-patterns/58-render-props-with-generics.problem.tsx diff --git a/src/07-advanced-patterns/58-record-of-components-with-same-props.problem.tsx b/src/07-advanced-patterns/59-record-of-components-with-same-props.problem.tsx similarity index 100% rename from src/07-advanced-patterns/58-record-of-components-with-same-props.problem.tsx rename to src/07-advanced-patterns/59-record-of-components-with-same-props.problem.tsx diff --git a/src/08-external-libraries/59-react-hook-form.problem.tsx b/src/08-external-libraries/60-react-hook-form.problem.tsx similarity index 100% rename from src/08-external-libraries/59-react-hook-form.problem.tsx rename to src/08-external-libraries/60-react-hook-form.problem.tsx diff --git a/src/08-external-libraries/60-react-query.problem.tsx b/src/08-external-libraries/61-react-query.problem.tsx similarity index 100% rename from src/08-external-libraries/60-react-query.problem.tsx rename to src/08-external-libraries/61-react-query.problem.tsx diff --git a/src/08-external-libraries/61-redux-toolkit.problem.tsx b/src/08-external-libraries/62-redux-toolkit.problem.tsx similarity index 100% rename from src/08-external-libraries/61-redux-toolkit.problem.tsx rename to src/08-external-libraries/62-redux-toolkit.problem.tsx diff --git a/src/08-external-libraries/62-zustand.problem.tsx b/src/08-external-libraries/63-zustand.problem.tsx similarity index 100% rename from src/08-external-libraries/62-zustand.problem.tsx rename to src/08-external-libraries/63-zustand.problem.tsx diff --git a/src/08-external-libraries/63-reusable-form-library-with-zod.problem.tsx b/src/08-external-libraries/64-reusable-form-library-with-zod.problem.tsx similarity index 100% rename from src/08-external-libraries/63-reusable-form-library-with-zod.problem.tsx rename to src/08-external-libraries/64-reusable-form-library-with-zod.problem.tsx From ea5cd5f5a440cdb4d9ba32657e61eff5b64f7fbb Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Mon, 22 May 2023 12:20:12 +0100 Subject: [PATCH 018/186] Updated vitest --- package-lock.json | 763 +++++++++++-------- package.json | 4 +- scripts/tests/__snapshots__/all.test.ts.snap | 270 ++++--- 3 files changed, 580 insertions(+), 457 deletions(-) diff --git a/package-lock.json b/package-lock.json index 199b979..2fdedf3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,9 +24,15 @@ "prettier": "^2.8.7", "typescript": "^5.0.3", "vite-tsconfig-paths": "^4.0.7", - "vitest": "^0.29.8" + "vitest": "^0.31.1" } }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -94,9 +100,9 @@ } }, "node_modules/@types/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz", + "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==", "dev": true }, "node_modules/@types/chai-subset": { @@ -186,46 +192,72 @@ } }, "node_modules/@vitest/expect": { - "version": "0.29.8", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.29.8.tgz", - "integrity": "sha512-xlcVXn5I5oTq6NiZSY3ykyWixBxr5mG8HYtjvpgg6KaqHm0mvhX18xuwl5YGxIRNt/A5jidd7CWcNHrSvgaQqQ==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.31.1.tgz", + "integrity": "sha512-BV1LyNvhnX+eNYzJxlHIGPWZpwJFZaCcOIzp2CNG0P+bbetenTupk6EO0LANm4QFt0TTit+yqx7Rxd1qxi/SQA==", "dev": true, "dependencies": { - "@vitest/spy": "0.29.8", - "@vitest/utils": "0.29.8", + "@vitest/spy": "0.31.1", + "@vitest/utils": "0.31.1", "chai": "^4.3.7" + }, + "funding": { + "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/runner": { - "version": "0.29.8", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.29.8.tgz", - "integrity": "sha512-FzdhnRDwEr/A3Oo1jtIk/B952BBvP32n1ObMEb23oEJNO+qO5cBet6M2XWIDQmA7BDKGKvmhUf2naXyp/2JEwQ==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.31.1.tgz", + "integrity": "sha512-imWuc82ngOtxdCUpXwtEzZIuc1KMr+VlQ3Ondph45VhWoQWit5yvG/fFcldbnCi8DUuFi+NmNx5ehMUw/cGLUw==", "dev": true, "dependencies": { - "@vitest/utils": "0.29.8", + "@vitest/utils": "0.31.1", + "concordance": "^5.0.4", "p-limit": "^4.0.0", "pathe": "^1.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.31.1.tgz", + "integrity": "sha512-L3w5uU9bMe6asrNzJ8WZzN+jUTX4KSgCinEJPXyny0o90fG4FPQMV0OWsq7vrCWfQlAilMjDnOF9nP8lidsJ+g==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.0", + "pathe": "^1.1.0", + "pretty-format": "^27.5.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/spy": { - "version": "0.29.8", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.29.8.tgz", - "integrity": "sha512-VdjBe9w34vOMl5I5mYEzNX8inTxrZ+tYUVk9jxaZJmHFwmDFC/GV3KBFTA/JKswr3XHvZL+FE/yq5EVhb6pSAw==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.31.1.tgz", + "integrity": "sha512-1cTpt2m9mdo3hRLDyCG2hDQvRrePTDgEJBFQQNz1ydHHZy03EiA6EpFxY+7ODaY7vMRCie+WlFZBZ0/dQWyssQ==", "dev": true, "dependencies": { - "tinyspy": "^1.0.2" + "tinyspy": "^2.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/utils": { - "version": "0.29.8", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.29.8.tgz", - "integrity": "sha512-qGzuf3vrTbnoY+RjjVVIBYfuWMjn3UMUqyQtdGNZ6ZIIyte7B37exj6LaVkrZiUTvzSadVvO/tJm8AEgbGCBPg==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.31.1.tgz", + "integrity": "sha512-yFyRD5ilwojsZfo3E0BnH72pSVSuLg2356cN1tCEe/0RtDzxTPYwOomIC+eQbot7m6DRy4tPZw+09mB7NkbMmA==", "dev": true, "dependencies": { - "cli-truncate": "^3.1.0", - "diff": "^5.1.0", + "concordance": "^5.0.4", "loupe": "^2.3.6", "pretty-format": "^27.5.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" } }, "node_modules/abab": { @@ -371,6 +403,12 @@ "node": ">=8" } }, + "node_modules/blueimp-md5": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz", + "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==", + "dev": true + }, "node_modules/body-parser": { "version": "1.20.0", "license": "MIT", @@ -484,22 +522,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/cli-truncate": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", - "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", - "dev": true, - "dependencies": { - "slice-ansi": "^5.0.0", - "string-width": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -521,6 +543,25 @@ "node": ">=14" } }, + "node_modules/concordance": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/concordance/-/concordance-5.0.4.tgz", + "integrity": "sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==", + "dev": true, + "dependencies": { + "date-time": "^3.1.0", + "esutils": "^2.0.3", + "fast-diff": "^1.2.0", + "js-string-escape": "^1.0.1", + "lodash": "^4.17.15", + "md5-hex": "^3.0.1", + "semver": "^7.3.2", + "well-known-symbols": "^2.0.0" + }, + "engines": { + "node": ">=10.18.0 <11 || >=12.14.0 <13 || >=14" + } + }, "node_modules/content-disposition": { "version": "0.5.4", "license": "MIT", @@ -622,6 +663,18 @@ "node": ">=14" } }, + "node_modules/date-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz", + "integrity": "sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==", + "dev": true, + "dependencies": { + "time-zone": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/debug": { "version": "2.6.9", "license": "MIT", @@ -677,15 +730,6 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/diff": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", - "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/domexception": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", @@ -707,22 +751,10 @@ "node": ">=12" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, "node_modules/ee-first": { "version": "1.1.1", "license": "MIT" }, - "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, "node_modules/encodeurl": { "version": "1.0.2", "license": "MIT", @@ -896,6 +928,12 @@ "node": ">= 0.10.0" } }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, "node_modules/fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", @@ -1206,18 +1244,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-fullwidth-code-point": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", - "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-glob": { "version": "4.0.3", "dev": true, @@ -1243,6 +1269,15 @@ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, + "node_modules/js-string-escape": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", + "integrity": "sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -1347,9 +1382,10 @@ } }, "node_modules/local-pkg": { - "version": "0.4.2", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", + "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", "dev": true, - "license": "MIT", "engines": { "node": ">=14" }, @@ -1357,6 +1393,12 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -1377,6 +1419,42 @@ "get-func-name": "^2.0.0" } }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/magic-string": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz", + "integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.13" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/md5-hex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz", + "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==", + "dev": true, + "dependencies": { + "blueimp-md5": "^2.10.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/media-typer": { "version": "0.3.0", "license": "MIT", @@ -1445,15 +1523,15 @@ } }, "node_modules/mlly": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.2.0.tgz", - "integrity": "sha512-+c7A3CV0KGdKcylsI6khWyts/CYrGTrRVo4R/I7u/cUsy0Conxa6LUhiEzVKIw14lc2L5aiO4+SeVe4TeGRKww==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.2.1.tgz", + "integrity": "sha512-1aMEByaWgBPEbWV2BOPEMySRrzl7rIHXmQxam4DM8jVjalTQDjpN2ZKOLUrwyhfZQO7IXHml2StcHMhooDeEEQ==", "dev": true, "dependencies": { "acorn": "^8.8.2", "pathe": "^1.1.0", - "pkg-types": "^1.0.2", - "ufo": "^1.1.1" + "pkg-types": "^1.0.3", + "ufo": "^1.1.2" } }, "node_modules/ms": { @@ -1620,13 +1698,13 @@ } }, "node_modules/pkg-types": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.2.tgz", - "integrity": "sha512-hM58GKXOcj8WTqUXnsQyJYXdeAPbythQgEF3nTcEo+nkD49chjQ9IKm/QJy9xf6JakXptz86h7ecP2024rrLaQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", "dev": true, "dependencies": { "jsonc-parser": "^3.2.0", - "mlly": "^1.1.1", + "mlly": "^1.2.0", "pathe": "^1.1.0" } }, @@ -1933,6 +2011,21 @@ "loose-envify": "^1.1.0" } }, + "node_modules/semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/send": { "version": "0.18.0", "license": "MIT", @@ -1994,39 +2087,12 @@ "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", "dev": true }, - "node_modules/slice-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", - "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.0.0", - "is-fullwidth-code-point": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, + "optional": true, "engines": { "node": ">=0.10.0" } @@ -2058,50 +2124,6 @@ "integrity": "sha512-uUZI65yrV2Qva5gqE0+A7uVAvO40iPo6jGhs7s8keRfHCmtg+uB2X6EiLGCI9IgL1J17xGhvoOqSz79lzICPTA==", "dev": true }, - "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/strip-ansi/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, "node_modules/strip-literal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.1.tgz", @@ -2131,25 +2153,34 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "node_modules/time-zone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", + "integrity": "sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/tinybench": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.4.0.tgz", - "integrity": "sha512-iyziEiyFxX4kyxSp+MtY1oCH/lvjH3PxFN8PGCDeqcZWAJ/i+9y+nL85w99PxVzrIvew/GSkSbDYtiGVa85Afg==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.0.tgz", + "integrity": "sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==", "dev": true }, "node_modules/tinypool": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.4.0.tgz", - "integrity": "sha512-2ksntHOKf893wSAH4z/+JbPpi92esw8Gn9N2deXX+B0EO92hexAVI9GIZZPx7P5aYo5KULfeOSt3kMOmSOy6uA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.5.0.tgz", + "integrity": "sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==", "dev": true, "engines": { "node": ">=14.0.0" } }, "node_modules/tinyspy": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-1.1.1.tgz", - "integrity": "sha512-UVq5AXt/gQlti7oxoIg5oi/9r0WpF7DGEVwXgqWSMmyN16+e3tl5lIvTaOpJ3TAtu5xFzWccFRM4R5NaWHF+4g==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.0.tgz", + "integrity": "sha512-7eORpyqImoOvkQJCSkL0d0mB4NHHIFAy4b1u8PHdDa7SjGS2njzl6/lyGoZLm+eyYEtlUmFGE0rFj66SWxZgQQ==", "dev": true, "engines": { "node": ">=14.0.0" @@ -2259,9 +2290,9 @@ } }, "node_modules/ufo": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.1.1.tgz", - "integrity": "sha512-MvlCc4GHrmZdAllBc0iUDowff36Q9Ndw/UzqmEKyrfSzokTd9ZCy1i+IIk5hrYKkjoYVQyNbrw7/F8XJ2rEwTg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.1.2.tgz", + "integrity": "sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==", "dev": true }, "node_modules/universalify": { @@ -2345,14 +2376,14 @@ } }, "node_modules/vite-node": { - "version": "0.29.8", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.29.8.tgz", - "integrity": "sha512-b6OtCXfk65L6SElVM20q5G546yu10/kNrhg08afEoWlFRJXFq9/6glsvSVY+aI6YeC1tu2TtAqI2jHEQmOmsFw==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.31.1.tgz", + "integrity": "sha512-BajE/IsNQ6JyizPzu9zRgHrBwczkAs0erQf/JRpgTIESpKvNj9/Gd0vxX905klLkb0I0SJVCKbdrl5c6FnqYKA==", "dev": true, "dependencies": { "cac": "^6.7.14", "debug": "^4.3.4", - "mlly": "^1.1.0", + "mlly": "^1.2.0", "pathe": "^1.1.0", "picocolors": "^1.0.0", "vite": "^3.0.0 || ^4.0.0" @@ -2361,10 +2392,10 @@ "vite-node": "vite-node.mjs" }, "engines": { - "node": ">=v14.16.0" + "node": ">=v14.18.0" }, "funding": { - "url": "https://github.com/sponsors/antfu" + "url": "https://opencollective.com/vitest" } }, "node_modules/vite-node/node_modules/debug": { @@ -2433,44 +2464,45 @@ "dev": true }, "node_modules/vitest": { - "version": "0.29.8", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.29.8.tgz", - "integrity": "sha512-JIAVi2GK5cvA6awGpH0HvH/gEG9PZ0a/WoxdiV3PmqK+3CjQMf8c+J/Vhv4mdZ2nRyXFw66sAg6qz7VNkaHfDQ==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.31.1.tgz", + "integrity": "sha512-/dOoOgzoFk/5pTvg1E65WVaobknWREN15+HF+0ucudo3dDG/vCZoXTQrjIfEaWvQXmqScwkRodrTbM/ScMpRcQ==", "dev": true, "dependencies": { - "@types/chai": "^4.3.4", + "@types/chai": "^4.3.5", "@types/chai-subset": "^1.3.3", "@types/node": "*", - "@vitest/expect": "0.29.8", - "@vitest/runner": "0.29.8", - "@vitest/spy": "0.29.8", - "@vitest/utils": "0.29.8", - "acorn": "^8.8.1", + "@vitest/expect": "0.31.1", + "@vitest/runner": "0.31.1", + "@vitest/snapshot": "0.31.1", + "@vitest/spy": "0.31.1", + "@vitest/utils": "0.31.1", + "acorn": "^8.8.2", "acorn-walk": "^8.2.0", "cac": "^6.7.14", "chai": "^4.3.7", + "concordance": "^5.0.4", "debug": "^4.3.4", - "local-pkg": "^0.4.2", + "local-pkg": "^0.4.3", + "magic-string": "^0.30.0", "pathe": "^1.1.0", "picocolors": "^1.0.0", - "source-map": "^0.6.1", - "std-env": "^3.3.1", - "strip-literal": "^1.0.0", - "tinybench": "^2.3.1", - "tinypool": "^0.4.0", - "tinyspy": "^1.0.2", + "std-env": "^3.3.2", + "strip-literal": "^1.0.1", + "tinybench": "^2.5.0", + "tinypool": "^0.5.0", "vite": "^3.0.0 || ^4.0.0", - "vite-node": "0.29.8", + "vite-node": "0.31.1", "why-is-node-running": "^2.2.2" }, "bin": { "vitest": "vitest.mjs" }, "engines": { - "node": ">=v14.16.0" + "node": ">=v14.18.0" }, "funding": { - "url": "https://github.com/sponsors/antfu" + "url": "https://opencollective.com/vitest" }, "peerDependencies": { "@edge-runtime/vm": "*", @@ -2547,6 +2579,15 @@ "dev": true, "license": "BSD-2-Clause" }, + "node_modules/well-known-symbols": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz", + "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/whatwg-encoding": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", @@ -2650,6 +2691,12 @@ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/yocto-queue": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", @@ -2671,6 +2718,12 @@ } }, "dependencies": { + "@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -2722,9 +2775,9 @@ } }, "@types/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz", + "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==", "dev": true }, "@types/chai-subset": { @@ -2805,44 +2858,55 @@ } }, "@vitest/expect": { - "version": "0.29.8", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.29.8.tgz", - "integrity": "sha512-xlcVXn5I5oTq6NiZSY3ykyWixBxr5mG8HYtjvpgg6KaqHm0mvhX18xuwl5YGxIRNt/A5jidd7CWcNHrSvgaQqQ==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.31.1.tgz", + "integrity": "sha512-BV1LyNvhnX+eNYzJxlHIGPWZpwJFZaCcOIzp2CNG0P+bbetenTupk6EO0LANm4QFt0TTit+yqx7Rxd1qxi/SQA==", "dev": true, "requires": { - "@vitest/spy": "0.29.8", - "@vitest/utils": "0.29.8", + "@vitest/spy": "0.31.1", + "@vitest/utils": "0.31.1", "chai": "^4.3.7" } }, "@vitest/runner": { - "version": "0.29.8", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.29.8.tgz", - "integrity": "sha512-FzdhnRDwEr/A3Oo1jtIk/B952BBvP32n1ObMEb23oEJNO+qO5cBet6M2XWIDQmA7BDKGKvmhUf2naXyp/2JEwQ==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.31.1.tgz", + "integrity": "sha512-imWuc82ngOtxdCUpXwtEzZIuc1KMr+VlQ3Ondph45VhWoQWit5yvG/fFcldbnCi8DUuFi+NmNx5ehMUw/cGLUw==", "dev": true, "requires": { - "@vitest/utils": "0.29.8", + "@vitest/utils": "0.31.1", + "concordance": "^5.0.4", "p-limit": "^4.0.0", "pathe": "^1.1.0" } }, + "@vitest/snapshot": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.31.1.tgz", + "integrity": "sha512-L3w5uU9bMe6asrNzJ8WZzN+jUTX4KSgCinEJPXyny0o90fG4FPQMV0OWsq7vrCWfQlAilMjDnOF9nP8lidsJ+g==", + "dev": true, + "requires": { + "magic-string": "^0.30.0", + "pathe": "^1.1.0", + "pretty-format": "^27.5.1" + } + }, "@vitest/spy": { - "version": "0.29.8", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.29.8.tgz", - "integrity": "sha512-VdjBe9w34vOMl5I5mYEzNX8inTxrZ+tYUVk9jxaZJmHFwmDFC/GV3KBFTA/JKswr3XHvZL+FE/yq5EVhb6pSAw==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.31.1.tgz", + "integrity": "sha512-1cTpt2m9mdo3hRLDyCG2hDQvRrePTDgEJBFQQNz1ydHHZy03EiA6EpFxY+7ODaY7vMRCie+WlFZBZ0/dQWyssQ==", "dev": true, "requires": { - "tinyspy": "^1.0.2" + "tinyspy": "^2.1.0" } }, "@vitest/utils": { - "version": "0.29.8", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.29.8.tgz", - "integrity": "sha512-qGzuf3vrTbnoY+RjjVVIBYfuWMjn3UMUqyQtdGNZ6ZIIyte7B37exj6LaVkrZiUTvzSadVvO/tJm8AEgbGCBPg==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.31.1.tgz", + "integrity": "sha512-yFyRD5ilwojsZfo3E0BnH72pSVSuLg2356cN1tCEe/0RtDzxTPYwOomIC+eQbot7m6DRy4tPZw+09mB7NkbMmA==", "dev": true, "requires": { - "cli-truncate": "^3.1.0", - "diff": "^5.1.0", + "concordance": "^5.0.4", "loupe": "^2.3.6", "pretty-format": "^27.5.1" } @@ -2947,6 +3011,12 @@ "version": "2.2.0", "dev": true }, + "blueimp-md5": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz", + "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==", + "dev": true + }, "body-parser": { "version": "1.20.0", "requires": { @@ -3022,16 +3092,6 @@ "readdirp": "~3.6.0" } }, - "cli-truncate": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", - "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", - "dev": true, - "requires": { - "slice-ansi": "^5.0.0", - "string-width": "^5.0.0" - } - }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -3047,6 +3107,22 @@ "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true }, + "concordance": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/concordance/-/concordance-5.0.4.tgz", + "integrity": "sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==", + "dev": true, + "requires": { + "date-time": "^3.1.0", + "esutils": "^2.0.3", + "fast-diff": "^1.2.0", + "js-string-escape": "^1.0.1", + "lodash": "^4.17.15", + "md5-hex": "^3.0.1", + "semver": "^7.3.2", + "well-known-symbols": "^2.0.0" + } + }, "content-disposition": { "version": "0.5.4", "requires": { @@ -3121,6 +3197,15 @@ } } }, + "date-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz", + "integrity": "sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==", + "dev": true, + "requires": { + "time-zone": "^1.0.0" + } + }, "debug": { "version": "2.6.9", "requires": { @@ -3160,12 +3245,6 @@ "destroy": { "version": "1.2.0" }, - "diff": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", - "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", - "dev": true - }, "domexception": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", @@ -3183,21 +3262,9 @@ } } }, - "eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, "ee-first": { "version": "1.1.1" }, - "emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, "encodeurl": { "version": "1.0.2" }, @@ -3312,6 +3379,12 @@ "vary": "~1.1.2" } }, + "fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, "fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", @@ -3524,12 +3597,6 @@ "version": "2.1.1", "dev": true }, - "is-fullwidth-code-point": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", - "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", - "dev": true - }, "is-glob": { "version": "4.0.3", "dev": true, @@ -3547,6 +3614,12 @@ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, + "js-string-escape": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", + "integrity": "sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==", + "dev": true + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3630,7 +3703,15 @@ } }, "local-pkg": { - "version": "0.4.2", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", + "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", + "dev": true + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, "loose-envify": { @@ -3650,6 +3731,33 @@ "get-func-name": "^2.0.0" } }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "magic-string": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz", + "integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==", + "dev": true, + "requires": { + "@jridgewell/sourcemap-codec": "^1.4.13" + } + }, + "md5-hex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz", + "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==", + "dev": true, + "requires": { + "blueimp-md5": "^2.10.0" + } + }, "media-typer": { "version": "0.3.0" }, @@ -3688,15 +3796,15 @@ } }, "mlly": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.2.0.tgz", - "integrity": "sha512-+c7A3CV0KGdKcylsI6khWyts/CYrGTrRVo4R/I7u/cUsy0Conxa6LUhiEzVKIw14lc2L5aiO4+SeVe4TeGRKww==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.2.1.tgz", + "integrity": "sha512-1aMEByaWgBPEbWV2BOPEMySRrzl7rIHXmQxam4DM8jVjalTQDjpN2ZKOLUrwyhfZQO7IXHml2StcHMhooDeEEQ==", "dev": true, "requires": { "acorn": "^8.8.2", "pathe": "^1.1.0", - "pkg-types": "^1.0.2", - "ufo": "^1.1.1" + "pkg-types": "^1.0.3", + "ufo": "^1.1.2" } }, "ms": { @@ -3798,13 +3906,13 @@ "dev": true }, "pkg-types": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.2.tgz", - "integrity": "sha512-hM58GKXOcj8WTqUXnsQyJYXdeAPbythQgEF3nTcEo+nkD49chjQ9IKm/QJy9xf6JakXptz86h7ecP2024rrLaQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", + "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", "dev": true, "requires": { "jsonc-parser": "^3.2.0", - "mlly": "^1.1.1", + "mlly": "^1.2.0", "pathe": "^1.1.0" } }, @@ -3985,6 +4093,15 @@ "loose-envify": "^1.1.0" } }, + "semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, "send": { "version": "0.18.0", "requires": { @@ -4034,29 +4151,12 @@ "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", "dev": true }, - "slice-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", - "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", - "dev": true, - "requires": { - "ansi-styles": "^6.0.0", - "is-fullwidth-code-point": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true - } - } - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "dev": true, + "optional": true }, "source-map-js": { "version": "1.0.2", @@ -4077,34 +4177,6 @@ "integrity": "sha512-uUZI65yrV2Qva5gqE0+A7uVAvO40iPo6jGhs7s8keRfHCmtg+uB2X6EiLGCI9IgL1J17xGhvoOqSz79lzICPTA==", "dev": true }, - "string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "requires": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - } - }, - "strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", - "dev": true, - "requires": { - "ansi-regex": "^6.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true - } - } - }, "strip-literal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.0.1.tgz", @@ -4124,22 +4196,28 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "time-zone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", + "integrity": "sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==", + "dev": true + }, "tinybench": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.4.0.tgz", - "integrity": "sha512-iyziEiyFxX4kyxSp+MtY1oCH/lvjH3PxFN8PGCDeqcZWAJ/i+9y+nL85w99PxVzrIvew/GSkSbDYtiGVa85Afg==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.0.tgz", + "integrity": "sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==", "dev": true }, "tinypool": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.4.0.tgz", - "integrity": "sha512-2ksntHOKf893wSAH4z/+JbPpi92esw8Gn9N2deXX+B0EO92hexAVI9GIZZPx7P5aYo5KULfeOSt3kMOmSOy6uA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.5.0.tgz", + "integrity": "sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==", "dev": true }, "tinyspy": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-1.1.1.tgz", - "integrity": "sha512-UVq5AXt/gQlti7oxoIg5oi/9r0WpF7DGEVwXgqWSMmyN16+e3tl5lIvTaOpJ3TAtu5xFzWccFRM4R5NaWHF+4g==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.0.tgz", + "integrity": "sha512-7eORpyqImoOvkQJCSkL0d0mB4NHHIFAy4b1u8PHdDa7SjGS2njzl6/lyGoZLm+eyYEtlUmFGE0rFj66SWxZgQQ==", "dev": true }, "to-regex-range": { @@ -4204,9 +4282,9 @@ "dev": true }, "ufo": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.1.1.tgz", - "integrity": "sha512-MvlCc4GHrmZdAllBc0iUDowff36Q9Ndw/UzqmEKyrfSzokTd9ZCy1i+IIk5hrYKkjoYVQyNbrw7/F8XJ2rEwTg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.1.2.tgz", + "integrity": "sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==", "dev": true }, "universalify": { @@ -4246,14 +4324,14 @@ } }, "vite-node": { - "version": "0.29.8", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.29.8.tgz", - "integrity": "sha512-b6OtCXfk65L6SElVM20q5G546yu10/kNrhg08afEoWlFRJXFq9/6glsvSVY+aI6YeC1tu2TtAqI2jHEQmOmsFw==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.31.1.tgz", + "integrity": "sha512-BajE/IsNQ6JyizPzu9zRgHrBwczkAs0erQf/JRpgTIESpKvNj9/Gd0vxX905klLkb0I0SJVCKbdrl5c6FnqYKA==", "dev": true, "requires": { "cac": "^6.7.14", "debug": "^4.3.4", - "mlly": "^1.1.0", + "mlly": "^1.2.0", "pathe": "^1.1.0", "picocolors": "^1.0.0", "vite": "^3.0.0 || ^4.0.0" @@ -4305,34 +4383,35 @@ } }, "vitest": { - "version": "0.29.8", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.29.8.tgz", - "integrity": "sha512-JIAVi2GK5cvA6awGpH0HvH/gEG9PZ0a/WoxdiV3PmqK+3CjQMf8c+J/Vhv4mdZ2nRyXFw66sAg6qz7VNkaHfDQ==", + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.31.1.tgz", + "integrity": "sha512-/dOoOgzoFk/5pTvg1E65WVaobknWREN15+HF+0ucudo3dDG/vCZoXTQrjIfEaWvQXmqScwkRodrTbM/ScMpRcQ==", "dev": true, "requires": { - "@types/chai": "^4.3.4", + "@types/chai": "^4.3.5", "@types/chai-subset": "^1.3.3", "@types/node": "*", - "@vitest/expect": "0.29.8", - "@vitest/runner": "0.29.8", - "@vitest/spy": "0.29.8", - "@vitest/utils": "0.29.8", - "acorn": "^8.8.1", + "@vitest/expect": "0.31.1", + "@vitest/runner": "0.31.1", + "@vitest/snapshot": "0.31.1", + "@vitest/spy": "0.31.1", + "@vitest/utils": "0.31.1", + "acorn": "^8.8.2", "acorn-walk": "^8.2.0", "cac": "^6.7.14", "chai": "^4.3.7", + "concordance": "^5.0.4", "debug": "^4.3.4", - "local-pkg": "^0.4.2", + "local-pkg": "^0.4.3", + "magic-string": "^0.30.0", "pathe": "^1.1.0", "picocolors": "^1.0.0", - "source-map": "^0.6.1", - "std-env": "^3.3.1", - "strip-literal": "^1.0.0", - "tinybench": "^2.3.1", - "tinypool": "^0.4.0", - "tinyspy": "^1.0.2", + "std-env": "^3.3.2", + "strip-literal": "^1.0.1", + "tinybench": "^2.5.0", + "tinypool": "^0.5.0", "vite": "^3.0.0 || ^4.0.0", - "vite-node": "0.29.8", + "vite-node": "0.31.1", "why-is-node-running": "^2.2.2" }, "dependencies": { @@ -4362,6 +4441,12 @@ "version": "3.0.1", "dev": true }, + "well-known-symbols": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz", + "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==", + "dev": true + }, "whatwg-encoding": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", @@ -4431,6 +4516,12 @@ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "yocto-queue": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", diff --git a/package.json b/package.json index f4eccac..49636b4 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "prettier": "^2.8.7", "typescript": "^5.0.3", "vite-tsconfig-paths": "^4.0.7", - "vitest": "^0.29.8" + "vitest": "^0.31.1" }, "scripts": { "exercise": "tt-cli run", @@ -143,4 +143,4 @@ "react-dom": "^18.2.0", "zod": "^3.17.10" } -} \ No newline at end of file +} diff --git a/scripts/tests/__snapshots__/all.test.ts.snap b/scripts/tests/__snapshots__/all.test.ts.snap index c8eee20..f2310b6 100644 --- a/scripts/tests/__snapshots__/all.test.ts.snap +++ b/scripts/tests/__snapshots__/all.test.ts.snap @@ -64,13 +64,13 @@ src/04-advanced-components/22-discriminated-union-props.problem.tsx(27,9): error src/04-advanced-components/23-destructuring-discriminated-unions.problem.tsx(13,34): error TS2339: Property 'title' does not exist on type 'ModalProps'. src/04-advanced-components/23-destructuring-discriminated-unions.solution.1.tsx(17,31): error TS2339: Property 'title' does not exist on type '{} | { title: string; }'. Property 'title' does not exist on type '{}'. -src/04-advanced-components/25-discriminated-union-with-other-props.problem.tsx(24,9): error TS2322: Type '{ buttonColor: string; variant: \\"no-title\\"; title: string; }' is not assignable to type 'IntrinsicAttributes & ModalProps'. +src/04-advanced-components/24-discriminated-union-with-other-props.problem.tsx(24,9): error TS2322: Type '{ buttonColor: string; variant: \\"no-title\\"; title: string; }' is not assignable to type 'IntrinsicAttributes & ModalProps'. Property 'buttonColor' does not exist on type 'IntrinsicAttributes & { variant: \\"no-title\\"; }'. -src/04-advanced-components/25-discriminated-union-with-other-props.problem.tsx(26,9): error TS2578: Unused '@ts-expect-error' directive. -src/04-advanced-components/25-discriminated-union-with-other-props.problem.tsx(29,44): error TS2322: Type '{ variant: \\"title\\"; title: string; buttonColor: string; }' is not assignable to type 'IntrinsicAttributes & ModalProps'. +src/04-advanced-components/24-discriminated-union-with-other-props.problem.tsx(26,9): error TS2578: Unused '@ts-expect-error' directive. +src/04-advanced-components/24-discriminated-union-with-other-props.problem.tsx(29,44): error TS2322: Type '{ variant: \\"title\\"; title: string; buttonColor: string; }' is not assignable to type 'IntrinsicAttributes & ModalProps'. Property 'buttonColor' does not exist on type 'IntrinsicAttributes & { variant: \\"title\\"; title: string; }'. -src/04-advanced-components/26-either-all-these-props-or-none.problem.tsx(30,8): error TS2578: Unused '@ts-expect-error' directive. -src/04-advanced-components/26-either-all-these-props-or-none.problem.tsx(33,8): error TS2578: Unused '@ts-expect-error' directive. +src/04-advanced-components/25-either-all-these-props-or-none.problem.tsx(30,8): error TS2578: Unused '@ts-expect-error' directive. +src/04-advanced-components/25-either-all-these-props-or-none.problem.tsx(33,8): error TS2578: Unused '@ts-expect-error' directive. src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx(8,30): error TS2345: Argument of type 'ReactNode' is not assignable to parameter of type '(value: number, index: number, array: number[]) => ReactNode'. Type 'undefined' is not assignable to type '(value: number, index: number, array: number[]) => ReactNode'. src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx(15,19): error TS2322: Type '(index: any) => Element' is not assignable to type 'ReactNode'. @@ -95,36 +95,44 @@ src/05-advanced-hooks/32-typing-custom-hooks.problem.ts(4,23): error TS7006: Par src/05-advanced-hooks/32-typing-custom-hooks.problem.ts(10,22): error TS2344: Type 'false' does not satisfy the constraint 'true'. src/05-advanced-hooks/33-tuple-return-type.problem.ts(13,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. src/05-advanced-hooks/33-tuple-return-type.problem.ts(14,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/34-generic-hooks.problem.ts(16,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/34-generic-hooks.problem.ts(18,5): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/34-generic-hooks.problem.ts(28,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/34-generic-hooks.problem.ts(29,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/35-function-overloads-in-hooks.problem.ts(25,13): error TS2554: Expected 1 arguments, but got 0. -src/05-advanced-hooks/35-function-overloads-in-hooks.problem.ts(28,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/35-function-overloads-in-hooks.problem.ts(30,5): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/36-generic-localstorage-hook.problem.ts(15,30): error TS2558: Expected 0 type arguments, but got 1. -src/05-advanced-hooks/36-generic-localstorage-hook.problem.ts(22,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/36-generic-localstorage-hook.problem.ts(28,5): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.problem.tsx(26,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.problem.tsx(32,5): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/38-unions-in-usestate.problem.tsx(49,3): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/38-unions-in-usestate.problem.tsx(66,22): error TS2344: Type 'false' does not satisfy the constraint 'true'. -src/05-advanced-hooks/39-discriminated-unions-in-usestate.problem.tsx(37,3): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/39-discriminated-unions-in-usestate.problem.tsx(40,3): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/39-discriminated-unions-in-usestate.problem.tsx(43,3): error TS2578: Unused '@ts-expect-error' directive. -src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx(31,25): error TS18048: 'value' is possibly 'undefined'. -src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx(31,31): error TS2339: Property 'message' does not exist on type 'Error | { title: string; }'. +src/05-advanced-hooks/35-generic-hooks.problem.ts(16,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/35-generic-hooks.problem.ts(18,5): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/35-generic-hooks.problem.ts(28,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/35-generic-hooks.problem.ts(29,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/36-function-overloads-in-hooks.problem.ts(25,13): error TS2554: Expected 1 arguments, but got 0. +src/05-advanced-hooks/36-function-overloads-in-hooks.problem.ts(28,10): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/36-function-overloads-in-hooks.problem.ts(30,5): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/37-generic-localstorage-hook.problem.ts(15,30): error TS2558: Expected 0 type arguments, but got 1. +src/05-advanced-hooks/37-generic-localstorage-hook.problem.ts(22,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/37-generic-localstorage-hook.problem.ts(28,5): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/38-generic-localstorage-hook-with-zod.problem.tsx(26,24): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/38-generic-localstorage-hook-with-zod.problem.tsx(32,5): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/39-unions-in-usestate.problem.tsx(49,3): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/39-unions-in-usestate.problem.tsx(66,22): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/05-advanced-hooks/40-discriminated-unions-in-usestate.problem.tsx(37,3): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/40-discriminated-unions-in-usestate.problem.tsx(40,3): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/40-discriminated-unions-in-usestate.problem.tsx(43,3): error TS2578: Unused '@ts-expect-error' directive. +src/05-advanced-hooks/42-discriminated-tuples-from-custom-hooks.problem.tsx(31,25): error TS18048: 'value' is possibly 'undefined'. +src/05-advanced-hooks/42-discriminated-tuples-from-custom-hooks.problem.tsx(31,31): error TS2339: Property 'message' does not exist on type 'Error | { title: string; }'. Property 'message' does not exist on type '{ title: string; }'. -src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx(34,16): error TS18048: 'value' is possibly 'undefined'. -src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx(34,22): error TS2339: Property 'title' does not exist on type 'Error | { title: string; }'. +src/05-advanced-hooks/42-discriminated-tuples-from-custom-hooks.problem.tsx(34,16): error TS18048: 'value' is possibly 'undefined'. +src/05-advanced-hooks/42-discriminated-tuples-from-custom-hooks.problem.tsx(34,22): error TS2339: Property 'title' does not exist on type 'Error | { title: string; }'. Property 'title' does not exist on type 'Error'. -src/06-types-deep-dive/49-add-attribute-to-div-elements.problem.tsx(6,7): error TS2717: Subsequent property declarations must have the same type. Property 'div' must be of type 'DetailedHTMLProps, HTMLDivElement>', but here has type 'ClassAttributes & HTMLAttributes & { something?: string | undefined; }'. -src/06-types-deep-dive/49-add-attribute-to-div-elements.problem.tsx(13,30): error TS2322: Type '{ something: string; }' is not assignable to type 'DetailedHTMLProps, HTMLDivElement>'. +src/06-types-deep-dive/50-add-attribute-to-div-elements.problem.tsx(6,7): error TS2717: Subsequent property declarations must have the same type. Property 'div' must be of type 'DetailedHTMLProps, HTMLDivElement>', but here has type 'ClassAttributes & HTMLAttributes & { something?: string | undefined; }'. +src/06-types-deep-dive/50-add-attribute-to-div-elements.problem.tsx(13,30): error TS2322: Type '{ something: string; }' is not assignable to type 'DetailedHTMLProps, HTMLDivElement>'. Property 'something' does not exist on type 'DetailedHTMLProps, HTMLDivElement>'. -src/07-advanced-patterns/54-as-prop.solution.1.tsx(18,5): error TS2322: Type '{ as: \\"div\\"; href: string; }' is not assignable to type 'IntrinsicAttributes & AsProps'. - Property 'href' does not exist on type 'IntrinsicAttributes & { as: \\"div\\"; } & ClassAttributes & HTMLAttributes'. Did you mean 'ref'? -src/07-advanced-patterns/55-as-prop-with-custom-components.problem.tsx(12,35): error TS2322: Type '{ as: (props: { href: string; children?: ReactNode; }) => Element; href: string; }' is not assignable to type 'IntrinsicAttributes & { as: any; }'. - Property 'href' does not exist on type 'IntrinsicAttributes & { as: any; }'. +src/07-advanced-patterns/51-required-context.problem.tsx(20,55): error TS2558: Expected 0 type arguments, but got 1. +src/07-advanced-patterns/51-required-context.problem.tsx(24,57): error TS2558: Expected 0 type arguments, but got 1. +src/07-advanced-patterns/51-required-context.problem.tsx(32,5): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/07-advanced-patterns/51-required-context.problem.tsx(43,5): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/07-advanced-patterns/51-required-context.problem.tsx(57,21): error TS2322: Type '{ name: string; }' is not assignable to type 'null'. +src/07-advanced-patterns/51-required-context.problem.tsx(59,11): error TS2322: Type '{ primaryColor: string; }' is not assignable to type 'null'. +src/07-advanced-patterns/53-forward-ref-with-generics.explainer.1.tsx(26,28): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/07-advanced-patterns/53-forward-ref-with-generics.explainer.2.tsx(26,28): error TS2344: Type 'false' does not satisfy the constraint 'true'. +src/07-advanced-patterns/55-as-prop.problem.tsx(13,5): error TS2578: Unused '@ts-expect-error' directive. +src/07-advanced-patterns/56-as-prop-with-custom-components.problem.tsx(5,11): error TS2604: JSX element type 'Comp' does not have any construct or call signatures. +src/07-advanced-patterns/56-as-prop-with-custom-components.problem.tsx(12,22): error TS2322: Type '{ as: (props: { href: string; children?: ReactNode; }) => Element; href: string; }' is not assignable to type 'IntrinsicAttributes & { as: unknown; }'. + Property 'href' does not exist on type 'IntrinsicAttributes & { as: unknown; }'. ," `; @@ -471,44 +479,44 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/24-discriminated-union-props-with-booleans.problem.tsx", - "name": "/src/04-advanced-components/24-discriminated-union-props-with-booleans.problem.tsx", + "message": "No test found in suite src/04-advanced-components/24-discriminated-union-with-other-props.problem.tsx", + "name": "/src/04-advanced-components/24-discriminated-union-with-other-props.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/25-discriminated-union-with-other-props.problem.tsx", - "name": "/src/04-advanced-components/25-discriminated-union-with-other-props.problem.tsx", + "message": "No test found in suite src/04-advanced-components/24-discriminated-union-with-other-props.solution.tsx", + "name": "/src/04-advanced-components/24-discriminated-union-with-other-props.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/25-discriminated-union-with-other-props.solution.tsx", - "name": "/src/04-advanced-components/25-discriminated-union-with-other-props.solution.tsx", + "message": "No test found in suite src/04-advanced-components/25-either-all-these-props-or-none.problem.tsx", + "name": "/src/04-advanced-components/25-either-all-these-props-or-none.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/26-either-all-these-props-or-none.problem.tsx", - "name": "/src/04-advanced-components/26-either-all-these-props-or-none.problem.tsx", + "message": "No test found in suite src/04-advanced-components/25-either-all-these-props-or-none.solution.1.tsx", + "name": "/src/04-advanced-components/25-either-all-these-props-or-none.solution.1.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/26-either-all-these-props-or-none.solution.1.tsx", - "name": "/src/04-advanced-components/26-either-all-these-props-or-none.solution.1.tsx", + "message": "No test found in suite src/04-advanced-components/25-either-all-these-props-or-none.solution.2.tsx", + "name": "/src/04-advanced-components/25-either-all-these-props-or-none.solution.2.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/26-either-all-these-props-or-none.solution.2.tsx", - "name": "/src/04-advanced-components/26-either-all-these-props-or-none.solution.2.tsx", + "message": "No test found in suite src/04-advanced-components/25-either-all-these-props-or-none.solution.3.tsx", + "name": "/src/04-advanced-components/25-either-all-these-props-or-none.solution.3.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/04-advanced-components/26-either-all-these-props-or-none.solution.3.tsx", - "name": "/src/04-advanced-components/26-either-all-these-props-or-none.solution.3.tsx", + "message": "No test found in suite src/04-advanced-components/26-partial-autocomplete.problem.tsx", + "name": "/src/04-advanced-components/26-partial-autocomplete.problem.tsx", "status": "passed", }, { @@ -626,58 +634,64 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` "name": "/src/05-advanced-hooks/33-tuple-return-type.solution.2.ts", "status": "passed", }, + { + "assertionResults": [], + "message": "No test found in suite src/05-advanced-hooks/34-discriminated-unions-with-booleans.problem.ts", + "name": "/src/05-advanced-hooks/34-discriminated-unions-with-booleans.problem.ts", + "status": "passed", + }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/34-generic-hooks.problem.ts", + "name": "/src/05-advanced-hooks/35-generic-hooks.problem.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/34-generic-hooks.solution.1.ts", + "name": "/src/05-advanced-hooks/35-generic-hooks.solution.1.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/34-generic-hooks.solution.2.ts", + "name": "/src/05-advanced-hooks/35-generic-hooks.solution.2.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/34-generic-hooks.solution.3.ts", + "name": "/src/05-advanced-hooks/35-generic-hooks.solution.3.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/34-generic-hooks.solution.4.ts", + "name": "/src/05-advanced-hooks/35-generic-hooks.solution.4.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/34-generic-hooks.solution.5.ts", + "name": "/src/05-advanced-hooks/35-generic-hooks.solution.5.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/35-function-overloads-in-hooks.problem.ts", + "name": "/src/05-advanced-hooks/36-function-overloads-in-hooks.problem.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/35-function-overloads-in-hooks.solution.1.ts", + "name": "/src/05-advanced-hooks/36-function-overloads-in-hooks.solution.1.ts", "status": "passed", }, { "assertionResults": [], "message": "Cannot read properties of null (reading 'useState')", - "name": "/src/05-advanced-hooks/35-function-overloads-in-hooks.solution.2.ts", + "name": "/src/05-advanced-hooks/36-function-overloads-in-hooks.solution.2.ts", "status": "passed", }, { @@ -702,7 +716,7 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, ], "message": "", - "name": "/src/05-advanced-hooks/36-generic-localstorage-hook.problem.ts", + "name": "/src/05-advanced-hooks/37-generic-localstorage-hook.problem.ts", "status": "passed", }, { @@ -727,7 +741,7 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, ], "message": "", - "name": "/src/05-advanced-hooks/36-generic-localstorage-hook.solution.ts", + "name": "/src/05-advanced-hooks/37-generic-localstorage-hook.solution.ts", "status": "passed", }, { @@ -752,7 +766,7 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, ], "message": "", - "name": "/src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.problem.tsx", + "name": "/src/05-advanced-hooks/38-generic-localstorage-hook-with-zod.problem.tsx", "status": "passed", }, { @@ -777,205 +791,223 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, ], "message": "", - "name": "/src/05-advanced-hooks/37-generic-localstorage-hook-with-zod.solution.tsx", + "name": "/src/05-advanced-hooks/38-generic-localstorage-hook-with-zod.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/38-unions-in-usestate.problem.tsx", - "name": "/src/05-advanced-hooks/38-unions-in-usestate.problem.tsx", + "message": "No test found in suite src/05-advanced-hooks/39-unions-in-usestate.problem.tsx", + "name": "/src/05-advanced-hooks/39-unions-in-usestate.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/38-unions-in-usestate.solution.tsx", - "name": "/src/05-advanced-hooks/38-unions-in-usestate.solution.tsx", + "message": "No test found in suite src/05-advanced-hooks/39-unions-in-usestate.solution.tsx", + "name": "/src/05-advanced-hooks/39-unions-in-usestate.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/39-discriminated-unions-in-usestate.problem.tsx", - "name": "/src/05-advanced-hooks/39-discriminated-unions-in-usestate.problem.tsx", + "message": "No test found in suite src/05-advanced-hooks/40-discriminated-unions-in-usestate.problem.tsx", + "name": "/src/05-advanced-hooks/40-discriminated-unions-in-usestate.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/39-discriminated-unions-in-usestate.solution.tsx", - "name": "/src/05-advanced-hooks/39-discriminated-unions-in-usestate.solution.tsx", + "message": "No test found in suite src/05-advanced-hooks/40-discriminated-unions-in-usestate.solution.tsx", + "name": "/src/05-advanced-hooks/40-discriminated-unions-in-usestate.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/40-discriminated-union-returns-from-custom-hooks.problem.ts", - "name": "/src/05-advanced-hooks/40-discriminated-union-returns-from-custom-hooks.problem.ts", + "message": "No test found in suite src/05-advanced-hooks/41-discriminated-union-returns-from-custom-hooks.problem.ts", + "name": "/src/05-advanced-hooks/41-discriminated-union-returns-from-custom-hooks.problem.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx", - "name": "/src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.problem.tsx", + "message": "No test found in suite src/05-advanced-hooks/42-discriminated-tuples-from-custom-hooks.problem.tsx", + "name": "/src/05-advanced-hooks/42-discriminated-tuples-from-custom-hooks.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.solution.tsx", - "name": "/src/05-advanced-hooks/41-discriminated-tuples-from-custom-hooks.solution.tsx", + "message": "No test found in suite src/05-advanced-hooks/42-discriminated-tuples-from-custom-hooks.solution.tsx", + "name": "/src/05-advanced-hooks/42-discriminated-tuples-from-custom-hooks.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/42-understand-react-namespace-export.explainer.ts", - "name": "/src/06-types-deep-dive/42-understand-react-namespace-export.explainer.ts", + "message": "No test found in suite src/06-types-deep-dive/43-understand-react-namespace-export.explainer.ts", + "name": "/src/06-types-deep-dive/43-understand-react-namespace-export.explainer.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/43-understanding-jsx-element.explainer.tsx", - "name": "/src/06-types-deep-dive/43-understanding-jsx-element.explainer.tsx", + "message": "No test found in suite src/06-types-deep-dive/44-understanding-jsx-element.explainer.tsx", + "name": "/src/06-types-deep-dive/44-understanding-jsx-element.explainer.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/44-strongly-typing-children.problem.tsx", - "name": "/src/06-types-deep-dive/44-strongly-typing-children.problem.tsx", + "message": "No test found in suite src/06-types-deep-dive/45-strongly-typing-children.problem.tsx", + "name": "/src/06-types-deep-dive/45-strongly-typing-children.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/45-how-does-react-represent-html.explainer.ts", - "name": "/src/06-types-deep-dive/45-how-does-react-represent-html.explainer.ts", + "message": "No test found in suite src/06-types-deep-dive/46-how-does-react-represent-html.explainer.ts", + "name": "/src/06-types-deep-dive/46-how-does-react-represent-html.explainer.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/45-understanding-jsx-intrinsic-elements.explainer.ts", - "name": "/src/06-types-deep-dive/45-understanding-jsx-intrinsic-elements.explainer.ts", + "message": "No test found in suite src/06-types-deep-dive/46-understanding-jsx-intrinsic-elements.explainer.ts", + "name": "/src/06-types-deep-dive/46-understanding-jsx-intrinsic-elements.explainer.ts", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/06-types-deep-dive/46-add-new-global-element.problem.tsx", - "name": "/src/06-types-deep-dive/46-add-new-global-element.problem.tsx", + "message": "No test found in suite src/06-types-deep-dive/47-add-new-global-element.problem.tsx", + "name": "/src/06-types-deep-dive/47-add-new-global-element.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "/src/06-types-deep-dive/47-add-attribute-to-all-elements.problem.tsx", + "name": "/src/06-types-deep-dive/48-add-attribute-to-all-elements.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "/src/06-types-deep-dive/48-add-attribute-to-audio-elements.problem.tsx", + "name": "/src/06-types-deep-dive/49-add-attribute-to-audio-elements.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "/src/06-types-deep-dive/49-add-attribute-to-div-elements.problem.tsx", + "name": "/src/06-types-deep-dive/50-add-attribute-to-div-elements.problem.tsx", + "status": "passed", + }, + { + "assertionResults": [], + "message": "No test found in suite src/07-advanced-patterns/51-required-context.problem.tsx", + "name": "/src/07-advanced-patterns/51-required-context.problem.tsx", + "status": "passed", + }, + { + "assertionResults": [], + "message": "No test found in suite src/07-advanced-patterns/51-required-context.solution.1.tsx", + "name": "/src/07-advanced-patterns/51-required-context.solution.1.tsx", + "status": "passed", + }, + { + "assertionResults": [], + "message": "No test found in suite src/07-advanced-patterns/51-required-context.solution.2.tsx", + "name": "/src/07-advanced-patterns/51-required-context.solution.2.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/50-generic-context.problem.tsx", - "name": "/src/07-advanced-patterns/50-generic-context.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/52-compound-components.problem.tsx", + "name": "/src/07-advanced-patterns/52-compound-components.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/51-compound-components.problem.tsx", - "name": "/src/07-advanced-patterns/51-compound-components.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/53-forward-ref-with-generics.explainer.1.tsx", + "name": "/src/07-advanced-patterns/53-forward-ref-with-generics.explainer.1.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/52-forward-ref.problem.tsx", - "name": "/src/07-advanced-patterns/52-forward-ref.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/53-forward-ref-with-generics.explainer.2.tsx", + "name": "/src/07-advanced-patterns/53-forward-ref-with-generics.explainer.2.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/53-hoc-problem.tsx", - "name": "/src/07-advanced-patterns/53-hoc-problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/54-hoc-problem.tsx", + "name": "/src/07-advanced-patterns/54-hoc-problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "/src/07-advanced-patterns/54-as-prop.problem.tsx", + "name": "/src/07-advanced-patterns/55-as-prop.problem.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "/src/07-advanced-patterns/54-as-prop.solution.1.tsx", + "name": "/src/07-advanced-patterns/55-as-prop.solution.1.tsx", "status": "passed", }, { "assertionResults": [], "message": "React is not defined", - "name": "/src/07-advanced-patterns/54-as-prop.solution.2.tsx", + "name": "/src/07-advanced-patterns/55-as-prop.solution.2.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/55-as-prop-with-custom-components.problem.tsx", - "name": "/src/07-advanced-patterns/55-as-prop-with-custom-components.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/56-as-prop-with-custom-components.problem.tsx", + "name": "/src/07-advanced-patterns/56-as-prop-with-custom-components.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/55-as-prop-with-custom-components.solution.tsx", - "name": "/src/07-advanced-patterns/55-as-prop-with-custom-components.solution.tsx", + "message": "No test found in suite src/07-advanced-patterns/56-as-prop-with-custom-components.solution.tsx", + "name": "/src/07-advanced-patterns/56-as-prop-with-custom-components.solution.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/56-render-props.problem.tsx", - "name": "/src/07-advanced-patterns/56-render-props.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/57-render-props.problem.tsx", + "name": "/src/07-advanced-patterns/57-render-props.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/57-render-props-with-generics.problem.tsx", - "name": "/src/07-advanced-patterns/57-render-props-with-generics.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/58-render-props-with-generics.problem.tsx", + "name": "/src/07-advanced-patterns/58-render-props-with-generics.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/07-advanced-patterns/58-record-of-components-with-same-props.problem.tsx", - "name": "/src/07-advanced-patterns/58-record-of-components-with-same-props.problem.tsx", + "message": "No test found in suite src/07-advanced-patterns/59-record-of-components-with-same-props.problem.tsx", + "name": "/src/07-advanced-patterns/59-record-of-components-with-same-props.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/59-react-hook-form.problem.tsx", - "name": "/src/08-external-libraries/59-react-hook-form.problem.tsx", + "message": "No test found in suite src/08-external-libraries/60-react-hook-form.problem.tsx", + "name": "/src/08-external-libraries/60-react-hook-form.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/60-react-query.problem.tsx", - "name": "/src/08-external-libraries/60-react-query.problem.tsx", + "message": "No test found in suite src/08-external-libraries/61-react-query.problem.tsx", + "name": "/src/08-external-libraries/61-react-query.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/61-redux-toolkit.problem.tsx", - "name": "/src/08-external-libraries/61-redux-toolkit.problem.tsx", + "message": "No test found in suite src/08-external-libraries/62-redux-toolkit.problem.tsx", + "name": "/src/08-external-libraries/62-redux-toolkit.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/62-zustand.problem.tsx", - "name": "/src/08-external-libraries/62-zustand.problem.tsx", + "message": "No test found in suite src/08-external-libraries/63-zustand.problem.tsx", + "name": "/src/08-external-libraries/63-zustand.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "No test found in suite src/08-external-libraries/63-reusable-form-library-with-zod.problem.tsx", - "name": "/src/08-external-libraries/63-reusable-form-library-with-zod.problem.tsx", + "message": "No test found in suite src/08-external-libraries/64-reusable-form-library-with-zod.problem.tsx", + "name": "/src/08-external-libraries/64-reusable-form-library-with-zod.problem.tsx", "status": "passed", }, ], From 73ffa04e858626288e0b9eaabdd84872d0bb75ad Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Mon, 22 May 2023 12:39:07 +0100 Subject: [PATCH 019/186] Update vitest --- package-lock.json | 1794 ++++++++++++------ package.json | 12 +- scripts/tests/__snapshots__/all.test.ts.snap | 17 +- 3 files changed, 1260 insertions(+), 563 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2fdedf3..751900d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,358 @@ "vitest": "^0.31.1" } }, + "node_modules/@esbuild/android-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", + "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", + "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", + "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", + "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", + "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", + "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", + "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", + "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", + "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", + "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", + "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", + "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", + "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", + "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", + "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", + "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", + "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", + "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", + "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", + "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", + "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", + "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", @@ -93,7 +445,8 @@ }, "node_modules/@types/body-parser": { "version": "1.19.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", "dependencies": { "@types/connect": "*", "@types/node": "*" @@ -107,45 +460,52 @@ }, "node_modules/@types/chai-subset": { "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz", + "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==", "dev": true, - "license": "MIT", "dependencies": { "@types/chai": "*" } }, "node_modules/@types/connect": { "version": "3.4.35", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", "dependencies": { "@types/node": "*" } }, "node_modules/@types/express": { - "version": "4.17.13", - "license": "MIT", + "version": "4.17.17", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", + "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", "dependencies": { "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", + "@types/express-serve-static-core": "^4.17.33", "@types/qs": "*", "@types/serve-static": "*" } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.30", - "license": "MIT", + "version": "4.17.35", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.35.tgz", + "integrity": "sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==", "dependencies": { "@types/node": "*", "@types/qs": "*", - "@types/range-parser": "*" + "@types/range-parser": "*", + "@types/send": "*" } }, "node_modules/@types/mime": { - "version": "3.0.1", - "license": "MIT" + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==" }, "node_modules/@types/node": { - "version": "18.6.5", - "license": "MIT" + "version": "20.2.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.3.tgz", + "integrity": "sha512-pg9d0yC4rVNWQzX8U7xb4olIOFuuVL9za3bzMT2pu2SU0SNEi66i2qrvhE2qt0HvkhuCaWJu7pLNOt/Pj8BIrw==" }, "node_modules/@types/prop-types": { "version": "15.7.5", @@ -154,16 +514,18 @@ }, "node_modules/@types/qs": { "version": "6.9.7", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" }, "node_modules/@types/range-parser": { "version": "1.2.4", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" }, "node_modules/@types/react": { - "version": "18.0.28", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.28.tgz", - "integrity": "sha512-RD0ivG1kEztNBdoAK7lekI9M+azSnitIn85h4iOiaLjaTrMjzslhaqCGaI4IyCJ1RljWiLCEu4jyrLLgqxBTew==", + "version": "18.2.6", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.6.tgz", + "integrity": "sha512-wRZClXn//zxCFW+ye/D2qY65UsYP1Fpex2YXorHc8awoNamkMZSvBxwxdYVInsHOZZd2Ppq8isnSzJL5Mpf8OA==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -171,21 +533,31 @@ } }, "node_modules/@types/react-dom": { - "version": "18.0.11", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.11.tgz", - "integrity": "sha512-O38bPbI2CWtgw/OoQoY+BRelw7uysmXbWvw3nLWO21H1HSh+GOlqPuXshJfjmpNlKiiSDG9cc1JZAaMmVdcTlw==", + "version": "18.2.4", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.4.tgz", + "integrity": "sha512-G2mHoTMTL4yoydITgOGwWdWMVd8sNgyEP85xVmMKAPUBwQWm9wBPQUmvbeF4V3WBY1P7mmL4BkjQ0SqUpf1snw==", "dependencies": { "@types/react": "*" } }, "node_modules/@types/scheduler": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", - "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz", + "integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==" + }, + "node_modules/@types/send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.1.tgz", + "integrity": "sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } }, "node_modules/@types/serve-static": { - "version": "1.15.0", - "license": "MIT", + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.1.tgz", + "integrity": "sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==", "dependencies": { "@types/mime": "*", "@types/node": "*" @@ -268,7 +640,8 @@ }, "node_modules/accepts": { "version": "1.3.8", - "license": "MIT", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" @@ -365,9 +738,10 @@ } }, "node_modules/anymatch": { - "version": "3.1.2", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, - "license": "ISC", "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -378,7 +752,8 @@ }, "node_modules/array-flatten": { "version": "1.1.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, "node_modules/assertion-error": { "version": "1.1.0", @@ -397,8 +772,9 @@ }, "node_modules/binary-extensions": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -410,8 +786,9 @@ "dev": true }, "node_modules/body-parser": { - "version": "1.20.0", - "license": "MIT", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -421,7 +798,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.10.3", + "qs": "6.11.0", "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -433,8 +810,9 @@ }, "node_modules/braces": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, - "license": "MIT", "dependencies": { "fill-range": "^7.0.1" }, @@ -444,7 +822,8 @@ }, "node_modules/bytes": { "version": "3.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "engines": { "node": ">= 0.8" } @@ -460,7 +839,8 @@ }, "node_modules/call-bind": { "version": "1.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -498,6 +878,8 @@ }, "node_modules/chokidar": { "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "funding": [ { @@ -505,7 +887,6 @@ "url": "https://paulmillr.com/funding/" } ], - "license": "MIT", "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -564,7 +945,8 @@ }, "node_modules/content-disposition": { "version": "0.5.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", "dependencies": { "safe-buffer": "5.2.1" }, @@ -573,29 +955,33 @@ } }, "node_modules/content-type": { - "version": "1.0.4", - "license": "MIT", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "engines": { "node": ">= 0.6" } }, "node_modules/cookie": { "version": "0.5.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", "engines": { "node": ">= 0.6" } }, "node_modules/cookie-signature": { "version": "1.0.6", - "license": "MIT" + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, "node_modules/cross-fetch": { - "version": "3.1.5", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.6.tgz", + "integrity": "sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==", "dev": true, - "license": "MIT", "dependencies": { - "node-fetch": "2.6.7" + "node-fetch": "^2.6.11" } }, "node_modules/cssstyle": { @@ -611,9 +997,9 @@ } }, "node_modules/csstype": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", - "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, "node_modules/data-urls": { "version": "4.0.0", @@ -629,40 +1015,6 @@ "node": ">=14" } }, - "node_modules/data-urls/node_modules/tr46": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", - "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", - "dev": true, - "dependencies": { - "punycode": "^2.3.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/data-urls/node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/data-urls/node_modules/whatwg-url": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", - "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", - "dev": true, - "dependencies": { - "tr46": "^4.1.1", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=14" - } - }, "node_modules/date-time": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/date-time/-/date-time-3.1.0.tgz", @@ -677,7 +1029,8 @@ }, "node_modules/debug": { "version": "2.6.9", - "license": "MIT", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dependencies": { "ms": "2.0.0" } @@ -717,14 +1070,16 @@ }, "node_modules/depd": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "engines": { "node": ">= 0.8" } }, "node_modules/destroy": { "version": "1.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "engines": { "node": ">= 0.8", "npm": "1.2.8000 || >= 1.4.16" @@ -742,30 +1097,23 @@ "node": ">=12" } }, - "node_modules/domexception/node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/ee-first": { "version": "1.1.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/encodeurl": { "version": "1.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "engines": { "node": ">= 0.8" } }, "node_modules/entities": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", - "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true, "engines": { "node": ">=0.12" @@ -775,10 +1123,11 @@ } }, "node_modules/esbuild": { - "version": "0.14.54", + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", + "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", "dev": true, "hasInstallScript": true, - "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -786,47 +1135,34 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/linux-loong64": "0.14.54", - "esbuild-android-64": "0.14.54", - "esbuild-android-arm64": "0.14.54", - "esbuild-darwin-64": "0.14.54", - "esbuild-darwin-arm64": "0.14.54", - "esbuild-freebsd-64": "0.14.54", - "esbuild-freebsd-arm64": "0.14.54", - "esbuild-linux-32": "0.14.54", - "esbuild-linux-64": "0.14.54", - "esbuild-linux-arm": "0.14.54", - "esbuild-linux-arm64": "0.14.54", - "esbuild-linux-mips64le": "0.14.54", - "esbuild-linux-ppc64le": "0.14.54", - "esbuild-linux-riscv64": "0.14.54", - "esbuild-linux-s390x": "0.14.54", - "esbuild-netbsd-64": "0.14.54", - "esbuild-openbsd-64": "0.14.54", - "esbuild-sunos-64": "0.14.54", - "esbuild-windows-32": "0.14.54", - "esbuild-windows-64": "0.14.54", - "esbuild-windows-arm64": "0.14.54" - } - }, - "node_modules/esbuild-darwin-arm64": { - "version": "0.14.54", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" + "@esbuild/android-arm": "0.17.19", + "@esbuild/android-arm64": "0.17.19", + "@esbuild/android-x64": "0.17.19", + "@esbuild/darwin-arm64": "0.17.19", + "@esbuild/darwin-x64": "0.17.19", + "@esbuild/freebsd-arm64": "0.17.19", + "@esbuild/freebsd-x64": "0.17.19", + "@esbuild/linux-arm": "0.17.19", + "@esbuild/linux-arm64": "0.17.19", + "@esbuild/linux-ia32": "0.17.19", + "@esbuild/linux-loong64": "0.17.19", + "@esbuild/linux-mips64el": "0.17.19", + "@esbuild/linux-ppc64": "0.17.19", + "@esbuild/linux-riscv64": "0.17.19", + "@esbuild/linux-s390x": "0.17.19", + "@esbuild/linux-x64": "0.17.19", + "@esbuild/netbsd-x64": "0.17.19", + "@esbuild/openbsd-x64": "0.17.19", + "@esbuild/sunos-x64": "0.17.19", + "@esbuild/win32-arm64": "0.17.19", + "@esbuild/win32-ia32": "0.17.19", + "@esbuild/win32-x64": "0.17.19" } }, "node_modules/escape-html": { "version": "1.0.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, "node_modules/escodegen": { "version": "2.0.0", @@ -883,18 +1219,20 @@ }, "node_modules/etag": { "version": "1.8.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "engines": { "node": ">= 0.6" } }, "node_modules/express": { - "version": "4.18.1", - "license": "MIT", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.0", + "body-parser": "1.20.1", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.5.0", @@ -913,7 +1251,7 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.10.3", + "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.18.0", @@ -967,8 +1305,9 @@ }, "node_modules/fill-range": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, - "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -978,7 +1317,8 @@ }, "node_modules/finalhandler": { "version": "1.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", @@ -1008,22 +1348,26 @@ }, "node_modules/forwarded": { "version": "0.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", "engines": { "node": ">= 0.6" } }, "node_modules/fresh": { "version": "0.5.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "engines": { "node": ">= 0.6" } }, "node_modules/fsevents": { "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, - "license": "MIT", + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -1034,7 +1378,8 @@ }, "node_modules/function-bind": { "version": "1.1.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "node_modules/get-func-name": { "version": "2.0.0", @@ -1046,11 +1391,13 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.2", - "license": "MIT", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" }, "funding": { @@ -1059,8 +1406,9 @@ }, "node_modules/glob-parent": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, - "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -1076,7 +1424,8 @@ }, "node_modules/has": { "version": "1.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dependencies": { "function-bind": "^1.1.1" }, @@ -1084,9 +1433,21 @@ "node": ">= 0.4.0" } }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "engines": { "node": ">= 0.4" }, @@ -1108,7 +1469,8 @@ }, "node_modules/http-errors": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", @@ -1195,7 +1557,8 @@ }, "node_modules/iconv-lite": { "version": "0.4.24", - "license": "MIT", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -1205,19 +1568,22 @@ }, "node_modules/inherits": { "version": "2.0.4", - "license": "ISC" + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ipaddr.js": { "version": "1.9.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", "engines": { "node": ">= 0.10" } }, "node_modules/is-binary-path": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, - "license": "MIT", "dependencies": { "binary-extensions": "^2.0.0" }, @@ -1225,29 +1591,20 @@ "node": ">=8" } }, - "node_modules/is-core-module": { - "version": "2.10.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-extglob": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/is-glob": { "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, - "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -1257,8 +1614,9 @@ }, "node_modules/is-number": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -1284,9 +1642,9 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/jsdom": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-21.1.1.tgz", - "integrity": "sha512-Jjgdmw48RKcdAIQyUD1UdBh2ecH7VqwaXPN3ehoZN6MqgVbMn+lRm1aAT1AsdJRAJpwfa4IpwgzySn61h2qu3w==", + "version": "21.1.2", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-21.1.2.tgz", + "integrity": "sha512-sCpFmK2jv+1sjff4u7fzft+pUh2KSUbUrEHYHyfSIbGTIcmnjyp83qg6qLwdJ/I3LpTXx33ACxeRL7Lsyc6lGQ==", "dev": true, "dependencies": { "abab": "^2.0.6", @@ -1302,7 +1660,7 @@ "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.1", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.2", + "nwsapi": "^2.2.4", "parse5": "^7.1.2", "rrweb-cssom": "^0.6.0", "saxes": "^6.0.0", @@ -1328,40 +1686,6 @@ } } }, - "node_modules/jsdom/node_modules/tr46": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", - "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", - "dev": true, - "dependencies": { - "punycode": "^2.3.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/jsdom/node_modules/webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/jsdom/node_modules/whatwg-url": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", - "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", - "dev": true, - "dependencies": { - "tr46": "^4.1.1", - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=14" - } - }, "node_modules/jsonc-parser": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", @@ -1457,14 +1781,16 @@ }, "node_modules/media-typer": { "version": "0.3.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", "engines": { "node": ">= 0.6" } }, "node_modules/merge-descriptors": { "version": "1.0.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" }, "node_modules/merge2": { "version": "1.4.1", @@ -1477,7 +1803,8 @@ }, "node_modules/methods": { "version": "1.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", "engines": { "node": ">= 0.6" } @@ -1497,7 +1824,8 @@ }, "node_modules/mime": { "version": "1.6.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "bin": { "mime": "cli.js" }, @@ -1507,14 +1835,16 @@ }, "node_modules/mime-db": { "version": "1.52.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { "version": "2.1.35", - "license": "MIT", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dependencies": { "mime-db": "1.52.0" }, @@ -1536,12 +1866,20 @@ }, "node_modules/ms": { "version": "2.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/nanoid": { - "version": "3.3.4", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", "dev": true, - "license": "MIT", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -1551,15 +1889,17 @@ }, "node_modules/negotiator": { "version": "0.6.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "engines": { "node": ">= 0.6" } }, "node_modules/node-fetch": { - "version": "2.6.7", + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", "dev": true, - "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -1575,30 +1915,55 @@ } } }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/normalize-path": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/nwsapi": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.2.tgz", - "integrity": "sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.4.tgz", + "integrity": "sha512-NHj4rzRo0tQdijE9ZqAx6kYDcoRwYwSYzCA8MY3JzfxlrvEU0jhnhJT9BhqhJs7I/dKcrDm6TyulaRqZPIhN5g==", "dev": true }, "node_modules/object-inspect": { - "version": "1.12.2", - "license": "MIT", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/on-finished": { "version": "2.4.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { "ee-first": "1.1.1" }, @@ -1652,19 +2017,16 @@ }, "node_modules/parseurl": { "version": "1.3.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "engines": { "node": ">= 0.8" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "dev": true, - "license": "MIT" - }, "node_modules/path-to-regexp": { "version": "0.1.7", - "license": "MIT" + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, "node_modules/pathe": { "version": "1.1.0", @@ -1683,13 +2045,15 @@ }, "node_modules/picocolors": { "version": "1.0.0", - "dev": true, - "license": "ISC" + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true }, "node_modules/picomatch": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8.6" }, @@ -1709,7 +2073,9 @@ } }, "node_modules/postcss": { - "version": "8.4.16", + "version": "8.4.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.23.tgz", + "integrity": "sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==", "dev": true, "funding": [ { @@ -1719,11 +2085,14 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { - "nanoid": "^3.3.4", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, @@ -1741,9 +2110,9 @@ } }, "node_modules/prettier": { - "version": "2.8.7", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz", - "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -1771,7 +2140,8 @@ }, "node_modules/proxy-addr": { "version": "2.0.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" @@ -1796,8 +2166,9 @@ } }, "node_modules/qs": { - "version": "6.10.3", - "license": "BSD-3-Clause", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "dependencies": { "side-channel": "^1.0.4" }, @@ -1836,14 +2207,16 @@ }, "node_modules/range-parser": { "version": "1.2.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "engines": { "node": ">= 0.6" } }, "node_modules/raw-body": { "version": "2.5.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -1885,8 +2258,9 @@ }, "node_modules/readdirp": { "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, - "license": "MIT", "dependencies": { "picomatch": "^2.2.1" }, @@ -1897,24 +2271,8 @@ "node_modules/requires-port": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true - }, - "node_modules/resolve": { - "version": "1.22.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true }, "node_modules/reusify": { "version": "1.0.4", @@ -1927,14 +2285,16 @@ } }, "node_modules/rollup": { - "version": "2.77.2", + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.23.0.tgz", + "integrity": "sha512-h31UlwEi7FHihLe1zbk+3Q7z1k/84rb9BSwmBSr/XjOCEaBJ2YyedQDuM0t/kfOS0IxM+vk1/zI9XxYj9V+NJQ==", "dev": true, - "license": "MIT", "bin": { "rollup": "dist/bin/rollup" }, "engines": { - "node": ">=10.0.0" + "node": ">=14.18.0", + "npm": ">=8.0.0" }, "optionalDependencies": { "fsevents": "~2.3.2" @@ -1971,6 +2331,8 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "funding": [ { "type": "github", @@ -1984,12 +2346,12 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/safer-buffer": { "version": "2.1.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/saxes": { "version": "6.0.0", @@ -2028,7 +2390,8 @@ }, "node_modules/send": { "version": "0.18.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", "dependencies": { "debug": "2.6.9", "depd": "2.0.0", @@ -2050,11 +2413,13 @@ }, "node_modules/send/node_modules/ms": { "version": "2.1.3", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/serve-static": { "version": "1.15.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", "dependencies": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", @@ -2067,11 +2432,13 @@ }, "node_modules/setprototypeof": { "version": "1.2.0", - "license": "ISC" + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, "node_modules/side-channel": { "version": "1.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -2099,8 +2466,9 @@ }, "node_modules/source-map-js": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", "dev": true, - "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -2113,15 +2481,16 @@ }, "node_modules/statuses": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "engines": { "node": ">= 0.8" } }, "node_modules/std-env": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.2.tgz", - "integrity": "sha512-uUZI65yrV2Qva5gqE0+A7uVAvO40iPo6jGhs7s8keRfHCmtg+uB2X6EiLGCI9IgL1J17xGhvoOqSz79lzICPTA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.3.tgz", + "integrity": "sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==", "dev": true }, "node_modules/strip-literal": { @@ -2136,17 +2505,6 @@ "url": "https://github.com/sponsors/antfu" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -2188,8 +2546,9 @@ }, "node_modules/to-regex-range": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, - "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -2199,7 +2558,8 @@ }, "node_modules/toidentifier": { "version": "1.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "engines": { "node": ">=0.6" } @@ -2220,9 +2580,16 @@ } }, "node_modules/tr46": { - "version": "0.0.3", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", "dev": true, - "license": "MIT" + "dependencies": { + "punycode": "^2.3.0" + }, + "engines": { + "node": ">=14" + } }, "node_modules/tsconfck": { "version": "2.1.1", @@ -2267,7 +2634,8 @@ }, "node_modules/type-is": { "version": "1.6.18", - "license": "MIT", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" @@ -2277,9 +2645,9 @@ } }, "node_modules/typescript": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz", - "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -2306,7 +2674,8 @@ }, "node_modules/unpipe": { "version": "1.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "engines": { "node": ">= 0.8" } @@ -2323,27 +2692,29 @@ }, "node_modules/utils-merge": { "version": "1.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", "engines": { "node": ">= 0.4.0" } }, "node_modules/vary": { "version": "1.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "engines": { "node": ">= 0.8" } }, "node_modules/vite": { - "version": "3.0.5", + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.8.tgz", + "integrity": "sha512-uYB8PwN7hbMrf4j1xzGDk/lqjsZvCDbt/JC5dyfxc19Pg8kRm14LinK/uq+HSLNswZEoKmweGdtpbnxRtrAXiQ==", "dev": true, - "license": "MIT", "dependencies": { - "esbuild": "^0.14.47", - "postcss": "^8.4.16", - "resolve": "^1.22.1", - "rollup": "^2.75.6" + "esbuild": "^0.17.5", + "postcss": "^8.4.23", + "rollup": "^3.21.0" }, "bin": { "vite": "bin/vite.js" @@ -2355,12 +2726,17 @@ "fsevents": "~2.3.2" }, "peerDependencies": { + "@types/node": ">= 14", "less": "*", "sass": "*", "stylus": "*", + "sugarss": "*", "terser": "^5.4.0" }, "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, "less": { "optional": true }, @@ -2370,6 +2746,9 @@ "stylus": { "optional": true }, + "sugarss": { + "optional": true + }, "terser": { "optional": true } @@ -2422,14 +2801,14 @@ "dev": true }, "node_modules/vite-tsconfig-paths": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.0.7.tgz", - "integrity": "sha512-MwIYaby6kcbQGZqMH+gAK6h0UYQGOkjsuAgw4q6bP/5vWkn8VKvnmLuCQHA2+IzHAJHnE8OFTO4lnJLFMf9+7Q==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==", "dev": true, "dependencies": { "debug": "^4.1.1", "globrex": "^0.1.2", - "tsconfck": "^2.0.1" + "tsconfck": "^2.1.0" }, "peerDependencies": { "vite": "*" @@ -2543,8 +2922,9 @@ }, "node_modules/vitest/node_modules/debug": { "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, - "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -2559,8 +2939,9 @@ }, "node_modules/vitest/node_modules/ms": { "version": "2.1.2", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/w3c-xmlserializer": { "version": "4.0.0", @@ -2575,9 +2956,13 @@ } }, "node_modules/webidl-conversions": { - "version": "3.0.1", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "dev": true, - "license": "BSD-2-Clause" + "engines": { + "node": ">=12" + } }, "node_modules/well-known-symbols": { "version": "2.0.0", @@ -2622,12 +3007,16 @@ } }, "node_modules/whatwg-url": { - "version": "5.0.0", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", + "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", "dev": true, - "license": "MIT", "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=14" } }, "node_modules/why-is-node-running": { @@ -2710,14 +3099,169 @@ } }, "node_modules/zod": { - "version": "3.17.10", - "license": "MIT", + "version": "3.21.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz", + "integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==", "funding": { "url": "https://github.com/sponsors/colinhacks" } } }, "dependencies": { + "@esbuild/android-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", + "integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz", + "integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz", + "integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz", + "integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz", + "integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz", + "integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz", + "integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz", + "integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz", + "integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz", + "integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz", + "integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz", + "integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz", + "integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz", + "integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz", + "integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz", + "integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz", + "integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", + "integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz", + "integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz", + "integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz", + "integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz", + "integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==", + "dev": true, + "optional": true + }, "@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", @@ -2769,6 +3313,8 @@ }, "@types/body-parser": { "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", "requires": { "@types/connect": "*", "@types/node": "*" @@ -2782,6 +3328,8 @@ }, "@types/chai-subset": { "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz", + "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==", "dev": true, "requires": { "@types/chai": "*" @@ -2789,32 +3337,43 @@ }, "@types/connect": { "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", "requires": { "@types/node": "*" } }, "@types/express": { - "version": "4.17.13", + "version": "4.17.17", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", + "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", "requires": { "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", + "@types/express-serve-static-core": "^4.17.33", "@types/qs": "*", "@types/serve-static": "*" } }, "@types/express-serve-static-core": { - "version": "4.17.30", + "version": "4.17.35", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.35.tgz", + "integrity": "sha512-wALWQwrgiB2AWTT91CB62b6Yt0sNHpznUXeZEcnPU3DRdlDIz74x8Qg1UUYKSVFi+va5vKOLYRBI1bRKiLLKIg==", "requires": { "@types/node": "*", "@types/qs": "*", - "@types/range-parser": "*" + "@types/range-parser": "*", + "@types/send": "*" } }, "@types/mime": { - "version": "3.0.1" + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==" }, "@types/node": { - "version": "18.6.5" + "version": "20.2.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.3.tgz", + "integrity": "sha512-pg9d0yC4rVNWQzX8U7xb4olIOFuuVL9za3bzMT2pu2SU0SNEi66i2qrvhE2qt0HvkhuCaWJu7pLNOt/Pj8BIrw==" }, "@types/prop-types": { "version": "15.7.5", @@ -2822,15 +3381,19 @@ "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" }, "@types/qs": { - "version": "6.9.7" + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" }, "@types/range-parser": { - "version": "1.2.4" + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" }, "@types/react": { - "version": "18.0.28", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.28.tgz", - "integrity": "sha512-RD0ivG1kEztNBdoAK7lekI9M+azSnitIn85h4iOiaLjaTrMjzslhaqCGaI4IyCJ1RljWiLCEu4jyrLLgqxBTew==", + "version": "18.2.6", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.6.tgz", + "integrity": "sha512-wRZClXn//zxCFW+ye/D2qY65UsYP1Fpex2YXorHc8awoNamkMZSvBxwxdYVInsHOZZd2Ppq8isnSzJL5Mpf8OA==", "requires": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -2838,20 +3401,31 @@ } }, "@types/react-dom": { - "version": "18.0.11", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.11.tgz", - "integrity": "sha512-O38bPbI2CWtgw/OoQoY+BRelw7uysmXbWvw3nLWO21H1HSh+GOlqPuXshJfjmpNlKiiSDG9cc1JZAaMmVdcTlw==", + "version": "18.2.4", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.4.tgz", + "integrity": "sha512-G2mHoTMTL4yoydITgOGwWdWMVd8sNgyEP85xVmMKAPUBwQWm9wBPQUmvbeF4V3WBY1P7mmL4BkjQ0SqUpf1snw==", "requires": { "@types/react": "*" } }, "@types/scheduler": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", - "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==" + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz", + "integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==" + }, + "@types/send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.1.tgz", + "integrity": "sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==", + "requires": { + "@types/mime": "^1", + "@types/node": "*" + } }, "@types/serve-static": { - "version": "1.15.0", + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.1.tgz", + "integrity": "sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==", "requires": { "@types/mime": "*", "@types/node": "*" @@ -2919,6 +3493,8 @@ }, "accepts": { "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "requires": { "mime-types": "~2.1.34", "negotiator": "0.6.3" @@ -2985,7 +3561,9 @@ "dev": true }, "anymatch": { - "version": "3.1.2", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, "requires": { "normalize-path": "^3.0.0", @@ -2993,7 +3571,9 @@ } }, "array-flatten": { - "version": "1.1.1" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, "assertion-error": { "version": "1.1.0", @@ -3009,6 +3589,8 @@ }, "binary-extensions": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, "blueimp-md5": { @@ -3018,7 +3600,9 @@ "dev": true }, "body-parser": { - "version": "1.20.0", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.4", @@ -3028,7 +3612,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.10.3", + "qs": "6.11.0", "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -3036,13 +3620,17 @@ }, "braces": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "requires": { "fill-range": "^7.0.1" } }, "bytes": { - "version": "3.1.2" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" }, "cac": { "version": "6.7.14", @@ -3052,6 +3640,8 @@ }, "call-bind": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "requires": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -3080,6 +3670,8 @@ }, "chokidar": { "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "requires": { "anymatch": "~3.1.2", @@ -3125,24 +3717,34 @@ }, "content-disposition": { "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", "requires": { "safe-buffer": "5.2.1" } }, "content-type": { - "version": "1.0.4" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" }, "cookie": { - "version": "0.5.0" + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==" }, "cookie-signature": { - "version": "1.0.6" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, "cross-fetch": { - "version": "3.1.5", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.6.tgz", + "integrity": "sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==", "dev": true, "requires": { - "node-fetch": "2.6.7" + "node-fetch": "^2.6.11" } }, "cssstyle": { @@ -3155,9 +3757,9 @@ } }, "csstype": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", - "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, "data-urls": { "version": "4.0.0", @@ -3168,33 +3770,6 @@ "abab": "^2.0.6", "whatwg-mimetype": "^3.0.0", "whatwg-url": "^12.0.0" - }, - "dependencies": { - "tr46": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", - "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", - "dev": true, - "requires": { - "punycode": "^2.3.0" - } - }, - "webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "dev": true - }, - "whatwg-url": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", - "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", - "dev": true, - "requires": { - "tr46": "^4.1.1", - "webidl-conversions": "^7.0.0" - } - } } }, "date-time": { @@ -3208,6 +3783,8 @@ }, "debug": { "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "requires": { "ms": "2.0.0" } @@ -3240,10 +3817,14 @@ "dev": true }, "depd": { - "version": "2.0.0" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" }, "destroy": { - "version": "1.2.0" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, "domexception": { "version": "4.0.0", @@ -3252,62 +3833,58 @@ "dev": true, "requires": { "webidl-conversions": "^7.0.0" - }, - "dependencies": { - "webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "dev": true - } } }, "ee-first": { - "version": "1.1.1" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "encodeurl": { - "version": "1.0.2" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" }, "entities": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", - "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true }, "esbuild": { - "version": "0.14.54", + "version": "0.17.19", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", + "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", "dev": true, "requires": { - "@esbuild/linux-loong64": "0.14.54", - "esbuild-android-64": "0.14.54", - "esbuild-android-arm64": "0.14.54", - "esbuild-darwin-64": "0.14.54", - "esbuild-darwin-arm64": "0.14.54", - "esbuild-freebsd-64": "0.14.54", - "esbuild-freebsd-arm64": "0.14.54", - "esbuild-linux-32": "0.14.54", - "esbuild-linux-64": "0.14.54", - "esbuild-linux-arm": "0.14.54", - "esbuild-linux-arm64": "0.14.54", - "esbuild-linux-mips64le": "0.14.54", - "esbuild-linux-ppc64le": "0.14.54", - "esbuild-linux-riscv64": "0.14.54", - "esbuild-linux-s390x": "0.14.54", - "esbuild-netbsd-64": "0.14.54", - "esbuild-openbsd-64": "0.14.54", - "esbuild-sunos-64": "0.14.54", - "esbuild-windows-32": "0.14.54", - "esbuild-windows-64": "0.14.54", - "esbuild-windows-arm64": "0.14.54" - } - }, - "esbuild-darwin-arm64": { - "version": "0.14.54", - "dev": true, - "optional": true + "@esbuild/android-arm": "0.17.19", + "@esbuild/android-arm64": "0.17.19", + "@esbuild/android-x64": "0.17.19", + "@esbuild/darwin-arm64": "0.17.19", + "@esbuild/darwin-x64": "0.17.19", + "@esbuild/freebsd-arm64": "0.17.19", + "@esbuild/freebsd-x64": "0.17.19", + "@esbuild/linux-arm": "0.17.19", + "@esbuild/linux-arm64": "0.17.19", + "@esbuild/linux-ia32": "0.17.19", + "@esbuild/linux-loong64": "0.17.19", + "@esbuild/linux-mips64el": "0.17.19", + "@esbuild/linux-ppc64": "0.17.19", + "@esbuild/linux-riscv64": "0.17.19", + "@esbuild/linux-s390x": "0.17.19", + "@esbuild/linux-x64": "0.17.19", + "@esbuild/netbsd-x64": "0.17.19", + "@esbuild/openbsd-x64": "0.17.19", + "@esbuild/sunos-x64": "0.17.19", + "@esbuild/win32-arm64": "0.17.19", + "@esbuild/win32-ia32": "0.17.19", + "@esbuild/win32-x64": "0.17.19" + } }, "escape-html": { - "version": "1.0.3" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, "escodegen": { "version": "2.0.0", @@ -3341,14 +3918,18 @@ "dev": true }, "etag": { - "version": "1.8.1" + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.18.1", + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.0", + "body-parser": "1.20.1", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.5.0", @@ -3367,7 +3948,7 @@ "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.7", - "qs": "6.10.3", + "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.18.0", @@ -3415,6 +3996,8 @@ }, "fill-range": { "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { "to-regex-range": "^5.0.1" @@ -3422,6 +4005,8 @@ }, "finalhandler": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", "requires": { "debug": "2.6.9", "encodeurl": "~1.0.2", @@ -3444,18 +4029,26 @@ } }, "forwarded": { - "version": "0.2.0" + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" }, "fresh": { - "version": "0.5.2" + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" }, "fsevents": { "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "optional": true }, "function-bind": { - "version": "1.1.1" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "get-func-name": { "version": "2.0.0", @@ -3464,15 +4057,20 @@ "dev": true }, "get-intrinsic": { - "version": "1.1.2", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3" } }, "glob-parent": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" @@ -3486,12 +4084,21 @@ }, "has": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "requires": { "function-bind": "^1.1.1" } }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" + }, "has-symbols": { - "version": "1.0.3" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" }, "html-encoding-sniffer": { "version": "3.0.0", @@ -3504,6 +4111,8 @@ }, "http-errors": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "requires": { "depd": "2.0.0", "inherits": "2.0.4", @@ -3569,36 +4178,41 @@ }, "iconv-lite": { "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "requires": { "safer-buffer": ">= 2.1.2 < 3" } }, "inherits": { - "version": "2.0.4" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ipaddr.js": { - "version": "1.9.1" + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, "is-binary-path": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "requires": { "binary-extensions": "^2.0.0" } }, - "is-core-module": { - "version": "2.10.0", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, "is-extglob": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, "is-glob": { "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -3606,6 +4220,8 @@ }, "is-number": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, "is-potential-custom-element-name": { @@ -3626,9 +4242,9 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "jsdom": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-21.1.1.tgz", - "integrity": "sha512-Jjgdmw48RKcdAIQyUD1UdBh2ecH7VqwaXPN3ehoZN6MqgVbMn+lRm1aAT1AsdJRAJpwfa4IpwgzySn61h2qu3w==", + "version": "21.1.2", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-21.1.2.tgz", + "integrity": "sha512-sCpFmK2jv+1sjff4u7fzft+pUh2KSUbUrEHYHyfSIbGTIcmnjyp83qg6qLwdJ/I3LpTXx33ACxeRL7Lsyc6lGQ==", "dev": true, "requires": { "abab": "^2.0.6", @@ -3644,7 +4260,7 @@ "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.1", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.2", + "nwsapi": "^2.2.4", "parse5": "^7.1.2", "rrweb-cssom": "^0.6.0", "saxes": "^6.0.0", @@ -3657,33 +4273,6 @@ "whatwg-url": "^12.0.1", "ws": "^8.13.0", "xml-name-validator": "^4.0.0" - }, - "dependencies": { - "tr46": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", - "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", - "dev": true, - "requires": { - "punycode": "^2.3.0" - } - }, - "webidl-conversions": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", - "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", - "dev": true - }, - "whatwg-url": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", - "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", - "dev": true, - "requires": { - "tr46": "^4.1.1", - "webidl-conversions": "^7.0.0" - } - } } }, "jsonc-parser": { @@ -3759,10 +4348,14 @@ } }, "media-typer": { - "version": "0.3.0" + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, "merge-descriptors": { - "version": "1.0.1" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" }, "merge2": { "version": "1.4.1", @@ -3771,7 +4364,9 @@ "dev": true }, "methods": { - "version": "1.1.2" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" }, "micromatch": { "version": "4.0.5", @@ -3784,13 +4379,19 @@ } }, "mime": { - "version": "1.6.0" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "mime-db": { - "version": "1.52.0" + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" }, "mime-types": { "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "requires": { "mime-db": "1.52.0" } @@ -3808,37 +4409,75 @@ } }, "ms": { - "version": "2.0.0" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "nanoid": { - "version": "3.3.4", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", "dev": true }, "negotiator": { - "version": "0.6.3" + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "node-fetch": { - "version": "2.6.7", + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", "dev": true, "requires": { "whatwg-url": "^5.0.0" + }, + "dependencies": { + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } } }, "normalize-path": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, "nwsapi": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.2.tgz", - "integrity": "sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.4.tgz", + "integrity": "sha512-NHj4rzRo0tQdijE9ZqAx6kYDcoRwYwSYzCA8MY3JzfxlrvEU0jhnhJT9BhqhJs7I/dKcrDm6TyulaRqZPIhN5g==", "dev": true }, "object-inspect": { - "version": "1.12.2" + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" }, "on-finished": { "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "requires": { "ee-first": "1.1.1" } @@ -3876,14 +4515,14 @@ } }, "parseurl": { - "version": "1.3.3" - }, - "path-parse": { - "version": "1.0.7", - "dev": true + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "path-to-regexp": { - "version": "0.1.7" + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, "pathe": { "version": "1.1.0", @@ -3899,10 +4538,14 @@ }, "picocolors": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, "picomatch": { "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, "pkg-types": { @@ -3917,10 +4560,12 @@ } }, "postcss": { - "version": "8.4.16", + "version": "8.4.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.23.tgz", + "integrity": "sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==", "dev": true, "requires": { - "nanoid": "^3.3.4", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" } @@ -3932,9 +4577,9 @@ "dev": true }, "prettier": { - "version": "2.8.7", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz", - "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true }, "pretty-format": { @@ -3950,6 +4595,8 @@ }, "proxy-addr": { "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", "requires": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" @@ -3968,7 +4615,9 @@ "dev": true }, "qs": { - "version": "6.10.3", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "requires": { "side-channel": "^1.0.4" } @@ -3986,10 +4635,14 @@ "dev": true }, "range-parser": { - "version": "1.2.1" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" }, "raw-body": { "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", "requires": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -4022,6 +4675,8 @@ }, "readdirp": { "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "requires": { "picomatch": "^2.2.1" @@ -4033,15 +4688,6 @@ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", "dev": true }, - "resolve": { - "version": "1.22.1", - "dev": true, - "requires": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - } - }, "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -4049,7 +4695,9 @@ "dev": true }, "rollup": { - "version": "2.77.2", + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.23.0.tgz", + "integrity": "sha512-h31UlwEi7FHihLe1zbk+3Q7z1k/84rb9BSwmBSr/XjOCEaBJ2YyedQDuM0t/kfOS0IxM+vk1/zI9XxYj9V+NJQ==", "dev": true, "requires": { "fsevents": "~2.3.2" @@ -4071,10 +4719,14 @@ } }, "safe-buffer": { - "version": "5.2.1" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, "safer-buffer": { - "version": "2.1.2" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "saxes": { "version": "6.0.0", @@ -4104,6 +4756,8 @@ }, "send": { "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", "requires": { "debug": "2.6.9", "depd": "2.0.0", @@ -4121,12 +4775,16 @@ }, "dependencies": { "ms": { - "version": "2.1.3" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" } } }, "serve-static": { "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", "requires": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", @@ -4135,10 +4793,14 @@ } }, "setprototypeof": { - "version": "1.2.0" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, "side-channel": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "requires": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -4160,6 +4822,8 @@ }, "source-map-js": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", "dev": true }, "stackback": { @@ -4169,12 +4833,14 @@ "dev": true }, "statuses": { - "version": "2.0.1" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" }, "std-env": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.2.tgz", - "integrity": "sha512-uUZI65yrV2Qva5gqE0+A7uVAvO40iPo6jGhs7s8keRfHCmtg+uB2X6EiLGCI9IgL1J17xGhvoOqSz79lzICPTA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.3.tgz", + "integrity": "sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==", "dev": true }, "strip-literal": { @@ -4186,10 +4852,6 @@ "acorn": "^8.8.2" } }, - "supports-preserve-symlinks-flag": { - "version": "1.0.0", - "dev": true - }, "symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -4222,13 +4884,17 @@ }, "to-regex-range": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { "is-number": "^7.0.0" } }, "toidentifier": { - "version": "1.0.1" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, "tough-cookie": { "version": "4.1.2", @@ -4243,8 +4909,13 @@ } }, "tr46": { - "version": "0.0.3", - "dev": true + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "dev": true, + "requires": { + "punycode": "^2.3.0" + } }, "tsconfck": { "version": "2.1.1", @@ -4270,15 +4941,17 @@ }, "type-is": { "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "requires": { "media-typer": "0.3.0", "mime-types": "~2.1.24" } }, "typescript": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz", - "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", "dev": true }, "ufo": { @@ -4294,7 +4967,9 @@ "dev": true }, "unpipe": { - "version": "1.0.0" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" }, "url-parse": { "version": "1.5.10", @@ -4307,20 +4982,25 @@ } }, "utils-merge": { - "version": "1.0.1" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" }, "vary": { - "version": "1.1.2" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" }, "vite": { - "version": "3.0.5", + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.8.tgz", + "integrity": "sha512-uYB8PwN7hbMrf4j1xzGDk/lqjsZvCDbt/JC5dyfxc19Pg8kRm14LinK/uq+HSLNswZEoKmweGdtpbnxRtrAXiQ==", "dev": true, "requires": { - "esbuild": "^0.14.47", + "esbuild": "^0.17.5", "fsevents": "~2.3.2", - "postcss": "^8.4.16", - "resolve": "^1.22.1", - "rollup": "^2.75.6" + "postcss": "^8.4.23", + "rollup": "^3.21.0" } }, "vite-node": { @@ -4355,14 +5035,14 @@ } }, "vite-tsconfig-paths": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.0.7.tgz", - "integrity": "sha512-MwIYaby6kcbQGZqMH+gAK6h0UYQGOkjsuAgw4q6bP/5vWkn8VKvnmLuCQHA2+IzHAJHnE8OFTO4lnJLFMf9+7Q==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==", "dev": true, "requires": { "debug": "^4.1.1", "globrex": "^0.1.2", - "tsconfck": "^2.0.1" + "tsconfck": "^2.1.0" }, "dependencies": { "debug": { @@ -4417,6 +5097,8 @@ "dependencies": { "debug": { "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "requires": { "ms": "2.1.2" @@ -4424,6 +5106,8 @@ }, "ms": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true } } @@ -4438,7 +5122,9 @@ } }, "webidl-conversions": { - "version": "3.0.1", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "dev": true }, "well-known-symbols": { @@ -4474,11 +5160,13 @@ "dev": true }, "whatwg-url": { - "version": "5.0.0", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", + "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", "dev": true, "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" } }, "why-is-node-running": { @@ -4529,7 +5217,9 @@ "dev": true }, "zod": { - "version": "3.17.10" + "version": "3.21.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz", + "integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==" } } } diff --git a/package.json b/package.json index 49636b4..b34038f 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,15 @@ "e-62": "tt-cli run 62", "s-62": "tt-cli run 62 --solution", "e-63": "tt-cli run 63", - "s-63": "tt-cli run 63 --solution" + "s-63": "tt-cli run 63 --solution", + "e-42": "tt-cli run 42", + "s-42": "tt-cli run 42 --solution", + "e-45": "tt-cli run 45", + "s-45": "tt-cli run 45 --solution", + "e-52": "tt-cli run 52", + "s-52": "tt-cli run 52 --solution", + "e-64": "tt-cli run 64", + "s-64": "tt-cli run 64 --solution" }, "dependencies": { "@types/express": "^4.17.13", @@ -143,4 +151,4 @@ "react-dom": "^18.2.0", "zod": "^3.17.10" } -} +} \ No newline at end of file diff --git a/scripts/tests/__snapshots__/all.test.ts.snap b/scripts/tests/__snapshots__/all.test.ts.snap index f2310b6..e8b1b9d 100644 --- a/scripts/tests/__snapshots__/all.test.ts.snap +++ b/scripts/tests/__snapshots__/all.test.ts.snap @@ -395,7 +395,7 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, { "assertionResults": [], - "message": "React is not defined", + "message": "No test found in suite src/03-hooks/18-element-refs.explainer.tsx", "name": "/src/03-hooks/18-element-refs.explainer.tsx", "status": "passed", }, @@ -587,8 +587,7 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, { "assertionResults": [], - "message": "Transform failed with 1 error: -/src/04-advanced-components/31-prop-groups-with-variants.solution.2.tsx:16:2: ERROR: Expected \\";\\" but found \\"satisfies\\"", + "message": "No test found in suite src/04-advanced-components/31-prop-groups-with-variants.solution.2.tsx", "name": "/src/04-advanced-components/31-prop-groups-with-variants.solution.2.tsx", "status": "passed", }, @@ -874,19 +873,19 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, { "assertionResults": [], - "message": "React is not defined", + "message": "No test found in suite src/06-types-deep-dive/48-add-attribute-to-all-elements.problem.tsx", "name": "/src/06-types-deep-dive/48-add-attribute-to-all-elements.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "React is not defined", + "message": "No test found in suite src/06-types-deep-dive/49-add-attribute-to-audio-elements.problem.tsx", "name": "/src/06-types-deep-dive/49-add-attribute-to-audio-elements.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "React is not defined", + "message": "No test found in suite src/06-types-deep-dive/50-add-attribute-to-div-elements.problem.tsx", "name": "/src/06-types-deep-dive/50-add-attribute-to-div-elements.problem.tsx", "status": "passed", }, @@ -934,19 +933,19 @@ exports[`vitest > Should have the correct Vitest errors 1`] = ` }, { "assertionResults": [], - "message": "React is not defined", + "message": "No test found in suite src/07-advanced-patterns/55-as-prop.problem.tsx", "name": "/src/07-advanced-patterns/55-as-prop.problem.tsx", "status": "passed", }, { "assertionResults": [], - "message": "React is not defined", + "message": "No test found in suite src/07-advanced-patterns/55-as-prop.solution.1.tsx", "name": "/src/07-advanced-patterns/55-as-prop.solution.1.tsx", "status": "passed", }, { "assertionResults": [], - "message": "React is not defined", + "message": "No test found in suite src/07-advanced-patterns/55-as-prop.solution.2.tsx", "name": "/src/07-advanced-patterns/55-as-prop.solution.2.tsx", "status": "passed", }, From 2d3effd34cd4a5f887b82d3dd993cb7a3a4a3f58 Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Wed, 24 May 2023 18:06:04 +0100 Subject: [PATCH 020/186] Fixed tsconfig issue --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index add5bfc..65e6f74 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "vitest/importMeta" ], "target": "es2020", - "jsx": "react-jsx", + "jsx": "preserve", "module": "ES2022", "moduleResolution": "node", "noEmit": true, From 8ff732b0d464a5d37c1d45a8cce26efd52fc4d80 Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Wed, 24 May 2023 18:14:16 +0100 Subject: [PATCH 021/186] Fixed tsconfig issue --- tsconfig.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 65e6f74..02525ad 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,7 @@ { "compilerOptions": { - "types": [ - "vitest/importMeta" - ], "target": "es2020", - "jsx": "preserve", + "jsx": "react-jsx", "module": "ES2022", "moduleResolution": "node", "noEmit": true, From 1b708f67c21b6afe35902ceb9a6840bd1913d1d5 Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Wed, 31 May 2023 14:27:30 +0100 Subject: [PATCH 022/186] Added 27, modified 26 --- .../26-partial-autocomplete.problem.tsx | 29 +++++++++++- .../26-partial-autocomplete.solution.1.tsx | 27 +++++++++++ .../26-partial-autocomplete.solution.2.tsx | 29 ++++++++++++ ...-of-components-with-same-props.problem.tsx | 45 +++++++++++++++++++ ...-components-with-same-props.solution.1.tsx | 40 +++++++++++++++++ ...-components-with-same-props.solution.2.tsx | 44 ++++++++++++++++++ ...onents-vs-passing-react-nodes.problem.tsx} | 0 ...nts-vs-passing-react-nodes.solution.1.tsx} | 0 ...nts-vs-passing-react-nodes.solution.2.tsx} | 0 ...oblem.tsx => 29-generic-props.problem.tsx} | 0 ...tion.tsx => 29-generic-props.solution.tsx} | 0 ...erics-vs-discriminated-unions.problem.tsx} | 0 ...rics-vs-discriminated-unions.solution.tsx} | 0 ...> 31-variants-with-classnames.problem.tsx} | 0 ... 31-variants-with-classnames.solution.tsx} | 0 ... 32-prop-groups-with-variants.problem.tsx} | 0 ...-prop-groups-with-variants.solution.1.tsx} | 0 ...-prop-groups-with-variants.solution.2.tsx} | 0 .../32-typing-custom-hooks.problem.ts | 10 ----- .../32-typing-custom-hooks.solution.1.ts | 10 ----- .../32-typing-custom-hooks.solution.2.ts | 10 ----- .../32-typing-custom-hooks.solution.3.ts | 10 ----- ...-of-components-with-same-props.problem.tsx | 1 - ...lem.tsx => 59-react-hook-form.problem.tsx} | 0 ...problem.tsx => 60-react-query.problem.tsx} | 0 ...oblem.tsx => 61-redux-toolkit.problem.tsx} | 0 ...and.problem.tsx => 62-zustand.problem.tsx} | 0 ...eusable-form-library-with-zod.problem.tsx} | 0 28 files changed, 213 insertions(+), 42 deletions(-) create mode 100644 src/04-advanced-components/26-partial-autocomplete.solution.1.tsx create mode 100644 src/04-advanced-components/26-partial-autocomplete.solution.2.tsx create mode 100644 src/04-advanced-components/27-record-of-components-with-same-props.problem.tsx create mode 100644 src/04-advanced-components/27-record-of-components-with-same-props.solution.1.tsx create mode 100644 src/04-advanced-components/27-record-of-components-with-same-props.solution.2.tsx rename src/04-advanced-components/{27-passing-react-components-vs-passing-react-nodes.problem.tsx => 28-passing-react-components-vs-passing-react-nodes.problem.tsx} (100%) rename src/04-advanced-components/{27-passing-react-components-vs-passing-react-nodes.solution.1.tsx => 28-passing-react-components-vs-passing-react-nodes.solution.1.tsx} (100%) rename src/04-advanced-components/{27-passing-react-components-vs-passing-react-nodes.solution.2.tsx => 28-passing-react-components-vs-passing-react-nodes.solution.2.tsx} (100%) rename src/04-advanced-components/{28-generic-props.problem.tsx => 29-generic-props.problem.tsx} (100%) rename src/04-advanced-components/{28-generic-props.solution.tsx => 29-generic-props.solution.tsx} (100%) rename src/04-advanced-components/{29-generics-vs-discriminated-unions.problem.tsx => 30-generics-vs-discriminated-unions.problem.tsx} (100%) rename src/04-advanced-components/{29-generics-vs-discriminated-unions.solution.tsx => 30-generics-vs-discriminated-unions.solution.tsx} (100%) rename src/04-advanced-components/{30-variants-with-classnames.problem.tsx => 31-variants-with-classnames.problem.tsx} (100%) rename src/04-advanced-components/{30-variants-with-classnames.solution.tsx => 31-variants-with-classnames.solution.tsx} (100%) rename src/04-advanced-components/{31-prop-groups-with-variants.problem.tsx => 32-prop-groups-with-variants.problem.tsx} (100%) rename src/04-advanced-components/{31-prop-groups-with-variants.solution.1.tsx => 32-prop-groups-with-variants.solution.1.tsx} (100%) rename src/04-advanced-components/{31-prop-groups-with-variants.solution.2.tsx => 32-prop-groups-with-variants.solution.2.tsx} (100%) delete mode 100644 src/05-advanced-hooks/32-typing-custom-hooks.problem.ts delete mode 100644 src/05-advanced-hooks/32-typing-custom-hooks.solution.1.ts delete mode 100644 src/05-advanced-hooks/32-typing-custom-hooks.solution.2.ts delete mode 100644 src/05-advanced-hooks/32-typing-custom-hooks.solution.3.ts delete mode 100644 src/07-advanced-patterns/59-record-of-components-with-same-props.problem.tsx rename src/08-external-libraries/{60-react-hook-form.problem.tsx => 59-react-hook-form.problem.tsx} (100%) rename src/08-external-libraries/{61-react-query.problem.tsx => 60-react-query.problem.tsx} (100%) rename src/08-external-libraries/{62-redux-toolkit.problem.tsx => 61-redux-toolkit.problem.tsx} (100%) rename src/08-external-libraries/{63-zustand.problem.tsx => 62-zustand.problem.tsx} (100%) rename src/08-external-libraries/{64-reusable-form-library-with-zod.problem.tsx => 63-reusable-form-library-with-zod.problem.tsx} (100%) diff --git a/src/04-advanced-components/26-partial-autocomplete.problem.tsx b/src/04-advanced-components/26-partial-autocomplete.problem.tsx index 70b786d..6248a9b 100644 --- a/src/04-advanced-components/26-partial-autocomplete.problem.tsx +++ b/src/04-advanced-components/26-partial-autocomplete.problem.tsx @@ -1 +1,28 @@ -// TODO +const presetSizes = { + xs: "0.5rem", + sm: "1rem", +}; + +type Size = keyof typeof presetSizes; + +type LooseSize = Size | string; + +export const Icon = (props: { size: LooseSize }) => { + return ( +
+ ); +}; + +<> + {/* Autocomplete for sm and xs are no longer working! */} + + + +; diff --git a/src/04-advanced-components/26-partial-autocomplete.solution.1.tsx b/src/04-advanced-components/26-partial-autocomplete.solution.1.tsx new file mode 100644 index 0000000..01751e1 --- /dev/null +++ b/src/04-advanced-components/26-partial-autocomplete.solution.1.tsx @@ -0,0 +1,27 @@ +const presetSizes = { + xs: "0.5rem", + sm: "1rem", +}; + +type Size = keyof typeof presetSizes; + +type LooseSize = Size | (string & {}); + +export const Icon = (props: { size: LooseSize }) => { + return ( +
+ ); +}; + +<> + + + +; diff --git a/src/04-advanced-components/26-partial-autocomplete.solution.2.tsx b/src/04-advanced-components/26-partial-autocomplete.solution.2.tsx new file mode 100644 index 0000000..9d15d7d --- /dev/null +++ b/src/04-advanced-components/26-partial-autocomplete.solution.2.tsx @@ -0,0 +1,29 @@ +const presetSizes = { + xs: "0.5rem", + sm: "1rem", +}; + +type Size = keyof typeof presetSizes; + +type LooseAutocomplete = T | (string & {}); + +type LooseSize = LooseAutocomplete; + +export const Icon = (props: { size: LooseSize }) => { + return ( +
+ ); +}; + +<> + + + +; diff --git a/src/04-advanced-components/27-record-of-components-with-same-props.problem.tsx b/src/04-advanced-components/27-record-of-components-with-same-props.problem.tsx new file mode 100644 index 0000000..8a10719 --- /dev/null +++ b/src/04-advanced-components/27-record-of-components-with-same-props.problem.tsx @@ -0,0 +1,45 @@ +import { Equal, Expect } from "../helpers/type-utils"; + +type InputProps = React.ComponentProps<"input">; + +/** + * All these components take the same props! + * + * We don't want to repeat ourselves by typing + * props: InputProps for each component. + * + * There must be a better way! + * + * Hint: Record and satisfies will come in handy. + */ +const COMPONENTS = { + text: (props) => { + return ; + }, + number: (props) => { + return ; + }, + password: (props) => { + return ; + }, +}; + +export const Input = (props: unknown) => { + const Component = COMPONENTS[props.type]; + return ; +}; + +<> + { + // e should be properly typed! + type test = Expect>>; + }} + > + + + + {/* @ts-expect-error */} + +; diff --git a/src/04-advanced-components/27-record-of-components-with-same-props.solution.1.tsx b/src/04-advanced-components/27-record-of-components-with-same-props.solution.1.tsx new file mode 100644 index 0000000..79c1baa --- /dev/null +++ b/src/04-advanced-components/27-record-of-components-with-same-props.solution.1.tsx @@ -0,0 +1,40 @@ +import { Equal, Expect } from "../helpers/type-utils"; + +type InputProps = React.ComponentProps<"input">; + +type Input = "text" | "number" | "password"; + +/** + * We can do it by typing Input and making COMPONENTS + * restricted to only those inputs. + */ +const COMPONENTS: Record> = { + text: (props) => { + return ; + }, + number: (props) => { + return ; + }, + password: (props) => { + return ; + }, +}; + +export const Input = (props: { type: Input } & InputProps) => { + const Component = COMPONENTS[props.type]; + return ; +}; + +<> + { + type test = Expect>>; + }} + > + + + + {/* @ts-expect-error */} + +; diff --git a/src/04-advanced-components/27-record-of-components-with-same-props.solution.2.tsx b/src/04-advanced-components/27-record-of-components-with-same-props.solution.2.tsx new file mode 100644 index 0000000..a1c689b --- /dev/null +++ b/src/04-advanced-components/27-record-of-components-with-same-props.solution.2.tsx @@ -0,0 +1,44 @@ +import { Equal, Expect } from "../helpers/type-utils"; + +type InputProps = React.ComponentProps<"input">; + +/** + * OR, we can do it by making COMPONENTS 'satisfy' + * a type that is a Record of React.FC. + */ +const COMPONENTS = { + text: (props) => { + return ; + }, + number: (props) => { + return ; + }, + password: (props) => { + return ; + }, +} satisfies Record>; + +/** + * Then, we can derive the type of input from the + * keys of COMPONENTS. + */ +type Input = keyof typeof COMPONENTS; + +export const Input = (props: { type: Input } & InputProps) => { + const Component = COMPONENTS[props.type]; + return ; +}; + +<> + { + type test = Expect>>; + }} + > + + + + {/* @ts-expect-error */} + +; diff --git a/src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx b/src/04-advanced-components/28-passing-react-components-vs-passing-react-nodes.problem.tsx similarity index 100% rename from src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.problem.tsx rename to src/04-advanced-components/28-passing-react-components-vs-passing-react-nodes.problem.tsx diff --git a/src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.solution.1.tsx b/src/04-advanced-components/28-passing-react-components-vs-passing-react-nodes.solution.1.tsx similarity index 100% rename from src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.solution.1.tsx rename to src/04-advanced-components/28-passing-react-components-vs-passing-react-nodes.solution.1.tsx diff --git a/src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.solution.2.tsx b/src/04-advanced-components/28-passing-react-components-vs-passing-react-nodes.solution.2.tsx similarity index 100% rename from src/04-advanced-components/27-passing-react-components-vs-passing-react-nodes.solution.2.tsx rename to src/04-advanced-components/28-passing-react-components-vs-passing-react-nodes.solution.2.tsx diff --git a/src/04-advanced-components/28-generic-props.problem.tsx b/src/04-advanced-components/29-generic-props.problem.tsx similarity index 100% rename from src/04-advanced-components/28-generic-props.problem.tsx rename to src/04-advanced-components/29-generic-props.problem.tsx diff --git a/src/04-advanced-components/28-generic-props.solution.tsx b/src/04-advanced-components/29-generic-props.solution.tsx similarity index 100% rename from src/04-advanced-components/28-generic-props.solution.tsx rename to src/04-advanced-components/29-generic-props.solution.tsx diff --git a/src/04-advanced-components/29-generics-vs-discriminated-unions.problem.tsx b/src/04-advanced-components/30-generics-vs-discriminated-unions.problem.tsx similarity index 100% rename from src/04-advanced-components/29-generics-vs-discriminated-unions.problem.tsx rename to src/04-advanced-components/30-generics-vs-discriminated-unions.problem.tsx diff --git a/src/04-advanced-components/29-generics-vs-discriminated-unions.solution.tsx b/src/04-advanced-components/30-generics-vs-discriminated-unions.solution.tsx similarity index 100% rename from src/04-advanced-components/29-generics-vs-discriminated-unions.solution.tsx rename to src/04-advanced-components/30-generics-vs-discriminated-unions.solution.tsx diff --git a/src/04-advanced-components/30-variants-with-classnames.problem.tsx b/src/04-advanced-components/31-variants-with-classnames.problem.tsx similarity index 100% rename from src/04-advanced-components/30-variants-with-classnames.problem.tsx rename to src/04-advanced-components/31-variants-with-classnames.problem.tsx diff --git a/src/04-advanced-components/30-variants-with-classnames.solution.tsx b/src/04-advanced-components/31-variants-with-classnames.solution.tsx similarity index 100% rename from src/04-advanced-components/30-variants-with-classnames.solution.tsx rename to src/04-advanced-components/31-variants-with-classnames.solution.tsx diff --git a/src/04-advanced-components/31-prop-groups-with-variants.problem.tsx b/src/04-advanced-components/32-prop-groups-with-variants.problem.tsx similarity index 100% rename from src/04-advanced-components/31-prop-groups-with-variants.problem.tsx rename to src/04-advanced-components/32-prop-groups-with-variants.problem.tsx diff --git a/src/04-advanced-components/31-prop-groups-with-variants.solution.1.tsx b/src/04-advanced-components/32-prop-groups-with-variants.solution.1.tsx similarity index 100% rename from src/04-advanced-components/31-prop-groups-with-variants.solution.1.tsx rename to src/04-advanced-components/32-prop-groups-with-variants.solution.1.tsx diff --git a/src/04-advanced-components/31-prop-groups-with-variants.solution.2.tsx b/src/04-advanced-components/32-prop-groups-with-variants.solution.2.tsx similarity index 100% rename from src/04-advanced-components/31-prop-groups-with-variants.solution.2.tsx rename to src/04-advanced-components/32-prop-groups-with-variants.solution.2.tsx diff --git a/src/05-advanced-hooks/32-typing-custom-hooks.problem.ts b/src/05-advanced-hooks/32-typing-custom-hooks.problem.ts deleted file mode 100644 index fc1144b..0000000 --- a/src/05-advanced-hooks/32-typing-custom-hooks.problem.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { useState } from "react"; -import { Equal, Expect } from "../helpers/type-utils"; - -export const useId = (defaultId) => { - const [id] = useState(defaultId); - - return id; -}; - -type tests = [Expect string>>]; diff --git a/src/05-advanced-hooks/32-typing-custom-hooks.solution.1.ts b/src/05-advanced-hooks/32-typing-custom-hooks.solution.1.ts deleted file mode 100644 index cc51090..0000000 --- a/src/05-advanced-hooks/32-typing-custom-hooks.solution.1.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { useState } from "react"; -import { Equal, Expect } from "../helpers/type-utils"; - -export const useId = (defaultId: string) => { - const [id] = useState(defaultId); - - return id; -}; - -type tests = [Expect string>>]; diff --git a/src/05-advanced-hooks/32-typing-custom-hooks.solution.2.ts b/src/05-advanced-hooks/32-typing-custom-hooks.solution.2.ts deleted file mode 100644 index 35f4be4..0000000 --- a/src/05-advanced-hooks/32-typing-custom-hooks.solution.2.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { useState } from "react"; -import { Equal, Expect } from "../helpers/type-utils"; - -export const useId = (defaultId: string): string => { - const [id] = useState(defaultId); - - return id; -}; - -type tests = [Expect string>>]; diff --git a/src/05-advanced-hooks/32-typing-custom-hooks.solution.3.ts b/src/05-advanced-hooks/32-typing-custom-hooks.solution.3.ts deleted file mode 100644 index 0f90c81..0000000 --- a/src/05-advanced-hooks/32-typing-custom-hooks.solution.3.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { useState } from "react"; -import { Equal, Expect } from "../helpers/type-utils"; - -export const useId = (defaultId: string): string => { - const [id] = useState(defaultId); - - return id; -}; - -type tests = [Expect string>>]; diff --git a/src/07-advanced-patterns/59-record-of-components-with-same-props.problem.tsx b/src/07-advanced-patterns/59-record-of-components-with-same-props.problem.tsx deleted file mode 100644 index 9289714..0000000 --- a/src/07-advanced-patterns/59-record-of-components-with-same-props.problem.tsx +++ /dev/null @@ -1 +0,0 @@ -// https://codesandbox.io/s/young-dream-ihjcq3?file=/src/App.tsx diff --git a/src/08-external-libraries/60-react-hook-form.problem.tsx b/src/08-external-libraries/59-react-hook-form.problem.tsx similarity index 100% rename from src/08-external-libraries/60-react-hook-form.problem.tsx rename to src/08-external-libraries/59-react-hook-form.problem.tsx diff --git a/src/08-external-libraries/61-react-query.problem.tsx b/src/08-external-libraries/60-react-query.problem.tsx similarity index 100% rename from src/08-external-libraries/61-react-query.problem.tsx rename to src/08-external-libraries/60-react-query.problem.tsx diff --git a/src/08-external-libraries/62-redux-toolkit.problem.tsx b/src/08-external-libraries/61-redux-toolkit.problem.tsx similarity index 100% rename from src/08-external-libraries/62-redux-toolkit.problem.tsx rename to src/08-external-libraries/61-redux-toolkit.problem.tsx diff --git a/src/08-external-libraries/63-zustand.problem.tsx b/src/08-external-libraries/62-zustand.problem.tsx similarity index 100% rename from src/08-external-libraries/63-zustand.problem.tsx rename to src/08-external-libraries/62-zustand.problem.tsx diff --git a/src/08-external-libraries/64-reusable-form-library-with-zod.problem.tsx b/src/08-external-libraries/63-reusable-form-library-with-zod.problem.tsx similarity index 100% rename from src/08-external-libraries/64-reusable-form-library-with-zod.problem.tsx rename to src/08-external-libraries/63-reusable-form-library-with-zod.problem.tsx From 846c613130c6eb25f0154ec57f952183ecf51ece Mon Sep 17 00:00:00 2001 From: Matt Pocock Date: Wed, 31 May 2023 14:55:33 +0100 Subject: [PATCH 023/186] Added toggle props --- .../29-toggle-props.problem.tsx | 35 +++++++++++++++++++ .../29-toggle-props.solution.tsx | 32 +++++++++++++++++ ...oblem.tsx => 30-generic-props.problem.tsx} | 0 ...tion.tsx => 30-generic-props.solution.tsx} | 0 ...erics-vs-discriminated-unions.problem.tsx} | 0 ...rics-vs-discriminated-unions.solution.tsx} | 0 ...> 32-variants-with-classnames.problem.tsx} | 0 ... 32-variants-with-classnames.solution.tsx} | 0 ... 33-prop-groups-with-variants.problem.tsx} | 0 ...-prop-groups-with-variants.solution.1.tsx} | 0 ...-prop-groups-with-variants.solution.2.tsx} | 0 ...criminated-unions-with-booleans.problem.ts | 1 - ...lem.ts => 34-tuple-return-type.problem.ts} | 0 ....ts => 34-tuple-return-type.solution.1.ts} | 0 ....ts => 34-tuple-return-type.solution.2.ts} | 0 15 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 src/04-advanced-components/29-toggle-props.problem.tsx create mode 100644 src/04-advanced-components/29-toggle-props.solution.tsx rename src/04-advanced-components/{29-generic-props.problem.tsx => 30-generic-props.problem.tsx} (100%) rename src/04-advanced-components/{29-generic-props.solution.tsx => 30-generic-props.solution.tsx} (100%) rename src/04-advanced-components/{30-generics-vs-discriminated-unions.problem.tsx => 31-generics-vs-discriminated-unions.problem.tsx} (100%) rename src/04-advanced-components/{30-generics-vs-discriminated-unions.solution.tsx => 31-generics-vs-discriminated-unions.solution.tsx} (100%) rename src/04-advanced-components/{31-variants-with-classnames.problem.tsx => 32-variants-with-classnames.problem.tsx} (100%) rename src/04-advanced-components/{31-variants-with-classnames.solution.tsx => 32-variants-with-classnames.solution.tsx} (100%) rename src/04-advanced-components/{32-prop-groups-with-variants.problem.tsx => 33-prop-groups-with-variants.problem.tsx} (100%) rename src/04-advanced-components/{32-prop-groups-with-variants.solution.1.tsx => 33-prop-groups-with-variants.solution.1.tsx} (100%) rename src/04-advanced-components/{32-prop-groups-with-variants.solution.2.tsx => 33-prop-groups-with-variants.solution.2.tsx} (100%) delete mode 100644 src/05-advanced-hooks/34-discriminated-unions-with-booleans.problem.ts rename src/05-advanced-hooks/{33-tuple-return-type.problem.ts => 34-tuple-return-type.problem.ts} (100%) rename src/05-advanced-hooks/{33-tuple-return-type.solution.1.ts => 34-tuple-return-type.solution.1.ts} (100%) rename src/05-advanced-hooks/{33-tuple-return-type.solution.2.ts => 34-tuple-return-type.solution.2.ts} (100%) diff --git a/src/04-advanced-components/29-toggle-props.problem.tsx b/src/04-advanced-components/29-toggle-props.problem.tsx new file mode 100644 index 0000000..0cf3e34 --- /dev/null +++ b/src/04-advanced-components/29-toggle-props.problem.tsx @@ -0,0 +1,35 @@ +type EmbeddedPlaygroundProps = + | { + useStackblitz: true; + stackblitzId: string; + } + | { + useStackblitz?: false; + codeSandboxId: string; + }; + +const EmbeddedPlayground = (props: EmbeddedPlaygroundProps) => { + if (props.useStackblitz) { + return ( +