Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
680
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
UnJSで簡単に始めるCLIツール開発 / cli-tool-development-with-unjs
aoseyuu
2
620
Other Decks in Technology
See All in Technology
組織とセキュリティ文化と、自分の一歩
maimyyym
3
1.4k
AWS Lambdaでサーバレス設計を学ぼう_ベンダーロックインの懸念を超えて-サーバレスの真価を探る
fukuchiiinu
4
500
GitHub Copilot Use Cases at ZOZO
horie1024
1
340
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
2k
やさしいClaude Code入門
minorun365
PRO
40
32k
JavaのMCPサーバーで体験するAIエージェントの世界
tatsuya1bm
1
200
Text-to-SQLの評価データセットを作って最新LLMモデルの性能評価をしてみた
gotalab555
2
180
Kubernetesで作るAIプラットフォーム
oracle4engineer
PRO
1
130
Introduction to Bill One Development Engineer
sansan33
PRO
0
240
Test Smarter, Not Harder: Achieving Confidence in Complex Distributed Systems
eliasnogueira
1
110
やさしい認証認可
minorun365
PRO
16
4.5k
impressions-trying-lambda-web-adapter
junkishigaki
2
140
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
245
12k
Raft: Consensus for Rubyists
vanstee
137
7k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
Bash Introduction
62gerente
614
210k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
Designing for Performance
lara
608
69k
It's Worth the Effort
3n
184
28k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
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操作を簡単に始めよう!