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
TypeScript + GASでAPIを作る / Build API with TypeScript and GAS
Search
shike
April 11, 2019
Programming
0
130
TypeScript + GASでAPIを作る / Build API with TypeScript and GAS
Cluexの社内LT大会で発表した時の資料です。
shike
April 11, 2019
Tweet
Share
More Decks by shike
See All by shike
Code Generatorを作ってコンポーネントを自動生成しよう / Let's make code generator
shike0909
1
2.1k
Nuxt + TypeScriptで SPAを作る / Build SPA with Nuxt and TypeScript
shike0909
0
120
Lighthouseを使った認証必須のGraphQL API / GraphQL API authentication with Lighthouse
shike0909
0
1.9k
Reduxについて / Redux introduction and TODO example with Redux
shike0909
0
89
Other Decks in Programming
See All in Programming
Ruby GitHub Packages
bkuhlmann
0
620
try! Swift Tokyo 初参加報告LT
hinakko2
0
190
Rubyでたのしむクリエイティブコーディング/Enjoy Creative coding with Ruby
chobishiba
1
160
From Spring Boot 2 to Spring Boot 3 with Java 22 and Jakarta EE
ivargrimstad
0
880
元気予報
suu_mire0726
0
850
入門 AWS Amplify Gen2 / Introduction to AWS Amplify Gen2
genkiogasawara
1
310
雑に思考を整理する技術と効能
konifar
55
25k
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
100
ONE WEDGE_company_guide
1wedge_one
0
370
Semantic search with Django and pgvector
pauloxnet
0
230
せっかくモデル図描くのなら、嬉しいことが多い方がいいよね!
kuboaki
1
3.1k
スクラムチームと認知負荷 - ニフティのスクラムトーク Vol2. / NIFTY Tech Talk #18
niftycorp
PRO
1
120
Featured
See All Featured
Web development in the modern age
philhawksworth
202
10k
Building Your Own Lightsaber
phodgson
98
5.7k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
124
32k
Building Adaptive Systems
keathley
30
1.8k
A Tale of Four Properties
chriscoyier
150
22k
Unsuck your backbone
ammeep
662
57k
A Philosophy of Restraint
colly
196
16k
Building a Modern Day E-commerce SEO Strategy
aleyda
16
6.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
397
65k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
29
6k
How GitHub (no longer) Works
holman
304
140k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
1
1.3k
Transcript
TypeScript + GASで APIを作る Cluex Webグループ 柴山健吾
話すこと • GASでアプリケーションを作る • claspについて • TypeScriptについて • clasp +
TypeScriptでAPIを開発してみる
GASでアプリケーションを作る • Spread SheetsとかGoogle製品のAPIを使ってあんなこ とやこんなことできる • でも普通に作ろうとするとつらい ◦ ローカルで開発できない ◦
バージョン管理できない ◦ 補完も何も効かないザコい専用エディター
GASでアプリケーションを作る
clasp
claspとは • ローカルで開発できる ◦ バージョン管理できる • コマンド一つでデプロイできる • TypeScriptで開発できる!!!
_人人人人人人人人人人人人人人人人_ > TypeScriptで開発できる!! <  ̄Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄
TypeScript • 静的型付けをJavaScriptにもたらす JSのスーパーセット • 既存のJSコードをそのまま使っても動作する • JSコードにトランスパイルするので、 型情報はトランスパイル時に失われる •
そのため実行時には型は保証されない
clasp + TypeScriptで開発してみる Googleカレンダーから1週間の予定を取得して JSONで返すAPIを作ってみた
claspのインストールとログイン
Google Apps Script APIをオンに https://script.google.com/home/usersettings
ローカル環境初期設定
tsconfig.jsonを作成
src/appscript.jsonのtimeZoneを修正
src/Code.tsを実装
src/Code.t s を実装
src/Code.tsを実装
コードをデプロイ
公開
公開
公開URLを叩く
まとめ • clasp使えば自分の好きな開発環境で GASアプリケーションが開発できるし バージョン管理もできる • TypeScriptによる型付けで補完が効いて開発が捗る • 型安全による安心感 •
静的型付けは正義
ご清聴ありがとうございました