Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ts-morphで簡単に始めるAST操作 / ast-manipulation-with-ts...
Search
aose
October 30, 2024
Technology
0
1k
ts-morphで簡単に始めるAST操作 / ast-manipulation-with-ts-morph
簡単に始めるシリーズ第二弾として、TypeScriptにおけるASTをあまり知らない方や、まだ触ったことがない方に向けて、簡単にできるASTの操作・ライブラリについてご紹介します。
aose
October 30, 2024
Tweet
Share
More Decks by aose
See All by aose
alien-signals と自作 OSS で実現する フレームワーク非依存な ロジック共通化の探求 / Exploring Framework-Agnostic Logic Sharing with alien-signals and Custom OSS
aoseyuu
4
6.4k
UnJSで簡単に始めるCLIツール開発 / cli-tool-development-with-unjs
aoseyuu
2
910
Other Decks in Technology
See All in Technology
安いGPUレンタルサービスについて
aratako
2
2.6k
eBPFとwaruiBPF
sat
PRO
4
2.5k
直接メモリアクセス
koba789
0
280
Microsoft Agent 365 を 30 分でなんとなく理解する
skmkzyk
1
1k
Noを伝える技術2025: 爆速合意形成のためのNICOフレームワーク速習 #pmconf2025
aki_iinuma
2
2.1k
世界最速級 memcached 互換サーバー作った
yasukata
0
330
Reinforcement Fine-tuning 基礎〜実践まで
ch6noota
0
160
エンジニアとPMのドメイン知識の溝をなくす、 AIネイティブな開発プロセス
applism118
4
990
AWS re:Invent 2025で見たGrafana最新機能の紹介
hamadakoji
0
130
ML PM Talk #1 - ML PMの分類に関する考察
lycorptech_jp
PRO
1
730
GitLab Duo Agent Platformで実現する“AI駆動・継続的サービス開発”と最新情報のアップデート
jeffi7
0
210
Oracle Technology Night #95 GoldenGate 26ai の実装に迫る1
oracle4engineer
PRO
0
150
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Making Projects Easy
brettharned
120
6.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.8k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
It's Worth the Effort
3n
187
29k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Thoughts on Productivity
jonyablonski
73
5k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Producing Creativity
orderedlist
PRO
348
40k
Speed Design
sergeychernyshev
33
1.4k
A Tale of Four Properties
chriscoyier
162
23k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Transcript
ts-morphで簡単に始めるAST操作
Speaker 株式会社ヤプリ フロントエンドエンジニア 青木 優弥 / Aose Yuu • 2023/11〜
ヤプリjoin 来月からヤプリ2年目突入 • Vue Fes ボランティアスタッフ
None
None
ASTとは?
AST ↕ 抽象構文木
抽象構文木(AST:Abstract Syntax Tree) • プログラムのソースコードを階層的に表現するデータ構造 • ツリー構造で、各ノードがプログラムの構成要素を表す • ノード同士の親子関係=ソースコードの構造的な関係
None
ASTでできること • コードの解析(Linter, Formetter) • コードの変換・生成 • リファクタリング
ASTでできること • コードの解析(Linter, Formetter) • コードの変換・生成 • リファクタリング ⬇
気合いの正規表現🔥 漢の文字列置換💪 からの卒業
ts-morphとは?
ts-morph ↕ TypeScript Compiler APIの ラッパーライブラリ
超簡単な例
None
None
None
🤮
None
🥰
None
ts-morphを使った実例 vuex → pinia:簡単&部分的な例
None
None
None
None
None
None
ts-morphを使って AST操作を簡単に始めよう!