@linkdesk/plugin-docs 0.1.44 → 0.1.46

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.
@@ -16,13 +16,14 @@ my-plugin/
16
16
  │ ├── plugin.json ← rewritten clone (contributes.views[].render → views/<View>.bundle.js)
17
17
  │ ├── index.bundle.js ← main entry bundle (whenever the loader sees it, it becomes the runtime entry)
18
18
  │ ├── index.bundle.css ← aggregated styles
19
- │ ├── views/<View>.bundle.js ← one independent build per contributes.views[].render
19
+ │ ├── views/<View>.bundle.js ← one build surface per contributes.views[].render
20
+ │ ├── <module>-<hash>.js ← deduped chunk for modules shared across surfaces (each surface imports it relatively)
20
21
  │ ├── resources/ icon.svg etc. ← resources ship inside the package
21
22
  │ └── (themes/ assets/ i18n/ node_modules/ …) depending on plugin content
22
23
  └── src/ … ← author source (does not go into the zip)
23
24
  ```
24
25
 
25
- **Who produces the zip:** [plugin-sdk](https://github.com/Encaron/linkdesk/tree/electron/packages/plugin-sdk) (`npm run publish` goes through the [author journey](https://github.com/Encaron/linkdesk/blob/electron/docs/02-Electron架构/插件生态与发布/05-文档与发布/00-第三方作者旅程.md)) emits `<id>.linkdesk-plugin` + the unpacked directory `dist/<id>.linkdesk-plugin/` at **the project root**. All JS inside the zip is pre-built and self-contained (react-family packages are external, provided by the shell)—**there is no source compilation in the installed state**.
26
+ **Who produces the zip:** [plugin-sdk](https://github.com/Encaron/linkdesk/tree/electron/packages/plugin-sdk) (`npm run publish` goes through the [author journey](https://github.com/Encaron/linkdesk/blob/electron/docs/02-Electron架构/插件生态与发布/05-文档与发布/00-第三方作者旅程.md)) emits `<id>.linkdesk-plugin` + the unpacked directory `dist/<id>.linkdesk-plugin/` at **the project root**. All JS inside the zip is pre-built (react-family packages are external, provided by the shell; modules shared across surfaces are emitted once as a deduped chunk)—**there is no source compilation in the installed state**.
26
27
 
27
28
  **Why a single file:** the shell loader only accepts pre-built bundles for installed plugins—`plugin-file-service` sees that `index.bundle.js` exists and overwrites the entry to point at it (`resolveEntry`; the bundle entry is always `index.bundle.js`). The zip is "one plugin = one file that can be downloaded, verified, and atomically replaced", and both install/uninstall and marketplace downloads work against it.
28
29
 
@@ -13,9 +13,9 @@ The `README.md` in the plugin root directory is displayed in the **"Details" tab
13
13
  | State | Where the README comes from | Relative-path media (assets shipped in the package) | https absolute-URL media |
14
14
  |:--|:--|:--:|:--:|
15
15
  | **Installed state** (the user downloaded and installed it, or it shipped with the shell, and then views the details) | Reads **the copy you packaged into the zip** | ✅ Shown | ✅ Shown |
16
- | **Marketplace preview state** (not installed; the list/details read the remote README of the catalog entry) | Reads the **remote readmeUrl** | ❌ Not shown (honestly hidden — at that moment there is no in-package copy of yours to resolve) | ✅ Shown |
16
+ | **Marketplace preview state** (not installed; the list/details read the remote README of the catalog entry) | Reads the **remote readmeUrl** | ✅ Shown (relative paths are resolved against the readmeUrl's own directory into same-directory https links; excepted when readmeUrl is not https or has no directory segment) | ✅ Shown |
17
17
 
18
- > **What this means:** if you want the image/video to be guaranteed visible after the user has **installed** the plugin → use a **relative path pointing inside the package** (§3 below); if you want the image/video to be visible even to **visitors who haven't installed it yet** → use an **https absolute URL**. Shipping only relative-path media = visible only once installed.
18
+ > **What this means:** relative-path media and https absolute-URL media are **both shown** in either state — provided the readmeUrl and the in-package assets line up relatively (readmeUrl at the repo root, assets placed relative to the repo root). The only thing to avoid is an asset that exists **only inside the package but not in the repository**: the preview state has no way to fetch it.
19
19
 
20
20
  ---
21
21
 
@@ -16,13 +16,14 @@ my-plugin/
16
16
  │ ├── plugin.json ← 改写克隆(contributes.views[].render → views/<View>.bundle.js)
17
17
  │ ├── index.bundle.js ← 主入口 bundle(loader 检测其存在即以 bundle 为运行时入口)
18
18
  │ ├── index.bundle.css ← 聚合样式
19
- │ ├── views/<View>.bundle.js ← 每个 contributes.views[].render 一次独立构建
19
+ │ ├── views/<View>.bundle.js ← 每个 contributes.views[].render 一个表面(构建产物)
20
+ │ ├── <模块名>-<hash>.js ← 跨表面共享模块的去重 chunk(各表面相对引它;无共享模块则无)
20
21
  │ ├── resources/ icon.svg 等 ← 资源随包
21
22
  │ └── (themes/ assets/ i18n/ node_modules/ …) 按插件内容
22
23
  └── src/ … ← 作者源码(不进 zip)
23
24
  ```
24
25
 
25
- **谁产 zip:** [plugin-sdk](https://github.com/Encaron/linkdesk/tree/electron/packages/plugin-sdk)(`npm run publish` 走 [作者旅程](https://github.com/Encaron/linkdesk/blob/electron/docs/02-Electron架构/插件生态与发布/05-文档与发布/00-第三方作者旅程.md))在**项目根**产 `<id>.linkdesk-plugin` + 解包目录 `dist/<id>.linkdesk-plugin/`。zip 内 JS 全部预构建自包含(react 系 external,壳提供)——**安装态没有源码编译**。
26
+ **谁产 zip:** [plugin-sdk](https://github.com/Encaron/linkdesk/tree/electron/packages/plugin-sdk)(`npm run publish` 走 [作者旅程](https://github.com/Encaron/linkdesk/blob/electron/docs/02-Electron架构/插件生态与发布/05-文档与发布/00-第三方作者旅程.md))在**项目根**产 `<id>.linkdesk-plugin` + 解包目录 `dist/<id>.linkdesk-plugin/`。zip 内 JS 全部预构建(react 系 external,壳提供;跨表面共享的模块去掉重 chunk、只存一份)——**安装态没有源码编译**。
26
27
 
27
28
  **为什么是单文件:** 壳 loader 对安装态插件只认预构建 bundle——`plugin-file-service` 检测到 `index.bundle.js` 存在即覆盖 entry 指向它(`resolveEntry`,bundle 入口恒 `index.bundle.js`)。zip 是「一个插件 = 一个可下载/可校验/可原子替换的文件」,装卸与市场下载都对着它。
28
29
 
@@ -13,9 +13,9 @@
13
13
  | 态 | README 从哪来 | 相对路径媒体(随包资源) | https 绝对 URL 媒体 |
14
14
  |:--|:--|:--:|:--:|
15
15
  | **已装态**(用户下载安装 / 随壳发货后看详情) | 读**你打包进 zip 的那份** | ✅ 显示 | ✅ 显示 |
16
- | **市场预览态**(未安装,列表/详情读目录条目的远程 README) | 读**远端 readmeUrl** | ❌ 不显示(诚实不显——此刻没有你的包内副本,无从解析) | ✅ 显示 |
16
+ | **市场预览态**(未安装,列表/详情读目录条目的远程 README) | 读**远端 readmeUrl** | ✅ 显示(相对路径按 readmeUrl 所在目录解析成同目录 https 直链;readmeUrl 非 https 或无目录段时例外) | ✅ 显示 |
17
17
 
18
- > **含义:** 想让图/视频在「用户已装」后必然看到 → 用**相对路径放包内**(下 §三);想让图/视频连「还没装的浏览者」也看得到 → 用 **https 绝对 URL**。只放相对路径媒体 = 装了才见。
18
+ > **含义:** 相对路径媒体与 https 绝对 URL 媒体在两种态下**都显示**——前提是 readmeUrl 与包内资产的相对位置一致(readmeUrl 在仓库根、资产按仓库根相对摆放)。唯一要避免的是「**只在包内、仓库里没有**」的资产:预览态无从取到它。
19
19
 
20
20
  ---
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linkdesk/plugin-docs",
3
- "version": "0.1.44",
3
+ "version": "0.1.46",
4
4
  "description": "LinkDesk 插件作者文档(离线包)——作者面文档树的发布产物(英文 `docs/03-plugin-authoring` 在包根、中文 `docs/03-插件制造` 在 `zh/`):从零学会做一个插件(导览 / 三档动线 / 区域地图 / 组件速查 / 主题 / API 入口)。",
5
5
  "type": "module",
6
6
  "files": [