-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add plugin pack command (Experimental) #915
Conversation
Co-authored-by: Teppei SATO <[email protected]> Co-authored-by: Will <[email protected]> Co-authored-by: teppeis <[email protected]> Co-authored-by: Teppei Sato <[email protected]> Co-authored-by: toshihisa-tomatsu <[email protected]> Co-authored-by: Hiroyuki Anai <[email protected]> Co-authored-by: renovate[bot] <renovate[bot]@users.noreply.github.com> Co-authored-by: Toshihisa Tomatsu <[email protected]> Co-authored-by: WhiteSource Renovate <[email protected]> Co-authored-by: Hiroyuki ANAI <[email protected]> Co-authored-by: Sakito Mukai <[email protected]> Co-authored-by: toshi-toma <[email protected]> Co-authored-by: sakito <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: shisama <[email protected]> Co-authored-by: chick-p <[email protected]> Co-authored-by: Sosuke Suzuki <[email protected]> Co-authored-by: Hodaka Kasama <[email protected]> Co-authored-by: Toru Kobayashi <[email protected]> Co-authored-by: nakajmg <[email protected]> Co-authored-by: Shingo Yamazaki <[email protected]> Co-authored-by: shintaroNagata <[email protected]> Co-authored-by: Shintaro Nagata <[email protected]> Co-authored-by: piyo <[email protected]> Co-authored-by: Shin'ya Ueoka <[email protected]> Co-authored-by: Masashi Hirano <[email protected]> Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Nguyen Thai Hung <[email protected]> Co-authored-by: ryounasso <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: tasshi / Masaharu TASHIRO <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: tuanphamcybozu <[email protected]> Co-authored-by: hung-nguyen <[email protected]> Co-authored-by: tuan-pham <[email protected]> Co-authored-by: trigger-github-actions[bot] <143469140+trigger-github-actions[bot]@users.noreply.github.com> Co-authored-by: Masaharu TASHIRO <[email protected]> Co-authored-by: Nguyen Thai Hung <[email protected]> Co-authored-by: Tuan Pham <[email protected]> Co-authored-by: trigger-github-actions-release[bot] <143469140+trigger-github-actions-release[bot]@users.noreply.github.com> Co-authored-by: tasshi / Masaharu Tashiro <[email protected]> Co-authored-by: nameless-mc <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
26eebd7
to
9c9a9f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
差分大きいですが、 src/plugin/packer
配下はほぼ plugin-packer のファイルそのままです!
@@ -5,6 +5,7 @@ const config = { | |||
testPathIgnorePatterns: [ | |||
"<rootDir>/node_modules/", | |||
"<rootDir>/src/__tests__/setup.ts", | |||
"<rootDir>/src/plugin/packer/__tests__/helpers/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
理想的には__tests__
の中であっても*.tests.ts
のみを試験対象にするように設定変更する方が良い
が、一旦決め打ちでhelpers
を除外している。
@@ -57,6 +57,14 @@ const OVERRIDE_LICENSES_TEXT = { | |||
licensePageUrl: | |||
"https://raw.githubusercontent.com/dominictarr/through/master/LICENSE.MIT", | |||
}, | |||
"node-rsa": { | |||
// License text is written in README.md | |||
licenseText: "See https://github.com/rzcoder/node-rsa#license", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node-rsaはLICENSEファイルがなく、READMEに直接ライセンス本文が書かれているため、license-managerで抽出できない。
そのためREADMEへのリンクを記載する。
import packageJson from "../../package.json"; | ||
import { logHandler, logOptions } from "./logOption"; | ||
|
||
// eslint-disable-next-line no-unused-expressions | ||
yargs | ||
.command(recordCommand) | ||
// NOTE: Hide the plugin command because it's in very early development. | ||
.command({ ...pluginCommand, describe: false }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe: false
でコマンド非公開になる。
if (process.env.NODE_ENV === "test") { | ||
console.log(JSON.stringify({ pluginDir: args.input, flags: flags })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここはplugin-packerの実装を踏襲
src/cli/record/index.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plugin/index.ts
と合わせてrecord/index.ts
を置く構成に変更
// TODO: Remove this test file | ||
const execa = {} as ExecaMethod<{}>; | ||
|
||
describe.skip("bin", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この試験はコマンドラインオプションの試験なので、一旦Skipにする。
(cli-kintone側のCLIが確定したら修正する)
9c9a9f2
to
a8e6a7d
Compare
ReturnType<typeof builder> extends yargs.Argv<infer U> ? U : never | ||
>; | ||
|
||
const handler = async (args: Args) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
後続の #916 で対応します!
packerMock_: typeof packer; | ||
}>; | ||
|
||
const cli = (pluginDir: string, options_?: Options) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
後続の #916 で対応します!
The |
Why
What
plugin pack
command as an experimental feature (hidden in the help message)NOTE: Be aware to add co-authors when merging. If co-authors are not automatically set in the commit message, add co-authors manually from co-authored-by.txt of #903 .
How to test
All the automated tests are inherited to
/src/plugin/packer/__tests__
from plugin-packer.Manual test example:
Checklist
pnpm lint
andpnpm test
on the root directory.