diff --git a/.babelrc b/.babelrc
index 887a4dbd7..267da6c5d 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,4 +1,14 @@
{
- "presets": ["next/babel"],
- "plugins": ["emotion"]
+ "presets": [
+ [
+ "next/babel",
+ {
+ "preset-react": {
+ "runtime": "automatic",
+ "importSource": "@emotion/react"
+ }
+ }
+ ]
+ ],
+ "plugins": ["@emotion"]
}
diff --git a/.eslintrc b/.eslintrc
index 2b34fb816..fa783345c 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -3,10 +3,9 @@
"extends": [
"plugin:@typescript-eslint/recommended",
"react-app",
- "prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
- "plugins": ["@typescript-eslint", "react", "react-hooks"],
+ "plugins": ["@typescript-eslint", "react", "react-hooks", "@emotion"],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
@@ -19,7 +18,12 @@
"jsx-a11y/accessible-emoji": "off",
"jsx-a11y/iframe-has-title": "off",
"react-hooks/rules-of-hooks": "error",
- "react-hooks/exhaustive-deps": "warn"
+ "react-hooks/exhaustive-deps": "warn",
+ "@typescript-eslint/prefer-as-const": "off",
+ "@typescript-eslint/ban-ts-comment": "off",
+ "import/no-anonymous-default-export": "off",
+ "@typescript-eslint/no-empty-function": "off",
+ "@emotion/pkg-renaming": "error"
},
"overrides": [
{
diff --git a/.gitignore b/.gitignore
index b70e5bc0b..f696f7eb9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.vscode/settings.json
outDir
jpOut
enOut
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 000000000..5de6c9f96
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1,4 @@
+public-hoist-pattern[]=*eslint*
+public-hoist-pattern[]=*prettier*
+# https://github.com/pnpm/pnpm/issues/4920#issuecomment-1226724790
+public-hoist-pattern[]=@react-spring/core
\ No newline at end of file
diff --git a/.nvmrc b/.nvmrc
index 817ba4bff..0828ab794 100644
--- a/.nvmrc
+++ b/.nvmrc
@@ -1 +1 @@
-v13
\ No newline at end of file
+v18
\ No newline at end of file
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 000000000..2e1fa2d52
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1 @@
+*.md
\ No newline at end of file
diff --git a/.prettierrc b/.prettierrc
index b2095be81..bf7e27e73 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -1,4 +1,7 @@
{
"semi": false,
- "singleQuote": true
+ "singleQuote": true,
+ "trailingComma": "none",
+ "arrowParens": "avoid",
+ "endOfLine": "auto"
}
diff --git a/README.md b/README.md
index 0c964eba8..b3ed2c6f2 100644
--- a/README.md
+++ b/README.md
@@ -19,8 +19,8 @@ I wrote about this repo on [this blog post](https://ycombinator.chibicode.com/fu
## Running it locally (English version)
```
-yarn install
-yarn dev:en
+pnpm install
+pnpm dev:en
# Go to http://localhost:9990
```
diff --git a/next-env.d.ts b/next-env.d.ts
index 7b7aa2c77..4f11a03dc 100644
--- a/next-env.d.ts
+++ b/next-env.d.ts
@@ -1,2 +1,5 @@
///
Here’s my Twitter:
-
The above emoji puzzle is equivalent to the earlier JS code.
First, the identity function{' '}
-
@@ -830,7 +822,7 @@ sushi => 'pizza'`}
-
Just like the JS code, the emoji puzzle ended up with a{' '} @@ -868,13 +860,14 @@ sushi => 'pizza'`}
The above steps are a visual representation of how functions are
evaluated. They are equivalent to how JavaScript evaluates{' '}
-
By learning these rules, non-programmers will be able to evaluate @@ -1139,7 +1132,7 @@ sushi => 'pizza'`}
…is represented by the bottom row:
And the two arguments…
@@ -1321,7 +1314,7 @@ sushi => 'pizza'`}
Next, here’s slightly different JS code. Compared to the last
time, there’s an extra pair of parentheses around{' '}
-
Now, suppose that we apply
Here’s an emoji puzzle that represents{' '}
-
The result is equivalent to{' '}
-
-
@@ -970,176 +958,43 @@ const H = ({ args, highlightType, episodeNumberOverrides }: HProps) => {
Once again, thank you for reading!
> ) - - if (episodeNumber <= numEpisodesExceptFirstAndLast) { - return ( - <> -
-
-
-
Once again, thank you for reading!
- > - ) - } } else { - const question = ( -
- また、本稿の内容について質問がございましたら、
-
+ お疲れ様でした!本稿の内容について質問がございましたら、メール(
+
+
+
+
重ね重ね、本稿をお読みになってくださりありがとうございました!
+ > ) - - if (episodeNumber <= numEpisodesExceptFirstAndLast) { - let quitReason: React.ReactNode - if (episodeNumber === 0) { - quitReason =
-
- 差し支えなければ、このページを閉じる前に
-
- お疲れ様でした!本稿に対するご意見・ご感想を、ぜひ
-
-
- プログラミング抜きに、コンピュータサイエンスを学べる教材が他にもあればご紹介したいのですが、現時点では筆者がおすすめできるものが見つかっておりません。 -
-
- というわけで、
-
- 続編をリクエストしたい方は、
-
-
-
-
-
- 重ね重ね、本稿をお読みになってくださりありがとうございました! -
- > - ) - } } } if (args.name === 'shareTitle') { @@ -1227,7 +1082,6 @@ const H = ({ args, highlightType, episodeNumberOverrides }: HProps) => { > )} - {args.includeTwitter && shareVisible &&Here are some of the readers’ comments:
- {testimonials.map(id => ( -Press the button below to continue to the course!
- > - ) - } else { - return ( - <> -みなさまコメントありがとうございます!
- {testimonials.map(id => ( -- 「読んでみたいかも」と思ってくださった方は、下のボタンを押してみてください! -
- > - ) - } - } if (args.name === 'goToOtherPage') { if (locale === 'en') { return <>Looking for some other page?> @@ -1841,7 +1663,7 @@ const H = ({ args, highlightType, episodeNumberOverrides }: HProps) => { <>
だから、
However, the =
+ VariableExpression & VariableStates[S]
-export type VariableWithStateShorthandNumber<
- S extends keyof VariableStates
-> = VariableShorthandNumber & VariableStates[S]
+export type VariableWithStateShorthandNumber =
+ VariableShorthandNumber & VariableStates[S]
export type VariableWithEmphasizePriorityAndState<
S extends keyof VariableStates
@@ -51,9 +49,8 @@ export type VariableWithEmphasizePriorityAndState<
readonly emphasizePriority: true
}
-export type VariableWithStateShorthandFunc<
- S extends keyof VariableStates
-> = VariableShorthandFunc & VariableStates[S]
+export type VariableWithStateShorthandFunc =
+ VariableShorthandFunc & VariableStates[S]
interface VariableStates {
default: {
@@ -365,57 +362,51 @@ type ExecutableRegular<
S extends CallStates,
F extends FunctionExpression,
E extends Expression
-> = CallExpression &
- ({
- readonly state: S
- readonly arg: E
- readonly func: F
- })
+> = CallExpression & {
+ readonly state: S
+ readonly arg: E
+ readonly func: F
+}
type ExecutableShorthand<
S extends CallStates,
F extends VariableShorthandFunc,
N extends VariableShorthandNumber
-> = CallExpression &
- ({
- readonly state: S
- readonly arg: N
- readonly func: F
- })
+> = CallExpression & {
+ readonly state: S
+ readonly arg: N
+ readonly func: F
+}
type ExecutableConditionalNumber<
C extends VariableShorthandNumber,
T extends Expression,
F extends Expression,
S extends ConditionalStates
-> = ConditionalExpression &
- ({
- readonly condition: C
- readonly trueCase: T
- readonly falseCase: F
- readonly state: S
- })
+> = ConditionalExpression & {
+ readonly condition: C
+ readonly trueCase: T
+ readonly falseCase: F
+ readonly state: S
+}
type ExecutableBinaryNumber<
A extends VariableShorthandNumber,
B extends VariableShorthandNumber,
S extends BinaryStates
-> = BinaryExpression &
- ({
- readonly first: A
- readonly second: B
- readonly state: S
- })
+> = BinaryExpression & {
+ readonly first: A
+ readonly second: B
+ readonly state: S
+}
export type StepVariable =
+ DistributeStepConditional = S extends ConditionalStates
? ExecutableConditional
: never
-export type ExecutableConditionalStatesDistributed = DistributeExecutableConditionalStates<
- ConditionalStates
->
+export type ExecutableConditionalStatesDistributed =
+ DistributeExecutableConditionalStates =
+ DistributeStepBinary = S extends BinaryStates
? ExecutableBinary
: never
-export type ExecutableBinaryStatesDistributed = DistributeExecutableBinaryStates<
- BinaryStates
->
+export type ExecutableBinaryStatesDistributed =
+ DistributeExecutableBinaryStates