file-viewer-copy-assets 2.1.28 → 2.1.30

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.en.md CHANGED
@@ -1,24 +1,41 @@
1
1
  # file-viewer-copy-assets
2
2
 
3
- The official Flyfish File Viewer asset-copy CLI. It makes this command a real npm Registry package that `npx` can resolve, install, and execute directly:
3
+ The official Flyfish File Viewer asset-copy CLI. Full packages include `preset-all`, but their Worker, WASM, font, and vendor files still have to be published. Without those files, only part of the format matrix can work.
4
+
5
+ Every `*-full` package automatically installs an exactly matching CLI. For Webpack, Vue CLI, and other non-Vite builds, run it to copy into the default static directory:
6
+
7
+ ```bash
8
+ npx --no-install file-viewer-copy-assets ./public/file-viewer
9
+ # In pnpm projects:
10
+ pnpm exec file-viewer-copy-assets ./public/file-viewer
11
+ ```
12
+
13
+ When using a standard package, explicitly install the matching CLI. For standalone execution, use an explicitly versioned `npx` command:
4
14
 
5
15
  ```bash
6
- npx --yes file-viewer-copy-assets@2.1.28 ./public/file-viewer
16
+ npm install -D file-viewer-copy-assets@2.1.30
17
+ npx --yes file-viewer-copy-assets@2.1.30 ./public/file-viewer
7
18
  ```
8
19
 
9
20
  The CLI carries a version-matched asset payload, copies Worker, WASM, font, PDF, CAD, Typst, Archive, Draw.io, and Office vendor assets, and writes a `flyfish-viewer-assets.json` integrity manifest. Installing it or running `--version` does not modify the project; only the copy command writes to the selected target. Runtime assets remain self-hosted with no public CDN dependency.
10
21
 
22
+ After copying, the static server must expose the target as `file-viewer/` under the deployment base (`/file-viewer/` for a root deployment) and return the manifest, JavaScript, WASM, and font URLs with correct MIME types. A valid manifest proves the local payload is complete; it does not replace an HTTP deployment check. If assets live elsewhere, call the full package's `setDefaultFullAssetBaseUrl()` during startup.
23
+
24
+ Vite projects should use `copyAssets: true` in `@file-viewer/vite-plugin`; the plugin publishes assets matching installed full/preset packages. A CDN/IIFE deployment of the complete `@file-viewer/web-full/dist/` directory already carries assets and needs no extra copy. Deploying only the entry IIFE is incomplete; use the installed CLI instead.
25
+
11
26
  ## Usage
12
27
 
13
28
  ```bash
14
29
  # Defaults to ./public/file-viewer
15
- npx --yes file-viewer-copy-assets@2.1.28
30
+ npx --no-install file-viewer-copy-assets
31
+ # pnpm equivalent
32
+ pnpm exec file-viewer-copy-assets
16
33
 
17
34
  # Keep unrelated existing files in the target directory
18
- npx --yes file-viewer-copy-assets@2.1.28 ./public/file-viewer --no-clean
35
+ pnpm exec file-viewer-copy-assets ./public/file-viewer --no-clean
19
36
 
20
- # pnpm equivalent
21
- pnpm dlx file-viewer-copy-assets@2.1.28 ./public/file-viewer
37
+ # With no local dependency, pin the standalone CLI version explicitly
38
+ pnpm dlx file-viewer-copy-assets@2.1.30 ./public/file-viewer
22
39
  ```
23
40
 
24
41
  Set `FILE_VIEWER_PUBLIC_DIR` to override the default output or `FILE_VIEWER_SKIP_ASSET_COPY=1` when a CI step should skip copying. See the [File Viewer deployment guide](https://doc.file-viewer.app/guide/distribution) for full details.
package/README.md CHANGED
@@ -1,24 +1,41 @@
1
1
  # file-viewer-copy-assets
2
2
 
3
- Flyfish File Viewer 官方静态资源复制 CLI。它让下面这条命令成为可直接从 npm Registry 解析、安装和执行的标准 `npx` 入口:
3
+ Flyfish File Viewer 官方静态资源复制 CLI。full 包已经内置 `preset-all`,但 Worker、WASM、字体和 vendor 文件仍需要发布到静态目录;缺少这些文件时只能使用部分格式。
4
+
5
+ 所有 `*-full` 包都会自动安装与自身完全同版本的 CLI。Webpack、Vue CLI 等非 Vite 项目直接运行它并复制到默认静态目录:
6
+
7
+ ```bash
8
+ npx --no-install file-viewer-copy-assets ./public/file-viewer
9
+ # pnpm 项目也可以运行:
10
+ pnpm exec file-viewer-copy-assets ./public/file-viewer
11
+ ```
12
+
13
+ 单独使用标准包时先显式安装同版本 CLI;需要独立执行时,也可以使用带明确版本的 `npx` 入口:
4
14
 
5
15
  ```bash
6
- npx --yes file-viewer-copy-assets@2.1.28 ./public/file-viewer
16
+ npm install -D file-viewer-copy-assets@2.1.30
17
+ npx --yes file-viewer-copy-assets@2.1.30 ./public/file-viewer
7
18
  ```
8
19
 
9
20
  CLI 自带与当前版本严格匹配的资源载荷,会将 Worker、WASM、字体、PDF、CAD、Typst、Archive、Draw.io 和 Office vendor 资源复制到目标目录,并生成 `flyfish-viewer-assets.json` 完整性清单。安装或执行 `--version` 不会修改项目目录;只有执行复制命令时才会写入指定目标。运行时资源全部自托管,不依赖公共 CDN。
10
21
 
22
+ 复制完成后,静态服务必须把目标目录映射为部署基址下的 `file-viewer/`(根部署即 `/file-viewer/`),并让清单、JavaScript、WASM、字体等 URL 以正确 MIME 返回。清单通过只能证明本地资源完整,不能替代 HTTP 部署检查。若资源不在这个约定目录,请同步调用 full 包导出的 `setDefaultFullAssetBaseUrl()`。
23
+
24
+ Vite 项目优先使用 `@file-viewer/vite-plugin` 的 `copyAssets: true`,插件会按已安装的 full/preset 自动发布资源。完整部署 `@file-viewer/web-full/dist/` 的 CDN/IIFE 场景已经携带 assets,无需再次复制;只部署入口 IIFE 文件并不完整,可改用随包安装的 CLI。
25
+
11
26
  ## 用法
12
27
 
13
28
  ```bash
14
29
  # 默认输出到 ./public/file-viewer
15
- npx --yes file-viewer-copy-assets@2.1.28
30
+ npx --no-install file-viewer-copy-assets
31
+ # pnpm 等价命令
32
+ pnpm exec file-viewer-copy-assets
16
33
 
17
34
  # 保留目标目录中已有的其他文件
18
- npx --yes file-viewer-copy-assets@2.1.28 ./public/file-viewer --no-clean
35
+ pnpm exec file-viewer-copy-assets ./public/file-viewer --no-clean
19
36
 
20
- # pnpm 等价命令
21
- pnpm dlx file-viewer-copy-assets@2.1.28 ./public/file-viewer
37
+ # 未安装本地依赖时,显式锁定独立 CLI 版本
38
+ pnpm dlx file-viewer-copy-assets@2.1.30 ./public/file-viewer
22
39
  ```
23
40
 
24
41
  可使用 `FILE_VIEWER_PUBLIC_DIR` 设置默认输出目录,或将 `FILE_VIEWER_SKIP_ASSET_COPY=1` 用于需要跳过复制步骤的 CI 场景。完整部署说明见 [File Viewer 文档](https://doc.file-viewer.app/guide/distribution)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "file-viewer-copy-assets",
3
- "version": "2.1.28",
3
+ "version": "2.1.30",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Official npx CLI for copying Flyfish File Viewer Worker, WASM, font, and vendor assets into self-hosted web projects.",
@@ -43,6 +43,7 @@
43
43
  "import": "./dist/index.js",
44
44
  "default": "./dist/index.js"
45
45
  },
46
+ "./cli": "./dist/cli.js",
46
47
  "./package.json": "./package.json"
47
48
  },
48
49
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-07-14T02:15:27.519Z",
3
+ "generatedAt": "2026-07-15T10:42:35.628Z",
4
4
  "rendererAssetManifests": [
5
5
  {
6
6
  "rendererId": "drawing",
@@ -252,7 +252,7 @@
252
252
  ],
253
253
  "validation": {
254
254
  "valid": true,
255
- "checkedAt": "2026-07-14T02:15:27.519Z",
255
+ "checkedAt": "2026-07-15T10:42:35.628Z",
256
256
  "assets": [
257
257
  {
258
258
  "id": "drawio-viewer-script",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@file-viewer/web",
3
- "version": "2.1.28",
3
+ "version": "2.1.30",
4
4
  "kind": "viewer-assets",
5
5
  "assets": "flyfish-viewer-assets.json"
6
6
  }