@blocklet/cli 1.16.44-beta-20250513-030435-c2d99062 → 1.16.44-beta-20250516-225119-c0b5ec8d
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const chalk = require('chalk');
|
|
3
|
-
const formatError = require('@
|
|
3
|
+
const { formatError } = require('@blocklet/error');
|
|
4
4
|
const parseBlockletMeta = require('@blocklet/meta/lib/parse');
|
|
5
5
|
const hasReservedKey = require('@blocklet/meta/lib/has-reserved-key');
|
|
6
6
|
const zipBundle = require('./zip');
|
|
@@ -21,11 +21,15 @@ exports.run = () => {
|
|
|
21
21
|
childProcess.execSync(npxCommand, { stdio: 'inherit' });
|
|
22
22
|
process.exit(0);
|
|
23
23
|
} catch (error) {
|
|
24
|
-
|
|
24
|
+
if (error?.stderr) {
|
|
25
|
+
print('');
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
console.error(error);
|
|
28
|
+
|
|
29
|
+
print('');
|
|
30
|
+
printWarning(`There was a problem executing ${chalk.cyan(npxCommand)}`);
|
|
31
|
+
print(`You can try running the command directly: ${chalk.cyan(npxCommand)}\n`);
|
|
32
|
+
}
|
|
29
33
|
|
|
30
34
|
process.exit(error.status || 1);
|
|
31
35
|
}
|
|
@@ -72,7 +72,10 @@ async function confirmOpenConnectPage(
|
|
|
72
72
|
return isOpenConnectPage;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
const deploy = async (
|
|
75
|
+
const deploy = async (
|
|
76
|
+
dir,
|
|
77
|
+
{ endpoint, accessKey, accessSecret, appDid, appId, mountPoint: inputMountPoint, incremental = false }
|
|
78
|
+
) => {
|
|
76
79
|
let bundleDir = dir;
|
|
77
80
|
if (fs.existsSync(path.join(dir, BLOCKLET_BUNDLE_FOLDER))) {
|
|
78
81
|
bundleDir = path.join(dir, BLOCKLET_BUNDLE_FOLDER);
|
|
@@ -188,23 +191,26 @@ const deploy = async (dir, { endpoint, accessKey, accessSecret, appDid, appId, m
|
|
|
188
191
|
}
|
|
189
192
|
|
|
190
193
|
let blockletDiff;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
headers: {
|
|
202
|
-
'x-access-blocklet': rootDid,
|
|
194
|
+
if (incremental) {
|
|
195
|
+
printInfo('Incremental mode, fetching blocklet diff...');
|
|
196
|
+
try {
|
|
197
|
+
blockletDiff = await client.getBlockletDiff(
|
|
198
|
+
{
|
|
199
|
+
input: {
|
|
200
|
+
did: localMeta.did,
|
|
201
|
+
hashFiles: Object.entries(files).map(([file, hash]) => ({ file, hash })),
|
|
202
|
+
rootDid: rootDid || '',
|
|
203
|
+
},
|
|
203
204
|
},
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
205
|
+
{
|
|
206
|
+
headers: {
|
|
207
|
+
'x-access-blocklet': rootDid,
|
|
208
|
+
},
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
} catch (error) {
|
|
212
|
+
throw new Error(`Blocklet deploy failed when fetching diff: ${formatGQLError(error)}`);
|
|
213
|
+
}
|
|
208
214
|
}
|
|
209
215
|
|
|
210
216
|
const {
|
|
@@ -213,7 +219,7 @@ const deploy = async (dir, { endpoint, accessKey, accessSecret, appDid, appId, m
|
|
|
213
219
|
deleteSet = [],
|
|
214
220
|
hasBlocklet: hasDiff,
|
|
215
221
|
version: serverVersion,
|
|
216
|
-
} = blockletDiff
|
|
222
|
+
} = blockletDiff?.blockletDiff || {};
|
|
217
223
|
|
|
218
224
|
printInfo(`Name: ${chalk.cyan(localMeta.name)}`);
|
|
219
225
|
printInfo(`DID: ${chalk.cyan(localMeta.did)}`);
|
|
@@ -239,6 +245,7 @@ const deploy = async (dir, { endpoint, accessKey, accessSecret, appDid, appId, m
|
|
|
239
245
|
integrity: localMeta.dist.integrity,
|
|
240
246
|
},
|
|
241
247
|
});
|
|
248
|
+
|
|
242
249
|
try {
|
|
243
250
|
const timestamp = Date.now();
|
|
244
251
|
const timer = setInterval(() => {
|
package/lib/commands/index.js
CHANGED
|
@@ -155,6 +155,7 @@ program
|
|
|
155
155
|
.option('--app-id <did>', 'Which app to mount to when deploy a component')
|
|
156
156
|
.option('--app-did <did>', '[Deprecated] Alias of --app-id')
|
|
157
157
|
.option('--mount-point <mountPoint>', 'Mount point to the app when deploy a component')
|
|
158
|
+
.option('--incremental', 'Deploy only changed files compared to the previous version', false)
|
|
158
159
|
.description('Deploy blocklet from local directory to Blocklet Server')
|
|
159
160
|
.action(parseArgsAndOptions(deploy.run));
|
|
160
161
|
|
|
@@ -121,7 +121,10 @@ module.exports = (parentCommand = '') => {
|
|
|
121
121
|
|
|
122
122
|
program
|
|
123
123
|
.command('cleanup')
|
|
124
|
-
.option(
|
|
124
|
+
.option(
|
|
125
|
+
'--target <target>',
|
|
126
|
+
'Which target to cleanup, available options: cache, maintenance-status, blacklist, blacklist-expired'
|
|
127
|
+
)
|
|
125
128
|
.description('Do some server level cleanup work')
|
|
126
129
|
.action(parseOptions(cleanup.run));
|
|
127
130
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
2
|
const cloneDeep = require('@abtnode/util/lib/deep-clone');
|
|
3
3
|
const { parseComponents } = require('@blocklet/resolver');
|
|
4
|
-
const formatError = require('@
|
|
4
|
+
const { formatError } = require('@blocklet/error');
|
|
5
5
|
|
|
6
6
|
const { printSuccess, printError, printInfo } = require('../index');
|
|
7
7
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/cli",
|
|
3
|
-
"version": "1.16.44-beta-
|
|
3
|
+
"version": "1.16.44-beta-20250516-225119-c0b5ec8d",
|
|
4
4
|
"description": "Command line tools to manage Blocklet Server",
|
|
5
5
|
"homepage": "https://github.com/ArcBlock/blocklet-server#readme",
|
|
6
6
|
"bin": {
|
|
@@ -35,30 +35,31 @@
|
|
|
35
35
|
"url": "https://github.com/ArcBlock/blocklet-server/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@abtnode/blocklet-services": "1.16.44-beta-
|
|
39
|
-
"@abtnode/client": "1.16.44-beta-
|
|
40
|
-
"@abtnode/constant": "1.16.44-beta-
|
|
41
|
-
"@abtnode/core": "1.16.44-beta-
|
|
42
|
-
"@abtnode/logger": "1.16.44-beta-
|
|
43
|
-
"@abtnode/router-provider": "1.16.44-beta-
|
|
44
|
-
"@abtnode/util": "1.16.44-beta-
|
|
45
|
-
"@abtnode/webapp": "1.16.44-beta-
|
|
46
|
-
"@arcblock/did": "1.20.
|
|
47
|
-
"@arcblock/event-hub": "1.20.
|
|
38
|
+
"@abtnode/blocklet-services": "1.16.44-beta-20250516-225119-c0b5ec8d",
|
|
39
|
+
"@abtnode/client": "1.16.44-beta-20250516-225119-c0b5ec8d",
|
|
40
|
+
"@abtnode/constant": "1.16.44-beta-20250516-225119-c0b5ec8d",
|
|
41
|
+
"@abtnode/core": "1.16.44-beta-20250516-225119-c0b5ec8d",
|
|
42
|
+
"@abtnode/logger": "1.16.44-beta-20250516-225119-c0b5ec8d",
|
|
43
|
+
"@abtnode/router-provider": "1.16.44-beta-20250516-225119-c0b5ec8d",
|
|
44
|
+
"@abtnode/util": "1.16.44-beta-20250516-225119-c0b5ec8d",
|
|
45
|
+
"@abtnode/webapp": "1.16.44-beta-20250516-225119-c0b5ec8d",
|
|
46
|
+
"@arcblock/did": "1.20.11",
|
|
47
|
+
"@arcblock/event-hub": "1.20.11",
|
|
48
48
|
"@arcblock/ipfs-only-hash": "^0.0.2",
|
|
49
|
-
"@arcblock/jwt": "1.20.
|
|
50
|
-
"@arcblock/ws": "1.20.
|
|
51
|
-
"@blocklet/constant": "1.16.44-beta-
|
|
49
|
+
"@arcblock/jwt": "1.20.11",
|
|
50
|
+
"@arcblock/ws": "1.20.11",
|
|
51
|
+
"@blocklet/constant": "1.16.44-beta-20250516-225119-c0b5ec8d",
|
|
52
|
+
"@blocklet/error": "^0.2.4",
|
|
52
53
|
"@blocklet/form-collector": "^0.1.8",
|
|
53
|
-
"@blocklet/images": "1.16.44-beta-
|
|
54
|
-
"@blocklet/meta": "1.16.44-beta-
|
|
55
|
-
"@blocklet/resolver": "1.16.44-beta-
|
|
56
|
-
"@blocklet/store": "1.16.44-beta-
|
|
57
|
-
"@blocklet/theme-builder": "^0.1.
|
|
58
|
-
"@ocap/client": "1.20.
|
|
59
|
-
"@ocap/mcrypto": "1.20.
|
|
60
|
-
"@ocap/util": "1.20.
|
|
61
|
-
"@ocap/wallet": "1.20.
|
|
54
|
+
"@blocklet/images": "1.16.44-beta-20250516-225119-c0b5ec8d",
|
|
55
|
+
"@blocklet/meta": "1.16.44-beta-20250516-225119-c0b5ec8d",
|
|
56
|
+
"@blocklet/resolver": "1.16.44-beta-20250516-225119-c0b5ec8d",
|
|
57
|
+
"@blocklet/store": "1.16.44-beta-20250516-225119-c0b5ec8d",
|
|
58
|
+
"@blocklet/theme-builder": "^0.1.17",
|
|
59
|
+
"@ocap/client": "1.20.11",
|
|
60
|
+
"@ocap/mcrypto": "1.20.11",
|
|
61
|
+
"@ocap/util": "1.20.11",
|
|
62
|
+
"@ocap/wallet": "1.20.11",
|
|
62
63
|
"@vercel/ncc": "^0.38.3",
|
|
63
64
|
"archiver": "^7.0.1",
|
|
64
65
|
"async": "^3.2.4",
|
|
@@ -152,7 +153,7 @@
|
|
|
152
153
|
"engines": {
|
|
153
154
|
"node": ">=14"
|
|
154
155
|
},
|
|
155
|
-
"gitHead": "
|
|
156
|
+
"gitHead": "eb15dee761c0ea273981c848992e5f29b94a69dc",
|
|
156
157
|
"devDependencies": {
|
|
157
158
|
"@types/fs-extra": "^11.0.4",
|
|
158
159
|
"@types/jest": "^29.5.13"
|