開発者ドキュメント
リファレンス·

リファレンス

niyase-plugin CLI・useNiyase() ブリッジ・型・ヘルパーの一覧。

@niyase/plugin-sdk の公開 API 一覧。

CLI(niyase-plugin

コマンド説明
new@scope/name の雛形を生成
buildIIFE バンドルを生成(--entry / --out / --minify
linttsc + validateManifest() + 禁止 API 走査
testvitest を実行
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(業種プリセットの例)も参考になります。