create-blocklet 0.2.9 → 0.2.10

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.
@@ -27,8 +27,8 @@ jobs:
27
27
  skip-upload: false
28
28
  skip-deploy: false
29
29
  bundle-command: yarn bundle
30
- store-endpoint: ${{ secrets.STORE_ENDPOINT_STAGING }}
31
- store-access-token: ${{ secrets.STORE_ACCESS_TOKEN_STAGING }}
30
+ store-endpoint: ${{ secrets.STORE_ENDPOINT_DEV }}
31
+ store-access-token: ${{ secrets.STORE_ACCESS_TOKEN_DEV }}
32
32
  server-endpoint: ${{ secrets.STAGING_NODE_ENDPOINT }}
33
33
  server-access-key: ${{ secrets.STAGING_NODE_ACCESS_KEY }}
34
34
  server-access-secret: ${{ secrets.STAGING_NODE_ACCESS_SECRET }}
package/index.js CHANGED
@@ -12,12 +12,7 @@ import * as envfile from 'envfile';
12
12
 
13
13
  import { echoBrand, echoDocument } from './lib/arcblock.js';
14
14
  import { getAuthor } from './lib/npm.js';
15
- import {
16
- checkAbtnodeInstalled,
17
- checkAbtnodeRunning,
18
- checkSatisfiedVersion,
19
- getAbtnodeDirectory,
20
- } from './lib/abtnode.js';
15
+ import { checkServerInstalled, checkServerRunning, checkSatisfiedVersion, getServerDirectory } from './lib/server.js';
21
16
  import { toBlockletDid, toDidIcon } from './lib/did.js';
22
17
 
23
18
  const argv = minimist(process.argv.slice(2));
@@ -201,11 +196,11 @@ async function init() {
201
196
 
202
197
  console.log('Checking blocklet server runtime environment...', '\n');
203
198
 
204
- const isAbtnodeInstalled = checkAbtnodeInstalled();
199
+ const isServerInstalled = checkServerInstalled();
205
200
  const isSatisfiedVersion = checkSatisfiedVersion();
206
- const isAbtnodeRunning = checkAbtnodeRunning();
201
+ const isServerRunning = checkServerRunning();
207
202
 
208
- if (!isAbtnodeInstalled) {
203
+ if (!isServerInstalled) {
209
204
  // 未安装 blocklet server
210
205
  console.log(red('To run the blocklet, you need a running blocklet server instance on local machine.'), '\n');
211
206
  console.log(`Checkout ${green('README.md')} for more usage instructions.`);
@@ -216,9 +211,9 @@ async function init() {
216
211
  // 已安装 blocklet server,但版本不满足
217
212
  console.log(red('Your blocklet server version is outdate, please update it to the latest version.'));
218
213
  console.log('Now you should run:', '\n');
219
- if (isAbtnodeRunning) {
214
+ if (isServerRunning) {
220
215
  // blocklet server 已经启动
221
- const serverPath = getAbtnodeDirectory();
216
+ const serverPath = getServerDirectory();
222
217
  console.log(cyan(`cd ${serverPath}`));
223
218
  console.log(cyan('blocklet server stop'));
224
219
  console.log(cyan('npm install -g @blocklet/cli'));
@@ -230,7 +225,7 @@ async function init() {
230
225
  console.log(cyan('npm install -g @blocklet/cli'));
231
226
  console.log(cyan('blocklet server start -a'));
232
227
  }
233
- } else if (!isAbtnodeRunning) {
228
+ } else if (!isServerRunning) {
234
229
  // 已经安装 blocklet server,且版本满足,并且 blocklet server 未启动
235
230
  console.log(red('You need to start your blocklet server before develop this blocklet.'));
236
231
  console.log('Now you should run:', '\n');
@@ -1,27 +1,27 @@
1
1
  import semver from 'semver';
2
2
  import { getOutput } from './index.js';
3
3
 
4
- export function checkAbtnodeInstalled() {
4
+ export function checkServerInstalled() {
5
5
  const output = getOutput('which blocklet');
6
6
  return !!output;
7
7
  }
8
8
 
9
- export function getAbtnodeVersion() {
9
+ export function getServerVersion() {
10
10
  const output = getOutput('blocklet --version');
11
11
  return output.trim();
12
12
  }
13
13
 
14
- export function getAbtnodeStatus() {
14
+ export function getServerStatus() {
15
15
  const output = getOutput('blocklet server status');
16
- const [matchStr] = output.match(/ABT Node status:[\s\S]*?\n/gm) || [];
16
+ const [matchStr] = output.match(/Blocklet Server status:[\s\S]*?\n/g) || [];
17
17
  if (!matchStr) {
18
18
  return 'stop';
19
19
  }
20
- const status = matchStr.replace(/ABT Node status:[\s]*([\S]+)\n/gm, '$1');
20
+ const status = matchStr.replace(/Blocklet Server status:\s*(\S+)\s*\S*\n*[\s\S]*/gm, '$1');
21
21
  return status.toLowerCase();
22
22
  }
23
- export function checkAbtnodeRunning() {
24
- const status = getAbtnodeStatus();
23
+ export function checkServerRunning() {
24
+ const status = getServerStatus();
25
25
  return status === 'running';
26
26
  }
27
27
 
@@ -31,7 +31,7 @@ export function checkSatisfiedVersion() {
31
31
  return semver.satisfies(version, '>= 1.6.1');
32
32
  }
33
33
 
34
- export function getAbtnodeDirectory() {
34
+ export function getServerDirectory() {
35
35
  const output = getOutput('blocklet server status');
36
36
  const [matchStr] = output.match(/Blocklet Server Data Directory:[\s\S]*?\n/gm) || [];
37
37
  if (!matchStr) return null;
@@ -39,7 +39,3 @@ export function getAbtnodeDirectory() {
39
39
  const directory = matchStr.replace(/Blocklet Server Data Directory:[\s]*([\S]+)\/\.abtnode\n/gm, '$1');
40
40
  return directory;
41
41
  }
42
-
43
- const dic = getAbtnodeDirectory();
44
-
45
- console.log(dic);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-blocklet",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "exports": "./index.js",
5
5
  "type": "module",
6
6
  "repository": "git@github.com:blocklet/create-blocklet.git",
@@ -145,7 +145,7 @@ After developing a blocklet, you may need to bundle it. Use `npm run bundle` com
145
145
  ## Learn More
146
146
 
147
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 AbtNode & blocklet development: [https://docs.arcblock.io/abtnode/en/introduction](https://docs.arcblock.io/abtnode/en/introduction)
148
+ - Full document of Blocklet Server & blocklet development: [https://docs.arcblock.io/abtnode/en/introduction](https://docs.arcblock.io/abtnode/en/introduction)
149
149
 
150
150
  ## License
151
151
 
@@ -1,6 +1,6 @@
1
1
  name: template-react
2
2
  title: Blocklet Template React
3
- description: An ABT Node blocklet
3
+ description: A Blocklet Server blocklet
4
4
  keywords:
5
5
  - blocklet
6
6
  - react
@@ -139,7 +139,7 @@ After developing a blocklet, you may need to bundle it. Use `npm run bundle` com
139
139
  ## Learn More
140
140
 
141
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 AbtNode & blocklet development: [https://docs.arcblock.io/abtnode/en/introduction](https://docs.arcblock.io/abtnode/en/introduction)
142
+ - Full document of Blocklet Server & blocklet development: [https://docs.arcblock.io/abtnode/en/introduction](https://docs.arcblock.io/abtnode/en/introduction)
143
143
 
144
144
  ## License
145
145
 
@@ -1,6 +1,6 @@
1
1
  name: template-vue
2
2
  title: Blocklet Template Vue
3
- description: ABT Node blocklet project
3
+ description: A Blocklet Server blocklet
4
4
  keywords:
5
5
  - blocklet
6
6
  - vue
@@ -139,7 +139,7 @@ After developing a blocklet, you may need to bundle it. Use `npm run bundle` com
139
139
  ## Learn More
140
140
 
141
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 AbtNode & blocklet development: [https://docs.arcblock.io/abtnode/en/introduction](https://docs.arcblock.io/abtnode/en/introduction)
142
+ - Full document of Blocklet Server & blocklet development: [https://docs.arcblock.io/abtnode/en/introduction](https://docs.arcblock.io/abtnode/en/introduction)
143
143
 
144
144
  ## License
145
145
 
@@ -1,6 +1,6 @@
1
1
  name: template-vue2
2
2
  title: Blocklet Template Vue2
3
- description: ABT Node blocklet project
3
+ description: A Blocklet Server blocklet
4
4
  keywords:
5
5
  - blocklet
6
6
  - vue
@@ -139,7 +139,7 @@ After developing a blocklet, you may need to bundle it. Use `npm run bundle` com
139
139
  ## Learn More
140
140
 
141
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 AbtNode & blocklet development: [https://docs.arcblock.io/abtnode/en/introduction](https://docs.arcblock.io/abtnode/en/introduction)
142
+ - Full document of Blocklet Server & blocklet development: [https://docs.arcblock.io/abtnode/en/introduction](https://docs.arcblock.io/abtnode/en/introduction)
143
143
 
144
144
  ## License
145
145
 
@@ -1,6 +1,6 @@
1
1
  name: template-react
2
2
  title: Blocklet Template React
3
- description: ABT Node blocklet project
3
+ description: A Blocklet Server blocklet
4
4
  keywords:
5
5
  - blocklet
6
6
  - react
@@ -139,7 +139,7 @@ After developing a blocklet, you may need to bundle it. Use `npm run bundle` com
139
139
  ## Learn More
140
140
 
141
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 AbtNode & blocklet development: [https://docs.arcblock.io/abtnode/en/introduction](https://docs.arcblock.io/abtnode/en/introduction)
142
+ - Full document of Blocklet Server & blocklet development: [https://docs.arcblock.io/abtnode/en/introduction](https://docs.arcblock.io/abtnode/en/introduction)
143
143
 
144
144
  ## License
145
145
 
@@ -1,6 +1,6 @@
1
1
  name: template-vue
2
2
  title: Blocklet Template Vue
3
- description: ABT Node blocklet project
3
+ description: A Blocklet Server blocklet
4
4
  keywords:
5
5
  - blocklet
6
6
  - vue
@@ -139,7 +139,7 @@ After developing a blocklet, you may need to bundle it. Use `npm run bundle` com
139
139
  ## Learn More
140
140
 
141
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 AbtNode & blocklet development: [https://docs.arcblock.io/abtnode/en/introduction](https://docs.arcblock.io/abtnode/en/introduction)
142
+ - Full document of Blocklet Server & blocklet development: [https://docs.arcblock.io/abtnode/en/introduction](https://docs.arcblock.io/abtnode/en/introduction)
143
143
 
144
144
  ## License
145
145
 
@@ -1,6 +1,6 @@
1
1
  name: template-vue2
2
2
  title: Blocklet Template Vue2
3
- description: ABT Node blocklet project
3
+ description: A Blocklet Server blocklet
4
4
  keywords:
5
5
  - blocklet
6
6
  - vue