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
ts-morphで簡単に始めるAST操作 / ast-manipulation-with-ts...
Search
aose
October 30, 2024
Technology
1.4k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ts-morphで簡単に始めるAST操作 / ast-manipulation-with-ts-morph
簡単に始めるシリーズ第二弾として、TypeScriptにおけるASTをあまり知らない方や、まだ触ったことがない方に向けて、簡単にできるASTの操作・ライブラリについてご紹介します。
aose
October 30, 2024
More Decks by aose
See All by aose
alien-signals と自作 OSS で実現する フレームワーク非依存な ロジック共通化の探求 / Exploring Framework-Agnostic Logic Sharing with alien-signals and Custom OSS
aoseyuu
4
8.1k
UnJSで簡単に始めるCLIツール開発 / cli-tool-development-with-unjs
aoseyuu
2
1.1k
Other Decks in Technology
See All in Technology
アカウント統制の健康診断
kenichinakamura
1
210
"計画的無茶振り"を通してAIネイティブ世代の新人を育てる
subroh0508
1
110
AWS Continuum for Penetration Testing に Deep Dive してみる
asanoharuki
2
1.4k
Snowflake でできることが増えたら、 ABAC が必要になった
kaeton
0
110
AI秘書と毎日働くのはもう当たり前。開発以外の業務に足りない機能をどう埋める?
minorun365
PRO
4
1.9k
E2Eってつらくないですか?E2Eの管理コストを下げる手段とその実践
akaboshinit
5
2.4k
野良MCPサーバーを排除せよ!MCPサーバーのガバナンス
yukiogawa
1
250
How we choose session proposals
kawaguti
PRO
1
180
1週間、Opus封印でお願いします
kintotechdev
0
310
AWSDirectConnectの構築の進め方を整理してみた
masa_my
1
200
AWSセキュリティで活用するAI機能
cmusudakeisuke
1
340
日本AIベンチャーレポート2026
kentarofujii
0
250
Featured
See All Featured
Building Adaptive Systems
keathley
44
3.3k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
4 Signs Your Business is Dying
shpigford
187
23k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
2
950
sira's awesome portfolio website redesign presentation
elsirapls
0
470
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
500
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
580
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
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操作を簡単に始めよう!