1.0.2 • Published 3 years ago

@another_works/nico-generator v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

NicoGenerator

指定したディレクトリ配下のソースコードを読み込み、指定した文字で置換したソースコードを新たに作成するツール。

使用方法

ドライラン

$ npx @another_works/nico-generator -b company -r employee -p ./check/modules -o ./check/modules -d

or

$ npm install -D @another_works/nico-generator
$ nico-generator -b company -r employee -p ./check/modules -o ./check/modules -d

パラメータ

引数名説明
-b置き換え元の文字列
-r置き換え後の文字列
-p置き換え対象ファイルがあるディレクトリ
-o出力先ディレクトリ
-dドライラン

ドライラン出力内容

出力名説明
optionsコマンドライン引数を構造化したもの
configこの設定に合わせて置き換えが行われる。general = 全体設定、input = 入力設定、output = 出力設定。
ruleconvertWordsの規則に沿って、フォルダ、ファイル名とファイルの中身の、文字列の置換が実行される(それぞれのkeyの文字列が、対応するvalueの文字列に置き換えられていく)
targetFileList置き換え対象のファイル一覧
output file start - create file(このファイルを元に) -> (このファイルを作成する)
output file start - create file body作成されるファイルの内容

ファイル生成

$ npx @another_works/nico-generator -b company -r employee -p ./check/modules -o ./check/modules 

for developer

preparing

$ npm install

execute

$ ts-node src/index.ts -b company -r employee -p ./check/modules -o ./check/modules

test

$ npm run test

build

$ npm run build

License

MIT