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
68
フロントエンドの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.9k
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
260
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
34
16k
Jetpack Compose Mechanisms
skydoves
2
700
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
200
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
110
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
140
Simple Storage Service(S3) is not simple
iwatsukayura
0
250
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
130
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
580
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
540
Featured
See All Featured
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
840
Navigating Weather and Climate Data
rabernat
0
550
Documentation Writing (for coders)
carmenintech
77
5.6k
Color Theory Basics | Prateek | Gurzu
gurzu
1
480
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
560
Facilitating Awesome Meetings
lara
57
7.2k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
430
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
470
My Coaching Mixtape
mlcsv
0
350
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Practical Orchestrator
shlominoach
192
12k
Making the Leap to Tech Lead
cromwellryan
135
10k
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