@rocket/js 0.1.1 → 0.2.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/README.md +14 -23
- package/dist-types/exports/layouts/atlasBlog.d.ts +2 -0
- package/dist-types/exports/layouts/atlasBlog.d.ts.map +1 -0
- package/dist-types/exports/types/rocket.d.ts +68 -2
- package/dist-types/exports/types/rocket.d.ts.map +1 -1
- package/dist-types/exports/types.d.ts +1 -1
- package/dist-types/exports/types.d.ts.map +1 -1
- package/dist-types/src/PageData.d.ts +3 -1
- package/dist-types/src/PageData.d.ts.map +1 -1
- package/dist-types/src/RocketJsDemo.d.ts.map +1 -1
- package/dist-types/src/SocialPreviewPlayground.d.ts +1 -0
- package/dist-types/src/SocialPreviewPlayground.d.ts.map +1 -1
- package/dist-types/src/asyncMessage.d.ts +5 -0
- package/dist-types/src/asyncMessage.d.ts.map +1 -1
- package/dist-types/src/cli/RocketBuild.d.ts.map +1 -1
- package/dist-types/src/cli/RocketCli.d.ts.map +1 -1
- package/dist-types/src/cli/RocketInit.d.ts +5 -1
- package/dist-types/src/cli/RocketInit.d.ts.map +1 -1
- package/dist-types/src/cli/RocketStart.d.ts +6 -1
- package/dist-types/src/cli/RocketStart.d.ts.map +1 -1
- package/dist-types/src/component-hydration.d.ts.map +1 -1
- package/dist-types/src/components/RocketDrawer.d.ts +8 -0
- package/dist-types/src/components/RocketDrawer.d.ts.map +1 -1
- package/dist-types/src/components/RocketSocialLink.d.ts.map +1 -1
- package/dist-types/src/config.d.ts.map +1 -1
- package/dist-types/src/feeds.d.ts +38 -0
- package/dist-types/src/feeds.d.ts.map +1 -0
- package/dist-types/src/hydration/hydrationLoader.d.ts +13 -4
- package/dist-types/src/hydration/hydrationLoader.d.ts.map +1 -1
- package/dist-types/src/icons.d.ts.map +1 -1
- package/dist-types/src/layouts/atlas/atlasBlogLayout.d.ts +42 -0
- package/dist-types/src/layouts/atlas/atlasBlogLayout.d.ts.map +1 -0
- package/dist-types/src/layouts/atlas/atlasDocLayout.d.ts +4 -0
- package/dist-types/src/layouts/atlas/atlasDocLayout.d.ts.map +1 -1
- package/dist-types/src/layouts/atlas/atlasHeroLayout.d.ts.map +1 -1
- package/dist-types/src/layouts/atlas/atlasNotFoundLayout.d.ts.map +1 -1
- package/dist-types/src/layouts/layout-helper.d.ts +3 -3
- package/dist-types/src/layouts/layout-helper.d.ts.map +1 -1
- package/dist-types/src/markdownHook.d.ts.map +1 -1
- package/dist-types/src/menu.d.ts +8 -3
- package/dist-types/src/menu.d.ts.map +1 -1
- package/dist-types/src/menus/MainMenu.d.ts.map +1 -1
- package/dist-types/src/{development-page-module-loader.d.ts → page-module-loader.d.ts} +7 -2
- package/dist-types/src/page-module-loader.d.ts.map +1 -0
- package/dist-types/src/page-runtime.d.ts +11 -0
- package/dist-types/src/page-runtime.d.ts.map +1 -1
- package/dist-types/src/pages.d.ts.map +1 -1
- package/dist-types/src/route-pattern.d.ts +10 -0
- package/dist-types/src/route-pattern.d.ts.map +1 -0
- package/dist-types/src/siteDiscoverability.d.ts +4 -0
- package/dist-types/src/siteDiscoverability.d.ts.map +1 -1
- package/dist-types/src/socialPreviewImages.d.ts +2 -1
- package/dist-types/src/socialPreviewImages.d.ts.map +1 -1
- package/dist-types/src/static-params.d.ts +33 -0
- package/dist-types/src/static-params.d.ts.map +1 -0
- package/dist-types/src/transform.d.ts +4 -0
- package/dist-types/src/transform.d.ts.map +1 -1
- package/dist-types/src/wds-plugin.d.ts.map +1 -1
- package/exports/layouts/atlasBlog.js +11 -0
- package/exports/types/rocket.test.ts +26 -0
- package/exports/types/rocket.ts +78 -2
- package/exports/types.ts +7 -0
- package/package.json +16 -32
- package/src/PageData.js +12 -2
- package/src/RocketJsDemo.js +1 -0
- package/src/SocialPreviewPlayground.js +26 -20
- package/src/asyncMessage.js +8 -2
- package/src/cli/RocketBuild.js +110 -13
- package/src/cli/RocketCli.js +11 -1
- package/src/cli/RocketInit.js +64 -12
- package/src/cli/RocketStart.js +60 -16
- package/src/cli/cli.js +10 -1
- package/src/component-hydration.js +23 -3
- package/src/components/RocketDrawer.js +44 -10
- package/src/components/RocketSocialLink.js +26 -2
- package/src/config.js +33 -4
- package/src/feeds.js +212 -0
- package/src/hydration/hydrationLoader.js +80 -48
- package/src/icons.js +5 -0
- package/src/layouts/atlas/atlasBlog.css +143 -0
- package/src/layouts/atlas/atlasBlogLayout.js +234 -0
- package/src/layouts/atlas/atlasDocLayout.js +10 -1
- package/src/layouts/atlas/atlasHeroLayout.js +10 -6
- package/src/layouts/atlas/atlasNotFoundLayout.js +12 -22
- package/src/layouts/layout-helper.js +5 -5
- package/src/layouts/layout.js +2 -2
- package/src/loaded-page-module.js +3 -1
- package/src/markdownCompiler.js +2 -2
- package/src/markdownHook.js +7 -2
- package/src/menu.js +25 -19
- package/src/menus/MainMenu.js +10 -4
- package/src/{static-page-module-loader.js → page-module-loader.js} +6 -1
- package/src/page-pagination.js +2 -2
- package/src/page-runtime.js +48 -3
- package/src/pages.js +47 -56
- package/src/publicAssets.js +2 -2
- package/src/route-pattern.js +21 -0
- package/src/siteDiscoverability.js +14 -1
- package/src/socialPreviewImages.js +80 -14
- package/src/standalone-demo-url.js +2 -2
- package/src/static-params.js +114 -0
- package/src/transform.js +89 -22
- package/src/wds-plugin.js +16 -3
- package/dist-types/src/development-page-module-loader.d.ts.map +0 -1
- package/dist-types/src/static-page-module-loader.d.ts +0 -15
- package/dist-types/src/static-page-module-loader.d.ts.map +0 -1
- package/src/development-page-module-loader.js +0 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atlasDocLayout.d.ts","sourceRoot":"","sources":["../../../../src/layouts/atlas/atlasDocLayout.js"],"names":[],"mappings":"AA0CA;;;;GAIG;AACH,uCAHW,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,YAClD,MAAM,0CAchB;AAED;;;;;;GAMG;AACH,uCAHW,KAAK,CAAC,MAAM,CAAC,YACb,MAAM,wCAahB;AAED;;GAEG;AACH,0CAFW,OAAO,qBAAqB,EAAE,WAAW,wCAenD;AAED;;GAEG;AACH,6CAFW,OAAO,qBAAqB,EAAE,WAAW,EAAE,0CAIrD;AAED;;GAEG;AACH,wCAFW,OAAO,qBAAqB,EAAE,WAAW,EAAE,wCAYrD;AAED;;;GAGG;AACH,6CAHW,OAAO,qBAAqB,EAAE,uBAAuB,GAAG,SAAS,GAC/D,OAAO,qBAAqB,EAAE,gBAAgB,GAAG,KAAK,GAAG,SAAS,CAK9E;AAED;;GAEG;AACH,yCAFW,OAAO,qBAAqB,EAAE,gBAAgB,GAAG,KAAK,GAAG,SAAS,6CAoB5E;
|
|
1
|
+
{"version":3,"file":"atlasDocLayout.d.ts","sourceRoot":"","sources":["../../../../src/layouts/atlas/atlasDocLayout.js"],"names":[],"mappings":"AA0CA;;;;GAIG;AACH,uCAHW,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,YAClD,MAAM,0CAchB;AAED;;;;;;GAMG;AACH,uCAHW,KAAK,CAAC,MAAM,CAAC,YACb,MAAM,wCAahB;AAED;;GAEG;AACH,0CAFW,OAAO,qBAAqB,EAAE,WAAW,wCAenD;AAED;;GAEG;AACH,6CAFW,OAAO,qBAAqB,EAAE,WAAW,EAAE,0CAIrD;AAED;;GAEG;AACH,wCAFW,OAAO,qBAAqB,EAAE,WAAW,EAAE,wCAYrD;AAED;;GAEG;AACH,gDAFW,MAAM,EAAE,GAAG,SAAS,0CAI9B;AAED;;;GAGG;AACH,6CAHW,OAAO,qBAAqB,EAAE,uBAAuB,GAAG,SAAS,GAC/D,OAAO,qBAAqB,EAAE,gBAAgB,GAAG,KAAK,GAAG,SAAS,CAK9E;AAED;;GAEG;AACH,yCAFW,OAAO,qBAAqB,EAAE,gBAAgB,GAAG,KAAK,GAAG,SAAS,6CAoB5E;AArJD,8DAA+D,EAAE,CAAC;AAElE,uDAAuD;AACvD,iCADW,OAAO,qBAAqB,EAAE,UAAU,CA6BjD;AAkKF,0FAA0F;AAC1F,6BADW,OAAO,qBAAqB,EAAE,MAAM,CAAC,OAAO,qBAAqB,EAAE,OAAO,CAAC,CAiFpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atlasHeroLayout.d.ts","sourceRoot":"","sources":["../../../../src/layouts/atlas/atlasHeroLayout.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"atlasHeroLayout.d.ts","sourceRoot":"","sources":["../../../../src/layouts/atlas/atlasHeroLayout.js"],"names":[],"mappings":"AAaA,uDAAuD;AACvD,kCADW,OAAO,qBAAqB,EAAE,UAAU,CA4BjD;AAmNF;;GAEG;AACH,8BAFU,OAAO,qBAAqB,EAAE,MAAM,CAAC,OAAO,qBAAqB,EAAE,QAAQ,CAAC,CAuFpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atlasNotFoundLayout.d.ts","sourceRoot":"","sources":["../../../../src/layouts/atlas/atlasNotFoundLayout.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"atlasNotFoundLayout.d.ts","sourceRoot":"","sources":["../../../../src/layouts/atlas/atlasNotFoundLayout.js"],"names":[],"mappings":"AAKA,uDAAuD;AACvD,sCADW,OAAO,qBAAqB,EAAE,UAAU,CACT;AAS1C,0FAA0F;AAC1F,kCADW,OAAO,qBAAqB,EAAE,MAAM,CAAC,OAAO,qBAAqB,EAAE,OAAO,CAAC,CA2CpF"}
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* @param {Object} [options]
|
|
6
6
|
* @param {LitHTML} [options.title]
|
|
7
7
|
* @param {'html' | false} [options.menu] render a default menu. set to false if you want your own
|
|
8
|
-
* @param {LitHTML} [options.
|
|
8
|
+
* @param {LitHTML} [options.headContent]
|
|
9
9
|
*/
|
|
10
|
-
export function document(data: import("../../exports/PageData.js").PageData, content: LitHTML, { title, menu,
|
|
10
|
+
export function document(data: import("../../exports/PageData.js").PageData, content: LitHTML, { title, menu, headContent, }?: {
|
|
11
11
|
title?: LitHTML | undefined;
|
|
12
12
|
menu?: false | "html" | undefined;
|
|
13
|
-
|
|
13
|
+
headContent?: LitHTML | undefined;
|
|
14
14
|
}): import("@lit-labs/ssr").ServerRenderedTemplate;
|
|
15
15
|
export type LitHTML = import("lit/directive.js").DirectiveResult | import("lit").TemplateResult;
|
|
16
16
|
//# sourceMappingURL=layout-helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-helper.d.ts","sourceRoot":"","sources":["../../../src/layouts/layout-helper.js"],"names":[],"mappings":"AAKA,mGAAmG;AAEnG;;;;;;;GAOG;AACH,+BAPW,OAAO,2BAA2B,EAAE,QAAQ,WAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"layout-helper.d.ts","sourceRoot":"","sources":["../../../src/layouts/layout-helper.js"],"names":[],"mappings":"AAKA,mGAAmG;AAEnG;;;;;;;GAOG;AACH,+BAPW,OAAO,2BAA2B,EAAE,QAAQ,WAC5C,OAAO,kCAEf;IAA0B,KAAK;IACE,IAAI;IACX,WAAW;CAAC,kDAsCxC;sBA9Ca,OAAO,kBAAkB,EAAE,eAAe,GAAG,OAAO,KAAK,EAAE,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdownHook.d.ts","sourceRoot":"","sources":["../../src/markdownHook.js"],"names":[],"mappings":"AAaW,iCAAO;IAAC,IAAI,EAAE,OAAO,mBAAmB,EAAE,SAAS,CAAA;CAAC,GAAK,OAAO,CAAC,IAAI,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"markdownHook.d.ts","sourceRoot":"","sources":["../../src/markdownHook.js"],"names":[],"mappings":"AAaW,iCAAO;IAAC,IAAI,EAAE,OAAO,mBAAmB,EAAE,SAAS,CAAA;CAAC,GAAK,OAAO,CAAC,IAAI,CAAC,CAAA;4GA4Iyoe,CAAC;iIAAl8B,CAAC"}
|
package/dist-types/src/menu.d.ts
CHANGED
|
@@ -4,19 +4,24 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export function treeFromPages(pages: import("@rocket/js/types.js").PageRegistry): import("@rocket/js/types.js").PageTree;
|
|
6
6
|
/**
|
|
7
|
+
* The itemFn receives the rendered child list (or lit `nothing`) and must place
|
|
8
|
+
* it inside the returned item so nested lists stay valid HTML.
|
|
9
|
+
*
|
|
7
10
|
* @param {import("@rocket/js/types.js").PageTree} tree
|
|
8
11
|
* @param {string} listTagName
|
|
9
|
-
* @param {(name: string, url: string, module: import("@rocket/js/types.js").Module, linkText: string) => import("lit").TemplateResult} itemFn
|
|
12
|
+
* @param {(name: string, url: string, module: import("@rocket/js/types.js").Module, linkText: string, children: import("lit").TemplateResult | typeof nothing) => import("lit").TemplateResult} itemFn
|
|
13
|
+
* @returns {import("lit").TemplateResult}
|
|
10
14
|
*/
|
|
11
|
-
export function treeToHtml(tree: import("@rocket/js/types.js").PageTree, listTagName: string, itemFn: (name: string, url: string, module: import("@rocket/js/types.js").Module, linkText: string) => import("lit").TemplateResult): import("lit
|
|
15
|
+
export function treeToHtml(tree: import("@rocket/js/types.js").PageTree, listTagName: string, itemFn: (name: string, url: string, module: import("@rocket/js/types.js").Module, linkText: string, children: import("lit").TemplateResult | typeof nothing) => import("lit").TemplateResult): import("lit").TemplateResult;
|
|
12
16
|
/**
|
|
13
17
|
* @param {import('@rocket/js/types.js').PageTree} pageTree
|
|
14
18
|
*/
|
|
15
|
-
export function defaultHtmlMenu(pageTree: import("@rocket/js/types.js").PageTree): import("lit-html").TemplateResult<1>;
|
|
19
|
+
export function defaultHtmlMenu(pageTree: import("@rocket/js/types.js").PageTree): import("lit-html").TemplateResult<2 | 1 | 3>;
|
|
16
20
|
/** Runs on: import-hook */
|
|
17
21
|
/**
|
|
18
22
|
* @param {import('@rocket/js/types.js').Headline[]} headlines
|
|
19
23
|
* @returns {import('@rocket/js/types.js').TableOfContents}
|
|
20
24
|
*/
|
|
21
25
|
export function headLinesToTree(headlines: import("@rocket/js/types.js").Headline[]): import("@rocket/js/types.js").TableOfContents;
|
|
26
|
+
import { nothing } from 'lit';
|
|
22
27
|
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../src/menu.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH,qCAHW,OAAO,qBAAqB,EAAE,YAAY,GACxC,OAAO,qBAAqB,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../src/menu.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH,qCAHW,OAAO,qBAAqB,EAAE,YAAY,GACxC,OAAO,qBAAqB,EAAE,QAAQ,CA0ElD;AA0DD;;;;;;;;GAQG;AACH,iCALW,OAAO,qBAAqB,EAAE,QAAQ,eACtC,MAAM,UACN,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,qBAAqB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,EAAE,cAAc,GAAG,OAAO,OAAO,KAAK,OAAO,KAAK,EAAE,cAAc,GAClL,OAAO,KAAK,EAAE,cAAc,CAexC;AAED;;GAEG;AACH,0CAFW,OAAO,qBAAqB,EAAE,QAAQ,gDAUhD;AAED,2BAA2B;AAC3B;;;GAGG;AACH,2CAHW,OAAO,qBAAqB,EAAE,QAAQ,EAAE,GACtC,OAAO,qBAAqB,EAAE,eAAe,CAoCzD;wBAtN6B,KAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainMenu.d.ts","sourceRoot":"","sources":["../../../src/menus/MainMenu.js"],"names":[],"mappings":"AAIA;IACE;;;;;;;MAGE;
|
|
1
|
+
{"version":3,"file":"MainMenu.d.ts","sourceRoot":"","sources":["../../../src/menus/MainMenu.js"],"names":[],"mappings":"AAIA;IACE;;;;;;;MAGE;IAkDF,uCAIE;IAlDA,qDAAqD;IAErD,UAFW,OAAO,qBAAqB,EAAE,QAAQ,CAExB;IACzB,oBAAqB;IAGvB,2DAOC;IAED;;;;OAIG;IACH,WAJW,OAAO,qBAAqB,EAAE,QAAQ,UACtC,MAAM,GACJ,OAAO,KAAK,EAAE,cAAc,CA0BxC;CAOF;2BA/DqC,KAAK"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/** @typedef {import('./page-runtime.js').PageModuleLoaderOptions} PageModuleLoaderOptions */
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The Page Module Loader used by both the development server and static builds.
|
|
4
|
+
* Loading goes through Rocket's import hooks, which behave the same in both
|
|
5
|
+
* runtime environments.
|
|
6
|
+
*/
|
|
7
|
+
export function createPageModuleLoader(): {
|
|
3
8
|
/**
|
|
4
9
|
* @param {PageModuleLoaderOptions} options
|
|
5
10
|
*/
|
|
@@ -12,4 +17,4 @@ export function createDevelopmentPageModuleLoader(): {
|
|
|
12
17
|
}>;
|
|
13
18
|
};
|
|
14
19
|
export type PageModuleLoaderOptions = import("./page-runtime.js").PageModuleLoaderOptions;
|
|
15
|
-
//# sourceMappingURL=
|
|
20
|
+
//# sourceMappingURL=page-module-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-module-loader.d.ts","sourceRoot":"","sources":["../../src/page-module-loader.js"],"names":[],"mappings":"AAGA,6FAA6F;AAE7F;;;;GAIG;AACH;IAEI;;OAEG;4BADQ,uBAAuB;;;;;;;EAoBrC;sCA9Ba,OAAO,mBAAmB,EAAE,uBAAuB"}
|
|
@@ -71,6 +71,17 @@ export class PageRuntime {
|
|
|
71
71
|
render(request: Request, { adapterContext }?: {
|
|
72
72
|
adapterContext?: unknown;
|
|
73
73
|
}): Promise<Response>;
|
|
74
|
+
/**
|
|
75
|
+
* Development falls back to the request origin so Page Feeds work before a
|
|
76
|
+
* Site Origin is configured; builds always pass the configured Site Origin.
|
|
77
|
+
*
|
|
78
|
+
* @param {{ page: Page; routePath: string }} feedMatch
|
|
79
|
+
* @param {string} requestOrigin
|
|
80
|
+
*/
|
|
81
|
+
renderPageFeed(feedMatch: {
|
|
82
|
+
page: Page;
|
|
83
|
+
routePath: string;
|
|
84
|
+
}, requestOrigin: string): Response;
|
|
74
85
|
}
|
|
75
86
|
export type PageRegistry = import("@rocket/js/types.js").PageRegistry;
|
|
76
87
|
export type Page = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-runtime.d.ts","sourceRoot":"","sources":["../../src/page-runtime.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page-runtime.d.ts","sourceRoot":"","sources":["../../src/page-runtime.js"],"names":[],"mappings":"AAgWA;;;GAGG;AACH,sDAHW,OAAO,GACL,QAAQ,CAepB;AAxWD,yEAAyE;AACzE,iKAAiK;AACjK,2IAA2I;AAC3I,kFAAkF;AAClF,mFAAmF;AACnF,wFAAwF;AACxF,mHAAmH;AACnH,2HAA2H;AAC3H,qFAAqF;AACrF,6EAA6E;AAC7E,mFAAmF;AAEnF;IACE;;;;OAIG;IACH,kBAJW,oBAAoB,WACpB,MAAM,YACN;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,EAQ9D;IAHC,2BAAgB;IAChB,uBAAwB;IACxB,8BAAkC;CAErC;AAED;IACE;;;;;;;;;;;;OAYG;IACH,qKAZW;QACN,KAAK,EAAE,YAAY,CAAC;QACpB,gBAAgB,EAAE,gBAAgB,CAAC;QACnC,YAAY,CAAC,EAAE,kBAAkB,CAAC;QAClC,gBAAgB,CAAC,EAAE,OAAO,qBAAqB,EAAE,sBAAsB,CAAC;QACxE,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,0BAA0B,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjD,aAAa,CAAC,EAAE,OAAO,qBAAqB,EAAE,mBAAmB,CAAC;QAClE,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,cAAc,CAAC,EAAE,OAAO,YAAY,EAAE,cAAc,CAAC;KACtD,EAsBH;IATC,kDAAkB;IAClB,mCAAwC;IACxC,2EAAgC;IAChC,mFAAwC;IACxC,+BAA4B;IAC5B,4DAA4D;IAC5D,6EAAkC;IAClC,uCAA4C;IAC5C,gEAAoC;IAGtC;;;;OAIG;IACH,gBAJW,OAAO,uBACP;QAAE,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,GAC1B,OAAO,CAAC,QAAQ,CAAC,CA2E7B;IAED;;;;;;OAMG;IACH,0BAHW;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,iBACjC,MAAM,YAsBhB;CACF;2BA3Ka,OAAO,qBAAqB,EAAE,YAAY;mBAC1C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,qBAAqB,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,qBAAqB,EAAE,YAAY,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE;0BAC1I,SAAS,GAAG;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE;yCAC7G;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE;uCACrC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE;+BACxC,0BAA0B,GAAG,wBAAwB;sCACrD;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE;+BACzE;IAAE,IAAI,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;CAAE;iCACxF,OAAO,qBAAqB,EAAE,kBAAkB;6BAChD,OAAO,qBAAqB,EAAE,cAAc;mCAC5C,qBAAqB,GAAG,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/pages.js"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,+BAJW,MAAM,WACN,MAAM,EAAE,WACR,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/pages.js"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,+BAJW,MAAM,WACN,MAAM,EAAE,WACR,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,uDAsD7B;2BA/Da,OAAO,qBAAqB,EAAE,YAAY;iCAC1C,OAAO,qBAAqB,EAAE,kBAAkB;iCAChD,OAAO,qBAAqB,EAAE,kBAAkB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compiling a URLPattern is comparatively expensive and route paths repeat on
|
|
3
|
+
* every request, so compiled patterns are cached per route path.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} routePath
|
|
6
|
+
* @returns {URLPattern}
|
|
7
|
+
*/
|
|
8
|
+
export function routePattern(routePath: string): URLPattern;
|
|
9
|
+
import { URLPattern } from 'urlpattern-polyfill';
|
|
10
|
+
//# sourceMappingURL=route-pattern.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-pattern.d.ts","sourceRoot":"","sources":["../../src/route-pattern.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,wCAHW,MAAM,GACJ,UAAU,CAStB;2BAnB0B,qBAAqB"}
|
|
@@ -21,6 +21,10 @@ export function createSitemap({ pages, siteOrigin }: {
|
|
|
21
21
|
siteOrigin: string;
|
|
22
22
|
}): string;
|
|
23
23
|
/**
|
|
24
|
+
* The Robots File always references the canonical Sitemap URL, even when
|
|
25
|
+
* Rocket does not generate `sitemap.xml` itself — this is documented behavior
|
|
26
|
+
* so projects can supply a sitemap through other tooling.
|
|
27
|
+
*
|
|
24
28
|
* @param {{
|
|
25
29
|
* pages?: import('@rocket/js/types.js').PageRegistry;
|
|
26
30
|
* siteOrigin: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siteDiscoverability.d.ts","sourceRoot":"","sources":["../../src/siteDiscoverability.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"siteDiscoverability.d.ts","sourceRoot":"","sources":["../../src/siteDiscoverability.js"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,2EANW;IACN,KAAK,EAAE,OAAO,qBAAqB,EAAE,YAAY,CAAC;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,qBAAqB,EAAE,oBAAoB,CAAC;CAC5D,QAoBH;AAED;;;;;GAKG;AACH,qDALW;IACN,KAAK,EAAE,OAAO,qBAAqB,EAAE,YAAY,CAAC;IAClD,UAAU,EAAE,MAAM,CAAC;CACpB,UAeH;AAED;;;;;;;;;GASG;AACH,wDALW;IACN,KAAK,CAAC,EAAE,OAAO,qBAAqB,EAAE,YAAY,CAAC;IACnD,UAAU,EAAE,MAAM,CAAC;CACpB,UAaH"}
|
|
@@ -134,9 +134,10 @@ export function createSocialPreviewTemplateData({ metadata, pageMetadata, pathna
|
|
|
134
134
|
export function captureSocialPreviewImageWithBrowser({ html }: SocialPreviewCaptureOptions): Promise<Buffer<ArrayBufferLike>>;
|
|
135
135
|
/**
|
|
136
136
|
* @param {string} html
|
|
137
|
+
* @param {import('puppeteer-core').Browser} [existingBrowser] reused across captures; the caller owns closing it
|
|
137
138
|
* @returns {Promise<Buffer>}
|
|
138
139
|
*/
|
|
139
|
-
export function renderSocialPreviewImage(html: string): Promise<Buffer>;
|
|
140
|
+
export function renderSocialPreviewImage(html: string, existingBrowser?: import("puppeteer-core").Browser): Promise<Buffer>;
|
|
140
141
|
/**
|
|
141
142
|
* @param {{
|
|
142
143
|
* platform?: NodeJS.Platform;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socialPreviewImages.d.ts","sourceRoot":"","sources":["../../src/socialPreviewImages.js"],"names":[],"mappings":"AAuBA;;;;;;;GAOG;AAEH;;GAEG;AAEH;;;;;;GAMG;AAEH;;;;;;;;;GASG;AACH,8IATW;IACN,KAAK,EAAE,OAAO,qBAAqB,EAAE,YAAY,CAAC;IAClD,gBAAgB,CAAC,EAAE,OAAO,qBAAqB,EAAE,sBAAsB,CAAC;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yBAAyB,CAAC,EAAE,oBAAoB,CAAC;CAClD,GACS,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"socialPreviewImages.d.ts","sourceRoot":"","sources":["../../src/socialPreviewImages.js"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** @typedef {import('@rocket/js/types.js').Page} Page */
|
|
2
|
+
/** @typedef {import('@rocket/js/types.js').PageRegistry} PageRegistry */
|
|
3
|
+
/** @typedef {import('@rocket/js/types.js').PageStaticParams} PageStaticParams */
|
|
4
|
+
/** @typedef {import('@rocket/js/types.js').PageStaticParamsDeclaration} PageStaticParamsDeclaration */
|
|
5
|
+
/**
|
|
6
|
+
* @param {Page} page
|
|
7
|
+
*/
|
|
8
|
+
export function hasStaticParams(page: Page): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* @param {string} pagePath
|
|
11
|
+
*/
|
|
12
|
+
export function hasPathParameter(pagePath: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Enumerates the concrete output paths of a parameterized static JavaScript
|
|
15
|
+
* Page from its `staticParams` export.
|
|
16
|
+
*
|
|
17
|
+
* @param {{
|
|
18
|
+
* pages: PageRegistry;
|
|
19
|
+
* page: Page;
|
|
20
|
+
* pagePath: string;
|
|
21
|
+
* }} options
|
|
22
|
+
* @returns {string[]}
|
|
23
|
+
*/
|
|
24
|
+
export function staticParamsPagePaths({ pages, page, pagePath }: {
|
|
25
|
+
pages: PageRegistry;
|
|
26
|
+
page: Page;
|
|
27
|
+
pagePath: string;
|
|
28
|
+
}): string[];
|
|
29
|
+
export type Page = import("@rocket/js/types.js").Page;
|
|
30
|
+
export type PageRegistry = import("@rocket/js/types.js").PageRegistry;
|
|
31
|
+
export type PageStaticParams = import("@rocket/js/types.js").PageStaticParams;
|
|
32
|
+
export type PageStaticParamsDeclaration = import("@rocket/js/types.js").PageStaticParamsDeclaration;
|
|
33
|
+
//# sourceMappingURL=static-params.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-params.d.ts","sourceRoot":"","sources":["../../src/static-params.js"],"names":[],"mappings":"AAEA,yDAAyD;AACzD,yEAAyE;AACzE,iFAAiF;AACjF,uGAAuG;AAEvG;;GAEG;AACH,sCAFW,IAAI,WAId;AAED;;GAEG;AACH,2CAFW,MAAM,WAIhB;AAED;;;;;;;;;;GAUG;AACH,iEAPW;IACN,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB,GACS,MAAM,EAAE,CA8BpB;mBA1Da,OAAO,qBAAqB,EAAE,IAAI;2BAClC,OAAO,qBAAqB,EAAE,YAAY;+BAC1C,OAAO,qBAAqB,EAAE,gBAAgB;0CAC9C,OAAO,qBAAqB,EAAE,2BAA2B"}
|
|
@@ -7,4 +7,8 @@ export function mdToJs(md: string): Promise<string>;
|
|
|
7
7
|
* @param {string} demo
|
|
8
8
|
*/
|
|
9
9
|
export function mdToJsSingleDemo(md: string, demo: string): Promise<string>;
|
|
10
|
+
/**
|
|
11
|
+
* @param {import('mdast').Code} node
|
|
12
|
+
*/
|
|
13
|
+
export function isDemoCodeNode(node: import("mdast").Code): boolean;
|
|
10
14
|
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/transform.js"],"names":[],"mappings":"AA8BA;;GAEG;AACH,2BAFW,MAAM,mBAoChB;AAED;;;GAGG;AACH,qCAHW,MAAM,QACN,MAAM,
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/transform.js"],"names":[],"mappings":"AA8BA;;GAEG;AACH,2BAFW,MAAM,mBAoChB;AAED;;;GAGG;AACH,qCAHW,MAAM,QACN,MAAM,mBAqChB;AAqSD;;GAEG;AACH,qCAFW,OAAO,OAAO,EAAE,IAAI,WAI9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wds-plugin.d.ts","sourceRoot":"","sources":["../../src/wds-plugin.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wds-plugin.d.ts","sourceRoot":"","sources":["../../src/wds-plugin.js"],"names":[],"mappings":"yBAkCgB,iBAAO,EAAE,4BAAO,EAAE,kDAAY,EAAE,gDAAY,KADmG,OAAO,sBAAsB,EAAE,MAAM;;iCAJtL,OAAO,qBAAqB,EAAE,kBAAkB;2CAChD;IAAE,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAAC,gBAAgB,CAAC,EAAE,OAAO,qBAAqB,EAAE,sBAAsB,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,mBAAmB,CAAC,EAAE,OAAO,qBAAqB,EAAE,yBAAyB,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,qBAAqB,EAAE,mBAAmB,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAAC,yBAAyB,CAAC,EAAE,OAAO,0BAA0B,EAAE,oBAAoB,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE;yCACxZ,4BAA4B,GAAG,kBAAkB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import type { AtlasLayoutHeadContent, BlogData, DocData, HeroData } from './rocket.js';
|
|
3
|
+
|
|
4
|
+
const pageAwareHeadContent: AtlasLayoutHeadContent = ({ pageData }) =>
|
|
5
|
+
html`<meta name="page-url" content=${pageData.url} />`;
|
|
6
|
+
|
|
7
|
+
const siteWideHeadContent: AtlasLayoutHeadContent = () =>
|
|
8
|
+
html`<meta name="site-extension" content="enabled" />`;
|
|
9
|
+
|
|
10
|
+
function sharedAtlasHeadContent(data: DocData | HeroData | BlogData) {
|
|
11
|
+
return data.headContent;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// @ts-expect-error Atlas Layout Head Content requires a Lit template result.
|
|
15
|
+
const rawStringHeadContent: AtlasLayoutHeadContent = () => '<meta name="raw-string" />';
|
|
16
|
+
|
|
17
|
+
// @ts-expect-error Atlas Layout Head Content is synchronous.
|
|
18
|
+
const asyncHeadContent: AtlasLayoutHeadContent = async () => html`<meta name="async" />`;
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
asyncHeadContent,
|
|
22
|
+
pageAwareHeadContent,
|
|
23
|
+
rawStringHeadContent,
|
|
24
|
+
sharedAtlasHeadContent,
|
|
25
|
+
siteWideHeadContent,
|
|
26
|
+
};
|
package/exports/types/rocket.ts
CHANGED
|
@@ -322,6 +322,8 @@ export type JsPage = (
|
|
|
322
322
|
export type Module = {
|
|
323
323
|
config: PageConfig;
|
|
324
324
|
pagination?: PagePaginationDeclaration;
|
|
325
|
+
feed?: PageFeedDeclaration;
|
|
326
|
+
staticParams?: PageStaticParamsDeclaration;
|
|
325
327
|
components?: Components;
|
|
326
328
|
_$title$?: string;
|
|
327
329
|
_$menuLinkText$?: string;
|
|
@@ -411,6 +413,37 @@ export type PagePagination = {
|
|
|
411
413
|
previousPath?: string;
|
|
412
414
|
};
|
|
413
415
|
|
|
416
|
+
export type PageFeedConfig = {
|
|
417
|
+
/**
|
|
418
|
+
* Feed display title.
|
|
419
|
+
*/
|
|
420
|
+
title: string;
|
|
421
|
+
/**
|
|
422
|
+
* Optional feed subtitle text.
|
|
423
|
+
*/
|
|
424
|
+
description?: string;
|
|
425
|
+
/**
|
|
426
|
+
* Page Collection entries included as feed entries, in collection order.
|
|
427
|
+
*/
|
|
428
|
+
collection: PageCollectionEntry[];
|
|
429
|
+
/**
|
|
430
|
+
* Optional maximum number of feed entries taken from the start of the collection.
|
|
431
|
+
*/
|
|
432
|
+
limit?: number;
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
export type PageFeedDeclaration = PageFeedConfig | ((pageData: PageData) => PageFeedConfig);
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Concrete param values for one generated output document of a parameterized static
|
|
439
|
+
* JavaScript Page. Every route param in the Page path must be present.
|
|
440
|
+
*/
|
|
441
|
+
export type PageStaticParams = Record<string, string>;
|
|
442
|
+
|
|
443
|
+
export type PageStaticParamsDeclaration =
|
|
444
|
+
| PageStaticParams[]
|
|
445
|
+
| ((pageData: PageData) => PageStaticParams[]);
|
|
446
|
+
|
|
414
447
|
export type PageRegistrySortDirection = 'asc' | 'desc';
|
|
415
448
|
|
|
416
449
|
export type PageRegistryQueryOptions = {
|
|
@@ -569,9 +602,30 @@ export type WorkflowData = {
|
|
|
569
602
|
steps: WorkflowStep[];
|
|
570
603
|
};
|
|
571
604
|
|
|
572
|
-
export type
|
|
605
|
+
export type AtlasLayoutHeadContentContext = {
|
|
606
|
+
/** The current PageData for this Page render. */
|
|
607
|
+
pageData: PageData;
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Returns trusted Site Author markup appended after Atlas-owned document head content.
|
|
612
|
+
*/
|
|
613
|
+
export type AtlasLayoutHeadContent = (context: AtlasLayoutHeadContentContext) => TemplateResult;
|
|
614
|
+
|
|
615
|
+
type AtlasLayoutHeadContentData = {
|
|
616
|
+
/**
|
|
617
|
+
* Trusted Site Author markup evaluated once and appended after Atlas-owned document head content.
|
|
618
|
+
*/
|
|
619
|
+
headContent?: AtlasLayoutHeadContent;
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
export type HeroData = AtlasLayoutHeadContentData & {
|
|
573
623
|
headerData: HeaderData;
|
|
574
624
|
footerData: FooterSection[];
|
|
625
|
+
/**
|
|
626
|
+
* Project-owned stylesheet URLs loaded after the package Atlas layout stylesheet.
|
|
627
|
+
*/
|
|
628
|
+
stylesheets?: string[];
|
|
575
629
|
featuresData?: Feature[];
|
|
576
630
|
heroMainData: HeroMainData;
|
|
577
631
|
whyRocketData?: HomeCard[];
|
|
@@ -580,15 +634,37 @@ export type HeroData = {
|
|
|
580
634
|
secondaryLinksData?: FooterLink[];
|
|
581
635
|
};
|
|
582
636
|
|
|
637
|
+
export type BlogData = AtlasLayoutHeadContentData & {
|
|
638
|
+
headerData: HeaderData;
|
|
639
|
+
/**
|
|
640
|
+
* Project-owned stylesheet URLs loaded after the package Atlas layout stylesheets.
|
|
641
|
+
*/
|
|
642
|
+
stylesheets?: string[];
|
|
643
|
+
/**
|
|
644
|
+
* Site-root path prefix for tag archive links, e.g. '/blog/tags/'. Tags render as
|
|
645
|
+
* plain text when omitted.
|
|
646
|
+
*/
|
|
647
|
+
tagPathPrefix?: string;
|
|
648
|
+
/**
|
|
649
|
+
* Site-root path of the blog's Page Feed, e.g. '/blog/feed.xml'. Adds a feed
|
|
650
|
+
* alternate link to the document head and a visible feed link on the index.
|
|
651
|
+
*/
|
|
652
|
+
feedPath?: string;
|
|
653
|
+
};
|
|
654
|
+
|
|
583
655
|
export type AtlasDocAsideTip = {
|
|
584
656
|
title?: string;
|
|
585
657
|
description: string;
|
|
586
658
|
iconName?: string;
|
|
587
659
|
};
|
|
588
660
|
|
|
589
|
-
export type DocData = {
|
|
661
|
+
export type DocData = AtlasLayoutHeadContentData & {
|
|
590
662
|
headerData: HeaderData;
|
|
591
663
|
footerData: FooterSection[];
|
|
664
|
+
/**
|
|
665
|
+
* Project-owned stylesheet URLs loaded after the package Atlas layout stylesheet.
|
|
666
|
+
*/
|
|
667
|
+
stylesheets?: string[];
|
|
592
668
|
/**
|
|
593
669
|
* Number of automatic `rocket-icon` hosts in the Atlas docs navigation that
|
|
594
670
|
* should be server-rendered before remaining navigation icons are deferred to
|
package/exports/types.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export type {
|
|
2
|
+
AtlasLayoutHeadContent,
|
|
3
|
+
AtlasLayoutHeadContentContext,
|
|
2
4
|
AtlasDocAsideTip,
|
|
5
|
+
BlogData,
|
|
3
6
|
Components,
|
|
4
7
|
DocData,
|
|
5
8
|
Feature,
|
|
@@ -27,6 +30,8 @@ export type {
|
|
|
27
30
|
PageCollectionEntry,
|
|
28
31
|
PageDiscoverabilityConfig,
|
|
29
32
|
PageConfig,
|
|
33
|
+
PageFeedConfig,
|
|
34
|
+
PageFeedDeclaration,
|
|
30
35
|
PageMetadata,
|
|
31
36
|
PageMetadataConfig,
|
|
32
37
|
PageMetadataCustom,
|
|
@@ -38,6 +43,8 @@ export type {
|
|
|
38
43
|
PageRegistryQuery,
|
|
39
44
|
PageRegistryQueryOptions,
|
|
40
45
|
PageRegistrySortDirection,
|
|
46
|
+
PageStaticParams,
|
|
47
|
+
PageStaticParamsDeclaration,
|
|
41
48
|
PageTree,
|
|
42
49
|
PackageIconLibrarySource,
|
|
43
50
|
PathIconLibrarySource,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rocket/js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "HTML-first static-site metaframework for content sites and Web Component docs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"types": "./dist-types/exports/*",
|
|
17
17
|
"default": "./exports/*"
|
|
18
18
|
},
|
|
19
|
+
"./layouts/atlasBlog.css": "./src/layouts/atlas/atlasBlog.css",
|
|
19
20
|
"./layouts/atlasDoc.css": "./src/layouts/atlas/atlasDoc.css",
|
|
20
21
|
"./layouts/atlasHero.css": "./src/layouts/atlas/atlasHero.css",
|
|
21
22
|
"./layouts/atlasNotFound.css": "./src/layouts/atlas/atlasNotFound.css",
|
|
@@ -48,10 +49,10 @@
|
|
|
48
49
|
},
|
|
49
50
|
"scripts": {
|
|
50
51
|
"start": "npx rocket start",
|
|
51
|
-
"build": "npx rocket build",
|
|
52
|
+
"build": "rm -rf dist && npx rocket build",
|
|
52
53
|
"build:start": "npx http-server dist -o",
|
|
53
54
|
"ai:do": "node scripts/codex-issue-loop.js",
|
|
54
|
-
"ai:do
|
|
55
|
+
"ai:do-loop": "node scripts/codex-issue-loop.js --max 6",
|
|
55
56
|
"ai:check": "node scripts/codex-issue-loop.js --dry-run",
|
|
56
57
|
"lint": "eslint . --ignore-pattern .gitignore && prettier \"**/*.{ts,js,json,md}\" --check --ignore-path .gitignore --ignore-path .prettierignore",
|
|
57
58
|
"format": "eslint . --ignore-pattern .gitignore --fix && prettier \"**/*.{ts,js,json,md}\" --write --ignore-path .gitignore --ignore-path .prettierignore",
|
|
@@ -65,31 +66,19 @@
|
|
|
65
66
|
"prepack": "npm run types",
|
|
66
67
|
"release": "changeset publish"
|
|
67
68
|
},
|
|
68
|
-
"eslintConfig": {
|
|
69
|
-
"overrides": [
|
|
70
|
-
{
|
|
71
|
-
"files": [
|
|
72
|
-
"*.demo.js"
|
|
73
|
-
],
|
|
74
|
-
"rules": {
|
|
75
|
-
"no-console": "off"
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
]
|
|
79
|
-
},
|
|
80
69
|
"bin": {
|
|
81
70
|
"rocket": "src/cli/cli.js"
|
|
82
71
|
},
|
|
83
72
|
"dependencies": {
|
|
84
73
|
"@awesome.me/webawesome": "^3.7.0",
|
|
85
74
|
"@lit-labs/ssr": "^4.1.0",
|
|
86
|
-
"@sparticuz/chromium": "^
|
|
75
|
+
"@sparticuz/chromium": "^149.0.0",
|
|
87
76
|
"@web/dev-server": "^0.4.6",
|
|
88
77
|
"bootstrap-icons": "^1.13.1",
|
|
89
|
-
"commander": "
|
|
78
|
+
"commander": "^15.0.0",
|
|
90
79
|
"es-module-lexer": "^2.1.0",
|
|
91
80
|
"lit": "^3.3.3",
|
|
92
|
-
"parse5": "^
|
|
81
|
+
"parse5": "^8.0.1",
|
|
93
82
|
"puppeteer-core": "^25.1.0",
|
|
94
83
|
"rehype-autolink-headings": "^7.1.0",
|
|
95
84
|
"rehype-prism-plus": "^2.0.2",
|
|
@@ -98,40 +87,33 @@
|
|
|
98
87
|
"rehype-stringify": "^10.0.1",
|
|
99
88
|
"remark-gfm": "^4.0.1",
|
|
100
89
|
"remark-rehype": "^11.1.2",
|
|
101
|
-
"typescript": "6.0.3",
|
|
90
|
+
"typescript": "^6.0.3",
|
|
102
91
|
"unified": "^11.0.5",
|
|
103
|
-
"unist-util-inspect": "8.1.0",
|
|
104
92
|
"unist-util-remove": "^4.0.0",
|
|
105
93
|
"unist-util-visit": "^5.1.0",
|
|
106
|
-
"urlpattern-polyfill": "10.1.0",
|
|
94
|
+
"urlpattern-polyfill": "^10.1.0",
|
|
107
95
|
"vite": "^8.0.14"
|
|
108
96
|
},
|
|
109
97
|
"devDependencies": {
|
|
110
98
|
"@changesets/cli": "^2.31.0",
|
|
111
99
|
"@eslint/eslintrc": "^3.3.5",
|
|
112
100
|
"@eslint/js": "^10.0.1",
|
|
113
|
-
"@netlify/functions": "^5.2.2",
|
|
114
101
|
"@open-wc/testing": "^4.0.0",
|
|
115
102
|
"@types/hast": "^3.0.4",
|
|
116
|
-
"@types/mdast": "4.0.4",
|
|
117
|
-
"@types/node": "^24.
|
|
103
|
+
"@types/mdast": "^4.0.4",
|
|
104
|
+
"@types/node": "^24.13.3",
|
|
118
105
|
"@typescript-eslint/eslint-plugin": "^8.59.4",
|
|
119
106
|
"@typescript-eslint/parser": "^8.59.4",
|
|
120
|
-
"@web/mocks": "^2.0.0",
|
|
121
107
|
"@web/test-runner": "^0.20.2",
|
|
122
|
-
"@web/test-runner-playwright": "^0.11.1",
|
|
123
|
-
"dotenv": "^17.4.2",
|
|
124
108
|
"eslint": "^10.4.0",
|
|
125
109
|
"eslint-config-prettier": "^10.1.8",
|
|
126
110
|
"eslint-plugin-no-only-tests": "^3.4.0",
|
|
127
111
|
"globals": "^17.6.0",
|
|
128
112
|
"netlify-cli": "^26.0.2",
|
|
129
|
-
"patch-package": "^8.0.1",
|
|
130
113
|
"prettier": "^3.8.3",
|
|
131
114
|
"prettier-plugin-packagejson": "^3.0.2",
|
|
132
|
-
"typescript": "6.0.3",
|
|
133
115
|
"typescript-eslint": "^8.59.4",
|
|
134
|
-
"vfile": "6.0.3",
|
|
116
|
+
"vfile": "^6.0.3",
|
|
135
117
|
"wireit": "^0.14.12"
|
|
136
118
|
},
|
|
137
119
|
"engines": {
|
|
@@ -145,7 +127,7 @@
|
|
|
145
127
|
},
|
|
146
128
|
"wireit": {
|
|
147
129
|
"deploy": {
|
|
148
|
-
"command": "
|
|
130
|
+
"command": "netlify deploy --prod --site 2439aca3-b7d1-495c-bb8a-478ce089b666 --no-build",
|
|
149
131
|
"files": [
|
|
150
132
|
"dist/**/*"
|
|
151
133
|
],
|
|
@@ -159,7 +141,8 @@
|
|
|
159
141
|
"command": "tsc --build --pretty",
|
|
160
142
|
"files": [
|
|
161
143
|
"src/**/*",
|
|
162
|
-
"
|
|
144
|
+
"exports/**/*",
|
|
145
|
+
"docs/**/*.js",
|
|
163
146
|
"tsconfig.json"
|
|
164
147
|
],
|
|
165
148
|
"output": [
|
|
@@ -186,6 +169,7 @@
|
|
|
186
169
|
"files": [
|
|
187
170
|
"exports/**/*",
|
|
188
171
|
"src/**/*",
|
|
172
|
+
"scripts/**/*.js",
|
|
189
173
|
"!src/**/*.test-browser.js"
|
|
190
174
|
],
|
|
191
175
|
"output": []
|
package/src/PageData.js
CHANGED
|
@@ -26,11 +26,14 @@ export class PageData {
|
|
|
26
26
|
url,
|
|
27
27
|
{ siteHeadMetadata, pageSiteHeadMetadata, defaultSocialPreviewImage, siteOrigin } = {},
|
|
28
28
|
) {
|
|
29
|
-
|
|
29
|
+
// Copy so layout/page writes (e.g. the title setter) never mutate the
|
|
30
|
+
// shared Page Registry across renders.
|
|
31
|
+
const pageMetadata = typeof metadata === 'string' ? { title: metadata } : { ...metadata };
|
|
30
32
|
this.pageRegistry = pageRegistry;
|
|
31
33
|
/** @type {import('@rocket/js/types.js').PageRegistryQuery} */
|
|
32
34
|
this.pages = new PageRegistryQuery(pageRegistry);
|
|
33
|
-
|
|
35
|
+
/** @type {import('@rocket/js/types.js').PageTree | undefined} */
|
|
36
|
+
this._pageTree = undefined;
|
|
34
37
|
this._clientCode = '';
|
|
35
38
|
this._hydrationScript = '';
|
|
36
39
|
/** @type {boolean} */
|
|
@@ -64,6 +67,13 @@ export class PageData {
|
|
|
64
67
|
: undefined;
|
|
65
68
|
}
|
|
66
69
|
|
|
70
|
+
get pageTree() {
|
|
71
|
+
if (!this._pageTree) {
|
|
72
|
+
this._pageTree = treeFromPages(this.pageRegistry);
|
|
73
|
+
}
|
|
74
|
+
return this._pageTree;
|
|
75
|
+
}
|
|
76
|
+
|
|
67
77
|
get title() {
|
|
68
78
|
return this.metadata.title;
|
|
69
79
|
}
|