Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
サーバサイドTypeScriptモノレポを半年運用した結果/How to maintain s...
Search
tom-256
October 30, 2022
Programming
470
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
サーバサイドTypeScriptモノレポを半年運用した結果/How to maintain server side typescript monorepo
Kanazawa.js #24
tom-256
October 30, 2022
More Decks by tom-256
See All by tom-256
PipeCDを導入してリリースフローを改善した話/How to improve release workflow by pipecd
tom256
0
65
フロントエンドのCIについて/front end ci tips
tom256
0
100
レガシーなAnsibleを改善していくための方針/How to improve the legacy Ansible
tom256
10
2.7k
Slack + Cloud Functionsで迅速な障害の初動対応をする/incident management by slack
tom256
0
180
AWSで実現するChatOps〜サーバレスでBlue/Greenデプロイする仕組みと工夫点〜 /chatops deployment
tom256
0
420
GHEとAWSを使用したデプロイ/リリースフローの紹介/introduction-deployflow-aws-and-ghe
tom256
0
160
Other Decks in Programming
See All in Programming
wkhtmltopdfの次どうするか問題2026
willnet
2
1.8k
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
150
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
390
Agents on Rails - Rails at Scale 2026
irinanazarova
0
310
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
320
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
140
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
430
FreeBSDでZabbixを動かす
kenkino
0
350
速習iPhone Duo対応
yuukiw00w
2
930
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
290
Heart of Swift Concurrency
koher
0
1.1k
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
33
14k
Featured
See All Featured
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
580
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
910
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
500
The browser strikes back
jonoalderson
0
1.7k
Are puppies a ranking factor?
jonoalderson
2
4k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
sira's awesome portfolio website redesign presentation
elsirapls
0
430
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
710
Statistics for Hackers
jakevdp
799
230k
Transcript
サーバサイド TypeScript モノレポを半 年運用した結果 Kanazawa.js #24 1
@tom-256 SRE/Backend 2
今日話すこと モノレポのメリット 現状の共有、工夫点 課題点 まとめ 3
モノレポのメリット コラボレーション... 意識しなくてもコード、PR 、会話が目に入る 視認性... プロダクトコードはすべてここにある状態 リポジトリ全体のコントール性が高い... 規約、ビルド、作業レバレ ッジ 4
機能面はGitHub の機能を使うとポリレポでもモノレポと近いメリット が得られる Template Repository( パッケージのテンプレート) GitHub Actions Reusable Workflow(CI
ワークフローの共通化) GitHub Actions Repository Dispatch( リポジトリ間のCI トリガー) npm package による設定ファイルの共通化 5
現状の共有 6
工夫点 設定ファイルの共通化 Makefile ESLint コミット規約 CI 7
設定ファイルの共通化 jest tsconfig など ディレクトリ構成 packages/config 利用側 "@tom-256/config": "*", 8
Makefile make init-service NAME='foo' アプリケーションディレクトリ作成 各種設定ファイル追加 要件が増えてきて手作業が出始めるので都度改修が必要 9
ESLint インポートに関する規約(import/no-restricted-paths) API サーバ間の相互依存を禁止 共通package は許容 アプリケーション設計の規約にも利用 ファイル名、ディレクトリ名の規約 10
パフォーマンス調査方法をブログにまとめた ESLint のパフォーマンスを調査する tom-256.log 開発が進むに連れ増えていくのでCI などで定期的に計測して検知する 仕組みが必要 11
コミット規約 Conventional Commits を採用 @commitlint/config-lerna-scopes を使用し、コミットメッセージにモ ノレポのパッケージ名を含めることで、フィルタが可能に 12
例: ディレクトリ構成 packages ├── hoge └── fuga コミットメッセージ feat(hoge): hogefuga
hogefuga 13
CI docker/build-push-action とmatrix strategy により動的なCI 構築 変更があったパッケージのみCI 実施 パッケージが増えてもCI 時間が増加しないように
unit test... キャッシュ未導入、テスト用パッケージが重い問題 docker build...multistage build,gha cache 14
actions/labeler でパッケージごとのラベルを作成 amannn/action-semantic-pull-request でPR タイトルを統一 ArtiomTr/jest-coverage-report-action でテストカバレッジ表示 15
課題点 Dockerfile コードジェネレーター Renovate フレームワーク 可視化 16
Dockerfile 共通のイメージを使いたいという要件から現状1 つのDockerfile コンテキストを小さく保つためDockerfile を分割したい COPY 対象 パイプラインのトリガー 17
. ├── Dockerfile └── apps ├── foo └── bar └──
apps ├── foo │ └── Dockerfile └── bar └── Dockerfile 18
コードジェネレーター 要件が増えてきて手作業が出始めるので都度改修が必要 パッケージの設定ファイルが各所に散らばってしまう 19
Renovate パッケージ更新を自動化 CODEOWNERS グルーピング 20
フレームワーク フレームワークに依存するのを避けるため導入しなかったが結局必要 な要件が出てきた 初期構築コストが無駄になってしまった TypeScript に統一...Turborepo 多言語も考慮...Nx 21
可視化 変化があったら知りたい 実行時間 test lint build docker build npm ci
Docker イメージサイズ 22
開発体制 開発体制はフィーチャーチーム DX 面にオーナーシップを持つメンバーが固定化 ローカル開発環境 Test 、Lint 、Build ライブラリバージョンアップ CI
23
まとめ 現状 簡単に同じ設定のアプリケーションをセットアップできる TypeScript は初期構築コストが高い 開発に関する規約を設定 アプリケーションが増えてもCI の時間が増えないように実装 24
感想 ESLint やCommit Hook で規約を作りやすい Developer Experience 、CI 面の負債をまとめて返しやすい 自分が触っていないコードが目に入りやすい
25