@@ -5,16 +5,15 @@ CodeSandbox 上でコードを編集し、GitHub Actions から npm レジスト
55
66## 利用方法
77
8- まだ記述の途中。
9-
1081 . GitHub から import する(GitHubBox からは https://githubbox.com/hankei6km/my-starter-npm-cli-and-lib )
1191 . fork
12- 1 . ` package.json ` の ` name ` ` version ` ` description ` ` license ` 、 ` LICENSE ` あたりを新しいパッケージにあわせて変更
10+ 1 . ` package.json ` と ` LICENSE ` 等を新しいパッケージにあわせて変更(付録にテンプレート)
13111 . 新しい terminal を開き ` $ npm run upgrade-interactive ` 等でパッケージを更新
12+ 1 . ブラウザーをリロードする
1413
15- これで 'npm run csb : test '( ` jest --watchAll ` ) が terminal(「yarn start」タブ) 内で実行される 。
14+ これで terminal(「yarn start」タブ) 内で ` start ` スクリプトが実行される(通常はエラーとなる)、後は必要に応じてコードの編集等を行う 。
1615
17- コマンドとしての実行を試す場合は ` npm run start -- foo.txt ` のように実行する。
16+ テストの実行は CodeSandbox 上では ` npm run csb:test ` を利用する。 コマンドとしての実行を試す場合は ` npm run start -- foo.txt ` のように実行する。
1817
1918### CLI 部分の変更
2019
@@ -28,24 +27,40 @@ CodeSandbox 上でコードを編集し、GitHub Actions から npm レジスト
2827
2928### npm publish
3029
31- GitHub で Release を Publish するとビルド実行後に ` npm pulish ` される。
30+ GitHub で Release を Publish すると ` npm pbulish ` される。
31+
32+ なお、` prepublishOnly ` 等は定義されていないので、手動で ` npm publish ` を実行してもビルドはされないので注意。
3233
33- なお、 ` prepublishOnly ` 等は定義されていないので、手動で ` npm publish ` 等を実行してもビルドはされないので注意。
34+ ## 付録
3435
36+ ` package.json ` に記述する情報のテンプレート。` license ` を変更したら ` LICENSE ` ファイルの変更も忘れずに。
3537
36- ## 既知の問題
38+ ```
39+ "name": "<package-name>",
40+ "version": "0.1.0",
41+ "description": "<description>",
42+ "author": "user <mail addr> (website url)",
43+ "license": "MIT",
44+ "repository": {
45+ "type": "git",
46+ "url": "git://github.com/<user>/<repository>.git"
47+ },
48+ "bugs": {
49+ "url": "https://github.com/<user>/<repository>/issues"
50+ },
51+ "keywords": []
52+ ```
3753
3854## 参考
3955
4056- [ TypeScript で npm ライブラリ開発ことはじめ - Qiita] ( https://qiita.com/saltyshiomix/items/d889ba79978dadba63fd )
4157- [ TypeScript で CLI ツールを作って、npm パッケージにする - Qiita] ( https://qiita.com/suzuki_sh/items/f3349efbfe1bdfc0c634 )
4258- [ yarn upgrade-interactive と同じように npm でも対話型な更新をしたい! - Qiita] ( https://qiita.com/kotarella1110/items/08afeb61d493829711eb )
43- - [ Node.jsパッケージの公開 - GitHub Docs] ( https://docs.github.com/ja/actions/guides/publishing-nodejs-packages )
44- - [ GitHub Actionsでnpmに自動でリリースするworkflowを作ってみた | DevelopersIO] ( https://dev.classmethod.jp/articles/github-actions-npm-automatic-release/ )
59+ - [ Node.js パッケージの公開 - GitHub Docs] ( https://docs.github.com/ja/actions/guides/publishing-nodejs-packages )
60+ - [ GitHub Actions で npm に自動でリリースする workflow を作ってみた | DevelopersIO] ( https://dev.classmethod.jp/articles/github-actions-npm-automatic-release/ )
4561
4662## ライセンス
4763
4864MIT License
4965
5066Copyright (c) 2021 hankei6km
51-
0 commit comments