LogoNotyra Docs
プラグイン

マニフェスト

package.json の全フィールドと Feature・Theme の宣言規則

配布 ZIP の直下に package.json を置きます。通常の npm 情報に notyra を追加します。未知の notyra フィールドは無視されますが、必須項目の欠落・型の不一致・不正な値は項目名と値を含むエラーになります。

項目型必須対象・規則
namestring必須両方。スコープなしの npm 名、小文字英数字から始まる最大214文字。ID はインストール後も変更しない
versionstring必須両方。semver。v 接頭辞・前後空白は不可
descriptionstring任意両方。プラグインの説明
authorstring または object任意両方。object は name: string、任意の email: string・url: string
notyra.displayNamestring必須両方。空でない表示名
notyra.typefeature または theme必須プラグインの種別
notyra.notyraVersionstring必須両方。node-semver の互換範囲。プレリリースも考慮して判定
notyra.mainstringFeature 必須ESM の .js / .mjs パス。Theme では禁止
notyra.permissionsarrayFeature 必須{ name, purpose? } の配列。空配列も可。重複は禁止。Theme では禁止
notyra.networkDestinationsstring[]条件付きFeature。network 宣言時は1件以上。書式は権限と通信
notyra.settingsarray任意Feature。下記の設定宣言
notyra.themestringTheme 必須カラーテーマ定義 .json のパス
notyra.themeCssstring任意Theme。選択中だけ適用する追加 .css のパス

ファイルパスはプラグインディレクトリ内の相対パスです。絶対パス、..、バックスラッシュ、ドライブ文字・コロンを使えません。

Feature の例

{
  "name": "my-plugin",
  "version": "0.1.0",
  "description": "文字数パネル",
  "author": { "name": "Developer", "url": "https://example.com" },
  "notyra": {
    "displayName": "My Plugin",
    "type": "feature",
    "notyraVersion": "^3.1.7",
    "main": "dist/index.js",
    "permissions": [],
    "settings": [{ "key": "prefix", "title": "ラベル", "type": "string", "default": "文字数" }]
  }
}

この構成で動く完全なコードはテンプレートにあります。

設定宣言

すべての設定は、一意な key、表示用の title、type、型に合う default を持ち、任意の description を付けられます。select は { value: string, label: string } の options 配列が必須で、既定値はその選択肢に含めます。

type値注意
string文字列空文字も可
number有限の数値入力欄の数値文字列は変換。空欄・NaN・Infinity は拒否
booleantrue / false文字列の "true" は不可
select宣言した選択肢の value宣言外の値は拒否

未保存・型不一致の保存値では既定値を返します。プラグインが提供する表示名・作者・設定名・目的説明は翻訳キーとして処理されず、そのまま表示されます。

Theme の例

{
  "name": "notyra-theme-blue",
  "version": "1.0.0",
  "notyra": {
    "displayName": "Blue Theme / ブルーテーマ",
    "type": "theme",
    "notyraVersion": "^3.1.7",
    "theme": "theme.json",
    "themeCss": "theme.css"
  }
}

theme.json の形式はテーマ作成ガイドを参照してください。組み込み・カスタム・先に読み込まれたプラグインのテーマと ID が重複すると登録できません。Theme はコードを実行しません。実行できる完全なパッケージは official theme plugins にあります。