Skip to content

mymactive/my-code-generator-templates

Repository files navigation

My Code Generator Templates

はじめに

コードジェネレーターの自作template置き場です.
追記時点ではPlopを推奨しております。

https://plopjs.com/

理由はPlopはESMに対応しているからです。 これによりViteでも簡単に導入できます。

テンプレートファイル

テンプレートとしてPlopと、hygenを用意しております。 推奨はPlopです。

Plop

Plopのテンプレートは、Storybookバージョン7の記法で生成します。
設定ファイルはplopfile.mjs、テンプレートplop-templatesディレクトリに配置してあります。
以下のコマンドを実行してコンポーネントを生成します:

npm run plop component

hygen

特別な理由がない限りPlopを推奨します。
コンポーネント生成の設定ファイル及びテンプレートは_templates/fc/new配下にあります。
フック生成の設定ファイル及びテンプレートは_templates/hook/new配下にあります。
以下のコマンドを実行してコンポーネントを生成します:

npm run hygen fc new

以下のコマンドを実行してフックを生成します:

npm run hygen hook new

サンプルファイル

テンプレートの出力サンプルは./sample/配下に置いております.

About

Templates of code generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors