From 336ac66730a0c2c1ac65ea63533d8f9c09760eb0 Mon Sep 17 00:00:00 2001 From: zhang han Date: Mon, 30 Sep 2024 16:45:45 +0800 Subject: [PATCH] chore(create-blocklet): use middlewares.session replace middlewares.user (#368) --- CHANGELOG.md | 5 +++++ package.json | 2 +- packages/create-app/package.json | 2 +- .../create-app/templates/did-connect-dapp/package.json | 7 ++++--- .../templates/did-wallet-dapp/api/routes/user.js | 4 ++-- packages/create-app/templates/did-wallet-dapp/package.json | 6 +++--- packages/create-app/templates/express-api/package.json | 2 +- packages/create-app/templates/html-static/package.json | 2 +- packages/create-app/templates/monorepo/package.json | 2 +- packages/create-app/templates/nestjs-api/package.json | 2 +- .../create-app/templates/nextjs-dapp/api/routes/index.js | 4 ++-- packages/create-app/templates/nextjs-dapp/package.json | 2 +- .../templates/react-dapp-ts/api/src/routes/index.ts | 4 ++-- packages/create-app/templates/react-dapp-ts/package.json | 6 +++--- .../create-app/templates/react-dapp/api/routes/index.js | 4 ++-- packages/create-app/templates/react-dapp/package.json | 6 +++--- .../templates/react-gun-dapp/api/routes/index.js | 4 ++-- packages/create-app/templates/react-gun-dapp/package.json | 6 +++--- packages/create-app/templates/react-static/package.json | 6 +++--- .../create-app/templates/solidjs-dapp/api/routes/index.js | 4 ++-- packages/create-app/templates/solidjs-dapp/package.json | 4 ++-- packages/create-app/templates/solidjs-static/package.json | 4 ++-- .../create-app/templates/svelte-dapp/api/routes/index.js | 4 ++-- packages/create-app/templates/svelte-dapp/package.json | 4 ++-- packages/create-app/templates/svelte-static/package.json | 4 ++-- .../templates/todo-list-example/api/src/routes/index.ts | 6 +++--- .../todo-list-example/api/src/routes/todo-list/index.ts | 6 +++--- .../create-app/templates/todo-list-example/package.json | 6 +++--- packages/create-app/templates/vue-dapp/api/routes/index.js | 4 ++-- packages/create-app/templates/vue-dapp/package.json | 4 ++-- packages/create-app/templates/vue-static/package.json | 4 ++-- packages/create-app/templates/vue-ts-static/package.json | 4 ++-- .../create-app/templates/vue2-dapp/api/routes/index.js | 4 ++-- packages/create-app/templates/vue2-dapp/package.json | 4 ++-- packages/create-app/templates/vue2-static/package.json | 4 ++-- plugins/vite-plugin-blocklet/package.json | 2 +- plugins/vite-plugin-wss-hmr/package.json | 2 +- version | 2 +- website/docs/blocklet.yml | 2 +- website/pages/blocklet.yml | 2 +- 40 files changed, 81 insertions(+), 75 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 758f6a71..fd179484 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.9.11 (2024-9-30) + +- chore(deps): update deps +- chore(create-blocklet): use middlewares.session replace middlewares.user + ## 0.9.10 (2024-9-29) - chore(create-blocklet): use onConnect in did-connect-dapp diff --git a/package.json b/package.json index 5e0cd90f..2522b7b6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "create-blocklet", "private": true, - "version": "0.9.10", + "version": "0.9.11", "description": "", "keywords": [], "author": "", diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 130e01ca..c8bb2ed8 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,6 +1,6 @@ { "name": "create-blocklet", - "version": "0.9.10", + "version": "0.9.11", "exports": "./index.js", "type": "module", "repository": "git@github.com:blocklet/create-blocklet.git", diff --git a/packages/create-app/templates/did-connect-dapp/package.json b/packages/create-app/templates/did-connect-dapp/package.json index 146ef52c..ad6761ae 100644 --- a/packages/create-app/templates/did-connect-dapp/package.json +++ b/packages/create-app/templates/did-connect-dapp/package.json @@ -63,8 +63,8 @@ "@iconify/react": "^5.0.2", "@mui/material": "^5.16.7", "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "@vitejs/plugin-react": "^4.3.1", - "bumpp": "^9.5.2", + "@vitejs/plugin-react": "^4.3.2", + "bumpp": "^9.6.1", "cross-env": "^7.0.3", "eslint": "^8.57.1", "flat": "^6.0.1", @@ -75,8 +75,9 @@ "react": "~18.2.0", "react-dom": "~18.2.0", "rimraf": "^5.0.10", + "simple-git-hooks": "^2.11.1", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "vite-plugin-svgr": "^4.2.0", "zx": "^8.1.8" }, diff --git a/packages/create-app/templates/did-wallet-dapp/api/routes/user.js b/packages/create-app/templates/did-wallet-dapp/api/routes/user.js index 8548ccc6..2bf782d5 100644 --- a/packages/create-app/templates/did-wallet-dapp/api/routes/user.js +++ b/packages/create-app/templates/did-wallet-dapp/api/routes/user.js @@ -5,8 +5,8 @@ const authClient = new AuthService(); module.exports = { init(app) { - // middleware.user() is used to get the user info from the session, see more: https://www.arcblock.io/docs/blocklet-developer/blocklet-sdk#session - app.get('/api/user', middlewares.user(), async (req, res) => { + // middlewares.session() is used to get the user info from the session, see more: https://www.arcblock.io/docs/blocklet-developer/blocklet-sdk#session + app.get('/api/user', middlewares.session(), async (req, res) => { if (!req.user) { res.json({ user: null }); return; diff --git a/packages/create-app/templates/did-wallet-dapp/package.json b/packages/create-app/templates/did-wallet-dapp/package.json index 6bb7a7dd..85db4d80 100644 --- a/packages/create-app/templates/did-wallet-dapp/package.json +++ b/packages/create-app/templates/did-wallet-dapp/package.json @@ -39,8 +39,8 @@ "@emotion/styled": "^11.13.0", "@mui/icons-material": "^5.16.7", "@mui/material": "^5.16.7", - "@vitejs/plugin-react": "^4.3.1", - "bumpp": "^9.5.2", + "@vitejs/plugin-react": "^4.3.2", + "bumpp": "^9.6.1", "dayjs": "^1.11.13", "dotenv-flow": "^4.1.0", "flat": "^6.0.1", @@ -52,7 +52,7 @@ "simple-git-hooks": "^2.11.1", "vite": "^5.4.8", "vite-node": "^2.1.1", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "vite-plugin-require": "^1.2.14", "vite-plugin-svgr": "^4.2.0", "zx": "^8.1.8" diff --git a/packages/create-app/templates/express-api/package.json b/packages/create-app/templates/express-api/package.json index b72f2b48..c0e9eff6 100644 --- a/packages/create-app/templates/express-api/package.json +++ b/packages/create-app/templates/express-api/package.json @@ -40,7 +40,7 @@ "devDependencies": { "@arcblock/eslint-config-base": "^0.3.2", "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "bumpp": "^9.5.2", + "bumpp": "^9.6.1", "eslint": "^8.57.1", "lint-staged": "^15.2.10", "nodemon": "^3.1.7", diff --git a/packages/create-app/templates/html-static/package.json b/packages/create-app/templates/html-static/package.json index 678c52af..e1ae15db 100644 --- a/packages/create-app/templates/html-static/package.json +++ b/packages/create-app/templates/html-static/package.json @@ -17,7 +17,7 @@ "license": "ISC", "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "bumpp": "^9.5.2", + "bumpp": "^9.6.1", "prettier": "^3.3.3", "rimraf": "^5.0.10", "zx": "^8.1.8" diff --git a/packages/create-app/templates/monorepo/package.json b/packages/create-app/templates/monorepo/package.json index 6747415b..826bb73d 100644 --- a/packages/create-app/templates/monorepo/package.json +++ b/packages/create-app/templates/monorepo/package.json @@ -21,7 +21,7 @@ "devDependencies": { "@arcblock/eslint-config": "^0.3.2", "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "bumpp": "^9.5.2", + "bumpp": "^9.6.1", "eslint": "^8.57.1", "prettier": "^3.3.3", "simple-git-hooks": "^2.11.1", diff --git a/packages/create-app/templates/nestjs-api/package.json b/packages/create-app/templates/nestjs-api/package.json index cd09a527..6efcdef9 100644 --- a/packages/create-app/templates/nestjs-api/package.json +++ b/packages/create-app/templates/nestjs-api/package.json @@ -55,7 +55,7 @@ "@types/node": "^20.16.10", "@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/parser": "^7.18.0", - "bumpp": "^9.5.2", + "bumpp": "^9.6.1", "eslint": "^8.57.1", "lint-staged": "^15.2.10", "nodemon": "^3.1.7", diff --git a/packages/create-app/templates/nextjs-dapp/api/routes/index.js b/packages/create-app/templates/nextjs-dapp/api/routes/index.js index 04f50432..4b8b21c3 100644 --- a/packages/create-app/templates/nextjs-dapp/api/routes/index.js +++ b/packages/create-app/templates/nextjs-dapp/api/routes/index.js @@ -1,6 +1,6 @@ -const middleware = require('@blocklet/sdk/lib/middlewares'); +const middlewares = require('@blocklet/sdk/lib/middlewares'); const router = require('express').Router(); -router.use('/user', middleware.user(), (req, res) => res.json(req.user || {})); +router.use('/user', middlewares.session(), (req, res) => res.json(req.user || {})); module.exports = router; diff --git a/packages/create-app/templates/nextjs-dapp/package.json b/packages/create-app/templates/nextjs-dapp/package.json index ab59b3b5..ab605280 100644 --- a/packages/create-app/templates/nextjs-dapp/package.json +++ b/packages/create-app/templates/nextjs-dapp/package.json @@ -41,7 +41,7 @@ "react-dom": "18.2.0" }, "devDependencies": { - "bumpp": "^9.5.2", + "bumpp": "^9.6.1", "eslint": "8.57.0", "eslint-config-next": "14.2.4", "lint-staged": "^15.2.10", diff --git a/packages/create-app/templates/react-dapp-ts/api/src/routes/index.ts b/packages/create-app/templates/react-dapp-ts/api/src/routes/index.ts index 54053bb8..2fe4d1de 100644 --- a/packages/create-app/templates/react-dapp-ts/api/src/routes/index.ts +++ b/packages/create-app/templates/react-dapp-ts/api/src/routes/index.ts @@ -1,9 +1,9 @@ -import middleware from '@blocklet/sdk/lib/middlewares'; +import middlewares from '@blocklet/sdk/lib/middlewares'; import { Router } from 'express'; const router = Router(); -router.use('/user', middleware.user(), (req, res) => res.json(req.user || {})); +router.use('/user', middlewares.session(), (req, res) => res.json(req.user || {})); router.use('/data', (_, res) => res.json({ diff --git a/packages/create-app/templates/react-dapp-ts/package.json b/packages/create-app/templates/react-dapp-ts/package.json index 6e31bea9..8bbdd9fd 100644 --- a/packages/create-app/templates/react-dapp-ts/package.json +++ b/packages/create-app/templates/react-dapp-ts/package.json @@ -63,8 +63,8 @@ "@types/node": "^20.16.10", "@types/react": "^18.3.10", "@types/react-dom": "^18.3.0", - "@vitejs/plugin-react": "^4.3.1", - "bumpp": "^9.5.2", + "@vitejs/plugin-react": "^4.3.2", + "bumpp": "^9.6.1", "cross-env": "^7.0.3", "eslint": "^8.57.1", "import-sort-style-module": "^6.0.0", @@ -81,7 +81,7 @@ "ts-node": "^10.9.2", "typescript": "^5.6.2", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "vite-plugin-svgr": "^4.2.0", "zx": "^8.1.8" }, diff --git a/packages/create-app/templates/react-dapp/api/routes/index.js b/packages/create-app/templates/react-dapp/api/routes/index.js index cf8fa991..7ee61328 100644 --- a/packages/create-app/templates/react-dapp/api/routes/index.js +++ b/packages/create-app/templates/react-dapp/api/routes/index.js @@ -1,7 +1,7 @@ -const middleware = require('@blocklet/sdk/lib/middlewares'); +const middlewares = require('@blocklet/sdk/lib/middlewaress'); const router = require('express').Router(); -router.use('/user', middleware.user(), (req, res) => res.json(req.user || {})); +router.use('/user', middlewares.session(), (req, res) => res.json(req.user || {})); router.use('/data', (req, res) => res.json({ diff --git a/packages/create-app/templates/react-dapp/package.json b/packages/create-app/templates/react-dapp/package.json index 88eef3da..5bc436c3 100644 --- a/packages/create-app/templates/react-dapp/package.json +++ b/packages/create-app/templates/react-dapp/package.json @@ -57,8 +57,8 @@ "@arcblock/eslint-config": "^0.3.2", "@blocklet/js-sdk": "^1.16.32", "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "@vitejs/plugin-react": "^4.3.1", - "bumpp": "^9.5.2", + "@vitejs/plugin-react": "^4.3.2", + "bumpp": "^9.6.1", "cross-env": "^7.0.3", "eslint": "^8.57.1", "lint-staged": "^15.2.10", @@ -71,7 +71,7 @@ "rimraf": "^5.0.10", "simple-git-hooks": "^2.11.1", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "vite-plugin-svgr": "^4.2.0", "zx": "^8.1.8" }, diff --git a/packages/create-app/templates/react-gun-dapp/api/routes/index.js b/packages/create-app/templates/react-gun-dapp/api/routes/index.js index 04f50432..a12a8b11 100644 --- a/packages/create-app/templates/react-gun-dapp/api/routes/index.js +++ b/packages/create-app/templates/react-gun-dapp/api/routes/index.js @@ -1,6 +1,6 @@ -const middleware = require('@blocklet/sdk/lib/middlewares'); +const middlewares = require('@blocklet/sdk/lib/middlewaress'); const router = require('express').Router(); -router.use('/user', middleware.user(), (req, res) => res.json(req.user || {})); +router.use('/user', middlewares.session(), (req, res) => res.json(req.user || {})); module.exports = router; diff --git a/packages/create-app/templates/react-gun-dapp/package.json b/packages/create-app/templates/react-gun-dapp/package.json index bb18652b..e21552a9 100644 --- a/packages/create-app/templates/react-gun-dapp/package.json +++ b/packages/create-app/templates/react-gun-dapp/package.json @@ -57,8 +57,8 @@ "devDependencies": { "@arcblock/eslint-config": "^0.3.2", "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "@vitejs/plugin-react": "^4.3.1", - "bumpp": "^9.5.2", + "@vitejs/plugin-react": "^4.3.2", + "bumpp": "^9.6.1", "cross-env": "^7.0.3", "eslint": "^8.57.1", "lint-staged": "^15.2.10", @@ -71,7 +71,7 @@ "rimraf": "^5.0.10", "simple-git-hooks": "^2.11.1", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "vite-plugin-svgr": "^4.2.0", "zx": "^8.1.8" }, diff --git a/packages/create-app/templates/react-static/package.json b/packages/create-app/templates/react-static/package.json index 14d529f5..c744c0ca 100644 --- a/packages/create-app/templates/react-static/package.json +++ b/packages/create-app/templates/react-static/package.json @@ -41,8 +41,8 @@ "devDependencies": { "@arcblock/eslint-config": "^0.3.2", "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "@vitejs/plugin-react": "^4.3.1", - "bumpp": "^9.5.2", + "@vitejs/plugin-react": "^4.3.2", + "bumpp": "^9.6.1", "eslint": "^8.57.1", "lint-staged": "^15.2.10", "prettier": "^3.3.3", @@ -52,7 +52,7 @@ "rimraf": "^5.0.10", "simple-git-hooks": "^2.11.1", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "vite-plugin-svgr": "^4.2.0", "zx": "^8.1.8" }, diff --git a/packages/create-app/templates/solidjs-dapp/api/routes/index.js b/packages/create-app/templates/solidjs-dapp/api/routes/index.js index cf8fa991..fc604e80 100644 --- a/packages/create-app/templates/solidjs-dapp/api/routes/index.js +++ b/packages/create-app/templates/solidjs-dapp/api/routes/index.js @@ -1,7 +1,7 @@ -const middleware = require('@blocklet/sdk/lib/middlewares'); +const middlewares = require('@blocklet/sdk/lib/middlewares'); const router = require('express').Router(); -router.use('/user', middleware.user(), (req, res) => res.json(req.user || {})); +router.use('/user', middlewares.session(), (req, res) => res.json(req.user || {})); router.use('/data', (req, res) => res.json({ diff --git a/packages/create-app/templates/solidjs-dapp/package.json b/packages/create-app/templates/solidjs-dapp/package.json index ff493ed5..6d0560e7 100644 --- a/packages/create-app/templates/solidjs-dapp/package.json +++ b/packages/create-app/templates/solidjs-dapp/package.json @@ -23,7 +23,7 @@ "devDependencies": { "@blocklet/js-sdk": "^1.16.32", "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "bumpp": "^9.5.2", + "bumpp": "^9.6.1", "cross-env": "^7.0.3", "eslint": "^8.57.1", "eslint-config-prettier": "^9.1.0", @@ -36,7 +36,7 @@ "rimraf": "^5.0.10", "simple-git-hooks": "^2.11.1", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "vite-plugin-solid": "^2.10.2", "zx": "^8.1.8" }, diff --git a/packages/create-app/templates/solidjs-static/package.json b/packages/create-app/templates/solidjs-static/package.json index fde496f0..39e7a072 100644 --- a/packages/create-app/templates/solidjs-static/package.json +++ b/packages/create-app/templates/solidjs-static/package.json @@ -21,7 +21,7 @@ "license": "MIT", "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "bumpp": "^9.5.2", + "bumpp": "^9.6.1", "eslint": "^8.57.1", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", @@ -32,7 +32,7 @@ "simple-git-hooks": "^2.11.1", "solid-js": "^1.9.1", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "vite-plugin-solid": "^2.10.2", "zx": "^8.1.8" }, diff --git a/packages/create-app/templates/svelte-dapp/api/routes/index.js b/packages/create-app/templates/svelte-dapp/api/routes/index.js index cf8fa991..fc604e80 100644 --- a/packages/create-app/templates/svelte-dapp/api/routes/index.js +++ b/packages/create-app/templates/svelte-dapp/api/routes/index.js @@ -1,7 +1,7 @@ -const middleware = require('@blocklet/sdk/lib/middlewares'); +const middlewares = require('@blocklet/sdk/lib/middlewares'); const router = require('express').Router(); -router.use('/user', middleware.user(), (req, res) => res.json(req.user || {})); +router.use('/user', middlewares.session(), (req, res) => res.json(req.user || {})); router.use('/data', (req, res) => res.json({ diff --git a/packages/create-app/templates/svelte-dapp/package.json b/packages/create-app/templates/svelte-dapp/package.json index e044d5b3..40147ea0 100644 --- a/packages/create-app/templates/svelte-dapp/package.json +++ b/packages/create-app/templates/svelte-dapp/package.json @@ -34,7 +34,7 @@ "@blocklet/js-sdk": "^1.16.32", "@sveltejs/vite-plugin-svelte": "3.1.1", "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "bumpp": "^9.5.2", + "bumpp": "^9.6.1", "cross-env": "^7.0.3", "lint-staged": "^15.2.10", "npm-run-all": "^4.1.5", @@ -44,7 +44,7 @@ "simple-git-hooks": "^2.11.1", "svelte": "^4.2.19", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "zx": "^8.1.8" }, "lint-staged": { diff --git a/packages/create-app/templates/svelte-static/package.json b/packages/create-app/templates/svelte-static/package.json index 4630052f..d38a3eaa 100644 --- a/packages/create-app/templates/svelte-static/package.json +++ b/packages/create-app/templates/svelte-static/package.json @@ -17,7 +17,7 @@ }, "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "bumpp": "^9.5.2", + "bumpp": "^9.6.1", "lint-staged": "^15.2.10", "prettier": "^3.3.3", "prettier-plugin-svelte": "^3.2.7", @@ -25,7 +25,7 @@ "simple-git-hooks": "^2.11.1", "svelte": "^4.2.19", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "zx": "^8.1.8" }, "lint-staged": { diff --git a/packages/create-app/templates/todo-list-example/api/src/routes/index.ts b/packages/create-app/templates/todo-list-example/api/src/routes/index.ts index 90968791..ef03e5a5 100644 --- a/packages/create-app/templates/todo-list-example/api/src/routes/index.ts +++ b/packages/create-app/templates/todo-list-example/api/src/routes/index.ts @@ -1,11 +1,11 @@ -import middleware from '@blocklet/sdk/lib/middlewares'; +import middlewares from '@blocklet/sdk/lib/middlewares'; import { Router } from 'express'; import todoListRouter from './todo-list'; const router = Router(); -router.use('/user', middleware.user(), (req, res) => res.json(req.user || {})); -router.use('/todo-list', middleware.user(), todoListRouter); +router.use('/user', middlewares.session(), (req, res) => res.json(req.user || {})); +router.use('/todo-list', middlewares.session(), todoListRouter); export default router; diff --git a/packages/create-app/templates/todo-list-example/api/src/routes/todo-list/index.ts b/packages/create-app/templates/todo-list-example/api/src/routes/todo-list/index.ts index 5767bd51..7f7986ec 100644 --- a/packages/create-app/templates/todo-list-example/api/src/routes/todo-list/index.ts +++ b/packages/create-app/templates/todo-list-example/api/src/routes/todo-list/index.ts @@ -1,4 +1,4 @@ -import middleware from '@blocklet/sdk/lib/middlewares'; +import middlewares from '@blocklet/sdk/lib/middlewares'; import { Router } from 'express'; import $get from './$get'; @@ -7,7 +7,7 @@ import $put from './$put'; const todoListRouter = Router(); // Step 2: the function of reading and writing DID Space is implemented -todoListRouter.get('/', middleware.user(), $get); -todoListRouter.put('/', middleware.user(), $put); +todoListRouter.get('/', middlewares.session(), $get); +todoListRouter.put('/', middlewares.session(), $put); export default todoListRouter; diff --git a/packages/create-app/templates/todo-list-example/package.json b/packages/create-app/templates/todo-list-example/package.json index 90c65c31..526caab8 100644 --- a/packages/create-app/templates/todo-list-example/package.json +++ b/packages/create-app/templates/todo-list-example/package.json @@ -76,8 +76,8 @@ "@types/react": "^18.3.10", "@types/react-dom": "^18.3.0", "@types/react-toastify": "^4.1.0", - "@vitejs/plugin-react": "^4.3.1", - "bumpp": "^9.5.2", + "@vitejs/plugin-react": "^4.3.2", + "bumpp": "^9.6.1", "cross-env": "^7.0.3", "eslint": "^8.57.1", "eslint-plugin-prettier": "^5.2.1", @@ -96,7 +96,7 @@ "ts-node": "^10.9.2", "typescript": "^5.6.2", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "vite-plugin-svgr": "^4.2.0", "zx": "^8.1.8" }, diff --git a/packages/create-app/templates/vue-dapp/api/routes/index.js b/packages/create-app/templates/vue-dapp/api/routes/index.js index cf8fa991..fc604e80 100644 --- a/packages/create-app/templates/vue-dapp/api/routes/index.js +++ b/packages/create-app/templates/vue-dapp/api/routes/index.js @@ -1,7 +1,7 @@ -const middleware = require('@blocklet/sdk/lib/middlewares'); +const middlewares = require('@blocklet/sdk/lib/middlewares'); const router = require('express').Router(); -router.use('/user', middleware.user(), (req, res) => res.json(req.user || {})); +router.use('/user', middlewares.session(), (req, res) => res.json(req.user || {})); router.use('/data', (req, res) => res.json({ diff --git a/packages/create-app/templates/vue-dapp/package.json b/packages/create-app/templates/vue-dapp/package.json index f3c6170c..6604e290 100644 --- a/packages/create-app/templates/vue-dapp/package.json +++ b/packages/create-app/templates/vue-dapp/package.json @@ -36,7 +36,7 @@ "@blocklet/js-sdk": "^1.16.32", "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@vitejs/plugin-vue": "^5.1.4", - "bumpp": "^9.5.2", + "bumpp": "^9.6.1", "cross-env": "^7.0.3", "eslint": "^8.57.1", "eslint-config-prettier": "^9.1.0", @@ -49,7 +49,7 @@ "rimraf": "^5.0.10", "simple-git-hooks": "^2.11.1", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "vue": "^3.5.10", "zx": "^8.1.8" }, diff --git a/packages/create-app/templates/vue-static/package.json b/packages/create-app/templates/vue-static/package.json index 264c2b0b..e49103de 100644 --- a/packages/create-app/templates/vue-static/package.json +++ b/packages/create-app/templates/vue-static/package.json @@ -20,7 +20,7 @@ "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@vitejs/plugin-vue": "^5.1.4", - "bumpp": "^9.5.2", + "bumpp": "^9.6.1", "eslint": "^8.57.1", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", @@ -30,7 +30,7 @@ "rimraf": "^5.0.10", "simple-git-hooks": "^2.11.1", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "vue": "^3.5.10", "zx": "^8.1.8" }, diff --git a/packages/create-app/templates/vue-ts-static/package.json b/packages/create-app/templates/vue-ts-static/package.json index b7201be0..8c75bd9e 100644 --- a/packages/create-app/templates/vue-ts-static/package.json +++ b/packages/create-app/templates/vue-ts-static/package.json @@ -30,7 +30,7 @@ "@antfu/eslint-config": "^2.27.3", "@blocklet/cli": "^1.16.32", "@vitejs/plugin-vue": "^5.1.4", - "bumpp": "^9.5.2", + "bumpp": "^9.6.1", "eslint": "9.5.0", "eslint-plugin-format": "^0.1.2", "lint-staged": "^15.2.10", @@ -39,7 +39,7 @@ "taze": "^0.16.9", "typescript": "^5.6.2", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "vue-tsc": "^2.1.6", "zx": "^8.1.8" }, diff --git a/packages/create-app/templates/vue2-dapp/api/routes/index.js b/packages/create-app/templates/vue2-dapp/api/routes/index.js index 04f50432..4b8b21c3 100644 --- a/packages/create-app/templates/vue2-dapp/api/routes/index.js +++ b/packages/create-app/templates/vue2-dapp/api/routes/index.js @@ -1,6 +1,6 @@ -const middleware = require('@blocklet/sdk/lib/middlewares'); +const middlewares = require('@blocklet/sdk/lib/middlewares'); const router = require('express').Router(); -router.use('/user', middleware.user(), (req, res) => res.json(req.user || {})); +router.use('/user', middlewares.session(), (req, res) => res.json(req.user || {})); module.exports = router; diff --git a/packages/create-app/templates/vue2-dapp/package.json b/packages/create-app/templates/vue2-dapp/package.json index 46c08e10..50494f66 100644 --- a/packages/create-app/templates/vue2-dapp/package.json +++ b/packages/create-app/templates/vue2-dapp/package.json @@ -35,7 +35,7 @@ "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@vitejs/plugin-vue2": "^2.3.1", - "bumpp": "^9.5.2", + "bumpp": "^9.6.1", "cross-env": "^7.0.3", "eslint": "^8.57.1", "eslint-config-prettier": "^9.1.0", @@ -48,7 +48,7 @@ "rimraf": "^5.0.10", "simple-git-hooks": "^2.11.1", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "vue": "^2.7.16", "zx": "^8.1.8" }, diff --git a/packages/create-app/templates/vue2-static/package.json b/packages/create-app/templates/vue2-static/package.json index cae69322..a3ef423c 100644 --- a/packages/create-app/templates/vue2-static/package.json +++ b/packages/create-app/templates/vue2-static/package.json @@ -20,7 +20,7 @@ "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@vitejs/plugin-vue2": "^2.3.1", - "bumpp": "^9.5.2", + "bumpp": "^9.6.1", "eslint": "^8.57.1", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", @@ -30,7 +30,7 @@ "rimraf": "^5.0.10", "simple-git-hooks": "^2.11.1", "vite": "^5.4.8", - "vite-plugin-blocklet": "^0.9.10", + "vite-plugin-blocklet": "^0.9.11", "vue": "^2.7.16", "zx": "^8.1.8" }, diff --git a/plugins/vite-plugin-blocklet/package.json b/plugins/vite-plugin-blocklet/package.json index c656e7d9..cc334b17 100644 --- a/plugins/vite-plugin-blocklet/package.json +++ b/plugins/vite-plugin-blocklet/package.json @@ -1,7 +1,7 @@ { "name": "vite-plugin-blocklet", "type": "module", - "version": "0.9.10", + "version": "0.9.11", "description": "", "main": "index.js", "files": [ diff --git a/plugins/vite-plugin-wss-hmr/package.json b/plugins/vite-plugin-wss-hmr/package.json index 366a671d..64a97fd1 100644 --- a/plugins/vite-plugin-wss-hmr/package.json +++ b/plugins/vite-plugin-wss-hmr/package.json @@ -1,7 +1,7 @@ { "name": "vite-plugin-wss-hmr", "type": "module", - "version": "0.9.10", + "version": "0.9.11", "description": "", "main": "index.js", "exports": { diff --git a/version b/version index ea8f4fd6..6889a311 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.9.10 \ No newline at end of file +0.9.11 \ No newline at end of file diff --git a/website/docs/blocklet.yml b/website/docs/blocklet.yml index 7dc31c96..61107a16 100644 --- a/website/docs/blocklet.yml +++ b/website/docs/blocklet.yml @@ -13,7 +13,7 @@ repository: type: git url: git+https://github.com/blocklet/create-blocklet.git specVersion: 1.2.8 -version: 0.9.10 +version: 0.9.11 logo: logo.png files: - logo.png diff --git a/website/pages/blocklet.yml b/website/pages/blocklet.yml index 16fd9b91..5fd4f735 100644 --- a/website/pages/blocklet.yml +++ b/website/pages/blocklet.yml @@ -13,7 +13,7 @@ repository: type: git url: git+https://github.com/blocklet/create-blocklet.git specVersion: 1.2.8 -version: 0.9.10 +version: 0.9.11 logo: logo.png files: - logo.png