From 0f01fb4981b0b3dd319c1766fb00ae4ceeed9962 Mon Sep 17 00:00:00 2001 From: onemen Date: Tue, 13 Jun 2023 17:49:39 +0300 Subject: [PATCH] native ESM + update dependencies (#118) --- .prettierrc | 14 +- examples/resetting-via-key-prop/index.tsx | 2 +- .../01.solution/increments.test.tsx | 2 +- .../01.solution/step-change.test.tsx | 2 +- exercises/02.composition/01.problem/index.tsx | 6 +- .../02.composition/01.solution/index.tsx | 4 +- .../01.solution/ui-still-works.test.tsx | 2 +- .../03.compound-components/01.problem/app.tsx | 2 +- .../01.problem/index.tsx | 2 +- .../01.problem/toggle.tsx | 2 +- .../01.solution/app.tsx | 2 +- .../01.solution/index.tsx | 2 +- .../01.solution/toggle.test.tsx | 2 +- .../01.solution/toggle.tsx | 2 +- .../02.problem.validation/app.tsx | 2 +- .../02.problem.validation/index.tsx | 2 +- .../02.problem.validation/toggle.tsx | 2 +- .../02.solution.validation/app.tsx | 2 +- .../02.solution.validation/index.tsx | 2 +- .../02.solution.validation/toggle.test.tsx | 2 +- .../02.solution.validation/toggle.tsx | 2 +- .../validation.test.tsx | 2 +- exercises/03.compound-components/README.mdx | 4 +- .../01.problem.collections/app.tsx | 4 +- .../01.problem.collections/index.tsx | 2 +- .../01.solution.collections/app.tsx | 4 +- .../custom-button.test.tsx | 2 +- .../01.solution.collections/index.tsx | 2 +- .../01.solution.collections/toggle.test.tsx | 2 +- .../02.problem.getters/app.tsx | 4 +- .../02.problem.getters/index.tsx | 2 +- .../02.solution.getters/app.tsx | 4 +- .../custom-button.test.tsx | 2 +- .../forwards-props.test.tsx | 2 +- .../02.solution.getters/index.tsx | 2 +- .../02.solution.getters/toggle.test.tsx | 2 +- .../05.state-initializer/01.problem/app.tsx | 4 +- .../05.state-initializer/01.problem/index.tsx | 2 +- .../05.state-initializer/01.solution/app.tsx | 4 +- .../01.solution/index.tsx | 2 +- .../01.solution/initial-on.test.tsx | 2 +- .../01.solution/toggle.test.tsx | 2 +- .../02.problem.initial/app.tsx | 4 +- .../02.problem.initial/index.tsx | 2 +- .../02.solution.initial/app.tsx | 4 +- .../02.solution.initial/index.tsx | 2 +- .../initial-on-change.test.tsx | 2 +- .../02.solution.initial/initial-on.test.tsx | 2 +- .../02.solution.initial/toggle.test.tsx | 2 +- exercises/06.state-reducer/01.problem/app.tsx | 4 +- .../06.state-reducer/01.problem/index.tsx | 2 +- .../06.state-reducer/01.solution/app.tsx | 4 +- .../01.solution/click-limit.test.tsx | 4 +- .../06.state-reducer/01.solution/index.tsx | 2 +- .../01.solution/toggle.test.tsx | 2 +- .../02.problem.default/app.tsx | 4 +- .../02.problem.default/index.tsx | 2 +- .../02.solution.default/app.tsx | 4 +- .../02.solution.default/click-limit.test.tsx | 4 +- .../exporting-toggle-reducer.test.tsx | 2 +- .../02.solution.default/index.tsx | 2 +- .../02.solution.default/toggle.test.tsx | 2 +- exercises/07.control-props/01.problem/app.tsx | 2 +- .../07.control-props/01.problem/index.tsx | 2 +- .../07.control-props/01.problem/toggle.tsx | 2 +- .../07.control-props/01.solution/app.tsx | 2 +- .../07.control-props/01.solution/index.tsx | 2 +- .../01.solution/synchronized.test.tsx | 4 +- .../07.control-props/01.solution/toggle.tsx | 2 +- .../01.solution/uncontrolled.test.tsx | 4 +- .../02.problem.warnings/README.mdx | 2 +- .../02.problem.warnings/app.tsx | 2 +- .../02.problem.warnings/index.tsx | 2 +- .../02.problem.warnings/toggle.tsx | 2 +- .../02.solution.warnings/app.tsx | 2 +- .../02.solution.warnings/index.tsx | 2 +- .../synchronized.test.tsx | 4 +- .../02.solution.warnings/toggle.tsx | 4 +- .../uncontrolled.test.tsx | 4 +- .../02.solution.warnings/warnings.test.tsx | 4 +- package-lock.json | 14354 ++++++++++++---- package.json | 22 +- playwright.config.ts | 9 +- public/manifest.json | 26 +- sandbox.config.json | 12 +- scripts/diff.js | 34 - scripts/pre-commit.js | 5 +- scripts/pre-push.js | 8 +- scripts/setup.js | 2 +- setup.js | 2 +- shared/pokemon.tsx | 2 +- shared/toggle.test.tsx | 2 +- shared/user-event.cjs | 2 + tsconfig.json | 52 +- 94 files changed, 11119 insertions(+), 3633 deletions(-) delete mode 100644 scripts/diff.js create mode 100644 shared/user-event.cjs diff --git a/.prettierrc b/.prettierrc index c9afdc8d..db4ac60e 100644 --- a/.prettierrc +++ b/.prettierrc @@ -16,5 +16,15 @@ "singleQuote": true, "tabWidth": 2, "trailingComma": "all", - "useTabs": true -} + "useTabs": true, + "overrides": [ + { + "files": [ + "**/*.json" + ], + "options": { + "useTabs": false + } + } + ] +} \ No newline at end of file diff --git a/examples/resetting-via-key-prop/index.tsx b/examples/resetting-via-key-prop/index.tsx index 7aa9037a..7cbce8b4 100644 --- a/examples/resetting-via-key-prop/index.tsx +++ b/examples/resetting-via-key-prop/index.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import * as ReactDOM from 'react-dom/client' -import { Switch } from '~/shared/switch' +import { Switch } from '~/shared/switch.tsx' function callAll>( ...fns: Array<((...args: Args) => unknown) | undefined> diff --git a/exercises/01.latest-ref/01.solution/increments.test.tsx b/exercises/01.latest-ref/01.solution/increments.test.tsx index fbd4d87f..e7b324b2 100644 --- a/exercises/01.latest-ref/01.solution/increments.test.tsx +++ b/exercises/01.latest-ref/01.solution/increments.test.tsx @@ -1,5 +1,5 @@ import { waitFor, within } from '@testing-library/dom' -import userEvent from '@testing-library/user-event' +import { userEvent } from '~/shared/user-event.cjs' import { expect, testStep } from '@kentcdodds/workshop-app/test' import '.' diff --git a/exercises/01.latest-ref/01.solution/step-change.test.tsx b/exercises/01.latest-ref/01.solution/step-change.test.tsx index 1460f44e..68595af6 100644 --- a/exercises/01.latest-ref/01.solution/step-change.test.tsx +++ b/exercises/01.latest-ref/01.solution/step-change.test.tsx @@ -1,5 +1,5 @@ import { waitFor, within, fireEvent } from '@testing-library/dom' -import userEvent from '@testing-library/user-event' +import { userEvent } from '~/shared/user-event.cjs' import { expect, testStep } from '@kentcdodds/workshop-app/test' import '.' diff --git a/exercises/02.composition/01.problem/index.tsx b/exercises/02.composition/01.problem/index.tsx index c88d5188..69348151 100644 --- a/exercises/02.composition/01.problem/index.tsx +++ b/exercises/02.composition/01.problem/index.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import * as ReactDOM from 'react-dom/client' -import { allPokemon, PokemonDataView } from '~/shared/pokemon' -import type { PokemonData, User } from '~/shared/types' +import { allPokemon, PokemonDataView } from '~/shared/pokemon.tsx' +import type { PokemonData, User } from '~/shared/types.tsx' function App() { const [user] = React.useState({ name: 'Kody', image: '/img/kody.png' }) @@ -22,7 +22,7 @@ function App() { */}