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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
aose
October 30, 2024
Technology
1.3k
0
Share
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
7.6k
UnJSで簡単に始めるCLIツール開発 / cli-tool-development-with-unjs
aoseyuu
2
990
Other Decks in Technology
See All in Technology
エンジニアは生成AIと どのように向き合うべきか? ことばの意味という観点から
verypluming
3
290
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development
yoshidashingo
1
260
Strands Agents超入門
kintotechdev
1
140
Oracle Cloud Infrastructure:2026年5月度サービス・アップデート
oracle4engineer
PRO
1
270
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
1.8k
AIが変えた"品質の守り方"
kkakizaki
13
5.4k
Spring AI × MCP 入門〜AIエージェントへのツール公開、境界設計から始める最小構成 〜
yuyamiyamoto
0
180
開発を止めない CI/CD ~CI Visibilityによる継続的最適化~
pensuke628
0
210
管理アカウント単一運用からAWS Organizationsに移行するの大変で滅
hiramax
0
320
Claude Codeを組織で使いこなす— サーバサイドAIエージェント運用の実践知
techtekt
PRO
0
130
サプライチェーンセキュリティの空白地帯 - 信頼できる”依存性”の未来を考える
rung
PRO
2
470
さきさん文庫の書籍ができるまで
sakiengineer
0
320
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
The agentic SEO stack - context over prompts
schlessera
0
790
Skip the Path - Find Your Career Trail
mkilby
1
130
We Have a Design System, Now What?
morganepeng
55
8.2k
[SF Ruby Conf 2025] Rails X
palkan
2
1.1k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
440
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Ruling the World: When Life Gets Gamed
codingconduct
0
240
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
560
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
Documentation Writing (for coders)
carmenintech
77
5.4k
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操作を簡単に始めよう!