diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 89477f16..613c4309 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -53,8 +53,8 @@ jobs: # Overlay only what the rclone sync (prepare) placed: # app/routes/**/*.mdx and public images from Google Drive. # Code merges from main are handled by the promote workflow. - rsync -a --delete ../app/routes/ ./app/routes/ - rsync -a --delete ../public/ ./public/ + rsync -a ../app/routes/ ./app/routes/ + rsync -a ../public/ ./public/ # Force-add the content files. They are intentionally gitignored on main # (to avoid committing dev fixture copies), but we explicitly want them @@ -83,7 +83,7 @@ jobs: - name: Install Playwright browsers run: npx playwright install chromium - name: Run readability test on built site - run: npm run test:reading || echo "Skipped failing tests" + run: npm run test:reading - if: failure() uses: ./.github/actions/notify-failure with: diff --git a/.gitignore b/.gitignore index d59f107e..ece35473 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,7 @@ dist # MDX files copied from app/fixtures to app/routes during `npm run dev` app/routes/**/*.mdx - +!app/routes/essays/programming/functional/andthen-and-then-monad.mdx # Change them to your taste: wrangler.toml # package-lock.json diff --git a/.nvmrc b/.nvmrc index 6f4247a6..a45fd52c 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -26 +24 diff --git a/app/routes/essays/programming/functional/andthen-and-then-monad.mdx b/app/routes/essays/programming/functional/andthen-and-then-monad.mdx new file mode 100644 index 00000000..73bd8eac --- /dev/null +++ b/app/routes/essays/programming/functional/andthen-and-then-monad.mdx @@ -0,0 +1,28 @@ +--- +title: "andThen and then Monad" +date: 2026-08-23 +--- + +
+ +# andThen and then Monad + +このエッセイでは、関数型プログラミングにおける `andThen` と `then` のモナド的な使い方について解説します。 + +## 背景 + +モナドは、`bind`(`>>=`)として知られる操作で、計算を連結します。`andThen` は JavaScript の `Promise` で同様の役割を果たします。 + +## 実例 + +```js +Promise.resolve(5) + .andThen(x => Promise.resolve(x * 2)) + .then(y => console.log(y)); // 10 +``` + +## まとめ + +`andThen` と `then` は、モナドの法則を満たすように設計できます。 + +
diff --git a/package.json b/package.json index df5b39fe..4404c2b7 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ "vitest": "^4.1.11" }, "engines": { - "node": "26.x" + "node": ">=24" + }, "overrides": { "@hono/node-server": "1.19.17"