@aiot-nexus/plugin-sdk 1.0.0 → 1.0.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
@@ -31,17 +31,17 @@ nexus-plugin create my-frame-plugin \
31
31
  --template minimal \
32
32
  --output . \
33
33
  --display-name "My Frame Plugin" \
34
- --sdk-source /path/to/aiot-nexus-plugin-sdk-1.0.0.tgz
34
+ --install
35
35
  ```
36
36
 
37
37
  - `--template` 默认为 `minimal`,也可选择带 `better-sqlite3` 的 `sqlite`。
38
38
  - `--output` 默认为当前目录,目标固定为 `<output>/<plugin-id>`。
39
- - `--sdk-source` 为必填项,接受严格的 `X.Y.Z` npm 版本、`@aiot-nexus/plugin-sdk@X.Y.Z` 或本地 `.tgz`。本地包会复制到生成工程的 `vendor/`,并写入可迁移的相对 `file:` 依赖。
39
+ - `--sdk-source` 默认为当前 CLI 的 SDK 版本。也可传入严格的 `X.Y.Z` npm 版本、`@aiot-nexus/plugin-sdk@X.Y.Z` 或本地 `.tgz` 进行覆盖;本地包会复制到生成工程的 `vendor/`,并写入可迁移的相对 `file:` 依赖。
40
40
  - 默认不安装依赖;传入 `--install` 后执行 `npm install`。SQLite 模板在每次 `npm run build` 前强制执行 Electron 22.3.27 native rebuild。
41
41
  - 目标目录非空时命令以返回码 `2` 拒绝覆盖。生成或安装失败返回 `1`。
42
42
  - 两套模板均读取宿主 `PluginRendererContext.language`,通过 `onContextChanged` 在同一 iframe 内响应运行时语言切换,并内置 `zh-CN` / `en-US` renderer 文案;manifest 使用相同文化资源本地化宿主入口。
43
43
 
44
- 当前 SDK 不发布到远程 registry。必须先执行 `npm run pack:sdk`,再把生成的 `.tgz` 路径传给 `--sdk-source`;CLI 不会默认写入当前无法安装的远程版本,并会把本地包一并放入生成工程。未来发布后可改用严格的 `X.Y.Z` 版本。
44
+ 默认来源从 npm registry 安装。离线开发时先执行 `npm run pack:sdk`,再通过 `--sdk-source /path/to/aiot-nexus-plugin-sdk-1.0.1.tgz` 指定本地包;CLI 会把本地包一并放入生成工程。
45
45
 
46
46
  ## 独立调试
47
47
 
@@ -75,7 +75,7 @@ function usage() {
75
75
  " nexus-plugin info",
76
76
  " nexus-plugin validate <plugin-package-directory>",
77
77
  " nexus-plugin create <plugin-id> [--template minimal|sqlite] [--output <parent-directory>]",
78
- " [--display-name <name>] --sdk-source <version-or-local-tgz> [--install]",
78
+ " [--display-name <name>] [--sdk-source <version-or-local-tgz>] [--install]",
79
79
  " nexus-plugin dev [plugin-project-directory] [--no-build] [--inspect[=<port>] | --inspect-brk[=<port>]]",
80
80
  " [--language <culture>] [--theme system|light|dark] [--surface business|tool|settings]",
81
81
  " [--contribution-id <id>] [--no-devtools]"
@@ -193,7 +193,7 @@ function runCreate(args, io) {
193
193
  let template = "minimal";
194
194
  let outputDirectory = io.cwd();
195
195
  let displayName = (0, scaffold_1.defaultPluginDisplayName)(pluginId);
196
- let sdkSource;
196
+ let sdkSource = index_1.PLUGIN_SDK_VERSION;
197
197
  let install = false;
198
198
  const seen = new Set();
199
199
  for (let index = 1; index < args.length; index += 1) {
@@ -234,9 +234,6 @@ function runCreate(args, io) {
234
234
  sdkSource = value;
235
235
  }
236
236
  }
237
- if (!sdkSource) {
238
- return usageError(io, "create requires --sdk-source; use a local SDK .tgz until @aiot-nexus/plugin-sdk is published.");
239
- }
240
237
  try {
241
238
  const result = (0, scaffold_1.createPluginScaffold)({
242
239
  pluginId,
@@ -1,5 +1,5 @@
1
1
  import pluginManifestSchema from "../.generated/plugin-manifest.schema.json";
2
- export declare const PLUGIN_SDK_VERSION = "1.0.0";
2
+ export declare const PLUGIN_SDK_VERSION = "1.0.1";
3
3
  export { pluginManifestSchema };
4
4
  export * from "../.generated/plugin-framework-version";
5
5
  export * from "./types";
package/dist/src/index.js CHANGED
@@ -20,7 +20,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.pluginManifestSchema = exports.PLUGIN_SDK_VERSION = void 0;
21
21
  const plugin_manifest_schema_json_1 = __importDefault(require("../.generated/plugin-manifest.schema.json"));
22
22
  exports.pluginManifestSchema = plugin_manifest_schema_json_1.default;
23
- exports.PLUGIN_SDK_VERSION = "1.0.0";
23
+ exports.PLUGIN_SDK_VERSION = "1.0.1";
24
24
  __exportStar(require("../.generated/plugin-framework-version"), exports);
25
25
  __exportStar(require("./types"), exports);
26
26
  __exportStar(require("./browser/frame-client"), exports);
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@aiot-nexus/plugin-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Types, PluginFrame client, and CLI for AIoT Nexus independent plugins.",
5
5
  "license": "UNLICENSED",
6
+ "publishConfig": {
7
+ "access": "public",
8
+ "registry": "https://registry.npmjs.org/"
9
+ },
6
10
  "main": "./dist/src/index.js",
7
11
  "types": "./dist/src/index.d.ts",
8
12
  "exports": {