pingcode-cli-unofficial 1.7.1 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # pingcode-cli
1
+ # pingcode-cli-unofficial
2
2
 
3
3
  [![CI](https://github.com/anine09/pingcode-cli-unofficial/actions/workflows/ci.yml/badge.svg)](https://github.com/anine09/pingcode-cli-unofficial/actions/workflows/ci.yml)
4
4
 
@@ -18,35 +18,30 @@ See [Coverage](#coverage-reach-vs-ergonomics) for the per-module split.
18
18
 
19
19
  ## Install
20
20
 
21
- Requires **Node.js >= 20**. The package is not published to npm; release zips
22
- ship their own `node_modules/` (`commander`, `picocolors`), so an installed
23
- binary needs only Node — no `npm` on the client. Build from a checkout for development.
21
+ Requires **Node.js >= 20**. The package is published to **npm** as [`pingcode-cli-unofficial`](https://www.npmjs.com/package/pingcode-cli-unofficial). Release tarballs ship their own `node_modules/` (`commander`, `picocolors`), so an installed binary needs only Node — no `npm` on the client.
24
22
 
25
- ### One-click (recommended)
26
-
27
- From the repo checkout, one command installs deps, builds, and links `pingcode` onto your
28
- `PATH` — compatible with Linux, macOS, and Windows. Re-run it after `git pull` to rebuild +
29
- relink the latest code:
23
+ ### Via npm (recommended)
30
24
 
31
25
  ```bash
32
- ./install.sh # Linux / macOS (or: npm run install:cli)
26
+ npm install -g pingcode-cli-unofficial
33
27
  ```
34
28
 
35
- ```powershell
36
- .\install.ps1 # Windows PowerShell (or: npm run install:cli)
37
- ```
29
+ That puts `pingcode` on your `PATH`. Self-update is automatic: the CLI checks npm for new versions on startup and updates silently in the background.
38
30
 
39
- The Windows variant needs PowerShell (`pwsh` or Windows PowerShell); the `install:cli` npm
40
- script is the cross-platform fallback (`node scripts/install.mjs`).
31
+ ### From source
41
32
 
42
- ### Manual
33
+ Build from a checkout when you want the latest code between releases, or want to edit/extend the CLI:
43
34
 
44
35
  ```bash
36
+ git clone https://github.com/anine09/pingcode-cli-unofficial.git
37
+ cd pingcode-cli-unofficial
45
38
  npm install
46
39
  npm run build # → dist/bin/pingcode.js
47
40
  npm link # then just: pingcode --help
48
41
  ```
49
42
 
43
+ The one-click installers (`./install.sh`, `.\install.ps1`) still work for source installs, but **npm is the recommended path** for end users.
44
+
50
45
  Development commands:
51
46
 
52
47
  ```bash
@@ -273,7 +273,7 @@ function printDryRun(plan, mode) {
273
273
  import { Command } from "commander";
274
274
 
275
275
  // src/version.ts
276
- var VERSION = "1.7.1";
276
+ var VERSION = "1.8.1";
277
277
 
278
278
  // src/cli/globals.ts
279
279
  import { Option } from "commander";
@@ -14273,6 +14273,19 @@ async function runAutoUpdate(env = process.env, fetchFn = defaultFetch, exec = d
14273
14273
  throw new TransportError("invalid tarball: dist/bin/pingcode.js not found");
14274
14274
  }
14275
14275
  await atomicReplace(dir, stagingDir);
14276
+ try {
14277
+ exec("npm", ["install", "--production", "--prefix", dir]);
14278
+ } catch (error) {
14279
+ const backup = `${dir}.backup`;
14280
+ try {
14281
+ atomicReplace(dir, backup);
14282
+ } catch {
14283
+ }
14284
+ throw new TransportError(
14285
+ `failed to install dependencies: ${errorMessage2(error)}`,
14286
+ { cause: error }
14287
+ );
14288
+ }
14276
14289
  const skillSource = path5.join(dir, "skills", "pingcode");
14277
14290
  if (dirExists(skillSource)) {
14278
14291
  await syncSkills(skillSource, skillTargets(env));