リファレンス·
リファレンス
niyase-plugin CLI・useNiyase() ブリッジ・型・ヘルパーの一覧。
@niyase/plugin-sdk の公開 API 一覧。
CLI(niyase-plugin)
| コマンド | 説明 |
|---|---|
new | @scope/name の雛形を生成 |
build | IIFE バンドルを生成(--entry / --out / --minify) |
lint | tsc + validateManifest() + 禁止 API 走査 |
test | vitest を実行 |
dev | ローカルプレビュー(--port) |
publish | ビルド + 検証 + 申請(--dry-run / --token) |
ブリッジ useNiyase()
data / core / context / i18n / navigate / toast / palette。
詳細は UI 統合 と コア API 連携。
import { createNiyase, useNiyase, register } from "@niyase/plugin-sdk";
// エントリで: createNiyase(); register("@scope/name", Root);
// 任意の場所で: const niyase = useNiyase();
マニフェスト(@niyase/plugin-sdk/manifest)
import {
defineManifest,
validateManifest,
type PluginManifest,
} from "@niyase/plugin-sdk/manifest";
defineManifest(m): 型付き identity(補完用)validateManifest(input):{ ok: true, manifest } | { ok: false, errors }(zod、CLI lint と同一)
型
PluginManifest / PluginAudience / PluginTableDef / PluginColumnDef /
PluginIndustryPreset / PluginI18nTerms / PluginPaletteMetadata /
NiyaseBridge / NiyaseContextValue / NiyaseErrorCode。
テスト用ヘルパー(@niyase/plugin-sdk/host)
createTestHost({ manifest, context }): MOCK バックエンドに繋いだ headless なブリッジを返すrunBridgeConformance(bridge): ブリッジ契約の最小適合チェック
import { createTestHost } from "@niyase/plugin-sdk/host";
const { niyase } = createTestHost({ manifest, context });
await niyase.ready;
const res = await niyase.data.list("task");
サンプル
最良のリファレンスは、ローカルプレビュー(niyase-plugin dev)で動く自分の雛形です。
公式プラグイン @niyase/projects(業種プリセットの例)も参考になります。