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,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
  - screenshots/ - Screenshots
10
8
  - api/ - Api side code
@@ -24,123 +22,3 @@ This blocklet is a dapp project, which means this is a full-stack application. I
24
22
  - package.json - Npm package file
25
23
  - README.md - A guide for this blocklet
26
24
  - version - Version file
27
-
28
- ## Development
29
-
30
- 1. Make sure you have [@blocklet/cli](https://www.npmjs.com/package/@blocklet/cli) installed
31
-
32
- Blocklet needs blocklet server as a dependency. So you need to install it first.
33
- `npm install -g @blocklet/cli`
34
- See details in [https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli](https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli)
35
-
36
- 2. Init blocklet server & start blocklet server
37
-
38
- Before starting an blocklet server, you need to init blocklet server.
39
- `blocklet server init --mode=debug`
40
- `blocklet server start`
41
- See details in [https://www.arcblock.io/docs/blocklet-developer/getting-started](https://www.arcblock.io/docs/blocklet-developer/getting-started)
42
-
43
- 3. Go to the project directory `cd [name]`
44
- 4. Install dependencies: `npm install` or `yarn`
45
- 5. Start development server: `blocklet dev`
46
-
47
- ## Bundle
48
-
49
- After developing a blocklet, you may need to bundle it. Use `npm run bundle` command.
50
-
51
- ## Deploy
52
-
53
- - 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).
54
- > Or you can simply use `npm run deploy` command.
55
- - If you want to deploy this blocklet to remote blocklet server, you can use the command below.
56
-
57
- ```shell
58
- blocklet deploy .blocklet/bundle --endpoint {your blocklet server url} --access-key {blocklet server access key} --access-secret {blocklet server access secret}
59
- ```
60
-
61
- > Make sure the blocklet is bundled before deployment.
62
-
63
- ## Upload to blocklet store
64
-
65
- - If you want to upload the blocklet to any store for other users to download and use, you can following the following instructions.
66
-
67
- Bump version at first.
68
-
69
- ```shell
70
- make bump-version
71
- ```
72
-
73
- Then config blocklet store url.
74
- You can use those store url in below.
75
-
76
- 1. [https://store.blocklet.dev/](https://store.blocklet.dev/)
77
- 2. [https://dev.store.blocklet.dev/](https://dev.store.blocklet.dev/)
78
- 3. A blocklet store started by yourself.
79
- > 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)
80
-
81
- ```shell
82
- blocklet config set store {store url}
83
- ```
84
-
85
- Get a `accessToken` by using this command.
86
-
87
- > Why we need a `accessToken`?
88
- > A `accessToken` is genrate by blocklet store, which help us upload our blocklet to any store.
89
-
90
- Set `accessToken` to blocklet config
91
-
92
- ```shell
93
- blocklet config set accessToken {accessToken}
94
- ```
95
-
96
- Upload a new version to a store.
97
-
98
- > Make sure the blocklet is bundled before upload.
99
-
100
- ```shell
101
- blocklet upload
102
- ```
103
-
104
- Or you can simply use `npm run upload` command.
105
-
106
- - You also can upload a new version to a store by Github CI.
107
- Bump version at first.
108
-
109
- ```shell
110
- make bump-version
111
- ```
112
-
113
- Push your code to Github main/master branch, or make a pull request to the main/master branch.
114
- The CI workflow will automatically upload a new version to a store.
115
-
116
- ## Q & A
117
-
118
- 1. Q: How to change a blocklet's name?
119
-
120
- A: Change the `name` field in the `package.json` file, change the `name` field in the `blocklet.yml` file.
121
-
122
- You can also change the `title` field and `description` field in the `blocklet.yml` file.
123
-
124
- Run `blocklet meta` command, you will get a `did` config, copy the `did` value.
125
-
126
- Replace this command `"bundle:client": "PUBLIC_URL='/.blocklet/proxy/{did}' npm run build",` in `package.json`
127
-
128
- Replace `did` field in the `blocklet.yml`
129
-
130
- 2. Q: How to change a blocklet's logo?
131
-
132
- Change the `logo.png` file root folder.
133
-
134
- Or you can change the `logo` field in the `blocklet.yml` file.
135
-
136
- > Make sure you have added the logo path to the `blocklet.yml` file `files` field.
137
-
138
- ## Learn More
139
-
140
- - 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)
141
- - Full document of Blocklet Server & blocklet development: [https://www.arcblock.io/docs/blocklet-developer](https://www.arcblock.io/docs/blocklet-developer)
142
-
143
- ## License
144
-
145
- The code is licensed under the Apache 2.0 license found in the
146
- [LICENSE](LICENSE) file.
@@ -1,4 +1,3 @@
1
- name: template-express
2
1
  title: Blocklet Template Express
3
2
  description: A Blocklet Api blocklet
4
3
  keywords:
@@ -32,21 +32,22 @@
32
32
  "license": "ISC",
33
33
  "dependencies": {
34
34
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
35
- "@blocklet/sdk": "^1.16.30",
35
+ "@blocklet/sdk": "^1.16.31",
36
36
  "@ocap/client": "^1.18.135",
37
37
  "dotenv-flow": "^4.1.0",
38
- "express": "^4.19.2"
38
+ "express": "^4.21.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@arcblock/eslint-config-base": "^0.3.2",
42
- "bumpp": "^9.4.1",
43
- "eslint": "^8.57.0",
44
- "lint-staged": "^15.2.7",
45
- "nodemon": "^3.1.4",
42
+ "@trivago/prettier-plugin-sort-imports": "^4.3.0",
43
+ "bumpp": "^9.5.2",
44
+ "eslint": "^8.57.1",
45
+ "lint-staged": "^15.2.10",
46
+ "nodemon": "^3.1.7",
46
47
  "prettier": "^3.3.3",
47
- "rimraf": "^5.0.7",
48
+ "rimraf": "^5.0.10",
48
49
  "simple-git-hooks": "^2.11.1",
49
- "zx": "^8.1.4"
50
+ "zx": "^8.1.8"
50
51
  },
51
52
  "simple-git-hooks": {
52
53
  "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 static project, which means this is a frontend application. It's contained `client` code.
6
4
 
7
- ## File Structure
5
+ ## FILE_STRUCTURE
8
6
 
9
7
  - app/ - Client side code (A static html project structure)
10
8
  - .env - Environment variables
@@ -19,124 +17,4 @@ This blocklet is a static project, which means this is a frontend application. I
19
17
  - Makefile - Makefile
20
18
  - package.json - Npm package file
21
19
  - README.md - A guide for this blocklet
22
- - version - Version file
23
-
24
- ## Development
25
-
26
- 1. Make sure you have [@blocklet/cli](https://www.npmjs.com/package/@blocklet/cli) installed
27
-
28
- Blocklet needs blocklet server as a dependency. So you need to install it first.
29
- `npm install -g @blocklet/cli`
30
- See details in [https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli](https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli)
31
-
32
- 2. Init blocklet server & start blocklet server
33
-
34
- Before starting an blocklet server, you need to init blocklet server.
35
- `blocklet server init --mode=debug`
36
- `blocklet server start`
37
- See details in [https://www.arcblock.io/docs/blocklet-developer/getting-started](https://www.arcblock.io/docs/blocklet-developer/getting-started)
38
-
39
- 3. Go to the project directory `cd [name]`
40
- 4. Install dependencies: `npm install` or `yarn`
41
- 5. Start development server: `blocklet dev`
42
-
43
- ## Bundle
44
-
45
- After developing a blocklet, you may need to bundle it. Use `npm run bundle` command.
46
-
47
- ## Deploy
48
-
49
- - 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.)
50
- > Or you can simply use `npm run deploy` command.
51
- - If you want to deploy this blocklet to remote blocklet server, you can use the command below.
52
-
53
- ```shell
54
- blocklet deploy .blocklet/bundle --endpoint {your blocklet server url} --access-key {blocklet server access key} --access-secret {blocklet server access secret}
55
- ```
56
-
57
- > Make sure the blocklet is bundled before deployment.
58
-
59
- ## Upload to blocklet store
60
-
61
- - If you want to upload the blocklet to any store for other users to download and use, you can following the following instructions.
62
-
63
- Bump version at first.
64
-
65
- ```shell
66
- make bump-version
67
- ```
68
-
69
- Then config blocklet store url.
70
- You can use those store url in below.
71
-
72
- 1. [https://store.blocklet.dev/](https://store.blocklet.dev/)
73
- 2. [https://dev.store.blocklet.dev/](https://dev.store.blocklet.dev/)
74
- 3. A blocklet store started by yourself.
75
- > 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)
76
-
77
- ```shell
78
- blocklet config set store {store url}
79
- ```
80
-
81
- Get a `accessToken` from blocklet store.
82
-
83
- > Why we need a `accessToken`?
84
- > A `accessToken` is genrate by blocklet store, which help us upload our blocklet to any store.
85
-
86
- Set `accessToken` to blocklet config
87
-
88
- ```shell
89
- blocklet config set accessToken {accessToken}
90
- ```
91
-
92
- Upload a new version to a store.
93
-
94
- > Make sure the blocklet is bundled before upload.
95
-
96
- ```shell
97
- blocklet upload
98
- ```
99
-
100
- Or you can simply use `npm run upload` command.
101
-
102
- - You also can upload a new version to blocklet store by Github CI.
103
- Bump version at first.
104
-
105
- ```shell
106
- make bump-version
107
- ```
108
-
109
- Push your code to Github main/master branch, or make a pull request to the main/master branch.
110
- The CI workflow will automatically upload a new version to a store.
111
-
112
- ## Q & A
113
-
114
- 1. Q: How to change a blocklet's name?
115
-
116
- A: Change the `name` field in the `package.json` file, change the `name` field in the `blocklet.yml` file.
117
-
118
- You can also change the `title` field and `description` field in the `blocklet.yml` file.
119
-
120
- Run `blocklet meta` command, you will get a `did` config, copy the `did` value.
121
-
122
- Replace this command `"bundle": "PUBLIC_URL='/.blocklet/proxy/{did}' npm run build",` in `package.json`
123
-
124
- Replace `did` field in the `blocklet.yml`
125
-
126
- 2. Q: How to change a blocklet's logo?
127
-
128
- Change the `logo.png` file root folder.
129
-
130
- Or you can change the `logo` field in the `blocklet.yml` file.
131
-
132
- > Make sure you have added the logo path to the `blocklet.yml` file `files` field.
133
-
134
- ## Learn More
135
-
136
- - 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)
137
- - Full document of Blocklet Server & blocklet development: [https://www.arcblock.io/docs/blocklet-developer](https://www.arcblock.io/docs/blocklet-developer)
138
-
139
- ## License
140
-
141
- The code is licensed under the Apache 2.0 license found in the
142
- [LICENSE](LICENSE) file.
20
+ - version - Version file
@@ -1,4 +1,3 @@
1
- name: template-html
2
1
  title: Blocklet Template HTML
3
2
  description: A Blocklet Server blocklet
4
3
  keywords:
@@ -16,9 +16,10 @@
16
16
  "author": "",
17
17
  "license": "ISC",
18
18
  "devDependencies": {
19
- "bumpp": "^9.4.1",
19
+ "@trivago/prettier-plugin-sort-imports": "^4.3.0",
20
+ "bumpp": "^9.5.2",
20
21
  "prettier": "^3.3.3",
21
- "rimraf": "^5.0.7",
22
- "zx": "^8.1.4"
22
+ "rimraf": "^5.0.10",
23
+ "zx": "^8.1.8"
23
24
  }
24
25
  }
@@ -1,6 +1,4 @@
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 project is a monorepo project, which means that there are multiple blocklet applications.
6
4
 
@@ -53,12 +51,14 @@ This project is a monorepo project, which means that there are multiple blocklet
53
51
  npm run bump-version
54
52
  ```
55
53
 
56
- ## Reference
54
+ ## Bundle
55
+
56
+ ## Deploy
57
+
58
+ ## Upload to blocklet store
57
59
 
58
- Our docs site is generate by Create Blocklet itself.
60
+ ## Q & A
59
61
 
60
- We use Blocklet Page to write our docs
62
+ ## Learn More
61
63
 
62
- check more details on
63
64
 
64
- - [Create Blocklet Docs](https://www.createblocklet.dev/docs/en/intro)
@@ -20,11 +20,12 @@
20
20
  "license": "ISC",
21
21
  "devDependencies": {
22
22
  "@arcblock/eslint-config": "^0.3.2",
23
- "bumpp": "^9.4.1",
24
- "eslint": "^8.57.0",
23
+ "@trivago/prettier-plugin-sort-imports": "^4.3.0",
24
+ "bumpp": "^9.5.2",
25
+ "eslint": "^8.57.1",
25
26
  "prettier": "^3.3.3",
26
27
  "simple-git-hooks": "^2.11.1",
27
- "zx": "^8.1.4"
28
+ "zx": "^8.1.8"
28
29
  },
29
30
  "simple-git-hooks": {
30
31
  "pre-commit": "npx lint-staged"
@@ -2,46 +2,50 @@
2
2
  import { execSync } from 'child_process';
3
3
  import { $, chalk, fs, path } from 'zx';
4
4
 
5
- const cwd = process.cwd(); // 获取脚本执行目录
5
+ async function main() {
6
+ const cwd = process.cwd(); // 获取脚本执行目录
6
7
 
7
- // or use pnpm to bump version: `pnpm -r --filter {packages/*, themes/*} -- pnpm version`
8
- execSync('bumpp --no-tag --no-commit --no-push package.json blocklets/*/package.json', { stdio: 'inherit' });
8
+ // or use pnpm to bump version: `pnpm -r --filter {packages/*, themes/*} -- pnpm version`
9
+ execSync('bumpp --no-tag --no-commit --no-push package.json blocklets/*/package.json', { stdio: 'inherit' });
9
10
 
10
- const { version } = await fs.readJSON('package.json');
11
- await fs.writeFileSync('version', version);
11
+ const { version } = await fs.readJSON('package.json');
12
+ await fs.writeFileSync('version', version);
12
13
 
13
- console.log(chalk.greenBright(`[info]: start to modify blocklets version to ${version}`));
14
- const dirPath = path.join(__dirname, '../blocklets');
15
- let pathList = await fs.readdirSync(dirPath);
16
- pathList = pathList.map((item) => `${dirPath}/${item}`);
17
- for (const ymlDir of pathList) {
18
- await $`cd ${ymlDir} && blocklet version ${version}`;
19
- }
20
- console.log(chalk.greenBright('[info]: all blocklets version modified.'));
14
+ console.log(chalk.greenBright(`[info]: start to modify blocklets version to ${version}`));
15
+ const dirPath = path.join(__dirname, '../blocklets');
16
+ let pathList = await fs.readdirSync(dirPath);
17
+ pathList = pathList.map((item) => `${dirPath}/${item}`);
18
+ for (const ymlDir of pathList) {
19
+ await $`cd ${ymlDir} && blocklet version ${version}`;
20
+ }
21
+ console.log(chalk.greenBright('[info]: all blocklets version modified.'));
21
22
 
22
- await $`cd ${cwd}`;
23
+ await $`cd ${cwd}`;
23
24
 
24
- let newChangelog = '';
25
+ let newChangelog = '';
25
26
 
26
- try {
27
- const gitRes = await $`git log --pretty=format:"- %s" "main"...HEAD`;
28
- newChangelog = gitRes.stdout.trim();
29
- } catch {
30
- console.error(chalk.redBright('Could not get git log, please write changelog manually.'));
31
- }
27
+ try {
28
+ const gitRes = await $`git log --pretty=format:"- %s" "main"...HEAD`;
29
+ newChangelog = gitRes.stdout.trim();
30
+ } catch {
31
+ console.error(chalk.redBright('Could not get git log, please write changelog manually.'));
32
+ }
32
33
 
33
- const now = new Date();
34
- const currentDate = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`;
35
- const title = `## ${version} (${currentDate})`;
34
+ const now = new Date();
35
+ const currentDate = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`;
36
+ const title = `## ${version} (${currentDate})`;
36
37
 
37
- await fs.ensureFile('CHANGELOG.md');
38
- const oldChangelog = await fs.readFile('CHANGELOG.md', 'utf8');
39
- const changelog = [title, newChangelog, oldChangelog].filter((item) => !!item).join('\n\n');
38
+ await fs.ensureFile('CHANGELOG.md');
39
+ const oldChangelog = await fs.readFile('CHANGELOG.md', 'utf8');
40
+ const changelog = [title, newChangelog, oldChangelog].filter((item) => !!item).join('\n\n');
40
41
 
41
- await fs.writeFile('CHANGELOG.md', changelog);
42
+ await fs.writeFile('CHANGELOG.md', changelog);
42
43
 
43
- console.log(`\nNow you can make adjustments to ${chalk.cyan('CHANGELOG.md')}. Then press enter to continue.`);
44
+ console.log(`\nNow you can make adjustments to ${chalk.cyan('CHANGELOG.md')}. Then press enter to continue.`);
45
+
46
+ process.stdin.setRawMode(true);
47
+ process.stdin.resume();
48
+ process.stdin.on('data', process.exit.bind(process, 0));
49
+ }
44
50
 
45
- process.stdin.setRawMode(true);
46
- process.stdin.resume();
47
- process.stdin.on('data', process.exit.bind(process, 0));
51
+ main();
@@ -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
  - screenshots/ - Screenshots
10
8
  - api/ - Api side code
@@ -21,122 +19,3 @@ This blocklet is a dapp project, which means this is a full-stack application. I
21
19
  - README.md - A guide for this blocklet
22
20
  - version - Version file
23
21
 
24
- ## Development
25
-
26
- 1. Make sure you have [@blocklet/cli](https://www.npmjs.com/package/@blocklet/cli) installed
27
-
28
- Blocklet needs blocklet server as a dependency. So you need to install it first.
29
- `npm install -g @blocklet/cli`
30
- See details in [https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli](https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli)
31
-
32
- 2. Init blocklet server & start blocklet server
33
-
34
- Before starting an blocklet server, you need to init blocklet server.
35
- `blocklet server init --mode=debug`
36
- `blocklet server start`
37
- See details in [https://www.arcblock.io/docs/blocklet-developer/getting-started](https://www.arcblock.io/docs/blocklet-developer/getting-started)
38
-
39
- 3. Go to the project directory `cd [name]`
40
- 4. Install dependencies: `npm install` or `yarn`
41
- 5. Start development server: `blocklet dev`
42
-
43
- ## Bundle
44
-
45
- After developing a blocklet, you may need to bundle it. Use `npm run bundle` command.
46
-
47
- ## Deploy
48
-
49
- - 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).
50
- > Or you can simply use `npm run deploy` command.
51
- - If you want to deploy this blocklet to remote blocklet server, you can use the command below.
52
-
53
- ```shell
54
- blocklet deploy .blocklet/bundle --endpoint {your blocklet server url} --access-key {blocklet server access key} --access-secret {blocklet server access secret}
55
- ```
56
-
57
- > Make sure the blocklet is bundled before deployment.
58
-
59
- ## Upload to blocklet store
60
-
61
- - If you want to upload the blocklet to any store for other users to download and use, you can following the following instructions.
62
-
63
- Bump version at first.
64
-
65
- ```shell
66
- make bump-version
67
- ```
68
-
69
- Then config blocklet store url.
70
- You can use those store url in below.
71
-
72
- 1. [https://store.blocklet.dev/](https://store.blocklet.dev/)
73
- 2. [https://dev.store.blocklet.dev/](https://dev.store.blocklet.dev/)
74
- 3. A blocklet store started by yourself.
75
- > 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)
76
-
77
- ```shell
78
- blocklet config set store {store url}
79
- ```
80
-
81
- Get a `accessToken` by using this command.
82
-
83
- > Why we need a `accessToken`?
84
- > A `accessToken` is genrate by blocklet store, which help us upload our blocklet to any store.
85
-
86
- Set `accessToken` to blocklet config
87
-
88
- ```shell
89
- blocklet config set accessToken {accessToken}
90
- ```
91
-
92
- Upload a new version to a store.
93
-
94
- > Make sure the blocklet is bundled before upload.
95
-
96
- ```shell
97
- blocklet upload
98
- ```
99
-
100
- Or you can simply use `npm run upload` command.
101
-
102
- - You also can upload a new version to a store by Github CI.
103
- Bump version at first.
104
-
105
- ```shell
106
- make bump-version
107
- ```
108
-
109
- Push your code to Github main/master branch, or make a pull request to the main/master branch.
110
- The CI workflow will automatically upload a new version to a store.
111
-
112
- ## Q & A
113
-
114
- 1. Q: How to change a blocklet's name?
115
-
116
- A: Change the `name` field in the `package.json` file, change the `name` field in the `blocklet.yml` file.
117
-
118
- You can also change the `title` field and `description` field in the `blocklet.yml` file.
119
-
120
- Run `blocklet meta` command, you will get a `did` config, copy the `did` value.
121
-
122
- Replace this command `"bundle:client": "PUBLIC_URL='/.blocklet/proxy/{did}' npm run build",` in `package.json`
123
-
124
- Replace `did` field in the `blocklet.yml`
125
-
126
- 2. Q: How to change a blocklet's logo?
127
-
128
- Change the `logo.png` file root folder.
129
-
130
- Or you can change the `logo` field in the `blocklet.yml` file.
131
-
132
- > Make sure you have added the logo path to the `blocklet.yml` file `files` field.
133
-
134
- ## Learn More
135
-
136
- - 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)
137
- - Full document of Blocklet Server & blocklet development: [https://www.arcblock.io/docs/blocklet-developer](https://www.arcblock.io/docs/blocklet-developer)
138
-
139
- ## License
140
-
141
- The code is licensed under the Apache 2.0 license found in the
142
- [LICENSE](LICENSE) file.
@@ -1,4 +1,3 @@
1
- name: template-nestjs
2
1
  title: Blocklet Template NestJS
3
2
  description: A Blocklet Api blocklet
4
3
  keywords:
@@ -36,36 +36,37 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
39
- "@blocklet/sdk": "^1.16.30",
40
- "@nestjs/common": "^10.3.9",
41
- "@nestjs/core": "^10.3.9",
42
- "@nestjs/platform-express": "^10.3.9",
39
+ "@blocklet/sdk": "^1.16.31",
40
+ "@nestjs/common": "^10.4.4",
41
+ "@nestjs/core": "^10.4.4",
42
+ "@nestjs/platform-express": "^10.4.4",
43
43
  "@ocap/client": "^1.18.135",
44
44
  "dotenv-flow": "^4.1.0",
45
- "express": "^4.19.2",
45
+ "express": "^4.21.0",
46
46
  "reflect-metadata": "^0.2.2",
47
47
  "rxjs": "^7.8.1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@arcblock/eslint-config-base": "^0.3.2",
51
- "@nestjs/cli": "^10.3.2",
52
- "@nestjs/schematics": "^10.1.1",
51
+ "@nestjs/cli": "^10.4.5",
52
+ "@nestjs/schematics": "^10.1.4",
53
+ "@trivago/prettier-plugin-sort-imports": "^4.3.0",
53
54
  "@types/express": "^4.17.21",
54
- "@types/node": "^20.14.13",
55
+ "@types/node": "^20.16.9",
55
56
  "@typescript-eslint/eslint-plugin": "^7.18.0",
56
57
  "@typescript-eslint/parser": "^7.18.0",
57
- "bumpp": "^9.4.1",
58
- "eslint": "^8.57.0",
59
- "lint-staged": "^15.2.7",
60
- "nodemon": "^3.1.4",
58
+ "bumpp": "^9.5.2",
59
+ "eslint": "^8.57.1",
60
+ "lint-staged": "^15.2.10",
61
+ "nodemon": "^3.1.7",
61
62
  "prettier": "^3.3.3",
62
- "rimraf": "^5.0.7",
63
+ "rimraf": "^5.0.10",
63
64
  "simple-git-hooks": "^2.11.1",
64
65
  "source-map-support": "^0.5.21",
65
66
  "ts-node": "^10.9.2",
66
67
  "tsconfig-paths": "^4.2.0",
67
- "typescript": "^5.5.2",
68
- "zx": "^8.1.4"
68
+ "typescript": "^5.6.2",
69
+ "zx": "^8.1.8"
69
70
  },
70
71
  "simple-git-hooks": {
71
72
  "pre-commit": "npx lint-staged"