create-blocklet 0.9.5 → 0.9.7

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.
Files changed (137) hide show
  1. package/common/.prettierrc +11 -1
  2. package/common/scripts/build-clean.mjs +0 -1
  3. package/common/scripts/bump-version.mjs +33 -29
  4. package/index.js +86 -10
  5. package/package.json +1 -1
  6. package/templates/base-readme.md +103 -0
  7. package/templates/did-connect-dapp/.eslintrc.js +4 -0
  8. package/templates/did-connect-dapp/README.md +143 -0
  9. package/templates/did-connect-dapp/api/dev.js +5 -0
  10. package/templates/did-connect-dapp/api/hooks/pre-start.js +33 -0
  11. package/templates/did-connect-dapp/api/index.js +48 -0
  12. package/templates/did-connect-dapp/api/libs/auth.js +25 -0
  13. package/templates/did-connect-dapp/api/libs/env.js +9 -0
  14. package/templates/did-connect-dapp/api/libs/logger.js +3 -0
  15. package/templates/did-connect-dapp/api/libs/utils.js +70 -0
  16. package/templates/did-connect-dapp/api/routes/auth/index.js +15 -0
  17. package/templates/did-connect-dapp/api/routes/auth/request-digest-signature.js +51 -0
  18. package/templates/did-connect-dapp/api/routes/auth/request-multiple-claims.js +52 -0
  19. package/templates/did-connect-dapp/api/routes/auth/request-multiple-steps.js +57 -0
  20. package/templates/did-connect-dapp/api/routes/auth/request-nft.js +82 -0
  21. package/templates/did-connect-dapp/api/routes/auth/request-payment.js +72 -0
  22. package/templates/did-connect-dapp/api/routes/auth/request-profile.js +25 -0
  23. package/templates/did-connect-dapp/api/routes/auth/request-text-signature.js +44 -0
  24. package/templates/did-connect-dapp/api/routes/auth/request-transaction-signature.js +62 -0
  25. package/templates/did-connect-dapp/blocklet.md +5 -0
  26. package/templates/did-connect-dapp/blocklet.yml +57 -0
  27. package/templates/did-connect-dapp/index.html +17 -0
  28. package/templates/did-connect-dapp/package.json +86 -0
  29. package/templates/did-connect-dapp/src/app.jsx +20 -0
  30. package/templates/did-connect-dapp/src/assets/get_wallet_en.png +0 -0
  31. package/templates/did-connect-dapp/src/assets/get_wallet_zh.png +0 -0
  32. package/templates/did-connect-dapp/src/components/connect-item.jsx +39 -0
  33. package/templates/did-connect-dapp/src/components/connects/request-digest-signature.jsx +45 -0
  34. package/templates/did-connect-dapp/src/components/connects/request-multiple-claims.jsx +55 -0
  35. package/templates/did-connect-dapp/src/components/connects/request-multiple-steps.jsx +54 -0
  36. package/templates/did-connect-dapp/src/components/connects/request-nft.jsx +75 -0
  37. package/templates/did-connect-dapp/src/components/connects/request-payment.jsx +82 -0
  38. package/templates/did-connect-dapp/src/components/connects/request-profile.jsx +72 -0
  39. package/templates/did-connect-dapp/src/components/connects/request-text-signature.jsx +44 -0
  40. package/templates/did-connect-dapp/src/components/connects/request-transaction-signature.jsx +44 -0
  41. package/templates/did-connect-dapp/src/components/info-row.jsx +39 -0
  42. package/templates/did-connect-dapp/src/components/layout.jsx +26 -0
  43. package/templates/did-connect-dapp/src/index.jsx +6 -0
  44. package/templates/did-connect-dapp/src/libs/session.js +11 -0
  45. package/templates/did-connect-dapp/src/libs/utils.js +4 -0
  46. package/templates/did-connect-dapp/src/locales/en.js +115 -0
  47. package/templates/did-connect-dapp/src/locales/index.js +5 -0
  48. package/templates/did-connect-dapp/src/locales/zh.js +115 -0
  49. package/templates/did-connect-dapp/src/pages/main.jsx +95 -0
  50. package/templates/did-connect-dapp/template-info.json +12 -0
  51. package/templates/did-connect-dapp/vite.config.mjs +11 -0
  52. package/templates/did-wallet-dapp/.eslintrc.js +7 -0
  53. package/templates/did-wallet-dapp/README.md +32 -0
  54. package/templates/did-wallet-dapp/api/dev.js +8 -0
  55. package/templates/did-wallet-dapp/api/functions/app.js +65 -0
  56. package/templates/did-wallet-dapp/api/index.js +13 -0
  57. package/templates/did-wallet-dapp/api/libs/constant.js +1 -0
  58. package/templates/did-wallet-dapp/api/routes/user.js +30 -0
  59. package/templates/did-wallet-dapp/blocklet.md +3 -0
  60. package/templates/did-wallet-dapp/blocklet.yml +58 -0
  61. package/templates/did-wallet-dapp/index.html +16 -0
  62. package/templates/did-wallet-dapp/package.json +84 -0
  63. package/templates/did-wallet-dapp/src/app.jsx +38 -0
  64. package/templates/did-wallet-dapp/src/assets/blocklet.svg +16 -0
  65. package/templates/did-wallet-dapp/src/assets/react.svg +1 -0
  66. package/templates/did-wallet-dapp/src/assets/vite.svg +1 -0
  67. package/templates/did-wallet-dapp/src/assets/wallet.png +0 -0
  68. package/templates/did-wallet-dapp/src/components/layout.jsx +28 -0
  69. package/templates/did-wallet-dapp/src/global.css +79 -0
  70. package/templates/did-wallet-dapp/src/index.jsx +6 -0
  71. package/templates/did-wallet-dapp/src/libs/api.js +7 -0
  72. package/templates/did-wallet-dapp/src/libs/session.js +13 -0
  73. package/templates/did-wallet-dapp/src/locales/en.js +13 -0
  74. package/templates/did-wallet-dapp/src/locales/index.js +4 -0
  75. package/templates/did-wallet-dapp/src/locales/zh.js +13 -0
  76. package/templates/did-wallet-dapp/src/pages/home/index.css +39 -0
  77. package/templates/did-wallet-dapp/src/pages/home/index.jsx +57 -0
  78. package/templates/did-wallet-dapp/src/pages/profile.jsx +136 -0
  79. package/templates/did-wallet-dapp/template-info.json +12 -0
  80. package/templates/did-wallet-dapp/vite.config.js +14 -0
  81. package/templates/did-wallet-dapp/vite.config.server.js +9 -0
  82. package/templates/express-api/README.md +2 -124
  83. package/templates/express-api/blocklet.yml +0 -1
  84. package/templates/express-api/package.json +9 -8
  85. package/templates/html-static/README.md +3 -125
  86. package/templates/html-static/blocklet.yml +0 -1
  87. package/templates/html-static/package.json +4 -3
  88. package/templates/monorepo/README.md +8 -8
  89. package/templates/monorepo/package.json +4 -3
  90. package/templates/monorepo/scripts/bump-version.mjs +36 -32
  91. package/templates/nestjs-api/README.md +2 -123
  92. package/templates/nestjs-api/blocklet.yml +0 -1
  93. package/templates/nestjs-api/package.json +16 -15
  94. package/templates/nextjs-dapp/README.md +2 -125
  95. package/templates/nextjs-dapp/blocklet.yml +0 -1
  96. package/templates/nextjs-dapp/package.json +7 -7
  97. package/templates/react-dapp/README.md +2 -124
  98. package/templates/react-dapp/blocklet.yml +0 -1
  99. package/templates/react-dapp/package.json +16 -15
  100. package/templates/react-dapp-ts/README.md +2 -125
  101. package/templates/react-dapp-ts/blocklet.yml +0 -1
  102. package/templates/react-dapp-ts/package.json +19 -18
  103. package/templates/react-gun-dapp/README.md +2 -125
  104. package/templates/react-gun-dapp/blocklet.yml +0 -1
  105. package/templates/react-gun-dapp/package.json +15 -14
  106. package/templates/react-static/README.md +2 -125
  107. package/templates/react-static/blocklet.yml +0 -1
  108. package/templates/react-static/package.json +11 -10
  109. package/templates/solidjs-dapp/README.md +2 -125
  110. package/templates/solidjs-dapp/blocklet.yml +0 -1
  111. package/templates/solidjs-dapp/package.json +14 -13
  112. package/templates/solidjs-static/README.md +2 -123
  113. package/templates/solidjs-static/blocklet.yml +0 -1
  114. package/templates/solidjs-static/package.json +9 -8
  115. package/templates/svelte-dapp/README.md +2 -124
  116. package/templates/svelte-dapp/blocklet.yml +0 -1
  117. package/templates/svelte-dapp/package.json +12 -11
  118. package/templates/svelte-static/README.md +2 -125
  119. package/templates/svelte-static/blocklet.yml +0 -1
  120. package/templates/svelte-static/package.json +8 -7
  121. package/templates/todo-list-example/blocklet.yml +0 -1
  122. package/templates/todo-list-example/package.json +11 -10
  123. package/templates/vue-dapp/README.md +2 -125
  124. package/templates/vue-dapp/blocklet.yml +0 -1
  125. package/templates/vue-dapp/package.json +16 -15
  126. package/templates/vue-static/README.md +2 -125
  127. package/templates/vue-static/blocklet.yml +0 -1
  128. package/templates/vue-static/package.json +11 -10
  129. package/templates/vue-ts-static/README.md +2 -124
  130. package/templates/vue-ts-static/blocklet.yml +1 -2
  131. package/templates/vue-ts-static/package.json +12 -12
  132. package/templates/vue2-dapp/README.md +2 -125
  133. package/templates/vue2-dapp/blocklet.yml +0 -1
  134. package/templates/vue2-dapp/package.json +13 -12
  135. package/templates/vue2-static/README.md +2 -125
  136. package/templates/vue2-static/blocklet.yml +0 -1
  137. package/templates/vue2-static/package.json +9 -8
@@ -1,10 +1,7 @@
1
- # Getting Started with Create Blocklet
2
-
3
- This project was bootstrapped with [Create Blocklet](https://github.com/blocklet/create-blocklet).
4
-
1
+ ## PROJECT_DESCRIPTION
5
2
  This blocklet is a dapp project, which means this is a full-stack application. It's contained both `api` and `client` code.
6
3
 
7
- ## File Structure
4
+ ## FILE_STRUCTURE
8
5
 
9
6
  - public/ - static files
10
7
  - favicon.ico - favicon
@@ -31,123 +28,3 @@ This blocklet is a dapp project, which means this is a full-stack application. I
31
28
  - package.json - Npm package file
32
29
  - README.md - A guide for this blocklet
33
30
  - version - Version file
34
-
35
- ## Development
36
-
37
- 1. Make sure you have [@blocklet/cli](https://www.npmjs.com/package/@blocklet/cli) installed
38
-
39
- Blocklet needs blocklet server as a dependency. So you need to install it first.
40
- `npm install -g @blocklet/cli`
41
- See details in [https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli](https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli)
42
-
43
- 2. Init blocklet server & start blocklet server
44
-
45
- Before starting an blocklet server, you need to init blocklet server.
46
- `blocklet server init --mode=debug`
47
- `blocklet server start`
48
- See details in [https://www.arcblock.io/docs/blocklet-developer/getting-started](https://www.arcblock.io/docs/blocklet-developer/getting-started)
49
-
50
- 3. Go to the project directory `cd [name]`
51
- 4. Install dependencies: `npm install` or `yarn`
52
- 5. Start development server: `blocklet dev`
53
-
54
- ## Bundle
55
-
56
- After developing a blocklet, you may need to bundle it. Use `npm run bundle` command.
57
-
58
- ## Deploy
59
-
60
- - If you want to deploy this blocklet to local blocklet server, you can use `blocklet deploy .blocklet/bundle` command(Make sure the blocklet is bundled before deployment).
61
- > Or you can simply use `npm run deploy` command.
62
- - If you want to deploy this blocklet to remote blocklet server, you can use the command below.
63
-
64
- ```shell
65
- blocklet deploy .blocklet/bundle --endpoint {your blocklet server url} --access-key {blocklet server access key} --access-secret {blocklet server access secret}
66
- ```
67
-
68
- > Make sure the blocklet is bundled before deployment.
69
-
70
- ## Upload to blocklet store
71
-
72
- - If you want to upload the blocklet to any store for other users to download and use, you can following the following instructions.
73
-
74
- Bump version at first.
75
-
76
- ```shell
77
- make bump-version
78
- ```
79
-
80
- Then config blocklet store url.
81
- You can use those store url in below.
82
-
83
- 1. [https://store.blocklet.dev/](https://store.blocklet.dev/)
84
- 2. [https://dev.store.blocklet.dev/](https://dev.store.blocklet.dev/)
85
- 3. A blocklet store started by yourself.
86
- > Make sure you have installed a `blocklet store` on your own blocklet server. Check it on here: [https://store.blocklet.dev/blocklet/z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ](https://store.blocklet.dev/blocklet/z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ)
87
-
88
- ```shell
89
- blocklet config set store {store url}
90
- ```
91
-
92
- Get a `accessToken` by using this command.
93
-
94
- > Why we need a `accessToken`?
95
- > A `accessToken` is genrate by blocklet store, which help us upload our blocklet to any store.
96
-
97
- Set `accessToken` to blocklet config
98
-
99
- ```shell
100
- blocklet config set accessToken {accessToken}
101
- ```
102
-
103
- Upload a new version to a store.
104
-
105
- > Make sure the blocklet is bundled before upload.
106
-
107
- ```shell
108
- blocklet upload
109
- ```
110
-
111
- Or you can simply use `npm run upload` command.
112
-
113
- - You also can upload a new version to a store by Github CI.
114
- Bump version at first.
115
-
116
- ```shell
117
- make bump-version
118
- ```
119
-
120
- Push your code to Github main/master branch, or make a pull request to the main/master branch.
121
- The CI workflow will automatically upload a new version to a store.
122
-
123
- ## Q & A
124
-
125
- 1. Q: How to change a blocklet's name?
126
-
127
- A: Change the `name` field in the `package.json` file, change the `name` field in the `blocklet.yml` file.
128
-
129
- You can also change the `title` field and `description` field in the `blocklet.yml` file.
130
-
131
- Run `blocklet meta` command, you will get a `did` config, copy the `did` value.
132
-
133
- Replace this command `"bundle:client": "PUBLIC_URL='/.blocklet/proxy/{did}' npm run build",` in `package.json`
134
-
135
- Replace `did` field in the `blocklet.yml`
136
-
137
- 2. Q: How to change a blocklet's logo?
138
-
139
- Change the `logo.png` file root folder.
140
-
141
- Or you can change the `logo` field in the `blocklet.yml` file.
142
-
143
- > Make sure you have added the logo path to the `blocklet.yml` file `files` field.
144
-
145
- ## Learn More
146
-
147
- - Full specification of `blocklet.yml`: [https://github.com/blocklet/blocklet-specification/blob/main/docs/meta.md](https://github.com/blocklet/blocklet-specification/blob/main/docs/meta.md)
148
- - Full document of Blocklet Server & blocklet development: [https://www.arcblock.io/docs/blocklet-developer](https://www.arcblock.io/docs/blocklet-developer)
149
-
150
- ## License
151
-
152
- The code is licensed under the Apache 2.0 license found in the
153
- [LICENSE](LICENSE) file.
@@ -1,4 +1,3 @@
1
- name: template-nextjs
2
1
  title: Blocklet Template Next.js
3
2
  description: A Blocklet DAPP blocklet
4
3
  keywords:
@@ -30,26 +30,26 @@
30
30
  "dependencies": {
31
31
  "@arcblock/did-auth": "^1.18.135",
32
32
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
33
- "@blocklet/sdk": "^1.16.30",
33
+ "@blocklet/sdk": "^1.16.31",
34
34
  "@ocap/client": "^1.18.135",
35
35
  "@ocap/mcrypto": "^1.18.135",
36
36
  "@ocap/wallet": "^1.18.135",
37
37
  "dotenv-flow": "^4.1.0",
38
- "express": "^4.19.2",
38
+ "express": "^4.21.0",
39
39
  "next": "14.2.4",
40
40
  "react": "18.2.0",
41
41
  "react-dom": "18.2.0"
42
42
  },
43
43
  "devDependencies": {
44
- "bumpp": "^9.4.1",
44
+ "bumpp": "^9.5.2",
45
45
  "eslint": "8.57.0",
46
46
  "eslint-config-next": "14.2.4",
47
- "lint-staged": "^15.2.7",
48
- "nodemon": "^3.1.4",
47
+ "lint-staged": "^15.2.10",
48
+ "nodemon": "^3.1.7",
49
49
  "npm-run-all": "^4.1.5",
50
- "rimraf": "^5.0.7",
50
+ "rimraf": "^5.0.10",
51
51
  "simple-git-hooks": "^2.11.1",
52
- "zx": "^8.1.4"
52
+ "zx": "^8.1.8"
53
53
  },
54
54
  "simple-git-hooks": {
55
55
  "pre-commit": "npx lint-staged"
@@ -1,10 +1,8 @@
1
- # Getting Started with Create Blocklet
2
-
3
- This project was bootstrapped with [Create Blocklet](https://github.com/blocklet/create-blocklet).
1
+ ## PROJECT_DESCRIPTION
4
2
 
5
3
  This blocklet is a dapp project, which means this is a full-stack application. It's contained both `server` and `client` code.
6
4
 
7
- ## File Structure
5
+ ## FILE_STRUCTURE
8
6
 
9
7
  - public/ - static files
10
8
  - favicon.ico - favicon
@@ -31,123 +29,3 @@ This blocklet is a dapp project, which means this is a full-stack application. I
31
29
  - package.json - Npm package file
32
30
  - README.md - A guide for this blocklet
33
31
  - version - Version file
34
-
35
- ## Development
36
-
37
- 1. Make sure you have [@blocklet/cli](https://www.npmjs.com/package/@blocklet/cli) installed
38
-
39
- Blocklet needs blocklet server as a dependency. So you need to install it first.
40
- `npm install -g @blocklet/cli`
41
- See details in [https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli](https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli)
42
-
43
- 2. Init blocklet server & start blocklet server
44
-
45
- Before starting an blocklet server, you need to init blocklet server.
46
- `blocklet server init --mode=debug`
47
- `blocklet server start`
48
- See details in [https://www.arcblock.io/docs/blocklet-developer/getting-started](https://www.arcblock.io/docs/blocklet-developer/getting-started)
49
-
50
- 3. Go to the project directory `cd [name]`
51
- 4. Install dependencies: `npm install` or `yarn`
52
- 5. Start development server: `blocklet dev`
53
-
54
- ## Bundle
55
-
56
- After developing a blocklet, you may need to bundle it. Use `npm run bundle` command.
57
-
58
- ## Deploy
59
-
60
- - If you want to deploy this blocklet to local blocklet server, you can use `blocklet deploy .blocklet/bundle` command(Make sure the blocklet is bundled before deployment).
61
- > Or you can simply use `npm run deploy` command.
62
- - If you want to deploy this blocklet to remote blocklet server, you can use the command below.
63
-
64
- ```shell
65
- blocklet deploy .blocklet/bundle --endpoint {your blocklet server url} --access-key {blocklet server access key} --access-secret {blocklet server access secret}
66
- ```
67
-
68
- > Make sure the blocklet is bundled before deployment.
69
-
70
- ## Upload to blocklet store
71
-
72
- - If you want to upload the blocklet to any store for other users to download and use, you can following the following instructions.
73
-
74
- Bump version at first.
75
-
76
- ```shell
77
- npm run bump-version
78
- ```
79
-
80
- Then config blocklet store url.
81
- You can use those store url in below.
82
-
83
- 1. [https://store.blocklet.dev/](https://store.blocklet.dev/)
84
- 2. [https://dev.store.blocklet.dev/](https://dev.store.blocklet.dev/)
85
- 3. A blocklet store started by yourself.
86
- > Make sure you have installed a `blocklet store` on your own blocklet server. Check it on here: [https://store.blocklet.dev/blocklet/z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ](https://store.blocklet.dev/blocklet/z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ)
87
-
88
- ```shell
89
- blocklet config set store {store url}
90
- ```
91
-
92
- Get a `accessToken` by using this command.
93
-
94
- > Why we need a `accessToken`?
95
- > A `accessToken` is genrate by blocklet store, which help us upload our blocklet to any store.
96
-
97
- Set `accessToken` to blocklet config
98
-
99
- ```shell
100
- blocklet config set accessToken {accessToken}
101
- ```
102
-
103
- Upload a new version to a store.
104
-
105
- > Make sure the blocklet is bundled before upload.
106
-
107
- ```shell
108
- blocklet upload
109
- ```
110
-
111
- Or you can simply use `npm run upload` command.
112
-
113
- - You also can upload a new version to a store by Github CI.
114
- Bump version at first.
115
-
116
- ```shell
117
- npm run bump-version
118
- ```
119
-
120
- Push your code to Github main/master branch, or make a pull request to the main/master branch.
121
- The CI workflow will automatically upload a new version to a store.
122
-
123
- ## Q & A
124
-
125
- 1. Q: How to change a blocklet's name?
126
-
127
- A: Change the `name` field in the `package.json` file, change the `name` field in the `blocklet.yml` file.
128
-
129
- You can also change the `title` field and `description` field in the `blocklet.yml` file.
130
-
131
- Run `blocklet meta` command, you will get a `did` config, copy the `did` value.
132
-
133
- Replace this command `"bundle:client": "PUBLIC_URL='/.blocklet/proxy/{did}' npm run build",` in `package.json`
134
-
135
- Replace `did` field in the `blocklet.yml`
136
-
137
- 2. Q: How to change a blocklet's logo?
138
-
139
- Change the `logo.png` file root folder.
140
-
141
- Or you can change the `logo` field in the `blocklet.yml` file.
142
-
143
- > Make sure you have added the logo path to the `blocklet.yml` file `files` field.
144
-
145
- ## Learn More
146
-
147
- - Full specification of `blocklet.yml`: [https://github.com/blocklet/blocklet-specification/blob/main/docs/meta.md](https://github.com/blocklet/blocklet-specification/blob/main/docs/meta.md)
148
- - Full document of Blocklet Server & blocklet development: [https://www.arcblock.io/docs/blocklet-developer](https://www.arcblock.io/docs/blocklet-developer)
149
-
150
- ## License
151
-
152
- The code is licensed under the Apache 2.0 license found in the
153
- [LICENSE](LICENSE) file.
@@ -1,4 +1,3 @@
1
- name: template-react-dapp
2
1
  title: Blocklet Template React
3
2
  description: A Blocklet DAPP blocklet
4
3
  keywords:
@@ -42,37 +42,38 @@
42
42
  "dependencies": {
43
43
  "@arcblock/did-auth": "^1.18.135",
44
44
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
45
- "@blocklet/sdk": "^1.16.30",
45
+ "@blocklet/sdk": "^1.16.31",
46
46
  "@ocap/client": "^1.18.135",
47
47
  "@ocap/mcrypto": "^1.18.135",
48
48
  "@ocap/wallet": "^1.18.135",
49
- "axios": "^1.7.2",
49
+ "axios": "^1.7.7",
50
50
  "cookie-parser": "^1.4.6",
51
51
  "cors": "^2.8.5",
52
52
  "dotenv-flow": "^4.1.0",
53
- "express": "^4.19.2",
53
+ "express": "^4.21.0",
54
54
  "express-async-errors": "^3.1.1"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@arcblock/eslint-config": "^0.3.2",
58
- "@blocklet/js-sdk": "^1.16.30",
58
+ "@blocklet/js-sdk": "^1.16.31",
59
+ "@trivago/prettier-plugin-sort-imports": "^4.3.0",
59
60
  "@vitejs/plugin-react": "^4.3.1",
60
- "bumpp": "^9.4.1",
61
+ "bumpp": "^9.5.2",
61
62
  "cross-env": "^7.0.3",
62
- "eslint": "^8.57.0",
63
- "lint-staged": "^15.2.7",
64
- "nodemon": "^3.1.4",
63
+ "eslint": "^8.57.1",
64
+ "lint-staged": "^15.2.10",
65
+ "nodemon": "^3.1.7",
65
66
  "npm-run-all": "^4.1.5",
66
67
  "prettier": "^3.3.3",
67
- "react": "^18.2.0",
68
- "react-dom": "^18.2.0",
69
- "react-router-dom": "^6.24.0",
70
- "rimraf": "^5.0.7",
68
+ "react": "~18.2.0",
69
+ "react-dom": "~18.2.0",
70
+ "react-router-dom": "^6.26.2",
71
+ "rimraf": "^5.0.10",
71
72
  "simple-git-hooks": "^2.11.1",
72
- "vite": "^5.3.5",
73
- "vite-plugin-blocklet": "^0.9.5",
73
+ "vite": "^5.4.8",
74
+ "vite-plugin-blocklet": "^0.9.7",
74
75
  "vite-plugin-svgr": "^4.2.0",
75
- "zx": "^8.1.4"
76
+ "zx": "^8.1.8"
76
77
  },
77
78
  "simple-git-hooks": {
78
79
  "pre-commit": "npx lint-staged"
@@ -1,14 +1,11 @@
1
- # Getting Started with Create Blocklet
2
-
3
- This project was bootstrapped with [Create Blocklet](https://github.com/blocklet/create-blocklet).
4
-
1
+ ## PROJECT_DESCRIPTION
5
2
  This blocklet is a dapp project, which means this is a full-stack application. It's contained both `server` and `client` code.
6
3
 
7
4
  ## Launch on Blocklet Server
8
5
 
9
6
  [![Launch on Blocklet Server](https://assets.arcblock.io/icons/launch_on_blocklet_server.svg)](https://install.arcblock.io/launch?action=blocklet-install&meta_url=https%3A%2F%2Fgithub.com%2Fblocklet%2Fpages-kit%2Freleases%2Fdownload%2Fv0.1.33%2Fblocklet.json)
10
7
 
11
- ## File Structure
8
+ ## FILE_STRUCTURE
12
9
 
13
10
  - public/ - static files
14
11
  - favicon.ico - favicon
@@ -35,123 +32,3 @@ This blocklet is a dapp project, which means this is a full-stack application. I
35
32
  - package.json - Npm package file
36
33
  - README.md - A guide for this blocklet
37
34
  - version - Version file
38
-
39
- ## Development
40
-
41
- 1. Make sure you have [@blocklet/cli](https://www.npmjs.com/package/@blocklet/cli) installed
42
-
43
- Blocklet needs blocklet server as a dependency. So you need to install it first.
44
- `npm install -g @blocklet/cli`
45
- See details in [https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli](https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli)
46
-
47
- 2. Init blocklet server & start blocklet server
48
-
49
- Before starting an blocklet server, you need to init blocklet server.
50
- `blocklet server init --mode=debug`
51
- `blocklet server start`
52
- See details in [https://www.arcblock.io/docs/blocklet-developer/getting-started](https://www.arcblock.io/docs/blocklet-developer/getting-started)
53
-
54
- 3. Go to the project directory `cd [name]`
55
- 4. Install dependencies: `npm install` or `yarn`
56
- 5. Start development server: `blocklet dev`
57
-
58
- ## Bundle
59
-
60
- After developing a blocklet, you may need to bundle it. Use `npm run bundle` command.
61
-
62
- ## Deploy
63
-
64
- - If you want to deploy this blocklet to local blocklet server, you can use `blocklet deploy .blocklet/bundle` command(Make sure the blocklet is bundled before deployment).
65
- > Or you can simply use `npm run deploy` command.
66
- - If you want to deploy this blocklet to remote blocklet server, you can use the command below.
67
-
68
- ```shell
69
- blocklet deploy .blocklet/bundle --endpoint {your blocklet server url} --access-key {blocklet server access key} --access-secret {blocklet server access secret}
70
- ```
71
-
72
- > Make sure the blocklet is bundled before deployment.
73
-
74
- ## Upload to blocklet store
75
-
76
- - If you want to upload the blocklet to any store for other users to download and use, you can following the following instructions.
77
-
78
- Bump version at first.
79
-
80
- ```shell
81
- npm run bump-version
82
- ```
83
-
84
- Then config blocklet store url.
85
- You can use those store url in below.
86
-
87
- 1. [https://store.blocklet.dev/](https://store.blocklet.dev/)
88
- 2. [https://dev.store.blocklet.dev/](https://dev.store.blocklet.dev/)
89
- 3. A blocklet store started by yourself.
90
- > Make sure you have installed a `blocklet store` on your own blocklet server. Check it on here: [https://store.blocklet.dev/blocklet/z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ](https://store.blocklet.dev/blocklet/z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ)
91
-
92
- ```shell
93
- blocklet config set store {store url}
94
- ```
95
-
96
- Get a `accessToken` by using this command.
97
-
98
- > Why we need a `accessToken`?
99
- > A `accessToken` is genrate by blocklet store, which help us upload our blocklet to any store.
100
-
101
- Set `accessToken` to blocklet config
102
-
103
- ```shell
104
- blocklet config set accessToken {accessToken}
105
- ```
106
-
107
- Upload a new version to a store.
108
-
109
- > Make sure the blocklet is bundled before upload.
110
-
111
- ```shell
112
- blocklet upload
113
- ```
114
-
115
- Or you can simply use `npm run upload` command.
116
-
117
- - You also can upload a new version to a store by Github CI.
118
- Bump version at first.
119
-
120
- ```shell
121
- npm run bump-version
122
- ```
123
-
124
- Push your code to Github main/master branch, or make a pull request to the main/master branch.
125
- The CI workflow will automatically upload a new version to a store.
126
-
127
- ## Q & A
128
-
129
- 1. Q: How to change a blocklet's name?
130
-
131
- A: Change the `name` field in the `package.json` file, change the `name` field in the `blocklet.yml` file.
132
-
133
- You can also change the `title` field and `description` field in the `blocklet.yml` file.
134
-
135
- Run `blocklet meta` command, you will get a `did` config, copy the `did` value.
136
-
137
- Replace this command `"bundle:client": "PUBLIC_URL='/.blocklet/proxy/{did}' npm run build",` in `package.json`
138
-
139
- Replace `did` field in the `blocklet.yml`
140
-
141
- 2. Q: How to change a blocklet's logo?
142
-
143
- Change the `logo.png` file root folder.
144
-
145
- Or you can change the `logo` field in the `blocklet.yml` file.
146
-
147
- > Make sure you have added the logo path to the `blocklet.yml` file `files` field.
148
-
149
- ## Learn More
150
-
151
- - Full specification of `blocklet.yml`: [https://github.com/blocklet/blocklet-specification/blob/main/docs/meta.md](https://github.com/blocklet/blocklet-specification/blob/main/docs/meta.md)
152
- - Full document of Blocklet Server & blocklet development: [https://www.arcblock.io/docs/blocklet-developer](https://www.arcblock.io/docs/blocklet-developer)
153
-
154
- ## License
155
-
156
- The code is licensed under the Apache 2.0 license found in the
157
- [LICENSE](LICENSE) file.
@@ -1,4 +1,3 @@
1
- name: template-react-dapp-ts
2
1
  title: Blocklet Template React
3
2
  description: A Blocklet DAPP blocklet
4
3
  keywords:
@@ -40,49 +40,50 @@
40
40
  "dependencies": {
41
41
  "@arcblock/did-auth": "^1.18.135",
42
42
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
43
- "@blocklet/sdk": "^1.16.30",
43
+ "@blocklet/sdk": "^1.16.31",
44
44
  "@ocap/client": "^1.18.135",
45
45
  "@ocap/mcrypto": "^1.18.135",
46
46
  "@ocap/wallet": "^1.18.135",
47
- "axios": "^1.7.2",
47
+ "axios": "^1.7.7",
48
48
  "cookie-parser": "^1.4.6",
49
49
  "cors": "^2.8.5",
50
50
  "dotenv-flow": "^4.1.0",
51
- "express": "^4.19.2",
51
+ "express": "^4.21.0",
52
52
  "express-async-errors": "^3.1.1"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@arcblock/eslint-config": "^0.3.2",
56
56
  "@arcblock/eslint-config-ts": "^0.3.2",
57
- "@blocklet/js-sdk": "^1.16.30",
57
+ "@blocklet/js-sdk": "^1.16.31",
58
+ "@trivago/prettier-plugin-sort-imports": "^4.3.0",
58
59
  "@types/cookie-parser": "^1.4.7",
59
60
  "@types/cors": "^2.8.17",
60
61
  "@types/dotenv-flow": "^3.3.3",
61
62
  "@types/express": "^4.17.21",
62
- "@types/node": "^20.14.13",
63
- "@types/react": "^18.3.3",
63
+ "@types/node": "^20.16.9",
64
+ "@types/react": "^18.3.9",
64
65
  "@types/react-dom": "^18.3.0",
65
66
  "@vitejs/plugin-react": "^4.3.1",
66
- "bumpp": "^9.4.1",
67
+ "bumpp": "^9.5.2",
67
68
  "cross-env": "^7.0.3",
68
- "eslint": "^8.57.0",
69
+ "eslint": "^8.57.1",
69
70
  "import-sort-style-module": "^6.0.0",
70
- "lint-staged": "^15.2.7",
71
- "nodemon": "^3.1.4",
71
+ "lint-staged": "^15.2.10",
72
+ "nodemon": "^3.1.7",
72
73
  "npm-run-all": "^4.1.5",
73
74
  "prettier": "^3.3.3",
74
75
  "prettier-plugin-import-sort": "^0.0.7",
75
- "react": "^18.2.0",
76
- "react-dom": "^18.2.0",
77
- "react-router-dom": "^6.24.0",
78
- "rimraf": "^5.0.7",
76
+ "react": "~18.2.0",
77
+ "react-dom": "~18.2.0",
78
+ "react-router-dom": "^6.26.2",
79
+ "rimraf": "^5.0.10",
79
80
  "simple-git-hooks": "^2.11.1",
80
81
  "ts-node": "^10.9.2",
81
- "typescript": "^5.5.2",
82
- "vite": "^5.3.5",
83
- "vite-plugin-blocklet": "^0.9.5",
82
+ "typescript": "^5.6.2",
83
+ "vite": "^5.4.8",
84
+ "vite-plugin-blocklet": "^0.9.7",
84
85
  "vite-plugin-svgr": "^4.2.0",
85
- "zx": "^8.1.4"
86
+ "zx": "^8.1.8"
86
87
  },
87
88
  "importSort": {
88
89
  ".js, .jsx, .mjs": {