create-blocklet 0.9.4 → 0.9.6
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.
- package/index.js +70 -0
- package/package.json +1 -1
- package/templates/base-readme.md +103 -0
- package/templates/did-wallet-dapp/.eslintrc.js +7 -0
- package/templates/did-wallet-dapp/README.md +32 -0
- package/templates/did-wallet-dapp/api/dev.js +8 -0
- package/templates/did-wallet-dapp/api/functions/app.js +65 -0
- package/templates/did-wallet-dapp/api/index.js +13 -0
- package/templates/did-wallet-dapp/api/libs/constant.js +1 -0
- package/templates/did-wallet-dapp/api/routes/user.js +30 -0
- package/templates/did-wallet-dapp/blocklet.md +3 -0
- package/templates/did-wallet-dapp/blocklet.yml +59 -0
- package/templates/did-wallet-dapp/index.html +16 -0
- package/templates/did-wallet-dapp/package.json +84 -0
- package/templates/did-wallet-dapp/src/app.jsx +38 -0
- package/templates/did-wallet-dapp/src/assets/blocklet.svg +16 -0
- package/templates/did-wallet-dapp/src/assets/react.svg +1 -0
- package/templates/did-wallet-dapp/src/assets/vite.svg +1 -0
- package/templates/did-wallet-dapp/src/assets/wallet.png +0 -0
- package/templates/did-wallet-dapp/src/components/layout.jsx +28 -0
- package/templates/did-wallet-dapp/src/global.css +79 -0
- package/templates/did-wallet-dapp/src/index.jsx +6 -0
- package/templates/did-wallet-dapp/src/libs/api.js +7 -0
- package/templates/did-wallet-dapp/src/libs/session.js +13 -0
- package/templates/did-wallet-dapp/src/locales/en.js +13 -0
- package/templates/did-wallet-dapp/src/locales/index.js +4 -0
- package/templates/did-wallet-dapp/src/locales/zh.js +13 -0
- package/templates/did-wallet-dapp/src/pages/home/index.css +39 -0
- package/templates/did-wallet-dapp/src/pages/home/index.jsx +57 -0
- package/templates/did-wallet-dapp/src/pages/profile.jsx +136 -0
- package/templates/did-wallet-dapp/template-info.json +12 -0
- package/templates/did-wallet-dapp/vite.config.js +14 -0
- package/templates/did-wallet-dapp/vite.config.server.js +9 -0
- package/templates/express-api/README.md +2 -124
- package/templates/html-static/README.md +3 -125
- package/templates/monorepo/README.md +8 -8
- package/templates/nestjs-api/README.md +2 -123
- package/templates/nextjs-dapp/README.md +2 -125
- package/templates/react-dapp/README.md +2 -124
- package/templates/react-dapp/package.json +1 -1
- package/templates/react-dapp-ts/README.md +2 -125
- package/templates/react-dapp-ts/package.json +1 -1
- package/templates/react-gun-dapp/README.md +2 -125
- package/templates/react-gun-dapp/package.json +1 -1
- package/templates/react-static/README.md +2 -125
- package/templates/react-static/package.json +1 -1
- package/templates/solidjs-dapp/README.md +2 -125
- package/templates/solidjs-dapp/package.json +1 -1
- package/templates/solidjs-static/README.md +2 -123
- package/templates/solidjs-static/package.json +1 -1
- package/templates/svelte-dapp/README.md +2 -124
- package/templates/svelte-dapp/package.json +1 -1
- package/templates/svelte-static/README.md +2 -125
- package/templates/svelte-static/package.json +1 -1
- package/templates/todo-list-example/api/src/index.ts +1 -1
- package/templates/todo-list-example/api/src/libs/auth.ts +1 -1
- package/templates/todo-list-example/api/src/routes/index.ts +1 -0
- package/templates/todo-list-example/api/src/routes/todo-list/$get.ts +17 -14
- package/templates/todo-list-example/api/src/routes/todo-list/$put.ts +9 -3
- package/templates/todo-list-example/api/src/routes/todo-list/index.ts +1 -0
- package/templates/todo-list-example/package.json +27 -27
- package/templates/todo-list-example/src/app.tsx +3 -2
- package/templates/todo-list-example/src/contexts/session.tsx +1 -1
- package/templates/todo-list-example/src/pages/required-login.tsx +1 -0
- package/templates/todo-list-example/src/pages/todo-list.tsx +16 -6
- package/templates/vue-dapp/README.md +2 -125
- package/templates/vue-dapp/package.json +1 -1
- package/templates/vue-static/README.md +2 -125
- package/templates/vue-static/package.json +1 -1
- package/templates/vue-ts-static/README.md +2 -124
- package/templates/vue-ts-static/package.json +1 -1
- package/templates/vue2-dapp/README.md +2 -125
- package/templates/vue2-dapp/package.json +1 -1
- package/templates/vue2-static/README.md +2 -125
- package/templates/vue2-static/package.json +1 -1
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
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 static project, which means this is a frontend application. It's contained `client` code.
|
|
6
3
|
|
|
7
|
-
##
|
|
4
|
+
## FILE_STRUCTURE
|
|
8
5
|
|
|
9
6
|
- public/ - static files
|
|
10
7
|
- favicon.ico - favicon
|
|
@@ -25,123 +22,3 @@ This blocklet is a static project, which means this is a frontend application. I
|
|
|
25
22
|
- package.json - Npm package file
|
|
26
23
|
- README.md - A guide for this blocklet
|
|
27
24
|
- version - Version file
|
|
28
|
-
|
|
29
|
-
## Development
|
|
30
|
-
|
|
31
|
-
1. Make sure you have [@blocklet/cli](https://www.npmjs.com/package/@blocklet/cli) installed
|
|
32
|
-
|
|
33
|
-
Blocklet needs blocklet server as a dependency. So you need to install it first.
|
|
34
|
-
`npm install -g @blocklet/cli`
|
|
35
|
-
See details in [https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli](https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli)
|
|
36
|
-
|
|
37
|
-
2. Init blocklet server & start blocklet server
|
|
38
|
-
|
|
39
|
-
Before starting an blocklet server, you need to init blocklet server.
|
|
40
|
-
`blocklet server init --mode=debug`
|
|
41
|
-
`blocklet server start`
|
|
42
|
-
See details in [https://www.arcblock.io/docs/blocklet-developer/getting-started](https://www.arcblock.io/docs/blocklet-developer/getting-started)
|
|
43
|
-
|
|
44
|
-
3. Go to the project directory `cd [name]`
|
|
45
|
-
4. Install dependencies: `npm install` or `yarn`
|
|
46
|
-
5. Start development server: `blocklet dev`
|
|
47
|
-
|
|
48
|
-
## Bundle
|
|
49
|
-
|
|
50
|
-
After developing a blocklet, you may need to bundle it. Use `npm run bundle` command.
|
|
51
|
-
|
|
52
|
-
## Deploy
|
|
53
|
-
|
|
54
|
-
- 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.)
|
|
55
|
-
> Or you can simply use `npm run deploy` command.
|
|
56
|
-
- If you want to deploy this blocklet to remote blocklet server, you can use the command below.
|
|
57
|
-
|
|
58
|
-
```shell
|
|
59
|
-
blocklet deploy .blocklet/bundle --endpoint {your blocklet server url} --access-key {blocklet server access key} --access-secret {blocklet server access secret}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
> Make sure the blocklet is bundled before deployment.
|
|
63
|
-
|
|
64
|
-
## Upload to blocklet store
|
|
65
|
-
|
|
66
|
-
- If you want to upload the blocklet to any store for other users to download and use, you can following the following instructions.
|
|
67
|
-
|
|
68
|
-
Bump version at first.
|
|
69
|
-
|
|
70
|
-
```shell
|
|
71
|
-
make bump-version
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Then config blocklet store url.
|
|
75
|
-
You can use those store url in below.
|
|
76
|
-
|
|
77
|
-
1. [https://store.blocklet.dev/](https://store.blocklet.dev/)
|
|
78
|
-
2. [https://dev.store.blocklet.dev/](https://dev.store.blocklet.dev/)
|
|
79
|
-
3. A blocklet store started by yourself.
|
|
80
|
-
> 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)
|
|
81
|
-
|
|
82
|
-
```shell
|
|
83
|
-
blocklet config set store {store url}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Get a `accessToken` from blocklet store.
|
|
87
|
-
|
|
88
|
-
> Why we need a `accessToken`?
|
|
89
|
-
> A `accessToken` is genrate by blocklet store, which help us upload our blocklet to any store.
|
|
90
|
-
|
|
91
|
-
Set `accessToken` to blocklet config
|
|
92
|
-
|
|
93
|
-
```shell
|
|
94
|
-
blocklet config set accessToken {accessToken}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Upload a new version to a store.
|
|
98
|
-
|
|
99
|
-
> Make sure the blocklet is bundled before upload.
|
|
100
|
-
|
|
101
|
-
```shell
|
|
102
|
-
blocklet upload
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Or you can simply use `npm run upload` command.
|
|
106
|
-
|
|
107
|
-
- You also can upload a new version to blocklet store by Github CI.
|
|
108
|
-
Bump version at first.
|
|
109
|
-
|
|
110
|
-
```shell
|
|
111
|
-
make bump-version
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Push your code to Github main/master branch, or make a pull request to the main/master branch.
|
|
115
|
-
The CI workflow will automatically upload a new version to a store.
|
|
116
|
-
|
|
117
|
-
## Q & A
|
|
118
|
-
|
|
119
|
-
1. Q: How to change a blocklet's name?
|
|
120
|
-
|
|
121
|
-
A: Change the `name` field in the `package.json` file, change the `name` field in the `blocklet.yml` file.
|
|
122
|
-
|
|
123
|
-
You can also change the `title` field and `description` field in the `blocklet.yml` file.
|
|
124
|
-
|
|
125
|
-
Run `blocklet meta` command, you will get a `did` config, copy the `did` value.
|
|
126
|
-
|
|
127
|
-
Replace this command `"bundle": "vite build --base /.blocklet/proxy/<%= did %>",` in `package.json`
|
|
128
|
-
|
|
129
|
-
Replace `did` field in the `blocklet.yml`
|
|
130
|
-
|
|
131
|
-
2. Q: How to change a blocklet's logo?
|
|
132
|
-
|
|
133
|
-
Change the `logo.png` file root folder.
|
|
134
|
-
|
|
135
|
-
Or you can change the `logo` field in the `blocklet.yml` file.
|
|
136
|
-
|
|
137
|
-
> Make sure you have added the logo path to the `blocklet.yml` file `files` field.
|
|
138
|
-
|
|
139
|
-
## Learn More
|
|
140
|
-
|
|
141
|
-
- 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)
|
|
142
|
-
- Full document of Blocklet Server & blocklet development: [https://www.arcblock.io/docs/blocklet-developer](https://www.arcblock.io/docs/blocklet-developer)
|
|
143
|
-
|
|
144
|
-
## License
|
|
145
|
-
|
|
146
|
-
The code is licensed under the Apache 2.0 license found in the
|
|
147
|
-
[LICENSE](LICENSE) file.
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
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 static project, which means this is a frontend application. It's contained `client` code.
|
|
6
3
|
|
|
7
|
-
##
|
|
4
|
+
## FILE_STRUCTURE
|
|
8
5
|
|
|
9
6
|
- public/ - static files
|
|
10
7
|
- favicon.ico - favicon
|
|
@@ -24,123 +21,3 @@ This blocklet is a static project, which means this is a frontend application. I
|
|
|
24
21
|
- package.json - Npm package file
|
|
25
22
|
- README.md - A guide for this blocklet
|
|
26
23
|
- 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` from blocklet store.
|
|
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 blocklet 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": "vite build --base /.blocklet/proxy/<%= did %>",` 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,10 +1,7 @@
|
|
|
1
|
-
|
|
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 static project, which means this is a frontend application. It's contained `client` code.
|
|
6
3
|
|
|
7
|
-
##
|
|
4
|
+
## FILE_STRUCTURE
|
|
8
5
|
|
|
9
6
|
- public/ - static files
|
|
10
7
|
- favicon.ico - favicon
|
|
@@ -24,122 +21,3 @@ This blocklet is a static project, which means this is a frontend application. I
|
|
|
24
21
|
- tsconfig.\*.json - TypeScript configuration file
|
|
25
22
|
- vite.config.ts - Vite configuration file
|
|
26
23
|
|
|
27
|
-
## Development
|
|
28
|
-
|
|
29
|
-
1. Make sure you have [@blocklet/cli](https://www.npmjs.com/package/@blocklet/cli) installed
|
|
30
|
-
|
|
31
|
-
Blocklet needs blocklet server as a dependency. So you need to install it first.
|
|
32
|
-
`npm install -g @blocklet/cli`
|
|
33
|
-
See details in [https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli](https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli)
|
|
34
|
-
|
|
35
|
-
2. Init blocklet server & start blocklet server
|
|
36
|
-
|
|
37
|
-
Before starting an blocklet server, you need to init blocklet server.
|
|
38
|
-
`blocklet server init --mode=debug`
|
|
39
|
-
`blocklet server start`
|
|
40
|
-
See details in [https://www.arcblock.io/docs/blocklet-developer/getting-started](https://www.arcblock.io/docs/blocklet-developer/getting-started)
|
|
41
|
-
|
|
42
|
-
3. Go to the project directory `cd [name]`
|
|
43
|
-
4. Install dependencies: `npm install` or `yarn`
|
|
44
|
-
5. Start development server: `blocklet dev`
|
|
45
|
-
|
|
46
|
-
## Bundle
|
|
47
|
-
|
|
48
|
-
After developing a blocklet, you may need to bundle it. Use `npm run bundle` command.
|
|
49
|
-
|
|
50
|
-
## Deploy
|
|
51
|
-
|
|
52
|
-
- 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.)
|
|
53
|
-
> Or you can simply use `npm run deploy` command.
|
|
54
|
-
- If you want to deploy this blocklet to remote blocklet server, you can use the command below.
|
|
55
|
-
|
|
56
|
-
```shell
|
|
57
|
-
blocklet deploy .blocklet/bundle --endpoint {your blocklet server url} --access-key {blocklet server access key} --access-secret {blocklet server access secret}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
> Make sure the blocklet is bundled before deployment.
|
|
61
|
-
|
|
62
|
-
## Upload to blocklet store
|
|
63
|
-
|
|
64
|
-
- If you want to upload the blocklet to any store for other users to download and use, you can following the following instructions.
|
|
65
|
-
|
|
66
|
-
Bump version at first.
|
|
67
|
-
|
|
68
|
-
```shell
|
|
69
|
-
make bump-version
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Then config blocklet store url.
|
|
73
|
-
You can use those store url in below.
|
|
74
|
-
|
|
75
|
-
1. [https://store.blocklet.dev/](https://store.blocklet.dev/)
|
|
76
|
-
2. [https://dev.store.blocklet.dev/](https://dev.store.blocklet.dev/)
|
|
77
|
-
3. A blocklet store started by yourself.
|
|
78
|
-
> 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)
|
|
79
|
-
|
|
80
|
-
```shell
|
|
81
|
-
blocklet config set store {store url}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Get a `accessToken` from blocklet store.
|
|
85
|
-
|
|
86
|
-
> Why we need a `accessToken`?
|
|
87
|
-
> A `accessToken` is genrate by blocklet store, which help us upload our blocklet to any store.
|
|
88
|
-
|
|
89
|
-
Set `accessToken` to blocklet config
|
|
90
|
-
|
|
91
|
-
```shell
|
|
92
|
-
blocklet config set accessToken {accessToken}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Upload a new version to a store.
|
|
96
|
-
|
|
97
|
-
> Make sure the blocklet is bundled before upload.
|
|
98
|
-
|
|
99
|
-
```shell
|
|
100
|
-
blocklet upload
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Or you can simply use `npm run upload` command.
|
|
104
|
-
|
|
105
|
-
- You also can upload a new version to blocklet store by Github CI.
|
|
106
|
-
Bump version at first.
|
|
107
|
-
|
|
108
|
-
```shell
|
|
109
|
-
make bump-version
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Push your code to Github main/master branch, or make a pull request to the main/master branch.
|
|
113
|
-
The CI workflow will automatically upload a new version to a store.
|
|
114
|
-
|
|
115
|
-
## Q & A
|
|
116
|
-
|
|
117
|
-
1. Q: How to change a blocklet's name?
|
|
118
|
-
|
|
119
|
-
A: Change the `name` field in the `package.json` file, change the `name` field in the `blocklet.yml` file.
|
|
120
|
-
|
|
121
|
-
You can also change the `title` field and `description` field in the `blocklet.yml` file.
|
|
122
|
-
|
|
123
|
-
Run `blocklet meta` command, you will get a `did` config, copy the `did` value.
|
|
124
|
-
|
|
125
|
-
Replace this command `"bundle": "vite build --base /.blocklet/proxy/<%= did %>",` in `package.json`
|
|
126
|
-
|
|
127
|
-
Replace `did` field in the `blocklet.yml`
|
|
128
|
-
|
|
129
|
-
2. Q: How to change a blocklet's logo?
|
|
130
|
-
|
|
131
|
-
Change the `logo.png` file root folder.
|
|
132
|
-
|
|
133
|
-
Or you can change the `logo` field in the `blocklet.yml` file.
|
|
134
|
-
|
|
135
|
-
> Make sure you have added the logo path to the `blocklet.yml` file `files` field.
|
|
136
|
-
|
|
137
|
-
## Learn More
|
|
138
|
-
|
|
139
|
-
- 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)
|
|
140
|
-
- Full document of Blocklet Server & blocklet development: [https://www.arcblock.io/docs/blocklet-developer](https://www.arcblock.io/docs/blocklet-developer)
|
|
141
|
-
|
|
142
|
-
## License
|
|
143
|
-
|
|
144
|
-
The code is licensed under the Apache 2.0 license found in the
|
|
145
|
-
[LICENSE](LICENSE) file.
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
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 static project, which means this is a frontend application. It's contained `client` code.
|
|
6
3
|
|
|
7
|
-
##
|
|
4
|
+
## FILE_STRUCTURE
|
|
8
5
|
|
|
9
6
|
- public/ - static files
|
|
10
7
|
- favicon.ico - favicon
|
|
@@ -25,123 +22,3 @@ This blocklet is a static project, which means this is a frontend application. I
|
|
|
25
22
|
- package.json - Npm package file
|
|
26
23
|
- README.md - A guide for this blocklet
|
|
27
24
|
- version - Version file
|
|
28
|
-
|
|
29
|
-
## Development
|
|
30
|
-
|
|
31
|
-
1. Make sure you have [@blocklet/cli](https://www.npmjs.com/package/@blocklet/cli) installed
|
|
32
|
-
|
|
33
|
-
Blocklet needs blocklet server as a dependency. So you need to install it first.
|
|
34
|
-
`npm install -g @blocklet/cli`
|
|
35
|
-
See details in [https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli](https://www.arcblock.io/docs/blocklet-developer/install-blocklet-cli)
|
|
36
|
-
|
|
37
|
-
2. Init blocklet server & start blocklet server
|
|
38
|
-
|
|
39
|
-
Before starting an blocklet server, you need to init blocklet server.
|
|
40
|
-
`blocklet server init --mode=debug`
|
|
41
|
-
`blocklet server start`
|
|
42
|
-
See details in [https://www.arcblock.io/docs/blocklet-developer/getting-started](https://www.arcblock.io/docs/blocklet-developer/getting-started)
|
|
43
|
-
|
|
44
|
-
3. Go to the project directory `cd [name]`
|
|
45
|
-
4. Install dependencies: `npm install` or `yarn`
|
|
46
|
-
5. Start development server: `blocklet dev`
|
|
47
|
-
|
|
48
|
-
## Bundle
|
|
49
|
-
|
|
50
|
-
After developing a blocklet, you may need to bundle it. Use `npm run bundle` command.
|
|
51
|
-
|
|
52
|
-
## Deploy
|
|
53
|
-
|
|
54
|
-
- 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.)
|
|
55
|
-
> Or you can simply use `npm run deploy` command.
|
|
56
|
-
- If you want to deploy this blocklet to remote blocklet server, you can use the command below.
|
|
57
|
-
|
|
58
|
-
```shell
|
|
59
|
-
blocklet deploy .blocklet/bundle --endpoint {your blocklet server url} --access-key {blocklet server access key} --access-secret {blocklet server access secret}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
> Make sure the blocklet is bundled before deployment.
|
|
63
|
-
|
|
64
|
-
## Upload to blocklet store
|
|
65
|
-
|
|
66
|
-
- If you want to upload the blocklet to any store for other users to download and use, you can following the following instructions.
|
|
67
|
-
|
|
68
|
-
Bump version at first.
|
|
69
|
-
|
|
70
|
-
```shell
|
|
71
|
-
make bump-version
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Then config blocklet store url.
|
|
75
|
-
You can use those store url in below.
|
|
76
|
-
|
|
77
|
-
1. [https://store.blocklet.dev/](https://store.blocklet.dev/)
|
|
78
|
-
2. [https://dev.store.blocklet.dev/](https://dev.store.blocklet.dev/)
|
|
79
|
-
3. A blocklet store started by yourself.
|
|
80
|
-
> 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)
|
|
81
|
-
|
|
82
|
-
```shell
|
|
83
|
-
blocklet config set store {store url}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Get a `accessToken` from blocklet store.
|
|
87
|
-
|
|
88
|
-
> Why we need a `accessToken`?
|
|
89
|
-
> A `accessToken` is genrate by blocklet store, which help us upload our blocklet to any store.
|
|
90
|
-
|
|
91
|
-
Set `accessToken` to blocklet config
|
|
92
|
-
|
|
93
|
-
```shell
|
|
94
|
-
blocklet config set accessToken {accessToken}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Upload a new version to a store.
|
|
98
|
-
|
|
99
|
-
> Make sure the blocklet is bundled before upload.
|
|
100
|
-
|
|
101
|
-
```shell
|
|
102
|
-
blocklet upload
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Or you can simply use `npm run upload` command.
|
|
106
|
-
|
|
107
|
-
- You also can upload a new version to blocklet store by Github CI.
|
|
108
|
-
Bump version at first.
|
|
109
|
-
|
|
110
|
-
```shell
|
|
111
|
-
make bump-version
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Push your code to Github main/master branch, or make a pull request to the main/master branch.
|
|
115
|
-
The CI workflow will automatically upload a new version to a store.
|
|
116
|
-
|
|
117
|
-
## Q & A
|
|
118
|
-
|
|
119
|
-
1. Q: How to change a blocklet's name?
|
|
120
|
-
|
|
121
|
-
A: Change the `name` field in the `package.json` file, change the `name` field in the `blocklet.yml` file.
|
|
122
|
-
|
|
123
|
-
You can also change the `title` field and `description` field in the `blocklet.yml` file.
|
|
124
|
-
|
|
125
|
-
Run `blocklet meta` command, you will get a `did` config, copy the `did` value.
|
|
126
|
-
|
|
127
|
-
Replace this command `"bundle": "PUBLIC_PATH=/.blocklet/proxy/<%= did %> npm run build",` in `package.json`
|
|
128
|
-
|
|
129
|
-
Replace `did` field in the `blocklet.yml`
|
|
130
|
-
|
|
131
|
-
2. Q: How to change a blocklet's logo?
|
|
132
|
-
|
|
133
|
-
Change the `logo.png` file root folder.
|
|
134
|
-
|
|
135
|
-
Or you can change the `logo` field in the `blocklet.yml` file.
|
|
136
|
-
|
|
137
|
-
> Make sure you have added the logo path to the `blocklet.yml` file `files` field.
|
|
138
|
-
|
|
139
|
-
## Learn More
|
|
140
|
-
|
|
141
|
-
- 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)
|
|
142
|
-
- Full document of Blocklet Server & blocklet development: [https://www.arcblock.io/docs/blocklet-developer](https://www.arcblock.io/docs/blocklet-developer)
|
|
143
|
-
|
|
144
|
-
## License
|
|
145
|
-
|
|
146
|
-
The code is licensed under the Apache 2.0 license found in the
|
|
147
|
-
[LICENSE](LICENSE) file.
|