Skip to content

Commit 0a3eb53

Browse files
authored
feat: canvas 3 (#52)
> canvas 3.x 开始修改了 binary 配置,不再设置 remotePath 和 host 配置,导致原匹配规则失效 https://npmmirror.com/package/canvas/files?version=3.1.0#L66-L67 https://npmmirror.com/package/canvas/files?version=2.11.2#L41-L42 新增 remotePath 兼容 3.x 配置,和 2.x 保持一致 ![image](https://github.com/user-attachments/assets/396f07b8-6300-4af7-b5a1-eabfc33e6598) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced an enhanced configuration for binary assets by adding a versioned remote path. This update streamlines asset retrieval by associating binaries with specific version identifiers, ensuring a more structured and consistent approach to version management. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 4713801 commit 0a3eb53

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@
152152
"host": "https://cdn.npmmirror.com/binaries/nodejieba"
153153
},
154154
"canvas": {
155-
"host": "https://cdn.npmmirror.com/binaries/canvas"
155+
"host": "https://cdn.npmmirror.com/binaries/canvas",
156+
"remote_path": "v{version}"
156157
},
157158
"skia-canvas": {
158159
"host": "https://cdn.npmmirror.com/binaries/skia-canvas"

test/fixtures/canvas/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"install": "node-pre-gyp install --fallback-to-build --update-binary"
55
},
66
"binary": {
7-
"host": "https://cdn.npmmirror.com/binaries/canvas"
7+
"host": "https://cdn.npmmirror.com/binaries/canvas",
8+
"remote_path": "v{version}"
89
}
910
}

test/index.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ describe('test/index.test.js', () => {
191191
},
192192
binary: {
193193
host: 'https://cdn.npmmirror.com/binaries/canvas',
194+
remote_path: 'v{version}',
194195
},
195196
});
196197
});

0 commit comments

Comments
 (0)