@neuxnet/neux-cli 0.2.4 → 0.2.5

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
@@ -51,6 +51,16 @@ NEUX_CLI_KEY_APP_XXX=key_xxx neux audit-status --app-id app_xxx --server-url htt
51
51
 
52
52
  `init` creates a minimal mini program project from scratch. In a TTY it interactively asks for the project name, App ID, Server URL, and a hidden `CLI Key`. The default Server URL is `https://demo-c.paas.superapp.neuvision.cn`. App ID and Server URL are written to the project; each App ID's CLI Key is stored in the user-level `~/.neux/config.json` and never in project files. Use `neux config set` to change the current project's CLI Key. `build` creates the client `.wgt` delivery artifact. `upload`, `debug`, `service-preview`, `submit`, `status` / `meta`, and `audit-status` use the signed service API when `--provider` is omitted. `debug-preview`, `submit-audit`, `version`, and `wgt` remain compatibility spellings for integrations that already use them. `login` is still provider-backed and unsupported by the signed service. Use `--provider local-file` or a provider module when testing adapter integrations instead of the remote service.
53
53
 
54
+ The generated project also includes source-backed JSON Schemas under `.vscode/neux-json-schemas/` and registers them in `.vscode/settings.json`. Run `npm run verify:schemas` in the CLI repository to verify that the checked-in schemas and init registration remain aligned. VS Code can therefore provide completion, hover documentation, enum suggestions, and basic validation for `app.json`, page JSON files, `project.config.json`, `project.private.config.json`, and `neux.config.json`. These schemas describe fields consumed by the Neux CLI/compiler; cross-file checks such as page existence and component path resolution remain compiler/CLI validation.
55
+
56
+ `neux inspect --project ./miniapp --json` also reports project-level configuration diagnostics for page files, TabBar membership and assets, subpackage pages, and local `usingComponents` targets. When errors are found, the result has `"ok": false` while retaining project metadata for IDE integrations.
57
+
58
+ The starter also generates `.vscode/neux-components.code-snippets`. In an `.nxml` file, type a component snippet prefix such as `nxButton`, `nxInput`, or `nxScrollView` and accept it to insert a component template containing the properties and `bind*` events declared by the Neux source inventory. This is an editor aid, not a replacement for component-level language-server validation.
59
+
60
+ `neux build` applies the same project validation by default and stops before invoking the compiler when configuration errors are present. Node API callers can explicitly pass `validate: false` when they need legacy compiler-only behavior.
61
+
62
+ The project validator also checks entry-page declarations, the five-item TabBar limit, duplicate or overlapping subpackage roots, pages duplicated across packages, and `miniprogramRoot` boundaries. These are project-level rules rather than JSON Schema rules.
63
+
54
64
  When the command runs inside a mini program project, `--project` defaults to the current directory. Output directories also have command-level defaults:
55
65
 
56
66
  | Command | Default output |
package/README.zh-CN.md CHANGED
@@ -148,6 +148,16 @@ neux build
148
148
 
149
149
  直接在终端执行 `neux init ./my-miniapp` 时,CLI 会交互式询问 `Project name`、`App ID`、`Server URL` 和隐藏输入的 `CLI Key`。`Server URL` 默认是 `https://demo-c.paas.superapp.neuvision.cn`,按回车即可使用。App ID 和 Server URL 写入项目;CLI Key 按 App ID 保存到用户级 `~/.neux/config.json`,不会写入项目文件或 Git。初始化模板还会生成 `AGENTS.md`、`llms.txt` 和 `mcp.example.json`,其中包含官方 AI 文档、LLM 文本导出、MCP endpoint 和 Agent Skill 入口。目标目录必须不存在或为空;如果需要写入已有目录,可以使用 `--force`。
150
150
 
151
+ 初始化项目还会生成 `.vscode/neux-json-schemas/` 下的 JSON Schema,并自动注册到 `.vscode/settings.json`。在 CLI 仓库中执行 `npm run verify:schemas` 可检查 Schema 资产、初始化注册和源码字段清单是否保持一致。VS Code 可为 `app.json`、页面 JSON、`project.config.json`、`project.private.config.json` 和 `neux.config.json` 提供字段补全、Hover、枚举值提示和基础校验。页面是否真实存在、组件路径是否有效等跨文件语义检查仍由 CLI/编译器负责。
152
+
153
+ `neux inspect --project ./miniapp --json` 还会报告页面文件、TabBar 页面归属和图标资源、分包页面以及本地 `usingComponents` 路径诊断。存在错误时返回的 `ok` 为 `false`,但仍保留项目元数据,便于 IDE 集成展示问题。
154
+
155
+ 初始化项目还会生成 `.vscode/neux-components.code-snippets`。在 `.nxml` 文件中输入 `nxButton`、`nxInput` 或 `nxScrollView` 等前缀并确认,即可插入包含源码声明属性和 `bind*` 事件的组件模板。这是编辑辅助能力,不替代组件级 Language Server 校验。
156
+
157
+ `neux build` 默认使用相同的项目级校验;存在配置错误时会在调用编译器前终止。Node API 调用方如需兼容旧的“仅调用编译器”行为,可以显式传入 `validate: false`。
158
+
159
+ 项目校验器还会检查入口页面声明、TabBar 最多五项、重复或重叠的分包根路径、主包与分包页面重复,以及 `miniprogramRoot` 是否越出项目目录。这些属于项目级规则,不属于 JSON Schema 能独立完成的校验。
160
+
151
161
  初始化后可以这样运行:
152
162
 
153
163
  ```sh