@abtnode/core 1.16.15-beta-74505f06 → 1.16.15-beta-04d1e821

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.
Files changed (2) hide show
  1. package/lib/router/index.js +19 -19
  2. package/package.json +19 -19
@@ -194,6 +194,23 @@ Router.formatSites = (sites = []) => {
194
194
  const rules = Array.isArray(site.rules) ? cloneDeep(site.rules) : [];
195
195
  const grouped = {};
196
196
 
197
+ // 0. serve robots.txt/sitemap.xml from root and proxy to daemon
198
+ if (isBlockletSite(site.domain) && !site.rules.find((x) => x.from.pathPrefix === '/robots.txt')) {
199
+ site.rules.push({
200
+ dynamic: true,
201
+ from: {
202
+ pathPrefix: '/',
203
+ groupPathPrefix: '/',
204
+ pathSuffix: '/(robots.txt|sitemap.xml)',
205
+ },
206
+ to: {
207
+ type: ROUTING_RULE_TYPES.DAEMON,
208
+ port: daemonRule.to.port,
209
+ did: site.blockletDid,
210
+ },
211
+ });
212
+ }
213
+
197
214
  // 1. serve blocklet.js for each component: both prefix and suffix do not contain trailing slash
198
215
  rules.forEach((rule) => {
199
216
  if ([ROUTING_RULE_TYPES.BLOCKLET].includes(rule.to.type) === false) {
@@ -209,29 +226,12 @@ Router.formatSites = (sites = []) => {
209
226
  }
210
227
 
211
228
  grouped[rule.from.groupPathPrefix] = rule;
212
-
213
- site.rules.push({
214
- dynamic: true,
215
- from: {
216
- pathPrefix: rule.from.pathPrefix,
217
- groupPathPrefix: rule.from.groupPathPrefix,
218
- pathSuffix: '/__meta__.js',
219
- },
220
- to: {
221
- type: ROUTING_RULE_TYPES.DAEMON,
222
- port: daemonRule.to.port,
223
- did: rule.to.did,
224
- componentId: rule.to.componentId,
225
- cacheGroup: site.mode === BLOCKLET_MODES.PRODUCTION ? 'blockletJs' : '',
226
- pageGroup: rule.to.pageGroup,
227
- },
228
- });
229
229
  site.rules.push({
230
230
  dynamic: true,
231
231
  from: {
232
232
  pathPrefix: rule.from.pathPrefix,
233
233
  groupPathPrefix: rule.from.groupPathPrefix,
234
- pathSuffix: '/__blocklet__.js',
234
+ pathSuffix: '/__(meta|blocklet)__.js',
235
235
  },
236
236
  to: {
237
237
  type: ROUTING_RULE_TYPES.DAEMON,
@@ -259,7 +259,7 @@ Router.formatSites = (sites = []) => {
259
259
  const rootFrom = {
260
260
  pathPrefix: groupPathPrefix,
261
261
  groupPathPrefix,
262
- pathSuffix: '/__blocklet__.js',
262
+ pathSuffix: '/__(meta|blocklet)__.js',
263
263
  };
264
264
 
265
265
  const rule = grouped[groupPathPrefix];
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.15-beta-74505f06",
6
+ "version": "1.16.15-beta-04d1e821",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,19 +19,19 @@
19
19
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
20
20
  "license": "Apache-2.0",
21
21
  "dependencies": {
22
- "@abtnode/analytics": "1.16.15-beta-74505f06",
23
- "@abtnode/auth": "1.16.15-beta-74505f06",
24
- "@abtnode/certificate-manager": "1.16.15-beta-74505f06",
25
- "@abtnode/constant": "1.16.15-beta-74505f06",
26
- "@abtnode/cron": "1.16.15-beta-74505f06",
27
- "@abtnode/logger": "1.16.15-beta-74505f06",
28
- "@abtnode/models": "1.16.15-beta-74505f06",
29
- "@abtnode/queue": "1.16.15-beta-74505f06",
30
- "@abtnode/rbac": "1.16.15-beta-74505f06",
31
- "@abtnode/router-provider": "1.16.15-beta-74505f06",
32
- "@abtnode/static-server": "1.16.15-beta-74505f06",
33
- "@abtnode/timemachine": "1.16.15-beta-74505f06",
34
- "@abtnode/util": "1.16.15-beta-74505f06",
22
+ "@abtnode/analytics": "1.16.15-beta-04d1e821",
23
+ "@abtnode/auth": "1.16.15-beta-04d1e821",
24
+ "@abtnode/certificate-manager": "1.16.15-beta-04d1e821",
25
+ "@abtnode/constant": "1.16.15-beta-04d1e821",
26
+ "@abtnode/cron": "1.16.15-beta-04d1e821",
27
+ "@abtnode/logger": "1.16.15-beta-04d1e821",
28
+ "@abtnode/models": "1.16.15-beta-04d1e821",
29
+ "@abtnode/queue": "1.16.15-beta-04d1e821",
30
+ "@abtnode/rbac": "1.16.15-beta-04d1e821",
31
+ "@abtnode/router-provider": "1.16.15-beta-04d1e821",
32
+ "@abtnode/static-server": "1.16.15-beta-04d1e821",
33
+ "@abtnode/timemachine": "1.16.15-beta-04d1e821",
34
+ "@abtnode/util": "1.16.15-beta-04d1e821",
35
35
  "@arcblock/did": "1.18.89",
36
36
  "@arcblock/did-auth": "1.18.89",
37
37
  "@arcblock/did-ext": "^1.18.89",
@@ -42,10 +42,10 @@
42
42
  "@arcblock/pm2-events": "^0.0.5",
43
43
  "@arcblock/validator": "^1.18.89",
44
44
  "@arcblock/vc": "1.18.89",
45
- "@blocklet/constant": "1.16.15-beta-74505f06",
46
- "@blocklet/meta": "1.16.15-beta-74505f06",
47
- "@blocklet/resolver": "1.16.15-beta-74505f06",
48
- "@blocklet/sdk": "1.16.15-beta-74505f06",
45
+ "@blocklet/constant": "1.16.15-beta-04d1e821",
46
+ "@blocklet/meta": "1.16.15-beta-04d1e821",
47
+ "@blocklet/resolver": "1.16.15-beta-04d1e821",
48
+ "@blocklet/sdk": "1.16.15-beta-04d1e821",
49
49
  "@did-space/client": "^0.2.141",
50
50
  "@fidm/x509": "^1.2.1",
51
51
  "@ocap/mcrypto": "1.18.89",
@@ -98,5 +98,5 @@
98
98
  "jest": "^27.5.1",
99
99
  "unzipper": "^0.10.11"
100
100
  },
101
- "gitHead": "344ae4a65afe846111eb1f901e09e0f59f333861"
101
+ "gitHead": "42e1523e5b92a3a57d9083ae29455df429afb0f6"
102
102
  }