@hile/cli 3.0.3 → 4.0.0

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/AI.md CHANGED
@@ -173,6 +173,8 @@ next Next.js + Hile controllers on one port
173
173
  micro-http Microservice plus HTTP endpoint
174
174
  micro Pure microservice
175
175
  micro-http-next Next.js + microservice + HTTP
176
+ rsc-host Single public Next host for internal RSC plugins
177
+ rsc-plugin Independently built RSC plugin service without HTTP
176
178
  monorepo Lerna + pnpm workspace
177
179
  ```
178
180
 
@@ -213,6 +215,8 @@ The CLI entrypoint exports a `create` command. Application code does not import
213
215
  - HTTP templates use `@hile/core` and `@hile/http`.
214
216
  - Next templates use `@hile/http-next` and `@hile/model`.
215
217
  - Micro templates use `@hile/micro` and `@hile/message-loader`.
218
+ - RSC host/plugin templates compose `@hile/rsc`, `@hile/http-next`, and `@hile/micro` as separate architecture roles.
219
+ - The RSC host template exposes a domain-free `/plugins/[pluginId]/[[...path]]` catch-all; plugin ID, active build, and route path are resolved at request time.
216
220
 
217
221
  ## Runtime And Lifecycle Notes
218
222
 
@@ -231,6 +235,9 @@ The CLI entrypoint exports a `create` command. Application code does not import
231
235
  - New project has `"type": "module"`.
232
236
  - Dev script runs `hile start --dev`.
233
237
  - Production script runs `hile start` after build.
238
+ - `rsc-host` is the only public HTTP owner; `rsc-plugin` starts only an internal micro listener.
239
+ - RSC templates pin React 19.2.8 exactly and verify plugin artifacts before startup.
240
+ - The RSC plugin template does not install Next; only the host pins the supported Next adapter version.
234
241
  - Boot files default-export `defineService(...)`.
235
242
 
236
243
 
@@ -0,0 +1,2 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerRegistryMonitorCommand(registryCmd: Command): void;
@@ -0,0 +1,39 @@
1
+ import { InvalidArgumentError } from 'commander';
2
+ function parsePositiveInteger(value) {
3
+ const parsed = Number(value);
4
+ if (!Number.isFinite(parsed) || parsed !== Math.trunc(parsed) || parsed <= 0) {
5
+ throw new InvalidArgumentError('must be a positive integer');
6
+ }
7
+ return parsed;
8
+ }
9
+ function parsePort(value) {
10
+ const parsed = Number(value);
11
+ if (!Number.isFinite(parsed) || parsed !== Math.trunc(parsed) || parsed < 1 || parsed > 65535) {
12
+ throw new InvalidArgumentError('must be an integer between 1 and 65535');
13
+ }
14
+ return parsed;
15
+ }
16
+ function parseScale(value) {
17
+ if (value !== 'compact' && value !== 'normal' && value !== 'large') {
18
+ throw new InvalidArgumentError('must be compact, normal, or large');
19
+ }
20
+ return value;
21
+ }
22
+ export function registerRegistryMonitorCommand(registryCmd) {
23
+ registryCmd
24
+ .command('monitor')
25
+ .option('--host <host>', '注册中心主机', '127.0.0.1')
26
+ .option('--port <port>', '注册中心端口', parsePort, 9876)
27
+ .option('--interval <ms>', '刷新间隔,单位毫秒', parsePositiveInteger, 1000)
28
+ .option('--scale <mode>', '界面缩放:compact、normal、large', parseScale, 'normal')
29
+ .description('实时监控已有 Hile 注册中心')
30
+ .action(async (options) => {
31
+ const { runRegistryMonitor } = await import('@hile/registry-monitor');
32
+ await runRegistryMonitor({
33
+ host: options.host,
34
+ port: options.port,
35
+ interval: options.interval,
36
+ scale: options.scale,
37
+ });
38
+ });
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hile/cli",
3
- "version": "3.0.3",
3
+ "version": "4.0.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -24,16 +24,17 @@
24
24
  "node": ">=20.12.0"
25
25
  },
26
26
  "devDependencies": {
27
+ "@types/node": "^26.2.0",
27
28
  "fix-esm-import-path": "^1.10.3",
28
29
  "vitest": "^4.0.18"
29
30
  },
30
31
  "dependencies": {
31
- "@hile/bootstrap": "^3.0.0",
32
- "@hile/logger": "^3.0.0",
33
- "@hile/micro": "^3.0.3",
32
+ "@hile/bootstrap": "^4.0.0",
33
+ "@hile/logger": "^4.0.0",
34
+ "@hile/micro": "^4.0.0",
34
35
  "commander": "^14.0.3",
35
36
  "pino-pretty": "^13.1.3",
36
37
  "yaml": "^2.9.0"
37
38
  },
38
- "gitHead": "eac3a74c71ec2c514b920015f1c0d3415d3b8057"
39
+ "gitHead": "b46cb7f3705a226f58e4d65a2ff985ea54b9a159"
39
40
  }