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
Babylon.jsユーザのためのCLIを軽率にnpmで公開した話 / about creat...
Search
にー兄さん
July 05, 2023
Programming
1k
0
Share
Babylon.jsユーザのためのCLIを軽率にnpmで公開した話 / about create babylon app CLI
Babylon.jsゆるほめLT会 vol2で登壇した資料です
にー兄さん
July 05, 2023
More Decks by にー兄さん
See All by にー兄さん
『Ground Truth: How We Create Geometrically Accurate Reconstructions (Niantic Spatial Blog)』 を読む / read Ground Truth: How We Create Geometrically Accurate Reconstructions
drumath2237
0
40
この時代にOSS開発に向き合ってみる / face the oss development in this era
drumath2237
0
38
プログラマの職能が代替可能になりつつあるこの時代でプログラムと向き合う修行を積む / dedicating myself to the discipline of programming
drumath2237
0
90
個人的3D Gaussian Splattingニュースをご紹介 / sharing 3d gaussian splatting news
drumath2237
0
530
Jetpack XR SDKから紐解くAndroid XR開発と技術選定のヒント / about-androidxr-and-jetpack-xr-sdk
drumath2237
1
630
XRエンジニアの視点から XRのイマと社会実装の実現について考える / thinking-about-xr-popularization
drumath2237
0
81
軽率にプログラミング言語のシンタックスについて考えてみよう / lets-think-about-programming-lang-syntax
drumath2237
0
110
エンジニアが軽率に趣味から始める、OSS貢献を軸とした個人活動 / oss-contribution-as-a-hoby-project
drumath2237
0
86
Babylon.js 8.0のアプデ情報を 軽率にキャッチアップ / catch-up-babylonjs-8
drumath2237
0
420
Other Decks in Programming
See All in Programming
AIエージェントの隔離技術の徹底比較
kawayu
0
440
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
530
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
310
OCRを使ってゲームのアイテムをデータ化する
kishikawakatsumi
0
120
Agentic UI beyond Chats Architecture Patterns & Open Standards @ngMunich 05/2026
manfredsteyer
PRO
0
180
JavaDoc 再入門
nagise
0
210
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
390
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
2
470
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
190
Swiftのレキシカルスコープ管理
kntkymt
0
200
初めてのRubyKaigiはこう見えた
jellyfish700
0
350
1人1案件のプロダクトエンジニア時代に、"プロセス監督"としてチャレンジしたこと
non0113
0
350
Featured
See All Featured
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
370
Docker and Python
trallard
47
3.9k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
540
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
130
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
What's in a price? How to price your products and services
michaelherold
247
13k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
The Curse of the Amulet
leimatthew05
1
13k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
Designing for Performance
lara
611
70k
Transcript
Babylon.jsユーザのためのCLIを 軽率にnpmで公開した話 にー兄さん@ninisan_drumath Babylon.js ゆるほめLT会 vol.2
アジェンダ - create-babylon-appを作りました - 要件と実装 - おわりに
にー兄さん(@ninisan_drumath) ソフトウェアエンジニア 株式会社ホロラボ / IwakenLab Unity / ロケーションベースAR / WebAR
/ Babylon.js / Azure Kinect 最新技術を使った検証開発や デモンストレーションが好き 唐突な うちの猫たち→
create-babylon-appを作りました
crate-babylon-appは Babylon.js環境構築の手間を減らすために開発したCLIです。 Babylon.jsユーザのためのCLI
とりあえずデモ
要件と実装
環境構築はわりと手間 Babylon.js(TypeScript)の環境構築はちょっと時間かかる @babylonjs/core入れて、canvas配置して、css書いて、ts書いて...... でもやってること毎回同じなんだよな……。 create-vite的なツールみたいなのが欲しい
要件 - npmありきで使えるCLI - エディタを開かずにdevサーバ起動までやる - テンプレートから選べる - インターフェースも作る -
Playgroundのコードがコピペで動く
採用ツール - pnpm - 気になっていたので採用。良き - TypeScript - 型が無いと始まらないため -
@inquirer/prompts - CLIフレームワーク。直観的で良い - コンパイルで若干苦戦した - fs-extra - node:fsでできない、痒い所に手が届く良ライブラリ
create xxx系のCLI npmで「create-xxx」という名前で公開する npm create xxxというコマンドで create-xxxというパッケージを検索してくれる 簡単! create initもエイリアスになってる
ディレクトリ構造 / ├─ src/ │ └─ index.ts ├─ dist/ │
└─ index.js ├─ index.cjs └─ package.json src/index.tsをビルドして dist/index.jsを生成 index.cjsからdist/index.jsの中身を実行 package.jsonでindex.cjsをbinとして登録
CI/CD 申し訳程度にCI/CD 自動バージョニングや リリースノート作成 も追加したいな…...
おわりに
まとめ など - create-babylon-appで簡単に環境構築が可能に - 本当は公式で作ってほしいなぁ - Node.jsのCLIを作るのは初めてだったけど楽しかった - Webpack、Turbopackなどのテンプレ追加したい
- プルリクお待ちしています!
参考 create-babylon-app - npm https://www.npmjs.com/package/create-babylon-app GitHub https://github.com/drumath2237/create-babylon-app Node.jsでのCLIの作り方と便利なライブラリまとめ https://qiita.com/toshi-toma/items/ea76b8894e7771d47e10 TypeScriptでCLIツールを作って、npmパッケージにする
https://qiita.com/suzuki_sh/items/f3349efbfe1bdfc0c634 inquirer - npm https://www.npmjs.com/package/inquirer