@decocms/blocks 8.11.0 → 8.12.0
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/protocol/conformance/blockMetaVectors.json +80 -0
- package/dist/protocol/index.d.ts +5 -2
- package/dist/protocol/index.d.ts.map +1 -1
- package/dist/protocol/index.js +5 -2
- package/dist/protocol/index.js.map +1 -1
- package/dist/v8/blockMeta.d.ts +33 -4
- package/dist/v8/blockMeta.d.ts.map +1 -1
- package/dist/v8/blockMeta.js +70 -13
- package/dist/v8/blockMeta.js.map +1 -1
- package/dist/v8/client.d.ts +6 -4
- package/dist/v8/client.d.ts.map +1 -1
- package/dist/v8/client.js +26 -70
- package/dist/v8/client.js.map +1 -1
- package/dist/v8/cms.d.ts.map +1 -1
- package/dist/v8/cms.js +1 -2
- package/dist/v8/cms.js.map +1 -1
- package/dist/v8/contentIndex.d.ts +18 -7
- package/dist/v8/contentIndex.d.ts.map +1 -1
- package/dist/v8/contentIndex.js +46 -17
- package/dist/v8/contentIndex.js.map +1 -1
- package/dist/v8/draftChanges.d.ts.map +1 -1
- package/dist/v8/draftChanges.js +4 -1
- package/dist/v8/draftChanges.js.map +1 -1
- package/dist/v8/index.d.ts +1 -1
- package/dist/v8/index.d.ts.map +1 -1
- package/dist/v8/remoteLoader.d.ts +4 -2
- package/dist/v8/remoteLoader.d.ts.map +1 -1
- package/dist/v8/remoteLoader.js +13 -3
- package/dist/v8/remoteLoader.js.map +1 -1
- package/dist/v8/types.d.ts +47 -7
- package/dist/v8/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/deco-make-editable/SKILL.md +1 -1
- package/skills/deco-make-editable/references/content-shapes.md +14 -9
- package/skills/deco-nextjs-site/references/rendering.md +6 -5
- package/skills/deco-site-authoring/references/pages.md +6 -4
- package/skills/deco-site-workflow/SKILL.md +12 -3
- package/skills/deco-site-workflow/references/cli-reference.md +2 -0
- package/skills/deco-v7-to-v8-migration/SKILL.md +2 -1
- package/skills/deco-v7-to-v8-migration/references/hosted-releases.md +1 -1
- package/skills/deco-v7-to-v8-migration/references/nextjs.md +2 -2
- package/skills/deco-v7-to-v8-migration/references/verify.md +3 -0
- package/skills/deco-v7-to-v8-migration/scripts/checkContentReads.ts +32 -0
- package/skills/deco-v7-to-v8-migration/scripts/contentReads.ts +157 -0
- package/skills/deco-v7-to-v8-migration/scripts/imports.ts +1 -1
- package/skills/deco-v7-to-v8-migration/scripts/migrate.ts +4 -0
- package/src/index.ts +1 -1
- package/src/protocol/conformance/blockMetaVectors.json +80 -0
- package/src/protocol/index.ts +8 -1
- package/src/v8/blockMeta.ts +75 -11
- package/src/v8/client.ts +32 -77
- package/src/v8/cms.ts +1 -2
- package/src/v8/contentIndex.ts +49 -19
- package/src/v8/draftChanges.ts +5 -1
- package/src/v8/index.ts +1 -1
- package/src/v8/remoteLoader.ts +13 -3
- package/src/v8/types.ts +48 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { type Analytics, type Block, type BlockFunction, type Blocks, type Client, type ClientOptions, type CMS, type CMSError, type CMSSettings, ContentUnavailableError, type ContentUnavailableReason, createCMS, currentClient, type DraftPointer, type EffectiveSettings, formatDraftPointer, type Lazy, type
|
|
1
|
+
export { type Analytics, type Block, type BlockFunction, type Blocks, type Client, type ClientOptions, type CMS, type CMSError, type CMSSettings, ContentUnavailableError, type ContentUnavailableReason, createCMS, currentClient, type DraftPointer, type EffectiveSettings, type Entry, formatDraftPointer, type Lazy, type Loader, type Match, matchRoute, type Page, parseDraftPointer, parseVersion, type Redirect, type RequestLike, type RequestVersion, type Result, type Route, remoteLoader, resetForTests, type Seo, type Snapshot, type Telemetry, type TelemetryConfig, type Variant, } from "./v8/index.ts";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,GAAG,EACR,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,uBAAuB,EACvB,KAAK,wBAAwB,EAC7B,SAAS,EACT,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,kBAAkB,EAClB,KAAK,IAAI,EACT,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,GAAG,EACR,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,uBAAuB,EACvB,KAAK,wBAAwB,EAC7B,SAAS,EACT,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,KAAK,EACV,kBAAkB,EAClB,KAAK,IAAI,EACT,KAAK,MAAM,EACX,KAAK,KAAK,EACV,UAAU,EACV,KAAK,IAAI,EACT,iBAAiB,EACjB,YAAY,EACZ,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,YAAY,EACZ,aAAa,EACb,KAAK,GAAG,EACR,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,OAAO,GACb,MAAM,eAAe,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,6EAA6E;AAC7E,OAAO,EAUL,uBAAuB,EAEvB,SAAS,EACT,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,6EAA6E;AAC7E,OAAO,EAUL,uBAAuB,EAEvB,SAAS,EACT,aAAa,EAIb,kBAAkB,EAIlB,UAAU,EAEV,iBAAiB,EACjB,YAAY,EAMZ,YAAY,EACZ,aAAa,GAMd,MAAM,eAAe,CAAC"}
|
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
"footer",
|
|
6
6
|
"footer-a",
|
|
7
7
|
"header",
|
|
8
|
+
"hidden-seo",
|
|
8
9
|
"home",
|
|
10
|
+
"noindex-inline",
|
|
11
|
+
"noindex-saved",
|
|
9
12
|
"plain",
|
|
10
13
|
"redirects",
|
|
11
14
|
"variants"
|
|
@@ -209,6 +212,83 @@
|
|
|
209
212
|
}
|
|
210
213
|
}
|
|
211
214
|
}
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"name": "hidden-seo",
|
|
218
|
+
"body": {
|
|
219
|
+
"__resolveType": "website/sections/Seo/SeoV2.tsx",
|
|
220
|
+
"title": "Staging",
|
|
221
|
+
"noIndexing": true
|
|
222
|
+
},
|
|
223
|
+
"version": "TweCqXol6NaqfznIdZHWGA",
|
|
224
|
+
"meta": {
|
|
225
|
+
"type": "website/sections/Seo/SeoV2.tsx"
|
|
226
|
+
},
|
|
227
|
+
"entry": {
|
|
228
|
+
"version": "TweCqXol6NaqfznIdZHWGA",
|
|
229
|
+
"meta": {
|
|
230
|
+
"type": "website/sections/Seo/SeoV2.tsx"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"name": "noindex-inline",
|
|
236
|
+
"body": {
|
|
237
|
+
"__resolveType": "website/pages/Page.tsx",
|
|
238
|
+
"path": "/staging",
|
|
239
|
+
"seo": {
|
|
240
|
+
"__resolveType": "website/sections/Seo/SeoV2.tsx",
|
|
241
|
+
"noIndexing": true
|
|
242
|
+
},
|
|
243
|
+
"sections": [
|
|
244
|
+
{
|
|
245
|
+
"__resolveType": "header"
|
|
246
|
+
}
|
|
247
|
+
]
|
|
248
|
+
},
|
|
249
|
+
"version": "9dPY85a3_dAGqgn9HyBymg",
|
|
250
|
+
"meta": {
|
|
251
|
+
"type": "website/pages/Page.tsx",
|
|
252
|
+
"path": "/staging",
|
|
253
|
+
"refs": ["header"],
|
|
254
|
+
"noIndex": true
|
|
255
|
+
},
|
|
256
|
+
"entry": {
|
|
257
|
+
"version": "9dPY85a3_dAGqgn9HyBymg",
|
|
258
|
+
"meta": {
|
|
259
|
+
"type": "website/pages/Page.tsx",
|
|
260
|
+
"path": "/staging",
|
|
261
|
+
"refs": ["header"],
|
|
262
|
+
"noIndex": true
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"name": "noindex-saved",
|
|
268
|
+
"body": {
|
|
269
|
+
"__resolveType": "page",
|
|
270
|
+
"path": "/landing",
|
|
271
|
+
"seo": {
|
|
272
|
+
"__resolveType": "hidden-seo"
|
|
273
|
+
},
|
|
274
|
+
"sections": []
|
|
275
|
+
},
|
|
276
|
+
"version": "sOB07_jkmJqe7Mr5Raj6rg",
|
|
277
|
+
"meta": {
|
|
278
|
+
"type": "page",
|
|
279
|
+
"path": "/landing",
|
|
280
|
+
"refs": ["hidden-seo"],
|
|
281
|
+
"noIndex": true
|
|
282
|
+
},
|
|
283
|
+
"entry": {
|
|
284
|
+
"version": "sOB07_jkmJqe7Mr5Raj6rg",
|
|
285
|
+
"meta": {
|
|
286
|
+
"type": "page",
|
|
287
|
+
"path": "/landing",
|
|
288
|
+
"refs": ["hidden-seo"],
|
|
289
|
+
"noIndex": true
|
|
290
|
+
}
|
|
291
|
+
}
|
|
212
292
|
}
|
|
213
293
|
]
|
|
214
294
|
}
|
package/dist/protocol/index.d.ts
CHANGED
|
@@ -19,14 +19,17 @@
|
|
|
19
19
|
* the page's bootstrap is `StudioChannel` in `@decocms/blocks/preview`.
|
|
20
20
|
*
|
|
21
21
|
* `blockMeta`/`indexEntry` compute a hosted revision index's entries (the
|
|
22
|
-
* SDK's own browser-safe module, shared with Studio and the CLI)
|
|
22
|
+
* SDK's own browser-safe module, shared with Studio and the CLI);
|
|
23
|
+
* `META_VERSION` is the `metaVersion` an index they computed carries, and
|
|
24
|
+
* `seoNoIndex`/`pageNoIndex` are the `noIndex` rule, a page's saved SEO block
|
|
25
|
+
* resolved through `bodyOf`.
|
|
23
26
|
*
|
|
24
27
|
* The SDK's runtime never imports the protocol, so it never reaches an app
|
|
25
28
|
* bundle. The canonical hash it re-exports is the SDK's own dependency-free
|
|
26
29
|
* leaf module (see ./canonical.ts). Draft previews and the draft lifecycle
|
|
27
30
|
* are outside the protocol (see /next/content-delivery#draft-previews).
|
|
28
31
|
*/
|
|
29
|
-
export { type BlockIndex, type BlockMeta, blockMeta, type IndexEntry, indexEntry, } from "../v8/blockMeta.ts";
|
|
32
|
+
export { type BlockIndex, type BlockMeta, type BodyOf, blockMeta, type IndexEntry, indexEntry, META_VERSION, pageNoIndex, seoNoIndex, } from "../v8/blockMeta.ts";
|
|
30
33
|
export { isRevisionId, REVISION_ID_RE } from "../v8/revisionId.ts";
|
|
31
34
|
export { blockVersion, CanonicalJsonError, CONTENT_HASH_FORMAT, canonicalJson, computeContentRevision, sha256Hex, } from "./canonical.ts";
|
|
32
35
|
export { CHANNEL_MESSAGE, type ChannelLoadErrorMessage, type ChannelLoadedMessage, type ChannelLoadMessage, type ChannelReadyMessage, DEFAULT_STUDIO_ORIGIN, DEFAULT_STUDIO_ORIGINS, defineStudioModule, type ModuleMessage, type PageChannelMessage, type StudioChannelContext, type StudioChannelMessage, type StudioChannelModule, } from "./channel.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EACL,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,MAAM,EACX,SAAS,EACT,KAAK,UAAU,EACf,UAAU,EACV,YAAY,EACZ,WAAW,EACX,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,sBAAsB,EACtB,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EACf,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,uBAAuB,EACvB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
package/dist/protocol/index.js
CHANGED
|
@@ -19,14 +19,17 @@
|
|
|
19
19
|
* the page's bootstrap is `StudioChannel` in `@decocms/blocks/preview`.
|
|
20
20
|
*
|
|
21
21
|
* `blockMeta`/`indexEntry` compute a hosted revision index's entries (the
|
|
22
|
-
* SDK's own browser-safe module, shared with Studio and the CLI)
|
|
22
|
+
* SDK's own browser-safe module, shared with Studio and the CLI);
|
|
23
|
+
* `META_VERSION` is the `metaVersion` an index they computed carries, and
|
|
24
|
+
* `seoNoIndex`/`pageNoIndex` are the `noIndex` rule, a page's saved SEO block
|
|
25
|
+
* resolved through `bodyOf`.
|
|
23
26
|
*
|
|
24
27
|
* The SDK's runtime never imports the protocol, so it never reaches an app
|
|
25
28
|
* bundle. The canonical hash it re-exports is the SDK's own dependency-free
|
|
26
29
|
* leaf module (see ./canonical.ts). Draft previews and the draft lifecycle
|
|
27
30
|
* are outside the protocol (see /next/content-delivery#draft-previews).
|
|
28
31
|
*/
|
|
29
|
-
export { blockMeta, indexEntry, } from "../v8/blockMeta.js";
|
|
32
|
+
export { blockMeta, indexEntry, META_VERSION, pageNoIndex, seoNoIndex, } from "../v8/blockMeta.js";
|
|
30
33
|
export { isRevisionId, REVISION_ID_RE } from "../v8/revisionId.js";
|
|
31
34
|
export { blockVersion, CanonicalJsonError, CONTENT_HASH_FORMAT, canonicalJson, computeContentRevision, sha256Hex, } from "./canonical.js";
|
|
32
35
|
export { CHANNEL_MESSAGE, DEFAULT_STUDIO_ORIGIN, DEFAULT_STUDIO_ORIGINS, defineStudioModule, } from "./channel.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAIL,SAAS,EAET,UAAU,EACV,YAAY,EACZ,WAAW,EACX,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,sBAAsB,EACtB,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EAKf,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,GAMnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,uBAAuB,EAKvB,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
package/dist/v8/blockMeta.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The version of the metadata `blockMeta` computes: 1 is `type`, `path` and
|
|
3
|
+
* `refs`; 2 adds `noIndex`. An index without `metaVersion` is version 1.
|
|
4
|
+
*/
|
|
5
|
+
export declare const META_VERSION = 2;
|
|
6
|
+
/** A saved block's body by name, to follow a reference (`undefined`: not known). */
|
|
7
|
+
export type BodyOf = (name: string) => unknown;
|
|
1
8
|
/** What an index says about a block, besides its hash. */
|
|
2
9
|
export interface BlockMeta {
|
|
3
10
|
/** The body's raw `__resolveType`. */
|
|
@@ -6,6 +13,8 @@ export interface BlockMeta {
|
|
|
6
13
|
path?: string;
|
|
7
14
|
/** The block names the body references, deduped, in code-unit order. */
|
|
8
15
|
refs?: string[];
|
|
16
|
+
/** `true` when the page says `noIndexing` (meta version 2); never written `false`. */
|
|
17
|
+
noIndex?: boolean;
|
|
9
18
|
}
|
|
10
19
|
/** One entry of a revision index. */
|
|
11
20
|
export interface IndexEntry {
|
|
@@ -20,8 +29,28 @@ export interface IndexEntry {
|
|
|
20
29
|
export type BlockIndex = Record<string, IndexEntry>;
|
|
21
30
|
/** The well-known name whose body every index inlines as `data`. */
|
|
22
31
|
export declare const INLINE_BLOCK = "CMS";
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
/**
|
|
33
|
+
* The metadata of one block body. `names` are the block names of the index
|
|
34
|
+
* being built; `bodyOf` gives the bodies of the saved blocks a page's `seo`
|
|
35
|
+
* may reference (without it, only an inline `seo` counts for `noIndex`).
|
|
36
|
+
*/
|
|
37
|
+
export declare function blockMeta(body: unknown, names: ReadonlySet<string> | readonly string[], bodyOf?: BodyOf): BlockMeta;
|
|
38
|
+
/**
|
|
39
|
+
* Whether a page body asks not to be indexed: it has a top-level string
|
|
40
|
+
* `path`, and `seoNoIndex(body.seo, bodyOf)`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function pageNoIndex(body: unknown, bodyOf?: BodyOf): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether a page's `seo` value says `noIndexing: true`: its own boolean
|
|
45
|
+
* `noIndexing` when it has one; otherwise, when its `__resolveType` is a saved
|
|
46
|
+
* block `bodyOf` knows (a saved SEO block such as `DefaultSeo`), that block's
|
|
47
|
+
* answer, following up to 8 saved blocks. Anything else (no `seo`, a variant,
|
|
48
|
+
* a block `bodyOf` doesn't know, a cycle) is `false`.
|
|
49
|
+
*/
|
|
50
|
+
export declare function seoNoIndex(seo: unknown, bodyOf?: BodyOf): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The index entry for a block: its hash, its metadata when any, and its body
|
|
53
|
+
* when it is `CMS`. `bodyOf` as for `blockMeta`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function indexEntry(name: string, body: unknown, names: ReadonlySet<string> | readonly string[], bodyOf?: BodyOf): Promise<IndexEntry>;
|
|
27
56
|
//# sourceMappingURL=blockMeta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockMeta.d.ts","sourceRoot":"","sources":["../../src/v8/blockMeta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blockMeta.d.ts","sourceRoot":"","sources":["../../src/v8/blockMeta.ts"],"names":[],"mappings":"AAkCA;;;GAGG;AACH,eAAO,MAAM,YAAY,IAAI,CAAC;AAE9B,oFAAoF;AACpF,MAAM,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;AAE/C,0DAA0D;AAC1D,MAAM,WAAW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|
* Index entries of a hosted release (see /next/hosted-releases-internals):
|
|
3
3
|
* `revisions/<id>/index.json` and `latest.json` map each block name to its
|
|
4
|
-
* hash (`version`) plus the little metadata routing
|
|
5
|
-
* need, so
|
|
4
|
+
* hash (`version`) plus the little metadata routing, the reference walk and
|
|
5
|
+
* `client.entries()` need, so none of them needs a block body.
|
|
6
6
|
*
|
|
7
|
-
* `blockMeta(body, names)` is the one helper Studio, the SDK and the
|
|
8
|
-
* to compute that metadata, so all three write and read the same
|
|
9
|
-
* Pure, synchronous, browser-safe; its only import is the
|
|
10
|
-
* canonical hash (for `indexEntry`).
|
|
7
|
+
* `blockMeta(body, names, bodyOf?)` is the one helper Studio, the SDK and the
|
|
8
|
+
* CLI use to compute that metadata, so all three write and read the same
|
|
9
|
+
* entries. Pure, synchronous, browser-safe; its only import is the
|
|
10
|
+
* dependency-free canonical hash (for `indexEntry`).
|
|
11
11
|
*
|
|
12
12
|
* - `type`: the body's raw top-level `__resolveType`, copied without alias
|
|
13
13
|
* mapping (readers map it with their alias rules).
|
|
@@ -15,15 +15,37 @@
|
|
|
15
15
|
* - `refs`: every `__resolveType` string anywhere in the body (the top-level
|
|
16
16
|
* one included, every variant, `never` and `lazy` values included) that is
|
|
17
17
|
* one of `names`, deduped and sorted in code-unit order.
|
|
18
|
+
* - `noIndex`: `true` when the body is a page that asks search engines not to
|
|
19
|
+
* index it: it has a top-level string `path` and its top-level `seo` says
|
|
20
|
+
* `noIndexing: true`, inline or through the saved SEO block it references
|
|
21
|
+
* (`{ "__resolveType": "DefaultSeo" }`), which `bodyOf` looks up (see
|
|
22
|
+
* `seoNoIndex`). Written only when `true`.
|
|
18
23
|
*
|
|
19
|
-
* A key is present only when it has a value (`refs: []`
|
|
20
|
-
* body with nothing to say gives `{}` and its entry
|
|
24
|
+
* A key is present only when it has a value (`refs: []` and `noIndex: false`
|
|
25
|
+
* are left out), so a body with nothing to say gives `{}` and its entry
|
|
26
|
+
* carries no `meta`.
|
|
27
|
+
*
|
|
28
|
+
* `META_VERSION` is the version of this metadata. An index says which version
|
|
29
|
+
* computed its entries (its top-level `metaVersion`; absent is 1). A reader
|
|
30
|
+
* trusts a missing `noIndex` as `false` only on an index at version 2 or
|
|
31
|
+
* later, and a publish that finds an older index recomputes every entry.
|
|
21
32
|
*/
|
|
22
33
|
import { blockVersion } from "./canonical.js";
|
|
34
|
+
/**
|
|
35
|
+
* The version of the metadata `blockMeta` computes: 1 is `type`, `path` and
|
|
36
|
+
* `refs`; 2 adds `noIndex`. An index without `metaVersion` is version 1.
|
|
37
|
+
*/
|
|
38
|
+
export const META_VERSION = 2;
|
|
23
39
|
/** The well-known name whose body every index inlines as `data`. */
|
|
24
40
|
export const INLINE_BLOCK = "CMS";
|
|
25
|
-
/**
|
|
26
|
-
|
|
41
|
+
/** How many saved blocks `seoNoIndex` follows, one referencing the next. */
|
|
42
|
+
const MAX_SEO_HOPS = 8;
|
|
43
|
+
/**
|
|
44
|
+
* The metadata of one block body. `names` are the block names of the index
|
|
45
|
+
* being built; `bodyOf` gives the bodies of the saved blocks a page's `seo`
|
|
46
|
+
* may reference (without it, only an inline `seo` counts for `noIndex`).
|
|
47
|
+
*/
|
|
48
|
+
export function blockMeta(body, names, bodyOf) {
|
|
27
49
|
const meta = {};
|
|
28
50
|
if (!isRecord(body))
|
|
29
51
|
return meta;
|
|
@@ -36,12 +58,47 @@ export function blockMeta(body, names) {
|
|
|
36
58
|
collectRefs(body, known, found);
|
|
37
59
|
if (found.size > 0)
|
|
38
60
|
meta.refs = [...found].sort();
|
|
61
|
+
if (pageNoIndex(body, bodyOf))
|
|
62
|
+
meta.noIndex = true;
|
|
39
63
|
return meta;
|
|
40
64
|
}
|
|
41
|
-
/**
|
|
42
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Whether a page body asks not to be indexed: it has a top-level string
|
|
67
|
+
* `path`, and `seoNoIndex(body.seo, bodyOf)`.
|
|
68
|
+
*/
|
|
69
|
+
export function pageNoIndex(body, bodyOf) {
|
|
70
|
+
return isRecord(body) && typeof body.path === "string" && seoNoIndex(body.seo, bodyOf);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Whether a page's `seo` value says `noIndexing: true`: its own boolean
|
|
74
|
+
* `noIndexing` when it has one; otherwise, when its `__resolveType` is a saved
|
|
75
|
+
* block `bodyOf` knows (a saved SEO block such as `DefaultSeo`), that block's
|
|
76
|
+
* answer, following up to 8 saved blocks. Anything else (no `seo`, a variant,
|
|
77
|
+
* a block `bodyOf` doesn't know, a cycle) is `false`.
|
|
78
|
+
*/
|
|
79
|
+
export function seoNoIndex(seo, bodyOf) {
|
|
80
|
+
let node = seo;
|
|
81
|
+
const seen = new Set();
|
|
82
|
+
for (let hop = 0; hop <= MAX_SEO_HOPS; hop++) {
|
|
83
|
+
if (!isRecord(node))
|
|
84
|
+
return false;
|
|
85
|
+
if (typeof node.noIndexing === "boolean")
|
|
86
|
+
return node.noIndexing;
|
|
87
|
+
const ref = node.__resolveType;
|
|
88
|
+
if (bodyOf === undefined || typeof ref !== "string" || seen.has(ref))
|
|
89
|
+
return false;
|
|
90
|
+
seen.add(ref);
|
|
91
|
+
node = bodyOf(ref);
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The index entry for a block: its hash, its metadata when any, and its body
|
|
97
|
+
* when it is `CMS`. `bodyOf` as for `blockMeta`.
|
|
98
|
+
*/
|
|
99
|
+
export async function indexEntry(name, body, names, bodyOf) {
|
|
43
100
|
const entry = { version: await blockVersion(body) };
|
|
44
|
-
const meta = blockMeta(body, names);
|
|
101
|
+
const meta = blockMeta(body, names, bodyOf);
|
|
45
102
|
if (Object.keys(meta).length > 0)
|
|
46
103
|
entry.meta = meta;
|
|
47
104
|
if (name === INLINE_BLOCK)
|
package/dist/v8/blockMeta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockMeta.js","sourceRoot":"","sources":["../../src/v8/blockMeta.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RIDES, type Overrides } from "./curr
|
|
|
2
2
|
import type { Visitor } from "./experiments.ts";
|
|
3
3
|
import { type Selection } from "./pin.ts";
|
|
4
4
|
import type { ClientTelemetry } from "./telemetry.ts";
|
|
5
|
-
import type { Block, Blocks, Client, ListOptions, Redirect, ResolveOptions, Result, Route } from "./types.ts";
|
|
5
|
+
import type { Block, Blocks, Client, Entry, ListOptions, Redirect, ResolveOptions, Result, Route } from "./types.ts";
|
|
6
6
|
interface ClientOptions {
|
|
7
7
|
/** Loads what this client reads; called at most once. */
|
|
8
8
|
load: () => Promise<Selection>;
|
|
@@ -22,6 +22,8 @@ interface ClientOptions {
|
|
|
22
22
|
onCollision?: (name: string) => void;
|
|
23
23
|
telemetry?: ClientTelemetry;
|
|
24
24
|
}
|
|
25
|
+
/** What `client.list()` throws: it was removed, and what to read instead. */
|
|
26
|
+
export declare const LIST_REMOVED: string;
|
|
25
27
|
export declare class CMSClient implements Client {
|
|
26
28
|
#private;
|
|
27
29
|
constructor(options: ClientOptions);
|
|
@@ -33,13 +35,13 @@ export declare class CMSClient implements Client {
|
|
|
33
35
|
/** Read by the built-in `calendar` (see ./current.ts). */
|
|
34
36
|
get [CAMPAIGN_OVERRIDES](): Overrides | undefined;
|
|
35
37
|
routes(): Promise<Result<Route[]>>;
|
|
38
|
+
entries(type?: string): Promise<Result<readonly Entry[]>>;
|
|
39
|
+
/** Removed: throws {@link LIST_REMOVED} before reading anything. */
|
|
40
|
+
list<T = Block>(_type: string, _options?: ListOptions<T>): Promise<Result<T[]>>;
|
|
36
41
|
prefetch(name: string): void;
|
|
37
42
|
redirects(): Promise<Result<Redirect[]>>;
|
|
38
43
|
resolve<T = unknown>(target: unknown, options?: ResolveOptions): Promise<Result<T>>;
|
|
39
|
-
list<T = Block>(type: string, options?: ListOptions<T>): Promise<Result<T[]>>;
|
|
40
44
|
revision(): Promise<string>;
|
|
41
45
|
}
|
|
42
|
-
/** Forgets which list types warned, so a test starts clean. */
|
|
43
|
-
export declare function resetListWarnings(): void;
|
|
44
46
|
export {};
|
|
45
47
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/v8/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/v8/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/v8/client.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAExF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAExE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EACV,KAAK,EACL,MAAM,EACN,MAAM,EAEN,KAAK,EAEL,WAAW,EACX,QAAQ,EACR,cAAc,EACd,MAAM,EACN,KAAK,EACN,MAAM,YAAY,CAAC;AAEpB,UAAU,aAAa;IACrB,yDAAyD;IACzD,IAAI,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3B,4DAA4D;IAC5D,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,oFAAoF;IACpF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B;AAED,6EAA6E;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` → `resolve(name)`. The
|
|
10
10
|
* page's subtree and the redirects block go out in one parallel wave.
|
|
11
|
+
* `entries(type?)` answers from the index too: what a sitemap or a lookup by
|
|
12
|
+
* path needs, with no body fetched.
|
|
11
13
|
*/
|
|
12
14
|
import { keepAlive } from "./background.js";
|
|
13
|
-
import {
|
|
15
|
+
import { entriesOf, redirectsBlockOf, routesOf, walk, } from "./contentIndex.js";
|
|
14
16
|
import { CAMPAIGN_OVERRIDES, EXPERIMENT_OVERRIDES } from "./current.js";
|
|
15
|
-
import { errors, isResolutionError
|
|
17
|
+
import { errors, isResolutionError } from "./errors.js";
|
|
16
18
|
import { isPlainObject } from "./json.js";
|
|
17
19
|
import { choosePin, rootsOf } from "./pin.js";
|
|
18
20
|
import { Resolver } from "./resolver.js";
|
|
19
|
-
/**
|
|
20
|
-
const
|
|
21
|
-
|
|
21
|
+
/** What `client.list()` throws: it was removed, and what to read instead. */
|
|
22
|
+
export const LIST_REMOVED = "[decocms/blocks] client.list() was removed in this version of @decocms/blocks: it fetched the " +
|
|
23
|
+
"body of every block of a type. Route with client.routes() and client.redirects() (index only); " +
|
|
24
|
+
"read a type's names, paths, refs and noIndex with client.entries(type) (index only); read a " +
|
|
25
|
+
"block's body with client.resolve(name).";
|
|
22
26
|
export class CMSClient {
|
|
23
27
|
#options;
|
|
24
28
|
#reported = new WeakSet();
|
|
@@ -49,17 +53,27 @@ export class CMSClient {
|
|
|
49
53
|
return this.#options.campaigns;
|
|
50
54
|
}
|
|
51
55
|
async routes() {
|
|
52
|
-
|
|
56
|
+
const [content, error] = await this.#index();
|
|
57
|
+
return error === null ? [routesOf(content), null] : this.#fail(error);
|
|
58
|
+
}
|
|
59
|
+
async entries(type) {
|
|
60
|
+
if (type !== undefined && typeof type !== "string")
|
|
61
|
+
return [[], null];
|
|
62
|
+
const [content, error] = await this.#index();
|
|
63
|
+
return error === null ? [entriesOf(content, type), null] : this.#fail(error);
|
|
64
|
+
}
|
|
65
|
+
/** Removed: throws {@link LIST_REMOVED} before reading anything. */
|
|
66
|
+
list(_type, _options) {
|
|
67
|
+
throw new Error(LIST_REMOVED);
|
|
68
|
+
}
|
|
69
|
+
/** The index it reads: a pinned client's pin; otherwise the current one, without pinning. */
|
|
70
|
+
async #index() {
|
|
53
71
|
const pinned = this.#pinned === undefined ? undefined : await this.#pinned;
|
|
54
72
|
if (pinned !== undefined) {
|
|
55
|
-
|
|
56
|
-
return this.#fail(pinned.error);
|
|
57
|
-
return [routesOf(pinned.pin.content), null];
|
|
73
|
+
return "error" in pinned ? [null, pinned.error] : [pinned.pin.content, null];
|
|
58
74
|
}
|
|
59
75
|
const selected = await this.#select();
|
|
60
|
-
|
|
61
|
-
return this.#fail(selected.error);
|
|
62
|
-
return [routesOf(selected.selection.current), null];
|
|
76
|
+
return "error" in selected ? [null, selected.error] : [selected.selection.current, null];
|
|
63
77
|
}
|
|
64
78
|
prefetch(name) {
|
|
65
79
|
if (typeof name !== "string")
|
|
@@ -114,33 +128,6 @@ export class CMSClient {
|
|
|
114
128
|
return this.#fail(asCMSError(error));
|
|
115
129
|
}
|
|
116
130
|
}
|
|
117
|
-
async list(type, options = {}) {
|
|
118
|
-
const pinned = await this.#pin();
|
|
119
|
-
if ("error" in pinned)
|
|
120
|
-
return this.#fail(pinned.error);
|
|
121
|
-
const { pin, resolver } = pinned;
|
|
122
|
-
warnRoutedList(canonicalType(pin.content, type));
|
|
123
|
-
const names = namesOfType(pin.content, type);
|
|
124
|
-
let entries;
|
|
125
|
-
try {
|
|
126
|
-
await pin.wave(walk(pin.content, names));
|
|
127
|
-
const values = await Promise.all(names.map((name) => (options.run === true ? resolver.resolveEntry(name) : resolver.expandEntry(name)).catch((error) => {
|
|
128
|
-
throw atEntry(name, error);
|
|
129
|
-
})));
|
|
130
|
-
entries = values.filter((value) => value !== undefined);
|
|
131
|
-
}
|
|
132
|
-
catch (error) {
|
|
133
|
-
return this.#fail(asCMSError(error));
|
|
134
|
-
}
|
|
135
|
-
if (options.where)
|
|
136
|
-
entries = entries.filter(options.where);
|
|
137
|
-
if (options.sort)
|
|
138
|
-
entries = [...entries].sort(options.sort);
|
|
139
|
-
if (typeof options.limit === "number" && options.limit >= 0) {
|
|
140
|
-
entries = entries.slice(0, Math.floor(options.limit));
|
|
141
|
-
}
|
|
142
|
-
return [entries, null];
|
|
143
|
-
}
|
|
144
131
|
async revision() {
|
|
145
132
|
const pinned = await this.#pin();
|
|
146
133
|
if ("error" in pinned)
|
|
@@ -194,31 +181,6 @@ function rulesOf(value) {
|
|
|
194
181
|
: [];
|
|
195
182
|
return list.filter((rule) => isPlainObject(rule));
|
|
196
183
|
}
|
|
197
|
-
/**
|
|
198
|
-
* `list("page")` and `list("redirect")` read every page or rule: routing reads
|
|
199
|
-
* `routes()` and `redirects()` from the index instead. Warns once per process
|
|
200
|
-
* and type, outside production.
|
|
201
|
-
*/
|
|
202
|
-
function warnRoutedList(type) {
|
|
203
|
-
if (!ROUTED_TYPES.has(type))
|
|
204
|
-
return;
|
|
205
|
-
const env = globalThis.process
|
|
206
|
-
?.env;
|
|
207
|
-
if (env?.NODE_ENV === "production")
|
|
208
|
-
return;
|
|
209
|
-
const store = globalThis;
|
|
210
|
-
const warned = store[LIST_WARNED] ?? new Set();
|
|
211
|
-
store[LIST_WARNED] = warned;
|
|
212
|
-
if (warned.has(type))
|
|
213
|
-
return;
|
|
214
|
-
warned.add(type);
|
|
215
|
-
console.warn(`[decocms/blocks] client.list("${type}") fetches every ${type} block; route with ` +
|
|
216
|
-
"client.routes() and client.redirects(), which read the index (see /next/routing).");
|
|
217
|
-
}
|
|
218
|
-
/** Forgets which list types warned, so a test starts clean. */
|
|
219
|
-
export function resetListWarnings() {
|
|
220
|
-
delete globalThis[LIST_WARNED];
|
|
221
|
-
}
|
|
222
184
|
/**
|
|
223
185
|
* The client's own frozen copy of a visitor, so a caller changing its object
|
|
224
186
|
* later changes no client; `null` for anything that isn't one.
|
|
@@ -242,10 +204,4 @@ function copyVisitor(visitor) {
|
|
|
242
204
|
function asCMSError(error) {
|
|
243
205
|
return isResolutionError(error) ? error : errors.blockFailed("<unknown>", [], error);
|
|
244
206
|
}
|
|
245
|
-
/** Prefixes a failed list entry's path with the entry's name, so the log says which one. */
|
|
246
|
-
function atEntry(name, error) {
|
|
247
|
-
if (!isResolutionError(error) || error.code === "CYCLE")
|
|
248
|
-
return error;
|
|
249
|
-
return new ResolutionError(error.code, error.message, [name, ...error.path], error.cause);
|
|
250
|
-
}
|
|
251
207
|
//# sourceMappingURL=client.js.map
|
package/dist/v8/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/v8/client.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/v8/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,SAAS,EAET,gBAAgB,EAChB,QAAQ,EACR,IAAI,GACL,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAkB,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAY,OAAO,EAAkB,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAoCzC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,YAAY,GACvB,gGAAgG;IAChG,iGAAiG;IACjG,8FAA8F;IAC9F,yCAAyC,CAAC;AAK5C,MAAM,OAAO,SAAS;IACX,QAAQ,CAAgB;IACxB,SAAS,GAAG,IAAI,OAAO,EAAY,CAAC;IACpC,QAAQ,CAAiB;IAClC,SAAS,CAAgC;IACzC,OAAO,CAA8B;IACrC,uC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gB,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,CAsBtD;AAeD,gEAAgE;AAChE,wBAAgB,aAAa,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"cms.d.ts","sourceRoot":"","sources":["../../src/v8/cms.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAIV,GAAG,EACH,SAAS,EAMT,QAAQ,EACT,MAAM,YAAY,CAAC;AA4VpB,sFAAsF;AACtF,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAGvD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,GAAG,CAsBhD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,CAsBtD;AAeD,gEAAgE;AAChE,wBAAgB,aAAa,IAAI,IAAI,CAIpC"}
|
package/dist/v8/cms.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { runInBackground } from "./background.js";
|
|
10
10
|
import { SETTINGS_BLOCK, SETTINGS_TYPE } from "./builtins/data.js";
|
|
11
11
|
import { builtIns } from "./builtins/index.js";
|
|
12
|
-
import { CMSClient
|
|
12
|
+
import { CMSClient } from "./client.js";
|
|
13
13
|
import { ContentStore, isLoader, isSnapshot } from "./content.js";
|
|
14
14
|
import { draftCookieFor, endsPreview, parseClientVersion, readVersion } from "./draft.js";
|
|
15
15
|
import { parseDraftHosts } from "./draftChanges.js";
|
|
@@ -400,7 +400,6 @@ function overridesOf(given) {
|
|
|
400
400
|
export function resetForTests() {
|
|
401
401
|
clearGlobals(INSTANCE_PREFIX);
|
|
402
402
|
resetRemoteLoaders();
|
|
403
|
-
resetListWarnings();
|
|
404
403
|
setCurrentTelemetry(undefined);
|
|
405
404
|
}
|
|
406
405
|
/** With `site`, hosted releases from the delivery CDN, at runtime only; without, the content given. */
|