Find a package. Add it to your script. Build something of your own.
パッケージを見つけて、スクリプトへ。作りたいものに、まっすぐ進もう。
mkdir hello-app
cd hello-app
gd init
gd add hello gd:@mofukuma/hello@0.1.3hello is your local alias. The scoped name identifies the published package.
helloは手元で使う呼び名。@mofukuma/helloは登録所でのパッケージ名です。
@import hello
func main():
print(hello.message("world"))
return 0Run gd main.gd to print hello, world. Use @import "./settings" for local scripts and shared constants, too.
gd main.gdでhello, worldを表示します。手元のscriptや共通定数にも@import "./settings"を使えます。
Commit gd.json (requested dependencies) and gd.lock (resolved versions and hashes). Other machines restore them with gd install --frozen. Packages extend scripts; native extensions add compiled APIs.
gd.json(必要な依存)とgd.lock(解決した版とハッシュ)をcommitし、別の環境ではgd install --frozenで復元します。scriptパッケージは処理の再利用、native拡張はコンパイル済みAPIの追加に使います。