@abtnode/core 1.8.19 → 1.8.20
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/lib/blocklet/manager/disk.js +30 -2
- package/lib/util/blocklet.js +10 -14
- package/package.json +16 -16
|
@@ -560,12 +560,30 @@ class BlockletManager extends BaseBlockletManager {
|
|
|
560
560
|
}),
|
|
561
561
|
});
|
|
562
562
|
|
|
563
|
-
|
|
563
|
+
const doc = await this._deleteBlocklet({ did, keepData, keepLogsDir, keepConfigs }, context);
|
|
564
|
+
states.notification.create({
|
|
565
|
+
title: 'Blocklet Deleted',
|
|
566
|
+
description: `Blocklet ${doc.meta.name}@${doc.meta.version} is deleted.`,
|
|
567
|
+
entityType: 'blocklet',
|
|
568
|
+
entityId: doc.meta.did,
|
|
569
|
+
severity: 'success',
|
|
570
|
+
});
|
|
571
|
+
return doc;
|
|
564
572
|
} catch (err) {
|
|
565
573
|
// If we installed a corrupted blocklet accidentally, just cleanup the disk and state db
|
|
566
574
|
if (err.code === 'BLOCKLET_CORRUPTED') {
|
|
567
575
|
logger.info('blocklet is corrupted, will delete again', { did });
|
|
568
|
-
|
|
576
|
+
const doc = await this._deleteBlocklet({ did, keepData, keepLogsDir, keepConfigs }, context);
|
|
577
|
+
|
|
578
|
+
states.notification.create({
|
|
579
|
+
title: 'Blocklet Deleted',
|
|
580
|
+
description: `Blocklet ${doc.meta.name}@${doc.meta.version} is deleted.`,
|
|
581
|
+
entityType: 'blocklet',
|
|
582
|
+
entityId: doc.meta.did,
|
|
583
|
+
severity: 'success',
|
|
584
|
+
});
|
|
585
|
+
|
|
586
|
+
return doc;
|
|
569
587
|
}
|
|
570
588
|
|
|
571
589
|
throw err;
|
|
@@ -681,6 +699,16 @@ class BlockletManager extends BaseBlockletManager {
|
|
|
681
699
|
|
|
682
700
|
const newBlocklet = await this.ensureBlocklet(rootDid);
|
|
683
701
|
this.emit(BlockletEvents.upgraded, { blocklet: newBlocklet, context }); // trigger router refresh
|
|
702
|
+
|
|
703
|
+
states.notification.create({
|
|
704
|
+
title: 'Component Deleted',
|
|
705
|
+
description: `Component ${child.meta.name} of ${newBlocklet.meta.name} is successfully deleted.`,
|
|
706
|
+
entityType: 'blocklet',
|
|
707
|
+
entityId: newBlocklet.meta.did,
|
|
708
|
+
severity: 'success',
|
|
709
|
+
action: `/blocklets/${newBlocklet.meta.did}/components`,
|
|
710
|
+
});
|
|
711
|
+
|
|
684
712
|
return newBlocklet;
|
|
685
713
|
}
|
|
686
714
|
|
package/lib/util/blocklet.js
CHANGED
|
@@ -220,21 +220,17 @@ const fillBlockletConfigs = (blocklet, configs) => {
|
|
|
220
220
|
};
|
|
221
221
|
|
|
222
222
|
const ensureBlockletExpanded = async (meta, appDir) => {
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
const nodeModulesPath = path.join(appDir, 'node_modules');
|
|
230
|
-
if (fs.existsSync(nodeModulesPath)) {
|
|
231
|
-
fs.removeSync(nodeModulesPath);
|
|
232
|
-
}
|
|
233
|
-
await expandBundle(bundlePath, appDir);
|
|
234
|
-
fs.removeSync(bundlePath);
|
|
235
|
-
} catch (err) {
|
|
236
|
-
throw new Error(`Failed to expand blocklet bundle: ${err.message}`);
|
|
223
|
+
const bundlePath = path.join(appDir, BLOCKLET_BUNDLE_FILE);
|
|
224
|
+
if (fs.existsSync(bundlePath)) {
|
|
225
|
+
try {
|
|
226
|
+
const nodeModulesPath = path.join(appDir, 'node_modules');
|
|
227
|
+
if (fs.existsSync(nodeModulesPath)) {
|
|
228
|
+
fs.removeSync(nodeModulesPath);
|
|
237
229
|
}
|
|
230
|
+
await expandBundle(bundlePath, appDir);
|
|
231
|
+
fs.removeSync(bundlePath);
|
|
232
|
+
} catch (err) {
|
|
233
|
+
throw new Error(`Failed to expand blocklet bundle: ${err.message}`);
|
|
238
234
|
}
|
|
239
235
|
}
|
|
240
236
|
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.8.
|
|
6
|
+
"version": "1.8.20",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -19,18 +19,18 @@
|
|
|
19
19
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@abtnode/auth": "1.8.
|
|
23
|
-
"@abtnode/certificate-manager": "1.8.
|
|
24
|
-
"@abtnode/constant": "1.8.
|
|
25
|
-
"@abtnode/cron": "1.8.
|
|
26
|
-
"@abtnode/db": "1.8.
|
|
27
|
-
"@abtnode/logger": "1.8.
|
|
28
|
-
"@abtnode/queue": "1.8.
|
|
29
|
-
"@abtnode/rbac": "1.8.
|
|
30
|
-
"@abtnode/router-provider": "1.8.
|
|
31
|
-
"@abtnode/static-server": "1.8.
|
|
32
|
-
"@abtnode/timemachine": "1.8.
|
|
33
|
-
"@abtnode/util": "1.8.
|
|
22
|
+
"@abtnode/auth": "1.8.20",
|
|
23
|
+
"@abtnode/certificate-manager": "1.8.20",
|
|
24
|
+
"@abtnode/constant": "1.8.20",
|
|
25
|
+
"@abtnode/cron": "1.8.20",
|
|
26
|
+
"@abtnode/db": "1.8.20",
|
|
27
|
+
"@abtnode/logger": "1.8.20",
|
|
28
|
+
"@abtnode/queue": "1.8.20",
|
|
29
|
+
"@abtnode/rbac": "1.8.20",
|
|
30
|
+
"@abtnode/router-provider": "1.8.20",
|
|
31
|
+
"@abtnode/static-server": "1.8.20",
|
|
32
|
+
"@abtnode/timemachine": "1.8.20",
|
|
33
|
+
"@abtnode/util": "1.8.20",
|
|
34
34
|
"@arcblock/did": "1.17.19",
|
|
35
35
|
"@arcblock/did-motif": "^1.1.10",
|
|
36
36
|
"@arcblock/did-util": "1.17.19",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@arcblock/jwt": "^1.17.19",
|
|
39
39
|
"@arcblock/pm2-events": "^0.0.5",
|
|
40
40
|
"@arcblock/vc": "1.17.19",
|
|
41
|
-
"@blocklet/meta": "1.8.
|
|
42
|
-
"@blocklet/sdk": "1.8.
|
|
41
|
+
"@blocklet/meta": "1.8.20",
|
|
42
|
+
"@blocklet/sdk": "1.8.20",
|
|
43
43
|
"@fidm/x509": "^1.2.1",
|
|
44
44
|
"@ocap/mcrypto": "1.17.19",
|
|
45
45
|
"@ocap/util": "1.17.19",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"express": "^4.18.1",
|
|
81
81
|
"jest": "^27.5.1"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "abe47e26c9583bfe5c4969e19cd36574f436a515"
|
|
84
84
|
}
|