@abtnode/core 1.8.20 → 1.8.22

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.
@@ -16,10 +16,10 @@ const runUserHook = async (processId, hookName, args) => {
16
16
  return;
17
17
  }
18
18
 
19
- logger.info(`run hook:${hookName}:`, { hook });
19
+ logger.info(`run hook:${hookName}:`, { processId, hook });
20
20
  await runScript(hook, [processId, hookName].join(':'), { cwd: appDir, env: getSafeEnv(env), silent });
21
21
  } catch (error) {
22
- logger.error(`run ${hook} error:`, { error });
22
+ logger.error(`run ${hook} error:`, { processId, error });
23
23
 
24
24
  if (notification) {
25
25
  notification.create({
@@ -32,12 +32,11 @@ const runUserHook = async (processId, hookName, args) => {
32
32
  }
33
33
 
34
34
  if (exitOnError) {
35
- throw new Error(`Run [${hookName}] failed: ${error.message}`);
35
+ throw new Error(`Run [${processId} - ${hookName}] failed: ${error.message}`);
36
36
  }
37
37
  }
38
38
  };
39
39
 
40
- const preDeploy = (processId, ...args) => runUserHook(processId, 'pre-deploy', ...args);
41
40
  const preInstall = (processId, ...args) => runUserHook(processId, 'pre-install', ...args);
42
41
  const postInstall = (processId, ...args) => runUserHook(processId, 'post-install', ...args);
43
42
  const preConfig = (processId, ...args) => runUserHook(processId, 'pre-config', ...args);
@@ -56,8 +55,8 @@ const preStart = async (blocklet, options) => {
56
55
  return runUserHook(blocklet.env.processId, 'pre-start', options);
57
56
  };
58
57
 
59
- const postStart = (processId, ...args) => runUserHook(processId, 'post-start', ...args);
58
+ const postStart = (blocklet, ...args) => runUserHook(blocklet.env.processId, 'post-start', ...args);
60
59
  const preUninstall = (processId, ...args) => runUserHook(processId, 'pre-uninstall', ...args);
61
60
  const preStop = (processId, ...args) => runUserHook(processId, 'pre-stop', ...args);
62
61
 
63
- module.exports = { preDeploy, preInstall, postInstall, preStart, postStart, preUninstall, preStop, preConfig };
62
+ module.exports = { preInstall, postInstall, preStart, postStart, preUninstall, preStop, preConfig };
@@ -1195,7 +1195,7 @@ class BlockletManager extends BaseBlockletManager {
1195
1195
  // ============================================================================================
1196
1196
 
1197
1197
  /**
1198
- * After the dev function finished, the caller should send a BlockletEvents.deployed event to the daemon
1198
+ * After the dev function finished, the caller should send a BlockletEvents.installed event to the daemon
1199
1199
  * @returns {Object} blocklet
1200
1200
  */
1201
1201
  async dev(folder, { rootDid, mountPoint } = {}) {
package/lib/event.js CHANGED
@@ -163,7 +163,7 @@ module.exports = ({
163
163
  const handleBlockletEvent = async (eventName, payload) => {
164
164
  const blocklet = payload.blocklet || payload;
165
165
 
166
- if ([BlockletEvents.deployed, BlockletEvents.installed].includes(eventName)) {
166
+ if ([BlockletEvents.installed].includes(eventName)) {
167
167
  await handleBlockletAdd(eventName, payload);
168
168
 
169
169
  try {
@@ -348,12 +348,19 @@ const getRuntimeEnvironments = (blocklet, nodeEnvironments, ancestors) => {
348
348
 
349
349
  const mountPoints = [];
350
350
  for (const x of root.children || []) {
351
- mountPoints.push({
351
+ const mountPoint = {
352
352
  title: x.meta.title,
353
353
  did: x.meta.bundleDid,
354
354
  name: x.meta.bundleName,
355
355
  mountPoint: x.mountPoint || '',
356
- });
356
+ };
357
+
358
+ const webInterface = findWebInterface(x);
359
+ if (webInterface && x.environmentObj[webInterface.port]) {
360
+ mountPoint.port = x.environmentObj[webInterface.port];
361
+ }
362
+
363
+ mountPoints.push(mountPoint);
357
364
  }
358
365
 
359
366
  return {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.8.20",
6
+ "version": "1.8.22",
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.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",
22
+ "@abtnode/auth": "1.8.22",
23
+ "@abtnode/certificate-manager": "1.8.22",
24
+ "@abtnode/constant": "1.8.22",
25
+ "@abtnode/cron": "1.8.22",
26
+ "@abtnode/db": "1.8.22",
27
+ "@abtnode/logger": "1.8.22",
28
+ "@abtnode/queue": "1.8.22",
29
+ "@abtnode/rbac": "1.8.22",
30
+ "@abtnode/router-provider": "1.8.22",
31
+ "@abtnode/static-server": "1.8.22",
32
+ "@abtnode/timemachine": "1.8.22",
33
+ "@abtnode/util": "1.8.22",
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.20",
42
- "@blocklet/sdk": "1.8.20",
41
+ "@blocklet/meta": "1.8.22",
42
+ "@blocklet/sdk": "1.8.22",
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": "abe47e26c9583bfe5c4969e19cd36574f436a515"
83
+ "gitHead": "b0b31c2a0d29de79b29591f020f577d6c3806248"
84
84
  }