proxylang 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +14 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -21,7 +21,16 @@ proxylang 把这些关系直接写进代码:
21
21
 
22
22
  ## 快速开始
23
23
 
24
- 当前处于早期开发,npm 发布流程见[发布说明](docs/engineering/npm-release/README.md)。首次版本发布前仍从源码使用。需要 **Node.js 24(最低 24.11.0)** 和 **Vite+ 1.3.0**。
24
+ 需要 **Node.js 24(最低 24.11.0)**。安装已发布的 npm 包:
25
+
26
+ ```sh
27
+ npm install --save-exact proxylang@0.1.1
28
+ npx proxylang --help
29
+ ```
30
+
31
+ 将下面的 Usage 示例保存为 `proxy.config.ts`,即可执行 `npx proxylang check proxy.config.ts`。
32
+
33
+ 若要运行仓库里的完整示例,另需 **Vite+ 1.3.0**:
25
34
 
26
35
  ```sh
27
36
  git clone https://github.com/CorrectRoadH/proxylang.git
@@ -40,7 +49,7 @@ DEMO_PASSWORD=example-only vp exec node dist/cli.js build examples/clients.ts --
40
49
 
41
50
  ## Usage
42
51
 
43
- 将下面三个 TypeScript 代码块按顺序保存为仓库根目录的 `proxy.config.ts`。
52
+ 将下面三个 TypeScript 代码块按顺序保存为项目中的 `proxy.config.ts`。
44
53
 
45
54
  ### 1. 组合规则,给出口留一个位置
46
55
 
@@ -165,14 +174,14 @@ export default defineConfig({
165
174
 
166
175
  ```sh
167
176
  # 检查所有目标和请求案例
168
- vp exec node dist/cli.js check proxy.config.ts
177
+ npx proxylang check proxy.config.ts
169
178
 
170
179
  # 查看请求命中了哪条规则,以及规则来自哪个模板
171
- vp exec node dist/cli.js explain proxy.config.ts --target backup \
180
+ npx proxylang explain proxy.config.ts --target backup \
172
181
  --request '{"network":"tcp","domain":"github.com","port":443}'
173
182
 
174
183
  # 用测试密码构建;实际使用时由环境提供真实凭据
175
- PROXY_PASSWORD=example-only vp exec node dist/cli.js build proxy.config.ts --out out
184
+ PROXY_PASSWORD=example-only npx proxylang build proxy.config.ts --out out
176
185
  ```
177
186
 
178
187
  `explain` 展示条件匹配与逻辑出口,不模拟节点测速或网络连通性。`build` 生成原生配置,整批成功后更新 `out/active.json`,其中列出各目标文件路径;一个目标失败不会替换上一批结果。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proxylang",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Composable routing policies in TypeScript with explicit platform targets",
5
5
  "homepage": "https://github.com/CorrectRoadH/proxylang#readme",
6
6
  "bugs": {