Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.14.2 (2026-1-4)

- fix(plugin-blocklet): set node-polyfills default options

## 0.14.1 (2026-1-4)

- fix(plugin-blocklet): fix import @ocap/mcrypto
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "create-blocklet",
"private": true,
"version": "0.14.1",
"version": "0.14.2",
"description": "",
"keywords": [],
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-blocklet",
"version": "0.14.1",
"version": "0.14.2",
"exports": "./index.js",
"type": "module",
"repository": "git@github.com:blocklet/create-blocklet.git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"typescript": "^5.7.2",
"vite": "^7.0.0",
"vite-node": "^3.2.4",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vite-plugin-require": "^1.2.14",
"vite-plugin-svgr": "^4.3.0",
"vite-tsconfig-paths": "^5.1.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"simple-git-hooks": "^2.11.1",
"tsx": "^4.19.3",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vite-plugin-svgr": "^4.3.0",
"zx": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/did-wallet-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"simple-git-hooks": "^2.11.1",
"vite": "^7.0.0",
"vite-node": "^3.2.4",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vite-plugin-require": "^1.2.14",
"vite-plugin-svgr": "^4.3.0",
"zx": "^8.3.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"tsx": "^4.19.3",
"typescript": "^5.7.3",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vite-plugin-svgr": "^4.3.0",
"zx": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/react-dapp-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"tsx": "^4.19.3",
"typescript": "^5.7.3",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vite-plugin-svgr": "^4.3.0",
"zx": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/react-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"simple-git-hooks": "^2.11.1",
"tsx": "^4.19.3",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vite-plugin-svgr": "^4.3.0",
"zx": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/react-gun-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"simple-git-hooks": "^2.11.1",
"tsx": "^4.19.3",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vite-plugin-svgr": "^4.3.0",
"zx": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/react-static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"rimraf": "^5.0.10",
"simple-git-hooks": "^2.11.1",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vite-plugin-svgr": "^4.3.0",
"zx": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/solidjs-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"simple-git-hooks": "^2.11.1",
"tsx": "^4.19.3",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vite-plugin-solid": "^2.11.7",
"zx": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/solidjs-static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"simple-git-hooks": "^2.11.1",
"solid-js": "^1.9.4",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vite-plugin-solid": "^2.11.7",
"zx": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/svelte-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"svelte": "^4.2.19",
"tsx": "^4.19.3",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"zx": "^8.3.2"
},
"lint-staged": {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/svelte-static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"simple-git-hooks": "^2.11.1",
"svelte": "^4.2.19",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"zx": "^8.3.2"
},
"lint-staged": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"tsx": "^4.19.3",
"typescript": "^5.7.3",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vite-plugin-svgr": "^4.3.0",
"zx": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/vue-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"simple-git-hooks": "^2.11.1",
"tsx": "^4.19.3",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vue": "^3.5.13",
"zx": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/vue-static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"rimraf": "^5.0.10",
"simple-git-hooks": "^2.11.1",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vue": "^3.5.13",
"zx": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/vue-ts-static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"taze": "^0.16.9",
"typescript": "^5.7.3",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vue-tsc": "^2.2.2",
"zx": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/vue2-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"simple-git-hooks": "^2.11.1",
"tsx": "^4.19.3",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vue": "^2.7.16",
"zx": "^8.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/vue2-static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"rimraf": "^5.0.10",
"simple-git-hooks": "^2.11.1",
"vite": "^7.0.0",
"vite-plugin-blocklet": "^0.14.1",
"vite-plugin-blocklet": "^0.14.2",
"vue": "^2.7.16",
"zx": "^8.3.2"
},
Expand Down
20 changes: 19 additions & 1 deletion plugins/vite-plugin-blocklet/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import { createDefu } from 'defu';

import createHmrPlugin from './libs/hmr.js';
import createConfigPlugin from './libs/config.js';
import createMetaPlugin from './libs/meta.js';
Expand Down Expand Up @@ -44,6 +46,14 @@ import setupClient from './libs/client.js';
* @property {number} [chunkSizeLimit=2000] - The chunk size limit in KB.
*/

const defuReplaceArray = createDefu((obj, key, value) => {
// 如果当前值或默认值是数组,直接使用新值(实现替换)
if (Array.isArray(obj[key]) || Array.isArray(value)) {
obj[key] = value
return true // 返回 true 表示我们已经处理了这个 key,defu 不需要再做默认处理
}
})

/**
* Create blocklet plugins.
*
Expand Down Expand Up @@ -79,7 +89,15 @@ export function createBlockletPlugin(options = {}) {
plugins.push(createHmrPlugin(restOptions));
}
if (!disableNodePolyfills) {
plugins.push(nodePolyfills(nodePolyfillsOptions));
const mergedOptions = defuReplaceArray(nodePolyfillsOptions, {
include: ['buffer'],
globals: {
buffer: true,
global: false,
process: false,
}
});
plugins.push(nodePolyfills(mergedOptions));
}
if (!disableLoading) {
plugins.push(createLoadingPlugin(restOptions));
Expand Down
3 changes: 2 additions & 1 deletion plugins/vite-plugin-blocklet/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vite-plugin-blocklet",
"type": "module",
"version": "0.14.1",
"version": "0.14.2",
"description": "",
"main": "index.js",
"files": [
Expand Down Expand Up @@ -33,6 +33,7 @@
"@arcblock/did": "^1.28.0",
"@ocap/mcrypto": "^1.28.0",
"@ocap/util": "^1.28.0",
"defu": "^6.1.4",
"get-port": "^5.1.1",
"http-proxy-middleware": "^3.0.3",
"ismobilejs": "^1.1.1",
Expand Down
2 changes: 1 addition & 1 deletion plugins/vite-plugin-wss-hmr/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vite-plugin-wss-hmr",
"type": "module",
"version": "0.14.1",
"version": "0.14.2",
"description": "",
"main": "index.js",
"exports": {
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.14.1
0.14.2
2 changes: 1 addition & 1 deletion website/docs/blocklet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository:
type: git
url: git+https://github.com/blocklet/create-blocklet.git
specVersion: 1.2.8
version: 0.14.1
version: 0.14.2
logo: logo.png
files:
- logo.png
Expand Down
2 changes: 1 addition & 1 deletion website/pages/blocklet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository:
type: git
url: git+https://github.com/blocklet/create-blocklet.git
specVersion: 1.2.8
version: 0.14.1
version: 0.14.2
logo: logo.png
files:
- logo.png
Expand Down
Loading