chore(cli): add npm publish metadata and package readme - #17
Conversation
There was a problem hiding this comment.
Pull request overview
This PR prepares confession-cli for npm publishing by adding standard package metadata and introducing a package-local README that documents installation and CLI usage.
Changes:
- Expanded
confession-cli/package.jsonwith npm publish metadata (keywords,homepage,bugs,repository,engines) plusfiles,publishConfig, and aprepublishOnlyhook. - Added
confession-cli/README.mdwith global install instructions and examples forinit/scan/list/status. - Documented CLI flags and project root resolution rules.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| confession-cli/package.json | Adds npm publish metadata and configures packaged files + prepublish build hook. |
| confession-cli/README.md | Adds end-user documentation for installation, commands, flags, and root resolution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "lint": "eslint .", | ||
| "build": "node -e \"const fs=require('fs');fs.mkdirSync('dist',{recursive:true});fs.copyFileSync('bin/confession.js','dist/confession.js')\"" | ||
| "build": "node -e \"const fs=require('fs');fs.mkdirSync('dist',{recursive:true});fs.copyFileSync('bin/confession.js','dist/confession.js')\"", | ||
| "prepublishOnly": "pnpm build" |
There was a problem hiding this comment.
prepublishOnly is invoking pnpm build. When publishing via npm publish (or in environments without pnpm/corepack enabled), this can fail because pnpm may not be available. Prefer calling the local script via npm run build (or inline the node build command) so the publish step doesn’t depend on pnpm being installed globally.
| "prepublishOnly": "pnpm build" | |
| "prepublishOnly": "npm run build" |
| ## 可用參數 | ||
|
|
||
| - `confession scan --api <baseUrl>`:指定 API 位址(預設讀取 `.confession/config.json`) | ||
| - `confession scan --depth quick|standard|deep`:覆寫掃描深度 |
There was a problem hiding this comment.
The README documents confession scan --depth quick|standard|deep as an override, but the current CLI implementation only treats quick and deep as explicit overrides (passing --depth standard is ignored and falls back to config). Please align the documentation with actual behavior, or update the CLI to accept standard explicitly.
| - `confession scan --depth quick|standard|deep`:覆寫掃描深度 | |
| - `confession scan --depth quick|deep`:覆寫掃描深度(standard 將依照設定檔預設值) |
摘要
confession-clinpm 發版 metadataconfession-cli/README.md,提供安裝與指令說明變更內容
confession-cli/package.jsonkeywords/homepage/bugs/repository/enginesfiles與publishConfig.access=publicprepublishOnlyconfession-cli/README.mdnpm i -g安裝方式init/scan/list/status使用範例驗證
pnpm lintpnpm buildpnpm test