Skip to content

Commit

Permalink
feat(vite-plugin-blocklet): vite hmr use same port with blocklet url (#…
Browse files Browse the repository at this point in the history
…327)

* feat(vite-plugin-blocklet): vite hmr use same port with blocklet url

* fix(create-app): fix monorepo create should create multi did

* chore(deps): update deps

* chore(release): v0.8.2
  • Loading branch information
LancelotLewis authored Jul 4, 2024
1 parent 447201a commit 8c7389f
Show file tree
Hide file tree
Showing 28 changed files with 176 additions and 107 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.8.2 (2024-7-4)

- fix(create-app): fix monorepo create should create multi did
- feat(vite-plugin-blocklet): vite hmr use same port with blocklet url

## 0.8.1 (2024-6-30)

- fix(template): fix lint error
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "create-blocklet",
"private": true,
"version": "0.8.1",
"version": "0.8.2",
"description": "",
"keywords": [],
"author": "",
Expand All @@ -11,7 +11,7 @@
"debug": "node packages/create-app/index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"bump-version": "zx --quiet scripts/bump-version.mjs",
"update:deps": "pnpm -r exec npx taze -r -n '/arcblock|ocap|abtnode|blocklet|did-connect|did-comment|nedb/' -w",
"update:deps": "npx taze -r -n '/arcblock|ocap|abtnode|blocklet|did-connect|did-comment|nedb/' -w",
"preinstall": "npx only-allow pnpm",
"publish-plugins": "zx --quiet scripts/publish-plugins.mjs"
},
Expand Down
9 changes: 4 additions & 5 deletions packages/create-app/lib/did.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,19 @@ export function toDidIcon(did, size = 200, isPng = false) {

export async function getBlockletDidList(monikerList = [], connectUrl = '') {
try {
let command = `${BLOCKLET_COMMAND} init`;
const commandArgs = ['init'];
if (monikerList.length > 0) {
command += ` --monikers=${monikerList.join(',')}`;
commandArgs.push(`--monikers=${monikerList.join(',')}`);
} else {
return [];
}

if (connectUrl) {
// eslint-disable-next-line no-unused-vars
command += ` --connectUrl=${connectUrl}`;
commandArgs.push(`--connectUrl=${connectUrl}`);
}
const runCommand = new Promise((resolve, reject) => {
let lastMessage = '';
const childProcess = spawn('blocklet', ['init', '--monikers=react-dapp']);
const childProcess = spawn(BLOCKLET_COMMAND, commandArgs);
const spinner = ora().start();
childProcess.stdout.on('data', (data) => {
const message = data.toString('utf8') || '';
Expand Down
8 changes: 4 additions & 4 deletions packages/create-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-blocklet",
"version": "0.8.1",
"version": "0.8.2",
"exports": "./index.js",
"type": "module",
"repository": "git@github.com:blocklet/create-blocklet.git",
Expand Down Expand Up @@ -29,9 +29,9 @@
"test:run": "vitest run"
},
"dependencies": {
"@arcblock/did": "^1.18.124",
"@ocap/mcrypto": "^1.18.124",
"@ocap/util": "^1.18.124",
"@arcblock/did": "^1.18.126",
"@ocap/mcrypto": "^1.18.126",
"@ocap/util": "^1.18.126",
"boxen": "^7.1.1",
"ejs": "^3.1.10",
"envfile": "^7.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/express-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dependencies": {
"@arcblock/did-auth-storage-nedb": "^1.7.1",
"@blocklet/sdk": "^1.16.28",
"@ocap/client": "^1.18.124",
"@ocap/client": "^1.18.126",
"dotenv-flow": "^4.1.0",
"express": "^4.19.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/templates/nestjs-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@nestjs/common": "^10.3.9",
"@nestjs/core": "^10.3.9",
"@nestjs/platform-express": "^10.3.9",
"@ocap/client": "^1.18.124",
"@ocap/client": "^1.18.126",
"dotenv-flow": "^4.1.0",
"express": "^4.19.2",
"reflect-metadata": "^0.2.2",
Expand Down
8 changes: 4 additions & 4 deletions packages/create-app/templates/nextjs-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
]
},
"dependencies": {
"@arcblock/did-auth": "^1.18.124",
"@arcblock/did-auth": "^1.18.126",
"@arcblock/did-auth-storage-nedb": "^1.7.1",
"@blocklet/sdk": "^1.16.28",
"@ocap/client": "^1.18.124",
"@ocap/mcrypto": "^1.18.124",
"@ocap/wallet": "^1.18.124",
"@ocap/client": "^1.18.126",
"@ocap/mcrypto": "^1.18.126",
"@ocap/wallet": "^1.18.126",
"dotenv-flow": "^4.1.0",
"express": "^4.19.2",
"next": "14.2.4",
Expand Down
10 changes: 5 additions & 5 deletions packages/create-app/templates/react-dapp-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
]
},
"dependencies": {
"@arcblock/did-auth": "^1.18.124",
"@arcblock/did-auth": "^1.18.126",
"@arcblock/did-auth-storage-nedb": "^1.7.1",
"@blocklet/sdk": "^1.16.28",
"@ocap/client": "^1.18.124",
"@ocap/mcrypto": "^1.18.124",
"@ocap/wallet": "^1.18.124",
"@ocap/client": "^1.18.126",
"@ocap/mcrypto": "^1.18.126",
"@ocap/wallet": "^1.18.126",
"axios": "^1.7.2",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
Expand Down Expand Up @@ -79,7 +79,7 @@
"ts-node": "^10.9.2",
"typescript": "^5.5.2",
"vite": "^5.3.2",
"vite-plugin-blocklet": "^0.8.1",
"vite-plugin-blocklet": "^0.8.2",
"vite-plugin-svgr": "^4.2.0",
"zx": "^8.1.3"
},
Expand Down
12 changes: 6 additions & 6 deletions packages/create-app/templates/react-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
]
},
"dependencies": {
"@arcblock/did-auth": "^1.18.124",
"@arcblock/did-auth": "^1.18.126",
"@arcblock/did-auth-storage-nedb": "^1.7.1",
"@blocklet/sdk": "^1.16.28",
"@ocap/client": "^1.18.124",
"@ocap/mcrypto": "^1.18.124",
"@ocap/wallet": "^1.18.124",
"@ocap/client": "^1.18.126",
"@ocap/mcrypto": "^1.18.126",
"@ocap/wallet": "^1.18.126",
"axios": "^1.7.2",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
Expand All @@ -63,13 +63,13 @@
"nodemon": "^3.1.4",
"npm-run-all": "^4.1.5",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.24.0",
"rimraf": "^5.0.7",
"simple-git-hooks": "^2.11.1",
"vite": "^5.3.2",
"vite-plugin-blocklet": "^0.8.1",
"vite-plugin-blocklet": "^0.8.2",
"vite-plugin-svgr": "^4.2.0",
"zx": "^8.1.3"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/create-app/templates/react-gun-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
]
},
"dependencies": {
"@arcblock/did-auth": "^1.18.124",
"@arcblock/did-auth": "^1.18.126",
"@arcblock/did-auth-storage-nedb": "^1.7.1",
"@blocklet/sdk": "^1.16.28",
"@ocap/client": "^1.18.124",
"@ocap/mcrypto": "^1.18.124",
"@ocap/wallet": "^1.18.124",
"@ocap/client": "^1.18.126",
"@ocap/mcrypto": "^1.18.126",
"@ocap/wallet": "^1.18.126",
"axios": "^1.7.2",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
Expand All @@ -69,7 +69,7 @@
"rimraf": "^5.0.7",
"simple-git-hooks": "^2.11.1",
"vite": "^5.3.2",
"vite-plugin-blocklet": "^0.8.1",
"vite-plugin-blocklet": "^0.8.2",
"vite-plugin-svgr": "^4.2.0",
"zx": "^8.1.3"
},
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 @@ -51,7 +51,7 @@
"rimraf": "^5.0.7",
"simple-git-hooks": "^2.11.1",
"vite": "^5.3.2",
"vite-plugin-blocklet": "^0.8.1",
"vite-plugin-blocklet": "^0.8.2",
"vite-plugin-svgr": "^4.2.0",
"zx": "^8.1.3"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/create-app/templates/solidjs-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
"rimraf": "^5.0.7",
"simple-git-hooks": "^2.11.1",
"vite": "^5.3.2",
"vite-plugin-blocklet": "^0.8.1",
"vite-plugin-blocklet": "^0.8.2",
"vite-plugin-solid": "^2.10.2",
"zx": "^8.1.3"
},
"dependencies": {
"@arcblock/did-auth": "^1.18.124",
"@arcblock/did-auth": "^1.18.126",
"@arcblock/did-auth-storage-nedb": "^1.7.1",
"@blocklet/sdk": "^1.16.28",
"@ocap/client": "^1.18.124",
"@ocap/mcrypto": "^1.18.124",
"@ocap/wallet": "^1.18.124",
"@ocap/client": "^1.18.126",
"@ocap/mcrypto": "^1.18.126",
"@ocap/wallet": "^1.18.126",
"axios": "^1.7.2",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
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 @@ -30,7 +30,7 @@
"simple-git-hooks": "^2.11.1",
"solid-js": "^1.8.18",
"vite": "^5.3.2",
"vite-plugin-blocklet": "^0.8.1",
"vite-plugin-blocklet": "^0.8.2",
"vite-plugin-solid": "^2.10.2",
"zx": "^8.1.3"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/create-app/templates/svelte-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"bump-version": "zx --quiet scripts/bump-version.mjs"
},
"dependencies": {
"@arcblock/did-auth": "^1.18.124",
"@arcblock/did-auth": "^1.18.126",
"@arcblock/did-auth-storage-nedb": "^1.7.1",
"@blocklet/sdk": "^1.16.28",
"@ocap/client": "^1.18.124",
"@ocap/mcrypto": "^1.18.124",
"@ocap/wallet": "^1.18.124",
"@ocap/client": "^1.18.126",
"@ocap/mcrypto": "^1.18.126",
"@ocap/wallet": "^1.18.126",
"axios": "^1.7.2",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
Expand All @@ -43,7 +43,7 @@
"simple-git-hooks": "^2.11.1",
"svelte": "^4.2.18",
"vite": "^5.3.2",
"vite-plugin-blocklet": "^0.8.1",
"vite-plugin-blocklet": "^0.8.2",
"zx": "^8.1.3"
},
"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 @@ -24,7 +24,7 @@
"simple-git-hooks": "^2.11.1",
"svelte": "^4.2.18",
"vite": "^5.3.2",
"vite-plugin-blocklet": "^0.8.1",
"vite-plugin-blocklet": "^0.8.2",
"zx": "^8.1.3"
},
"lint-staged": {
Expand Down
10 changes: 5 additions & 5 deletions packages/create-app/templates/todo-list-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
]
},
"dependencies": {
"@arcblock/did-auth": "^1.18.124",
"@arcblock/did-auth": "^1.18.126",
"@arcblock/did-auth-storage-nedb": "^1.7.1",
"@blocklet/sdk": "^1.16.28",
"@did-space/client": "^0.5.4",
"@did-space/core": "^0.5.4",
"@ocap/client": "^1.18.124",
"@ocap/mcrypto": "^1.18.124",
"@ocap/wallet": "^1.18.124",
"@ocap/client": "^1.18.126",
"@ocap/mcrypto": "^1.18.126",
"@ocap/wallet": "^1.18.126",
"axios": "^1.7.2",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
Expand Down Expand Up @@ -91,7 +91,7 @@
"ts-node": "^10.9.2",
"typescript": "^5.5.2",
"vite": "^5.3.2",
"vite-plugin-blocklet": "^0.8.1",
"vite-plugin-blocklet": "^0.8.2",
"vite-plugin-svgr": "^4.2.0",
"zx": "^8.1.3"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/create-app/templates/vue-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"bump-version": "zx --quiet scripts/bump-version.mjs"
},
"dependencies": {
"@arcblock/did-auth": "^1.18.124",
"@arcblock/did-auth": "^1.18.126",
"@arcblock/did-auth-storage-nedb": "^1.7.1",
"@blocklet/sdk": "^1.16.28",
"@ocap/client": "^1.18.124",
"@ocap/mcrypto": "^1.18.124",
"@ocap/wallet": "^1.18.124",
"@ocap/client": "^1.18.126",
"@ocap/mcrypto": "^1.18.126",
"@ocap/wallet": "^1.18.126",
"axios": "^1.7.2",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
Expand All @@ -47,7 +47,7 @@
"rimraf": "^5.0.7",
"simple-git-hooks": "^2.11.1",
"vite": "^5.3.2",
"vite-plugin-blocklet": "^0.8.1",
"vite-plugin-blocklet": "^0.8.2",
"vue": "^3.4.31",
"zx": "^8.1.3"
},
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 @@ -28,7 +28,7 @@
"rimraf": "^5.0.7",
"simple-git-hooks": "^2.11.1",
"vite": "^5.3.2",
"vite-plugin-blocklet": "^0.8.1",
"vite-plugin-blocklet": "^0.8.2",
"vue": "^3.4.31",
"zx": "^8.1.3"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/create-app/templates/vue2-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"bump-version": "zx --quiet scripts/bump-version.mjs"
},
"dependencies": {
"@arcblock/did-auth": "^1.18.124",
"@arcblock/did-auth": "^1.18.126",
"@arcblock/did-auth-storage-nedb": "^1.7.1",
"@blocklet/sdk": "^1.16.28",
"@ocap/client": "^1.18.124",
"@ocap/mcrypto": "^1.18.124",
"@ocap/wallet": "^1.18.124",
"@ocap/client": "^1.18.126",
"@ocap/mcrypto": "^1.18.126",
"@ocap/wallet": "^1.18.126",
"axios": "^1.7.2",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
Expand All @@ -46,7 +46,7 @@
"rimraf": "^5.0.7",
"simple-git-hooks": "^2.11.1",
"vite": "^5.3.2",
"vite-plugin-blocklet": "^0.8.1",
"vite-plugin-blocklet": "^0.8.2",
"vue": "^2.7.16",
"zx": "^8.1.3"
},
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 @@ -28,7 +28,7 @@
"rimraf": "^5.0.7",
"simple-git-hooks": "^2.11.1",
"vite": "^5.3.2",
"vite-plugin-blocklet": "^0.8.1",
"vite-plugin-blocklet": "^0.8.2",
"vue": "^2.7.16",
"zx": "^8.1.3"
},
Expand Down
Loading

0 comments on commit 8c7389f

Please sign in to comment.