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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
73
フロントエンドの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
190
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
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
190
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
290
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
230
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.2k
SODA - FACT BOOK(JP)
sodainc
1
40k
AIがコードを書いてくれる時代、我々は何を確かめるのか
yosuke_furukawa
PRO
13
5.7k
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
1.5k
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
180
Kotlinの15年とServer-Side Kotlin
n_takehata
1
200
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
130
ChromeでローカルLLM
ryu1013
0
200
Getting Started with Vibe Coding
miccheng
0
180
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
Rails Girls Zürich Keynote
gr2m
96
14k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
460
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
The Invisible Side of Design
smashingmag
301
52k
Deep Space Network (abreviated)
tonyrice
0
410
The World Runs on Bad Software
bkeepers
PRO
72
12k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
890
A better future with KSS
kneath
240
18k
Become a Pro
speakerdeck
PRO
31
6.3k
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