pi-charset 0.1.2 → 0.1.3

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/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
7
7
 
8
8
  ---
9
9
 
10
+ ## [0.1.3] - 2026-10-28
11
+
12
+ ### Changed
13
+
14
+ - Configure `.github/workflows/release.yml` for tokenless npm OIDC Trusted Publishing with Sigstore provenance attestations and automatic `--latest` GitHub Release promotion.
15
+ - Update installation guides and badges to recommend `pi install npm:pi-charset` and `pi update --extensions` as the primary installation and upgrade path.
16
+
10
17
  ## [0.1.2] - 2026-10-28
11
18
 
12
19
  ### Added
@@ -6,6 +6,13 @@
6
6
 
7
7
  ---
8
8
 
9
+ ## [0.1.3] - 2026-10-28
10
+
11
+ ### 调整
12
+
13
+ - 将 `.github/workflows/release.yml` 切换为无密钥 npm OIDC Trusted Publishing(附带 Sigstore Provenance 溯源签名)并自动标记最新 GitHub Release。
14
+ - 更新安装说明与实时版本徽章,将 `pi install npm:pi-charset` 与 `pi update --extensions` 作为首选安装与一键升级路径。
15
+
9
16
  ## [0.1.2] - 2026-10-28
10
17
 
11
18
  ### 新增
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # pi-charset
2
2
 
3
3
  [![CI](https://github.com/ethan-blue/pi-charset/actions/workflows/ci.yml/badge.svg)](https://github.com/ethan-blue/pi-charset/actions/workflows/ci.yml)
4
- [![Version](https://img.shields.io/badge/version-0.1.2-blue.svg)](https://github.com/ethan-blue/pi-charset/releases)
4
+ [![npm](https://img.shields.io/npm/v/pi-charset.svg)](https://www.npmjs.com/package/pi-charset)
5
5
  [![Node](https://img.shields.io/badge/node-%3E%3D22.19.0-brightgreen.svg)](./package.json)
6
6
  [![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](./LICENSE)
7
7
 
@@ -58,17 +58,17 @@ Files are classified in memory in a fixed order:
58
58
 
59
59
  ## Quick Start
60
60
 
61
- ### 1. Installation
61
+ ### 1. Installation & Updates
62
62
 
63
63
  ```bash
64
- # Install from Git (-l writes to project .pi/settings.json; omit -l for global install)
65
- pi install git:github.com/ethan-blue/pi-charset -l
64
+ # Install globally from npm (recommended; omit -l for global, add -l for project .pi/settings.json)
65
+ pi install npm:pi-charset
66
66
 
67
- # Pin a specific release tag
68
- pi install git:github.com/ethan-blue/pi-charset@v0.1.2 -l
67
+ # Upgrade to the latest release at any time
68
+ pi update --extensions
69
69
 
70
- # Or install from a local checkout (run npm install --omit=dev in the package directory first)
71
- pi install /path/to/pi-charset -l
70
+ # Or install directly from Git
71
+ pi install git:github.com/ethan-blue/pi-charset -l
72
72
  ```
73
73
 
74
74
  ### 2. Scaffold or Create `.pi-charset.json`
package/README.zh-CN.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # pi-charset
2
2
 
3
3
  [![CI](https://github.com/ethan-blue/pi-charset/actions/workflows/ci.yml/badge.svg)](https://github.com/ethan-blue/pi-charset/actions/workflows/ci.yml)
4
- [![Version](https://img.shields.io/badge/version-0.1.2-blue.svg)](https://github.com/ethan-blue/pi-charset/releases)
4
+ [![npm](https://img.shields.io/npm/v/pi-charset.svg)](https://www.npmjs.com/package/pi-charset)
5
5
  [![Node](https://img.shields.io/badge/node-%3E%3D22.19.0-brightgreen.svg)](./package.json)
6
6
  [![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](./LICENSE)
7
7
 
@@ -58,17 +58,17 @@
58
58
 
59
59
  ## 快速开始
60
60
 
61
- ### 1. 安装
61
+ ### 1. 安装与升级
62
62
 
63
63
  ```bash
64
- # 从 Git 安装(-l 写入当前项目 .pi/settings.json,不加 -l 写入用户全局配置)
65
- pi install git:github.com/ethan-blue/pi-charset -l
64
+ # 从 npm 全局安装(推荐;加 -l 则仅写入当前工程 .pi/settings.json)
65
+ pi install npm:pi-charset
66
66
 
67
- # 指定版本标签安装
68
- pi install git:github.com/ethan-blue/pi-charset@v0.1.2 -l
67
+ # 日常一键升级至最新发布版
68
+ pi update --extensions
69
69
 
70
- # 或从本地目录安装(需先在扩展目录执行 npm install --omit=dev)
71
- pi install /path/to/pi-charset -l
70
+ # 或从 Git 仓库安装
71
+ pi install git:github.com/ethan-blue/pi-charset -l
72
72
  ```
73
73
 
74
74
  ### 2. 脚手架生成或手动编写 `.pi-charset.json`
package/docs/INSTALL.md CHANGED
@@ -13,31 +13,33 @@ English | [简体中文](./zh-CN/INSTALL.md)
13
13
  | Runtime Dependencies | `iconv-lite`, `micromatch` (no Python required) |
14
14
  | ripgrep | Automatically resolved from `~/.pi/agent/bin/rg(.exe)`, `rg` on `PATH`, or `@vscode/ripgrep` |
15
15
 
16
- ## 2. Installation Methods
16
+ ## 2. Installation & Updates
17
17
 
18
- ### Option A: Install from Git (Recommended)
18
+ ### Option A: Install from npm (Recommended)
19
19
 
20
20
  ```powershell
21
+ # Global user-level install (writes to ~/.pi/agent/settings.json)
22
+ pi install npm:pi-charset
23
+
21
24
  # Project-level install (writes to <project>/.pi/settings.json)
22
- cd D:\path\to\your-project
23
- pi install git:github.com/ethan-blue/pi-charset -l
25
+ pi install npm:pi-charset -l
24
26
 
25
- # Global user-level install (writes to ~/.pi/agent/settings.json)
27
+ # Upgrade installed packages to the latest release at any time
28
+ pi update --extensions
29
+ ```
30
+
31
+ ### Option B: Install from Git
32
+
33
+ ```powershell
34
+ # Unpinned Git install (tracks main via pi update --extensions)
26
35
  pi install git:github.com/ethan-blue/pi-charset
27
36
 
28
37
  # Pin a specific release tag
29
- pi install git:github.com/ethan-blue/pi-charset@v0.1.2 -l
38
+ pi install git:github.com/ethan-blue/pi-charset@v0.1.3 -l
30
39
  ```
31
40
 
32
41
  When installing from a `git:` source, Pi clones the repository under `.pi/git/github.com/ethan-blue/pi-charset` (or `~/.pi/agent/git/...`) and runs `npm install` automatically.
33
42
 
34
- ### Option B: Install from npm (When Published)
35
-
36
- ```powershell
37
- pi install npm:pi-charset -l
38
- pi install npm:pi-charset@0.1.2 -l
39
- ```
40
-
41
43
  ### Option C: Install from a Local Directory (Offline / Intranet)
42
44
 
43
45
  `pi install <local-path>` records the absolute path in `settings.json` without running `npm install`. When copying a source tree without `node_modules`, install production dependencies first:
@@ -91,7 +93,7 @@ Restart Pi after creating `.pi-charset.json`.
91
93
 
92
94
  ## 4. Post-Install Verification
93
95
 
94
- 1. Run `/charset-status` in Pi to confirm `pi-charset v0.1.2` and the active mode or `.pi-charset.json` path.
96
+ 1. Run `/charset-status` in Pi to confirm `pi-charset v0.1.3` and the active mode or `.pi-charset.json` path.
95
97
  2. Edit a Chinese comment in a GBK file, then run `/charset-scan` (or `node <PKG_DIR>/tools/scan-encoding.mjs <file>`) and verify the file remains `cjk/GBK`.
96
98
  3. Optionally scan for pre-existing damaged files (`U+FFFD` or `锟斤拷`):
97
99
  ```text
@@ -13,31 +13,33 @@
13
13
  | 运行时依赖 | `iconv-lite`、`micromatch`(无 Python 依赖) |
14
14
  | ripgrep | 自动查找 `~/.pi/agent/bin/rg(.exe)`、系统 `PATH` 中的 `rg` 或 `@vscode/ripgrep` |
15
15
 
16
- ## 2. 安装方式
16
+ ## 2. 安装与升级
17
17
 
18
- ### 方式 A:从 Git 仓库安装(推荐)
18
+ ### 方式 A:从 npm 官方源安装(推荐)
19
19
 
20
20
  ```powershell
21
+ # 用户级全局安装(写入 ~/.pi/agent/settings.json,所有工程自动生效)
22
+ pi install npm:pi-charset
23
+
21
24
  # 项目级安装(写入当前工程 .pi/settings.json)
22
- cd D:\path\to\your-project
23
- pi install git:github.com/ethan-blue/pi-charset -l
25
+ pi install npm:pi-charset -l
26
+
27
+ # 日常一键升级已安装扩展至最新版本
28
+ pi update --extensions
29
+ ```
30
+
31
+ ### 方式 B:从 Git 仓库安装
24
32
 
25
- # 用户级全局安装(写入 ~/.pi/agent/settings.json)
33
+ ```powershell
34
+ # 不锁版本安装(后续可通过 pi update --extensions 跟踪最新提交)
26
35
  pi install git:github.com/ethan-blue/pi-charset
27
36
 
28
37
  # 指定版本标签安装
29
- pi install git:github.com/ethan-blue/pi-charset@v0.1.2 -l
38
+ pi install git:github.com/ethan-blue/pi-charset@v0.1.3 -l
30
39
  ```
31
40
 
32
41
  使用 `git:` 源安装时,Pi 会将仓库克隆至 `.pi/git/github.com/ethan-blue/pi-charset`(或 `~/.pi/agent/git/...`)并自动执行 `npm install`。
33
42
 
34
- ### 方式 B:从 npm 安装(发布至 npm 后可用)
35
-
36
- ```powershell
37
- pi install npm:pi-charset -l
38
- pi install npm:pi-charset@0.1.2 -l
39
- ```
40
-
41
43
  ### 方式 C:从本地目录安装(离线或内网环境)
42
44
 
43
45
  `pi install <本地路径>` 仅将绝对路径写入 `settings.json`,不会自动执行 `npm install`。若拷贝的是不含 `node_modules` 的源码目录,需先安装运行时依赖:
@@ -91,7 +93,7 @@ node <PKG_DIR>/tools/scan-encoding.mjs . --init
91
93
 
92
94
  ## 4. 安装后验证
93
95
 
94
- 1. **状态检查**:在 Pi 会话中输入 `/charset-status`,确认显示 `pi-charset v0.1.2` 及生效的模式或 `.pi-charset.json` 路径。
96
+ 1. **状态检查**:在 Pi 会话中输入 `/charset-status`,确认显示 `pi-charset v0.1.3` 及生效的模式或 `.pi-charset.json` 路径。
95
97
  2. **读写验证**:修改工程内一个 GBK 文件的中文注释,执行 `/charset-scan`(或 `node <PKG_DIR>/tools/scan-encoding.mjs <文件路径>`),确认编码仍为 `cjk/GBK`。
96
98
  3. **历史受损文件排查(可选)**:
97
99
  ```text
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-charset",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Encoding-aware read, write, edit, and grep extension for Pi",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Synchronized with package.json version.
2
- export const PLUGIN_VERSION = "0.1.2";
2
+ export const PLUGIN_VERSION = "0.1.3";