@zygapp/kintone-plugineer-cli
v0.1.1
Published
It's a CLI tool designed to simplify and streamline the development of plugin for kintone.
Downloads
23
Readme
kintone プラグイン CLI ツール
この CLI ツールは、kintone のプラグインを簡単かつ効率的に開発するためのものです!
🎯 特徴
- リアルタイム開発: ローカル環境で変更が即座に kintone に反映されます。
- TypeScript 完全対応:
.tsファイルやvite.plugins.tsをネイティブサポート。 - 複数環境デプロイ: 一度のコマンドで複数の本番環境に同時デプロイ可能。
- エラー耐性: 開発モードでエラーが発生してもプロセスを継続し、次の変更を監視。
- 柔軟なビルド: Vite の高速ビルドを活用。
- 簡単なデプロイ: コマンド 1 発で本番環境に反映。
- プラグイン対応: Vite プラグインを手軽に追加できます。
🔧 コマンド一覧
kintone-plugineer <command>| コマンド | 説明 |
| -------------- | ----------------------------------------------------------------------------------------------- |
| dev | リアルタイムに開発モードで kintone への反映 |
| build | プラグインを本番モードでビルド |
| deploy | プラグインを本番モードで kintone に本番反映※ デプロイ対象のファイル名を指定します。 |
| build:deploy | 本番モードビルドとデプロイを同時に実行 |
🛠️ 機能
1. Vite プラグインを簡単追加
プロジェクトルートにあるvite.plugins.jsまたはvite.plugins.tsにプラグインを追加するだけで、カスタマイズできます。
例:
// vite.plugins.js または vite.plugins.ts
import vue from "@vitejs/plugin-vue";
import { Plugin } from "vite";
const plugins: Plugin[] = [vue()];
export default plugins;2. TypeScript & モダンフレームワーク対応
- TypeScript:
.tsファイルのネイティブサポート - React/Vue: モダンフレームワークとの組み合わせが可能
- エラー継続: 開発中にエラーが発生してもプロセスが継続し、ファイル監視を継続
🚀 始め方
インストール
npm install -g @zygapp/kintone-plugineer-cliプロジェクトを初期化
各種ファイルが生成されます。create-kintone-plugineer <ディレクトリ名|kintone-plugineer>設定ファイル修正
必要に応じて./config.jsonの各項目を書き換えます。{ "version": "0.1", "name": { "ja": "<プラグイン名>", "en": "<PLUGIN NAME>" }, "description": { "ja": "<プラグイン 説明文>", "en": "<PLUGIN DESCRIPTION>" }, "homepage_url": { "ja": "<ホームページURL>", "en": "<WEBSITE URL>" }, "required_params": [], "entryFiles": { "public": "src/public", "js": { "config": "src/config.ts", "mobile": "src/plugin.ts", "desktop": "src/plugin.ts" } }, "dev": { "baseUrl": "https://<KINTONE DEV SUBDOMAIN>.cybozu.com", "auth": { "username": "<KINTONE DEV USERNAME>", "password": "<KINTONE DEV PASSWORD>" } }, "prod": { "baseUrl": "https://<KINTONE PROD SUBDOMAIN>.cybozu.com", "auth": { "username": "<KINTONE PROD USERNAME>", "password": "<KINTONE PROD PASSWORD>" } } }複数環境デプロイの設定例
prodプロパティを配列にすることで、複数の本番環境に同時デプロイできます:{ "prod": [ { "baseUrl": "https://company-a.cybozu.com", "auth": { "username": "admin-a", "password": "password-a" } }, { "baseUrl": "https://company-b.cybozu.com", "auth": { "username": "admin-b", "password": "password-b" } } ] }| プロパティ | 型 | 必須 | 説明 | | ----------------------- | :----------------: | :--: | ---------------------------------------------------- | |
version|StringorNumber| ✅️ | プラグインのバージョン | |name|Object| ✅️ | プラグイン名 | |name.ja|Object| ✅️ | 日本語 | |name.en|Object| ✅️ | 英語 | |description|Object| | プラグインの説明文 | |description.ja|String| | 日本語 | |description.en|String| | 英語 | |required_params[]|String| | プラグイン設定画面で設定必須とするパラメーター | |entryFiles|Object| ✅️ | ビルド時に読み込むディレクトリやファイルの情報 | |entryFiles.public|String| ✅️ |config.htmlとicon.pngが存在するディレクトリパス | |entryFiles.js|Object| ✅️ | Javascript ファイルの情報 | |entryFiles.js.config|Object| |config.jsのファイルパス | |entryFiles.js.mobile|Object| |mobile.jsのファイルパス | |entryFiles.js.desktop|Object| |desktop.jsのファイルパス | |dev|Object| ✅️ | 開発環境 | |dev.auth|Object| ✅️ | 認証情報 | |dev.auth.username|String| ✅️ | アプリ設定権限をもつ kintone ユーザーのアカウント ID | |dev.auth.password|String| ✅️ | アプリ設定権限をもつ kintone ユーザーのパスワード | |prod|ObjectorArray| ✅️ | 本番環境(配列指定で複数環境同時デプロイ対応) | |prod.auth|Object| ✅️ | 認証情報 | |prod.auth.username|String| ✅️ | アプリ設定権限をもつ kintone ユーザーのアカウント ID | |prod.auth.password|String| ✅️ | アプリ設定権限をもつ kintone ユーザーのパスワード |※ CSS ファイルは、各 JS ファイルで
importするとビルド時に生成され、自動的にプラグインに含まれます。【例】src/config.ts
import "./main.css"; import "./style.scss";ローカル環境でビルドし、逐次デプロイ
kintone-plugineer --dev or # npm npm run dev:deploy # yarn yarn dev:deployローカル環境でビルド
kintone-plugineer --build or # npm npm run build # yarn yarn build本番環境にデプロイ
kintone-plugineer --deploy <zipFileName> or # npm npm run deploy <zipFileName> # yarn yarn deploy <zipFileName>ローカル環境でビルドし、本番環境にデプロイ
kintone-plugineer --build --deploy or # npm npm run build:deploy # yarn yarn build:deploy
📝 ライセンス
このプロジェクトは MIT ライセンスのもとで提供されています。
👨💻 開発者情報
加藤@合同会社 ZYG
https://www.zyg.jp
