\\n"
+ }, undefined, false, {
+ fileName: "",
+ lineNumber: 1,
+ columnNumber: 1
+ }, this)
+ }`);
+ });
+});
diff --git a/packages/site-middleware/src/compileMdx.ts b/packages/site-middleware/src/compileMdx.ts
index 4d8e6e73..e3fd093e 100644
--- a/packages/site-middleware/src/compileMdx.ts
+++ b/packages/site-middleware/src/compileMdx.ts
@@ -11,8 +11,8 @@ export async function compileMDX(
) {
const mdxSource = await serialize(content, {
mdxOptions: {
- rehypePlugins: [rehypeSlug, ...remarkPlugins],
- remarkPlugins: [codeBlocks, remarkGfm, ...rehypePlugins]
+ rehypePlugins: [codeBlocks, rehypeSlug, ...remarkPlugins],
+ remarkPlugins: [remarkGfm, ...rehypePlugins]
},
parseFrontmatter
});
diff --git a/packages/site-middleware/src/plugins/codeBlocks.ts b/packages/site-middleware/src/plugins/codeBlocks.ts
index 14360d6f..ef94d2a3 100644
--- a/packages/site-middleware/src/plugins/codeBlocks.ts
+++ b/packages/site-middleware/src/plugins/codeBlocks.ts
@@ -9,7 +9,7 @@ import { type MdxJsxFlowElementHast } from 'mdast-util-mdx-jsx';
import { propertiesToMdxJsxAttributes } from 'hast-util-properties-to-mdx-jsx-attributes';
/**
- * Modified from: https://github.com/remcohaszing/remark-mdx-code-meta
+ * Modified from: https://github.com/remcohaszing/rehype-mdx-code-props/blob/main/src/rehype-mdx-code-props.ts
*
* Custom meta parser for codefences that have extra params. e.g.
* ```jsx filename="hello.jsx"
@@ -24,7 +24,7 @@ import { propertiesToMdxJsxAttributes } from 'hast-util-properties-to-mdx-jsx-at
*/
export const transformer: Transformer = ast => {
visitParents(ast, 'element', (node, ancestors) => {
- if (node.tagName !== 'code' && node.tagName !== 'pre') {
+ if (node.tagName !== 'code') {
return;
}
@@ -53,7 +53,7 @@ export const transformer: Transformer = ast => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
parent = ancestors.at(-2)!;
- // // Limit eval to just basic strings that start with "meta."
+ // Limit eval to just basic strings that start with "meta."
// const isEval =
// /(^| )eval(="true"| |$)/.test(meta) && /^meta\.[a-z0-9_[\].$"']+$/i.test(child.value);
//
diff --git a/packages/site/next.config.js b/packages/site/next.config.js
index 6e64d8ee..2246e025 100755
--- a/packages/site/next.config.js
+++ b/packages/site/next.config.js
@@ -3,6 +3,11 @@ const webpack = require('webpack');
module.exports = {
reactStrictMode: true,
swcMinify: true,
+ experimental: {
+ outputFileTracingExcludes: {
+ '*': ['**/.next/cache/webpack']
+ }
+ },
transpilePackages: [
'@jpmorganchase/mosaic-components',
'@jpmorganchase/mosaic-content-editor-plugin',
@@ -32,11 +37,6 @@ module.exports = {
]
},
webpack(config) {
- // Swaps out Buble for a smaller version that removes the latest Regex spec features.
- // See https://github.com/FormidableLabs/react-live#what-bundle-size-can-i-expect
- config.plugins.push(
- new webpack.NormalModuleReplacementPlugin(/^buble$/, require.resolve('@philpl/buble'))
- );
// Required by MDX-JS
if (config.resolve.fallback) {
config.resolve.fallback.fs = false;
diff --git a/packages/site/package.json b/packages/site/package.json
index c12479a0..2c915ccb 100644
--- a/packages/site/package.json
+++ b/packages/site/package.json
@@ -41,7 +41,6 @@
"@jpmorganchase/mosaic-standard-generator": "^0.1.0-beta.85",
"@jpmorganchase/mosaic-store": "^0.1.0-beta.85",
"@jpmorganchase/mosaic-theme": "^0.1.0-beta.85",
- "@philpl/buble": "^0.19.7",
"@salt-ds/core": "^1.33.0",
"@salt-ds/lab": "1.0.0-alpha.50",
"@types/react": "^18.0.26",
diff --git a/packages/site/public/search-data.json b/packages/site/public/search-data.json
index 703fe227..e08a93ae 100644
--- a/packages/site/public/search-data.json
+++ b/packages/site/public/search-data.json
@@ -1 +1 @@
-[{"title":"Mosaic","route":"/mosaic/index","content":["True to its name, Mosaic brings together several concepts—including content, design and technical infrastructure—to deliver a unified website experience that is truly greater than the sum of its individual parts.","With Mosaic, you can:","Don't move your content where it does not belong. ","Compose content from remote data sources which\n","are pulled at runtime by our content aggregator.","Visualize your content with your own theme, layouts and components or use the Mosaic Design\n","language.","Extend the existing code and add your own content source types through our simple plugin\n","architecture.","Publish your content through Server Side Rendering (SSR) or generate a snapshot of your content\n","and serve it as a Statically Generated Site (SGS).","Creating a website has never been so easy!"]},{"title":"Sitemap","route":"/mosaic/sitemap","content":["Sitemap"]},{"title":"Aliases","route":"/mosaic/author/aliases","content":["Aliases are virtual 'symlinks' of pages, allowing one page to take on one or more other routes.\n","This is not the same as copying the page, it is a primitive filesystem link which is resolved by Mosaic.","Use Cases","Aliases are great for linking to an old route if you've moved a page to a new place.\n","They can also be used to create short hand links to pages or to 'clone' a copy of a page into\n","another section of the site where it may be relevant.","Example","This is the frontmatter for this page:","---\n","title: Aliases\n","layout: DetailTechnical\n","aliases:\n"," - /mosaic/example/aliases\n","---","Try accessing this page from ","/mosaic/example/aliases"]},{"title":"Fragments","route":"/mosaic/author/fragments","content":["Fragments, also known as content fragments, are powerful tools that allow you to incorporate content from other pages into your documentation. ","By creating an MDX file and using the ","generic directives"," syntax ",", you can easily render the fragment in another file, providing modularity and reusability to your content.","Use Cases","Fragments offer various use cases, such as:","Consistent Content",": Use fragments to maintain consistent content across multiple pages. ","For instance, if you have a table or a tile that appears on multiple pages, you can create a fragment for it and include it in all relevant files. ","This ensures that any updates made to the fragment automatically reflect across the entire documentation.","Reusable Components",": Fragments enable the creation of reusable components or sections. ","You can define a complex or commonly used section once and then include it in multiple pages as needed. ","This approach saves time and effort, as you only need to update the fragment file to propagate changes throughout your documentation.","Modular Documentation",": With fragments, you can break down your documentation into smaller, manageable pieces. ","Each fragment represents a specific topic or section, allowing you to organize and structure your content more efficiently. ","This modular approach simplifies maintenance and makes it easier to navigate and update your documentation.","Usage","Firstly, enable the Fragment Plugin by adding the following to your plugins in ",".","{\n"," modulePath: '@jpmorganchase/mosaic-plugins/FragmentPlugin',\n"," options: {}\n","}","To include a fragment in your content, follow these steps:","Create an MDX file for the fragment you want to reuse. ","Remember to set the sidebar property of your fragment's frontmatter to exclude: true if you don't want the fragment to appear in the vertical navigation menu.","---\n","title: Fragment Title\n","sidebar:\n"," exclude: true\n","---","In the target file where you want to include the fragment, use the remark directive syntax ",".","Markdown Content Example","This is the contents of a fragment located at ",":","---\n","title: Content Fragment\n","sidebar:\n"," exclude: true\n","---\n","\n","#### Fragment Title\n","\n","This is an example fragment of markdown content, being pulled from `../fragments/content-fragment.mdx`.\n","The below code snippet will render the content from the content-fragment.mdx file in your target file:",":fragment{src=\"../fragments/content-fragment.mdx\"}","Example output:","Fragment Title","This is an example fragment of markdown content, being pulled from ",".","Component Example","Here is another example, where the fragment files each contain a "," component.",":fragment{src=\"../fragments/tile-a.mdx\"} :fragment{src=\"../fragments/tile-b.mdx\"}","The above code will render the content from tile-a.mdx and tile-b.mdx files, demonstrated below:"," "]},{"title":"Frontmatter","route":"/mosaic/author/frontmatter","content":["Frontmatter",", also known as page metadata, is a powerful feature that allows easy configuration of a page and Mosaic site components e.g. the sidebar.","Frontmatter is written in yaml syntax and is found at the top of a page between 2 sets of 3 dashes: ",".","Example page yaml","---\n","title: Page Title\n","layout: DetailTechnical\n","sidebar:\n"," priority: 4\n","---\n","\n","// frontmatter is closed and now comes page content\n","# Page Title\n","\n","This is some content.\n","Accessing Frontmatter in content","With the syntax below it is possible to directly reference frontmatter inside content using curly brackets and the "," object.","You can think of "," as a JSON object that holds all the frontmatter of a page and when the Mosaic "," encounters the curly brackets then the value in the frontmatter will be resolved.","{meta.title}\n","{meta.description}\n","{meta.someValueYouHaveAddedToTheFrontmatter}","This is very common to see Mosaic pages that reference the title as shown below:","---\n","title: Title\n","---\n","\n","# {meta.title}","Plugins & Frontmatter","Mosaic plugins can also embed their output into page frontmatter in 2 different ways:","a property is directly added to the page object","a JSON file is generated and referenced using a ","ref","Adding a property to the page","A plugin can add a property to a page simply by extending the page object it receives in the "," lifecycle event:","async function $afterSource(pages) {\n"," for (const page of pages) {\n"," page.newProperty = 'Hello'\n"," }\n"," return pages;\n","}","You could use this property in the page content using ","JSON File","Let's take a look at the ",".","The purpose of this plugin is to crawl the page hierarchy to find the closest "," found in any parent page's frontmatter.","Finds all index pages among the source docs","Deserialises those pages so it can read the frontmatter and content of the page","If a property called "," in the page frontmatter is found a new file named shared-config.json is created","Adds a ref named "," to the shared config file that points to the shared config of the index page","import type { Page, Plugin as PluginType } from '@jpmorganchase/mosaic-types';\n","import { flatten } from 'lodash-es';\n","import path from 'path';\n","\n","function createFileGlob(url, pageExtensions) {\n","if (pageExtensions.length === 1) {\n","return `${url}${pageExtensions[0]}`;\n","}\n","return `${url}{${pageExtensions.join(',')}}`;\n","}\n","\n","interface SharedConfigPluginPage extends Page {\n","sharedConfig?: string;\n","}\n","\n","interface SharedConfigPluginOptions {\n","filename: string;\n","}\n","\n","const SharedConfigPlugin: PluginType = {\n","async $beforeSend(\n"," mutableFilesystem,\n"," { config, serialiser, ignorePages, pageExtensions },\n"," options\n"," ) {\n"," const pagePaths = await mutableFilesystem.promises.glob(\n"," createFileGlob('**/index', pageExtensions),\n"," {\n"," ignore: [options.filename, ...flatten(ignorePages.map(ignore => [ignore, `**/${ignore}`]))],\n","cwd: '/'\n","}\n",");\n","\n"," for (const pagePath of pagePaths) {\n"," const sharedConfigFile = path.join(path.dirname(String(pagePath)), options.filename);\n","\n"," const page = await serialiser.deserialise(\n"," String(pagePath),\n"," await mutableFilesystem.promises.readFile(String(pagePath))\n"," );\n"," if (page.sharedConfig) {\n"," config.setRef(sharedConfigFile, ['config', '$ref'], `${String(pagePath)}#/sharedConfig`);\n"," await mutableFilesystem.promises.writeFile(sharedConfigFile, '{}');\n"," } else {\n"," const baseDir = path.posix.resolve(path.dirname(String(pagePath)), '..","/');\n"," config.setAliases(path.join(baseDir, options.filename), [sharedConfigFile]);\n"," }\n"," }\n","\n","}\n","};\n","\n","export default SharedConfigPlugin;\n"]},{"title":"Author","route":"/mosaic/author/index","content":["Here you will learn how to author documentation using markdown, Mosaic components and page templates"]},{"title":"Markdown Syntax","route":"/mosaic/author/markdown-syntax","content":["Out of the box, Mosaic supports documents written in ","MDX"," which allows React components to be embedded within the ","basic syntax"," outlined in the original Markdown design document.","In addition to the basic markdown syntax, the MDX processor used by Mosaic has been configured to support additional markdown syntax and features:","GitHub flavored markdown (gfm)","Frontmatter","Mosaic Standard Components","All components that comprise the "," export from "," package are available to use out of the box in your documents.","This includes components for all standard markdown syntax and additional components like "," and ",".","Referencing Frontmatter","Frontmatter values can be embedded into the page using the "," object. ","See ","frontmatter"," for more information.","Configuring Supported components","TODO"]},{"title":"Refs","route":"/mosaic/author/refs","content":["Refs are a very powerful feature of Mosaic documents that use ","JSON References"," to reference\n","a property from the page frontmatter or frontmatter of other pages.","The key concept is that of a JSON pointer which takes the form ","A","#","B"," where:","A"," is the relative path from the current schema to a target schema. ","If A is empty, the reference is to a type or property in the same schema, an in-schema reference. ","Otherwise, the reference is to a different schema, a cross-schema reference.","B"," is the complete path from the root of the schema to a type or property in the schema. ","If # in not included or B is empty, the reference is to an entire schema.","To translate this for our purposes:","A"," is the relative path to a file in the filesystem.","B"," is the path to a property in the frontmatter of the file.","It's probably better explained with examples...","Local refs (In-schema reference)","It is possible to reference a page's own frontmatter to avoid duplication:","---\n","title: Refs\n","layout: DetailTechnical\n","sidebar:\n"," priority: 3\n","data:\n"," sidebarPriority:\n"," $ref: '#/sidebar/priority'\n","---","This page you are reading right now has a sidebar priority of ",".","The value of "," comes from "," in the frontmatter.","Notice that because we don't specify a path before the "," in the ref we need to put the whole\n","value inside quotes.","Remote Refs (Cross-schema reference)","It is possible to reference frontmatter of other pages. ","Again this helps avoid duplication but the real power is using refs to build the data model. ","See ","advanced"," for more information.","The ","index"," page of the Author section has this frontmatter:","---\n","title: Author\n","layout: DetailTechnical\n","sidebar:\n"," priority: 3\n","data:\n"," exampleRefData: Hello from Author page\n","---","This page you are currently looking at is referencing the "," in it's frontmatter like this:","---\n","title: Refs\n","layout: DetailTechnical\n","sidebar:\n"," priority: 3\n","data:\n"," authorRef:\n"," $ref: ./#/data/exampleRefData\n","---","I can then use the data and embed it in this page like this:","{meta.data.authorRef}","And here it is: ","Notice that we did not need to put "," in the ref since index pages are resolved\n","automatically.","Advanced","You have had a taste of the power and want to know more? ","OK, lets reference and then list out all the mosaic modes:","The Modes ","index"," page has this frontmatter:","---\n","title: Modes of operation\n","layout: DetailTechnical\n","sidebar:\n"," priority: 4\n","data:\n"," modes:\n"," $ref: ./*#/title\n","---","The ref here is essentially using a wildcard (the *) to grab the "," property from the frontmatter of every page in the modes folder.","We can reference that data just like before:","---\n","title: Refs\n","layout: DetailTechnical\n","sidebar:\n"," priority: 3\n","data:\n"," modes:\n"," $ref: ../configure/modes#/data/modes\n","---","Output","With the code below, the referenced data can be embedded in a page.","
\n"," {meta.data.modes.map(mode => (\n","
{mode}
\n"," ))}\n","
","Output with Mosaic Components","You can use Mosaic components with referenced data as well. ","Below we are using the "," and "," components.","\n"," {meta.data.modes.map(mode => (\n"," \n"," ))}\n","","Setting Refs using Plugins","Mosaic plugins can create new refs, create new ","global"," refs and see existing refs created by the page or other plugins. ","This is achieved using a special "," property available in the plugin helpers.","Create new refs","Use the "," function from the helpers provided to plugin lifecycle events. ","You need to provide","The file/fullpath to write the ref to","The path to the ptoperty where the ref will be applied","The value of the ref, which can use wildcards","For example, the following would add a property to pages named ",". ","The value is the title of all pages in the ","same"," directory as the current page"," async $afterSource(pages, { config }) {\n"," for (const page of pages) {\n"," config.setRef(page.fullPath, ['titles', '$ref'], `**#/title`);\n"," }\n"," return pages;\n"," }","When setting the property path the last string must be "," otherwise you're not creating a ref\n","that will be resolved by the RefPlugin.","Existing refs","To view refs that already exist you can use ",". ","For example to see all refs for a page:"," config.data.refs[fullPathToPage]","Create global refs","Global refs are similar to regular refs except they do not pre-resolve. ","This means they are resolved when the referenced file is read and the global mosaic filesystem, made up of multiple sources, is used rather than the filesystem of a single source."]},{"title":"Sidebar Configuration","route":"/mosaic/author/sidebars","content":["Sidebar data is generated by the the ","Sidebar Plugin"," which by default uses alphabetical ordering of page names to order the sidebar.","Sidebar frontmatter","A page can add a "," property to its ","frontmatter"," to change the ordering of a sidebar and what title is used for a page in the sidebar.","To rearrange pages in the sidebar or to apply a different label to a page you can specify the following in the page frontmatter:","Sidebar group label","A sidebar group when expanded will reveal the pages contained within the group.\n","Each group has a default page, ",", which is the default for the group and any breadcrumb link.","The"," can define a "," which defines the name of the sidebar group.\n","If no ","groupLabel"," is defined, sidebar group labels will be defined by either ","label"," or ","title",".","To specify the label of the default page, refer to [Sidebar label](.","/Sidebar label)","---\n","title: Sidebar Configuration\n","layout: DetailTechnical\n","sidebar:\n"," groupLabel: Group label\n","---","Sidebar label","By default the ","title"," of a page is used in the sidebar as the label but this can be changed to another label using page frontmatter.","---\n","title: Sidebar Configuration\n","layout: DetailTechnical\n","sidebar:\n"," label: A New Label\n","---","Sidebar priority","Sidebar priority is a number used to sort the sidebar. ","Higher the priority pages appear first in the sidebar ordering.","---\n","title: Sidebar Configuration\n","layout: DetailTechnical\n","sidebar:\n"," priority: 10\n","---","Sidebar Sort Configuration","Sidebar sort configuration allows the sidebar to be sorted using a more sophisticated approach and only needs to be applied to the "," page of the directory you want to sort.","Priority takes precedence over sort configuration so it can be used to override the sort\n","configuration if required.","You must add the sidebar sort configuration to the "," property of an ","index"," page e.g.,","sharedConfig:\n"," sidebar:\n"," sort:\n"," field: data/title\n"," dataType: string\n"," arrange: desc","The properties of the sort configuration are described in the table below:","| Property | Description | Required |\n","| -------- | ------------------------------------------------------------------------------------------ | -------- |\n","| field | the path, separated by ",", used to find the value in page frontmatter you wish to sort by | Yes |\n","| dataType | is the type of the value. ","Can be a "," or "," or ",". ","| Yes |\n","| arrange | "," or "," order | yes |","Newsletters Example","Let's say you have a ","Newsletters"," directory and each page in the directory represents a newsletter. ","You wish to sort the newsletter sidebar by publication date in descending order (newest first).","One way to do this is to edit each page and add a "," which is manually incremented every time a news newsletter is added. ","Alternatively you can add the following sort configuration to the newsletters index page:","sharedConfig:\n"," sidebar:\n"," sort:\n"," field: data/publicationDate\n"," dataType: date\n"," arrange: desc","This will use the "," property in each newsletter to sort the newsletters in the sidebar. ","The publication date is converted to a "," by the Sidebar Plugin to ensure accurate ordering. ","There is now no need to increment a priority when a new newsletter is added.","Example newsletter page frontmatter:","---\n","title: Newsletter 01 Jan 2023\n","description: Newsletter 01 Jan 2023\n","data:\n"," title:\n"," $ref: '#/title'\n"," link: /newsletters/2023-01-01\n"," publicationDate: '2023-01-01'\n","---"]},{"title":"Tags","route":"/mosaic/author/tags","content":["Tags are very similar to ","Refs"," with one very important distinction: Tags work ","across multiple sources",".","In Mosaic, each source has it's own filesystem which are then merged together to form a union of all source filesystems. ","It is in this union filesystem that tags are applied and not to the individual source filesystem that the tag was defined on.","Tags are slower to apply than refs. ","Multiple sources need to run and update before tagged data\n","will be resolved. ","If possible, stick to refs and only use tags when dealing with multiple sources.","Tagging a page","To tag a page, add a "," property to the page frontmatter. ","For example, the Product A page is tagged with \"in-stock\":","---\n","title: Product A\n","description: Mosaic Product A\n","layout: ProductDiscover\n","tags:\n"," - in-stock\n","data:\n"," name:\n"," $ref: '#/title'\n","---"," is always an array","Subscribing to a tag","To subscribe to a tag, use the "," property. ","For example, the Products page has subscribed to the "," property of pages tagged with ",".","---\n","title: Products\n","data:\n"," in-stock:\n"," $tag: in-stock#/data\n","---","A "," can provide a path to a specific piece of metadata on tagged pages, just like a ref.","Example","This page has subscribed to "," and "," tags and is displaying them using 2 Mosaic "," components.","Both the Product A and Product B pages are part of a different source than this page.","In Stock","Out of Stock"]},{"title":"UI Components","route":"/mosaic/author/ui-components","content":["Todo..."]},{"title":"Configure","route":"/mosaic/configure/index","content":["Mosaic is a tool which retrieves, formats and combines documentation pages from any number of different external sources (such as GitHub repositories, local disks or REST endpoints), into a single filesystem for you to use in your websites."]},{"title":"Content Fragment","route":"/mosaic/fragments/content-fragment","content":["Fragment Title","This is an example fragment of markdown content, being pulled from ","."]},{"title":"Fragments","route":"/mosaic/fragments/index","content":["This folder contains example fragments that are referenced and rendered in the Fragments docs page."]},{"title":"Tile A","route":"/mosaic/fragments/tile-a","content":[]},{"title":"Tile B","route":"/mosaic/fragments/tile-b","content":[]},{"title":"Create a Site","route":"/mosaic/getting-started/create-a-site","content":["In this guide you will learn how to generate and serve a Mosaic site.","Prerequisites","To begin setting up a Mosaic site, you need to have the following software installed:","Yarn v1","Node.js v18 or higher","Step 1: Generate a Mosaic site","Run the following command in your project directory to generate a new Mosaic site:","npx @jpmorganchase/mosaic-create-site create -o my-sample-site","This command creates a new Mosaic site in the my-sample-site directory.","Next, navigate to the site directory:","cd my-sample-site","Step 2: Serve the site","The example site you have generated comes preconfigured with two ","sources",": a remote repository and a local docs folder. ","Sources are used by Mosaic to pull content from disparate locations and merge them into a single virtual filesystem that can be used by a Mosaic site.","Set up Git credentials","If you want the site to read from remote repositories, you need to set up an environment variable to store your Git credentials. ","Follow these steps:","Open a terminal or command prompt.","Replace "," and "," in the following commands with your actual Git username and personal access token.","On Unix:","export MOSAIC_DOCS_CLONE_CREDENTIALS=\":\"","On Windows:","set MOSAIC_DOCS_CLONE_CREDENTIALS=\":\"","This sets the MOSAIC_DOCS_CLONE_CREDENTIALS environment variable with your Git credentials.","Serve command","Now you can serve your Mosaic site by running the following command:","yarn serve","Access your Mosaic site from a browser using the following URLs:","To browse the content from your local source: http://localhost:3000/local","To browse the content from the Mosaic Git repo source: http://localhost:3000/mosaic","That's it! ","Your Mosaic site is now up and running.","Next Steps:","Deploy your Mosaic site to AWS or Vercel for production use.","Create more pages to expand your site's content.","Configure your own sources in the mosaic.config.mjs file to pull content from different locations.","Theme your site"]},{"title":"Getting Started","route":"/mosaic/getting-started/index","content":["Getting Started with Mosaic","Follow our step-by-step guides to quickly create and deploy your first Mosaic site."]},{"title":"Publish a site to AWS","route":"/mosaic/getting-started/publish-site-to-aws","content":["Publish a site to AWS using S3 snapshots.","Step 1: Generate a Mosaic site","If you have already created your Mosaic site, skip ahead to step 2.","> npx @jpmorganchase/mosaic-create-site -o my-sample-site\n","> cd my-sample-site","Step 2: Create a Github repository","> git init\n","> git remote add origin git@github.com:username/my-sample-site.git\n","> git add .\n","> git commit -m \"initial commit\"\n","> git push origin main","Step 3: Generate a snapshot of content","Consider a snapshot as a directory of static content previously pulled from your content sources, which does not update itself.","> yarn gen:snapshot","Step 4: Configure environment for S3","> export MOSAIC_MODE=\"snapshot-s3\"\n","> export MOSAIC_S3_BUCKET=\"\"\n","> export MOSAIC_S3_REGION=\"\"\n","> export MOSAIC_S3_ACCESS_KEY_ID=\"\"\"\n","> export MOSAIC_S3_SECRET_ACCESS_KEY=\"\"\n","> yarn mosaic upload -S ./snapshots/latest","Step 5: Setup AWS","Switch to the ","AWS Amplify"," console and deploy your app as a SSR application by following the ","AWS docs",".","Setup an S3 bucket as per the ","AWS S3 docs",".","Step 7: Configure your AWS app","Add the environment vars to the hosted app via your console","MOSAIC_MODE=\"snapshot-s3\"\n","MOSAIC_S3_BUCKET=\"\"\n","MOSAIC_S3_REGION=\"\"\n","MOSAIC_S3_ACCESS_KEY_ID=\"\"\"\n","MOSAIC_S3_SECRET_ACCESS_KEY=\"\"","Add the following build settings","version: 1\n","frontend:\n"," phases:\n"," preBuild:\n"," commands:\n"," - yarn install\n"," - env | grep -e MOSAIC >> .env.production\n"," build:\n"," commands:\n"," - yarn run build\n"," artifacts:\n"," baseDirectory: .next\n"," files:\n"," - '**/*'\n"," cache:\n"," paths:\n"," - node_modules/**/*","Ensure the Node is set to 16","Step 8: Upload your snapshot","Upload your snapshot to S3 storage.","> yarn mosaic upload -S ./snapshots/latest"]},{"title":"Publish","route":"/mosaic/publish/index","content":["To create your first Mosaic site, we have created a command line generator that scaffolds a ","standard"," site.","A ","standard"," site offers","an out the box, working site, which showcases local and remote content sources","a minimal set of files that can be configured with your own components, themes, layouts, sources and plugins","an update path that enables you to update Mosaic, independently of your own configuration","Create your first site","Install the Mosaic create site script.","> yarn global add @jpmorganchase/mosaic-create-site","Create a directory for your site and run the "," script.","> mkdir mosaic-sample-site\n","> cd mosaic-sample-site\n","> mosaic-create-site -f .","Define the environment variable, which enables us to access your remote repo.","> export MOSAIC_DOCS_CLONE_CREDENTIALS=\"\"","The "," environment variable is composed of your git username and your PAT token.\n","Follow these ","docs"," to see how to create your own PAT token.","Your site is ready to run.","> yarn serve","In your browser load ","Congratulations, you have created your first Mosaic site."]},{"title":"Publish a site to AWS","route":"/mosaic/publish/publish-site-to-aws","content":["A Mosaic site is a ","Next.Js"," app.","To publish a Next.Js App to AWS, deploy your app as a SSR application by following the ","AWS docs",".","Once the basic app has been configured, add the Mosaic specifics.","Add the environment vars to the hosted app via the Amplify console","MOSAIC_MODE=\"snapshot-s3\"\n","MOSAIC_S3_BUCKET=\"\"\n","MOSAIC_S3_REGION=\"\"\n","MOSAIC_S3_ACCESS_KEY_ID=\"\"\"\n","MOSAIC_S3_SECRET_ACCESS_KEY=\"\"","Add the following build settings","version: 1\n","frontend:\n"," phases:\n"," preBuild:\n"," commands:\n"," - yarn install\n"," - env | grep -e MOSAIC >> .env.production\n"," build:\n"," commands:\n"," - yarn run build\n"," artifacts:\n"," baseDirectory: .next\n"," files:\n"," - '**/*'\n"," cache:\n"," paths:\n"," - node_modules/**/*","Ensure the Node is set to 16"]},{"title":"Publish a site to Vercel","route":"/mosaic/publish/publish-site-to-vercel","content":["A Mosaic site is a ","Next.Js"," app.","To publish a Next.Js App to Vercel, refer to the ","Vercel docs",".","Deployment","As the ","vercel platform"," hosts static content you will need to deploy a mosaic snapshot. ","There is no option to run mosaic in ","active mode",".","1. ","Update Config File","Add the following to the mosaic config file used by your site:"," deployment: { mode: 'snapshot-file', platform: 'vercel' }","2. ","Set Environment Variables","Set 2 ","environment variables"," in the vercel dashboard.","| Variable Name | Value |\n","| ------------------- | ----------------- |\n","| MOSAIC_MODE | snapshot-file |\n","| MOSAIC_SNAPSHOT_DIR | snapshots/latest. ","|","3. ","Run Build and Deploy","The "," command used by vercel must run "," followed by ","The "," command is needed to workaround an ","output file tracing"," problem.","Example:","yarn build && yarn deploy","Output File Tracing","Output File Tracing"," is a feature of Next.js that uses static analysis\n","to determine what files are needed to deploy a production version of an application.","Due to the architecture of mosaic, snapshot files can be ignored by this process and therefore excluded from the build artifacts deployed by vercel.","If you are deploying your site to the ","vercel platform"," then the mosaic site has a "," command that will update the nextjs output trace to include the snapshot files."]},{"title":"Test","route":"/mosaic/test/index","content":["Pages for e2e testing."]},{"title":"Admin","route":"/mosaic/configure/admin/index","content":["There are several admin urls exposed by Mosaic that provide an insight into how the filesystem has been configured and a way to remotely manage sources.","Endpoints","| Endpoint | Method | Description | Params |\n","| -------------------------- | ------ | -------------------------------------------- | ---------------------- |\n","| "," | GET | Returns the JSON from the Mosaic config file | n/a |\n","| "," | GET | Returns the entire mosaic filesystem as JSON | n/a |\n","| "," | GET | Returns a collection of active sources | n/a |\n","| "," | POST | Adds the source | definition & isPreview |\n","| "," | PUT | Stops the source with the provided name | name |\n","| "," | PUT | Restarts the source with the provided name | name |"]},{"title":"Detail Highlight","route":"/mosaic/configure/layouts/detail-highlight","content":["Layout: Detail Highlight","Initialize with "," in your page's frontmatter.","This layout is used to promote, share insights, and statistics for a line of business.","This layout should be used for pages with only one level of nesting, therefore, pagination is not eligible for this\n","layout.","Page geometry"]},{"title":"Detail Overview","route":"/mosaic/configure/layouts/detail-overview","content":["Layout: Detail Overview","Initialize with "," in your page's frontmatter.","This layout is used to present an overview of expected documentation, statisitics, and ability to\n","navigate to more documents.","Avoid making this page too long. ","If it gets too long, we recommend the ","Detail Technical"," template.","Page geometry","Other Layouts","Detail Highlight","Detail Technical","Landing","Product Discover","Product Preview","Filler content","Eiusmod veniam adipisicing est magna id sunt occaecat minim adipisicing ad do pariatur id aliqua.\n","Officia officia deserunt consequat ullamco irure. ","Excepteur deserunt esse occaecat ex aute. ","Duis do\n","do in incididunt cupidatat dolore veniam magna aliquip voluptate laborum. ","Non irure magna amet\n","ullamco culpa esse dolore nostrud. ","Id ea id ipsum incididunt do velit aliquip fugiat do non\n","consequat.","A sub heading","Deserunt sunt pariatur mollit dolor eiusmod. ","Anim sunt officia cillum anim. ","Laborum ullamco\n","consectetur elit dolore quis laborum. ","Eiusmod cillum amet veniam sunt Lorem reprehenderit commodo.\n","Cupidatat cillum ea consequat anim. ","Duis voluptate nulla veniam labore quis tempor.","Commodo reprehenderit excepteur amet aliquip cillum veniam ad. ","Ullamco proident deserunt laboris\n","duis laborum consequat laboris est eu enim nulla. ","Mollit velit consectetur ea aliqua consectetur\n","mollit eu ex deserunt. ","Aute excepteur exercitation esse proident excepteur Lorem. ","Quis cillum\n","occaecat sint voluptate incididunt ea ipsum incididunt duis sint magna magna fugiat.","Third-level heading","Ea do magna aute proident nulla cupidatat esse consectetur anim eu esse. ","Consectetur est voluptate\n","excepteur non dolore consequat fugiat deserunt. ","Est nostrud est ea irure reprehenderit commodo\n","nostrud nulla tempor ipsum tempor sit id exercitation. ","Sunt reprehenderit officia anim id quis\n","pariatur velit cillum incididunt officia sunt. ","Ullamco ipsum cillum minim deserunt eiusmod nostrud\n","irure et nulla laborum ipsum ipsum incididunt. ","Voluptate reprehenderit in occaecat ipsum nulla\n","excepteur excepteur mollit laboris id ad laborum do. ","Qui in laborum nostrud quis occaecat proident\n","ipsum tempor laborum consequat id ut velit occaecat.Aliquip quis qui ullamco ipsum exercitation\n","exercitation excepteur ea ex. ","Proident elit incididunt incididunt ad adipisicing quis deserunt sint\n","laboris deserunt ipsum culpa est. ","Id do ex duis Lorem exercitation amet reprehenderit. ","Voluptate qui\n","tempor qui sit minim sit qui ea id dolor excepteur. ","Laborum elit excepteur enim sunt consequat\n","officia cillum. ","Do ea occaecat ut voluptate ea proident duis minim ad pariatur dolore magna enim\n","duis. ","Sit aliqua aliqua ea mollit enim cupidatat proident incididunt. ","Eu dolore sit non incididunt.\n","Mollit reprehenderit sunt sunt cillum labore velit exercitation officia aliqua ea adipisicing do ea.\n","Commodo et fugiat velit dolore consectetur.","Amet dolore deserunt in ut amet officia exercitation sint excepteur voluptate proident tempor enim\n","est. ","Culpa proident tempor in voluptate laboris sunt consectetur sit cillum excepteur culpa enim\n","velit laboris. ","Pariatur elit amet nostrud tempor nostrud ea. ","Exercitation do aliquip nisi amet id.\n","Lorem labore incididunt sit sit veniam tempor do consectetur do culpa qui.","Id sint deserunt laborum mollit id excepteur","mollit excepteur labore labore dolor. ","Sit cupidatat nostrud ad consequat amet excepteur id sunt\n","labore adipisicing non irure. ","Fugiat exercitation laborum officia minim duis dolor do officia Lorem\n","cillum excepteur. ","Sint elit mollit duis sit ad commodo.","Cillum amet irure ut tempor tempor culpa dolore sint.","Lorem qui ipsum reprehenderit est incididunt duis exercitation ea duis fugiat. ","Consectetur enim id\n","sunt exercitation et dolore ea proident sunt excepteur fugiat dolor. ","Veniam proident dolore irure\n","incididunt deserunt pariatur quis. ","Incididunt ea elit deserunt occaecat eiusmod velit fugiat eiusmod\n","dolor eiusmod ullamco. ","Fugiat fugiat eiusmod occaecat nulla consequat pariatur.","Aliquip non cupidatat irure magna et fugiat sunt amet ex est excepteur irure quis. ","Non culpa magna\n","nisi enim eu nulla esse laborum amet ipsum. ","Eu consectetur labore do id occaecat adipisicing."]},{"title":"Detail Technical","route":"/mosaic/configure/layouts/detail-technical","content":["Layout: Detail Technical","Initialize with "," in your page's frontmatter.","This layout is used for longer, technical, detailed content about the product.","This layout shows less marketing-type visuals and more visual of diagrams, screenshots, and code\n","snippets.","This page can be short or very lengthy.","Page geometry","Other Layouts","Detail Highlight","Detail Overview","Landing","Product Discover","Product Preview","Filler content","Eiusmod veniam adipisicing est magna id sunt occaecat minim adipisicing ad do pariatur id aliqua.\n","Officia officia deserunt consequat ullamco irure. ","Excepteur deserunt esse occaecat ex aute. ","Duis do\n","do in incididunt cupidatat dolore veniam magna aliquip voluptate laborum. ","Non irure magna amet\n","ullamco culpa esse dolore nostrud. ","Id ea id ipsum incididunt do velit aliquip fugiat do non\n","consequat.","A sub heading","Deserunt sunt pariatur mollit dolor eiusmod. ","Anim sunt officia cillum anim. ","Laborum ullamco\n","consectetur elit dolore quis laborum. ","Eiusmod cillum amet veniam sunt Lorem reprehenderit commodo.\n","Cupidatat cillum ea consequat anim. ","Duis voluptate nulla veniam labore quis tempor.","Commodo reprehenderit excepteur amet aliquip cillum veniam ad. ","Ullamco proident deserunt laboris\n","duis laborum consequat laboris est eu enim nulla. ","Mollit velit consectetur ea aliqua consectetur\n","mollit eu ex deserunt. ","Aute excepteur exercitation esse proident excepteur Lorem. ","Quis cillum\n","occaecat sint voluptate incididunt ea ipsum incididunt duis sint magna magna fugiat.","Third-level heading","Ea do magna aute proident nulla cupidatat esse consectetur anim eu esse. ","Consectetur est voluptate\n","excepteur non dolore consequat fugiat deserunt. ","Est nostrud est ea irure reprehenderit commodo\n","nostrud nulla tempor ipsum tempor sit id exercitation. ","Sunt reprehenderit officia anim id quis\n","pariatur velit cillum incididunt officia sunt. ","Ullamco ipsum cillum minim deserunt eiusmod nostrud\n","irure et nulla laborum ipsum ipsum incididunt. ","Voluptate reprehenderit in occaecat ipsum nulla\n","excepteur excepteur mollit laboris id ad laborum do. ","Qui in laborum nostrud quis occaecat proident\n","ipsum tempor laborum consequat id ut velit occaecat.Aliquip quis qui ullamco ipsum exercitation\n","exercitation excepteur ea ex. ","Proident elit incididunt incididunt ad adipisicing quis deserunt sint\n","laboris deserunt ipsum culpa est. ","Id do ex duis Lorem exercitation amet reprehenderit. ","Voluptate qui\n","tempor qui sit minim sit qui ea id dolor excepteur. ","Laborum elit excepteur enim sunt consequat\n","officia cillum. ","Do ea occaecat ut voluptate ea proident duis minim ad pariatur dolore magna enim\n","duis. ","Sit aliqua aliqua ea mollit enim cupidatat proident incididunt. ","Eu dolore sit non incididunt.\n","Mollit reprehenderit sunt sunt cillum labore velit exercitation officia aliqua ea adipisicing do ea.\n","Commodo et fugiat velit dolore consectetur.","Amet dolore deserunt in ut amet officia exercitation sint excepteur voluptate proident tempor enim\n","est. ","Culpa proident tempor in voluptate laboris sunt consectetur sit cillum excepteur culpa enim\n","velit laboris. ","Pariatur elit amet nostrud tempor nostrud ea. ","Exercitation do aliquip nisi amet id.\n","Lorem labore incididunt sit sit veniam tempor do consectetur do culpa qui.","Id sint deserunt laborum mollit id excepteur","mollit excepteur labore labore dolor. ","Sit cupidatat nostrud ad consequat amet excepteur id sunt\n","labore adipisicing non irure. ","Fugiat exercitation laborum officia minim duis dolor do officia Lorem\n","cillum excepteur. ","Sint elit mollit duis sit ad commodo.","Cillum amet irure ut tempor tempor culpa dolore sint.","Lorem qui ipsum reprehenderit est incididunt duis exercitation ea duis fugiat. ","Consectetur enim id\n","sunt exercitation et dolore ea proident sunt excepteur fugiat dolor. ","Veniam proident dolore irure\n","incididunt deserunt pariatur quis. ","Incididunt ea elit deserunt occaecat eiusmod velit fugiat eiusmod\n","dolor eiusmod ullamco. ","Fugiat fugiat eiusmod occaecat nulla consequat pariatur.","Aliquip non cupidatat irure magna et fugiat sunt amet ex est excepteur irure quis. ","Non culpa magna\n","nisi enim eu nulla esse laborum amet ipsum. ","Eu consectetur labore do id occaecat adipisicing."]},{"title":"Layouts","route":"/mosaic/configure/layouts/index","content":["Todo..."]},{"title":"Landing Layout","route":"/mosaic/configure/layouts/landing","content":["Layout: Landing","Initialize with "," in your page's frontmatter.","Use this layout as a landing page to show large branded visuals, and high-level content about the\n","line of business.","Set the tone and voice for your LOB’s experience.","Use components that support your content with places to insert visuals, share any stats or an\n","introduction of LOB’s story.","Use heading styles to show the grouping of content of a section.","Page geometry"]},{"title":"Product Discover Layout","route":"/mosaic/configure/layouts/product-discover","content":["Layout: Product Discover","Initialize with "," in your page's frontmatter.","Use this layout to introduce a product feature with a description and large visual.","This layout is use for marketing and discovery content.","Page geometry"]},{"title":"Product Preview Layout","route":"/mosaic/configure/layouts/product-preview","content":["Layout: Product Preview","Initialize with "," in your page's frontmatter.","This layout has been used to introduce a product and showcase their suite of product offerings.","Use heading styles to show the grouping of content of a section.","Page geometry"]},{"title":"Active mode","route":"/mosaic/configure/modes/active","content":["In "," mode content can be ","pulled"," from heterogeneous data sources and normalized via plugins, to the configured components/theme.\n","As your content changes, the site will ","re-pull"," the content and update your site in real-time.","The standard generated site comes with 2 sources to demonstrate, how 'active' mode work.","a local source, which loads content from ","a remote source, which loads content from a ","sample Github repository","Configuring your content sources","All content is composed together within a ","namespace",".","A ","namespace"," is the scope for aggregated content, represented by the root path.\n","e.g Our sample docs are aggregated into a ","namespace"," called "," and served by the user journey ","Mosaic doc sources are defined by a file called ","Here is how that might look for a standard site.","Pull your local content","To tryout local content creation, add a file called","The load ","Each directory should contain an "," which is the default page, when a page is loaded without a path","Now create other pages and subdirectories and explore how Mosaic, builds your user-journeys from your fileset.","Pull your remote content","To tryout remote content creation, your standard site comes pre-configured to load our Mosaic sample docs.","Edit the "," and change your "," and "," to pull content from other repos."]},{"title":"Modes of operation","route":"/mosaic/configure/modes/index","content":["Mosaic can operate in 3 different modes","Active updates","In ","active"," mode, content updates in real-time.","active"," mode content is pulled at configured intervals in real-time, as defined by ",".","Read the ","active"," configuration docs.","Static content","Consider a snapshot as a directory of static content previously pulled from your content sources, which does not update itself.","In a snapshot mode, the snapshot does update itself.","File based snapshots","In "," mode, immutable snapshots of content are loaded at startup from the local file-system.","Read the ","snapshot-file"," configuration docs.","S3 based snapshots","In "," mode, snapshots of content are loaded at startup from a remote S3 bucket.","Read the ","snapshot-s3"," configuration docs."]},{"title":"Snapshot file mode","route":"/mosaic/configure/modes/snapshot-file","content":["In "," mode a local immutable snapshot can be loaded by the site. ","Typically, the snapshot and the site are\n","deployed together and upon startup the site can load the snapshot from the local file-system.","To use "," mode","export MOSAIC_MODE=\"snapshot-file\"\n","export MOSAIC_SNAPSHOT_DIR=\"./snapshot/latest\"","Generating a snapshot","To generate a snapshot, run","yarn gen:snapshot","Commit the snapshot to your Git repo and push the site+snapshot to your Git repo, within the same branch."]},{"title":"Snapshot AWS/S3 mode","route":"/mosaic/configure/modes/snapshot-s3","content":["In "," mode a snapshot can be loaded from a pre-configured AWS S3 bucket.","To use "," mode","> export MOSAIC_MODE=\"snapshot-s3\"\n","> MOSAIC_S3_BUCKET=\"\"\n","> MOSAIC_S3_REGION=\"\"\n","> MOSAIC_S3_ACCESS_KEY_ID=\"\"\n","> MOSAIC_S3_SECRET_ACCESS_KEY=\"\"","Generating a snapshot","To generate a snapshot, run","yarn gen:snapshot","Uploading a snapshot to S3","To upload a snapshot to S3, define the required environment variables and run","yarn mosaic upload -S "]},{"title":"$AliasPlugin","route":"/mosaic/configure/plugins/alias-plugin","content":["The "," is what powers the ","aliases"," feature of Mosaic.","It does this by scrapes "," from page metadata and also applies all aliases stored in ","Other plugins can use "," to apply new aliases, as long as they call it before this plugin has reaches the "," lifecycle event.","This plugin is added to the plugins collection by Mosaic itself so users do ","not"," need to include it in their own mosaic config file.","Priority","This plugin runs with a priority of -1 so it runs ","after"," most other plugins."]},{"title":"BreadcrumbsPlugin","route":"/mosaic/configure/plugins/breadcrumbs-plugin","content":["The "," is responsible for generating the data needed to show breadcrumbs navigation on pages. ","It then appends this data to a "," property in the page metadata.","Should a page already have a "," property in it's metadata then it is respected and not overwritten.","If a page has a "," property in it's metadata then this is used as the label for the breadcrumb, otherwise the page "," is used.","When the "," is traversing up directories, it needs to know what page in the directory represents the ","breadcrumb"," for that directory. ","It is recommended to use the "," page for this but the page to use is a configurable option of the breadcrumbs plugin.","Priority","This plugin runs with no special priority.","Options","| Property | Description |\n","| ------------- | ------------------------------------------------ |\n","| indexPageName | The page name to use for \"directory\" breadcrumbs |","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the breadcrumbs plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/BreadcrumbsPlugin',\n"," options: {\n"," indexPageName: 'index.mdx'\n"," }\n"," }\n"," // other plugins\n","];"]},{"title":"BrokenLinksPlugin","route":"/mosaic/configure/plugins/broken-links-plugin","content":["The "," will identify any broken links in pages Mosaic has pulled into it's filesystem by making use of the ","check-links"," package.","It can identify broken links between the pages themselves and external links that pages link out to.","What this plugin is really checking is \"liveness\" of a link.","alive if the URL is reachable (2XX status code)","dead if the URL is not reachable","invalid if the URL was parsed as invalid or used an unsupported protocol","Links may be \"alive\", but the ","content"," of the linked page may not be what you want so continue\n","to check links show what you expect.","Priority","This plugin runs with no special priority.","Options","| Property | Description |\n","| ------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n","| baseUrl | This is used to calculate the full url for links between pages. ","It should be the url Mosaic is running on |\n","| proxyEndpoint | If you are behind a corporate proxy, external link checking will not work unless you specify the proxy endpoint using this option |","Adding to Mosaic","This plugin is ","not"," included in the mosaic config shipped by the Mosaic standard generator so it must be added manually to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/BrokenLinksPlugin',\n"," priority: -1,\n"," // Exclude this plugin in builds\n"," runTimeOnly: true,\n"," options: {\n"," baseUrl: process.env.MOSAIC_ACTIVE_MODE_URL || 'http://localhost:8080',\n"," proxyEndpoint: 'http://some-proxy-url'\n"," }\n"," }\n"," // other plugins\n","];","This plugin needs to be a "," plugin because it needs Mosaic to be running in order to\n","make requests to all of the page links.","Example Output","When a link is found to be broken, you will see the following output in the console:","@jpmorganchase/mosaic-site:serve: 8080 [Mosaic] Broken links found in /local/docs/publish-site-to-vercel.mdx\n","@jpmorganchase/mosaic-site:serve: 8080 Link to https://nextjs.org/davie is dead {\n","@jpmorganchase/mosaic-site:serve: 8080 type: 'link',\n","@jpmorganchase/mosaic-site:serve: 8080 title: null,\n","@jpmorganchase/mosaic-site:serve: 8080 url: 'https://nextjs.org/davie',\n","@jpmorganchase/mosaic-site:serve: 8080 children: [ { type: 'text', value: 'Next.Js', position: [Object] } ],\n","@jpmorganchase/mosaic-site:serve: 8080 position: {\n","@jpmorganchase/mosaic-site:serve: 8080 start: { line: 4, column: 20, offset: 36 },\n","@jpmorganchase/mosaic-site:serve: 8080 end: { line: 4, column: 55, offset: 71 }\n","@jpmorganchase/mosaic-site:serve: 8080 }\n","@jpmorganchase/mosaic-site:serve: 8080 }"]},{"title":"$CodeModPlugin","route":"/mosaic/configure/plugins/codemod-plugin","content":["Todo"]},{"title":"Plugins","route":"/mosaic/configure/plugins/index","content":["Mosaic Plugins are ","lifecycle-based"," hooks that are called on ","every"," source at different stages. ","You will never need to invoke a lifecycle method directly as their execution is managed by a plugin runner.","Plugins enable Mosaic to have a lightweight and flexible, modular architecture by encapsulating features and functionality as plugins.","Installation","Configuration","Plugins are added to the "," collection of the mosaic config file. ","Like ","sources",", plugins have an options property that can be used to provide plugin specific configuration.","| Property | Description | Required |\n","| --------------- | -------------------------------------------------------------------------- | -------- |\n","| modulePath | The path to the installed plugin module | Yes |\n","| disabled | Exclude this plugin completely. ","Defaults to false | No |\n","| runtimeOnly | Exclude this plugin when generating a snapshot. ","Defaults to false | No |\n","| previewDisabled | Exclude this plugin for \"preview\" sources | No |\n","| allowMultiple | Allow multiple instances of this plugin to run. ","| No |\n","| priority | The importance of this plugin. ","Plugins with the highest priority run first | No |\n","| options | Collection of other configuration values | No |"," plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/PagesWithoutFileExtPlugin',\n"," options: {},\n"," priority: 1\n"," },\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/SidebarPlugin',\n"," options: {}\n"," },\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/ReadingTimePlugin',\n"," options: {}\n"," }\n","],","There is no need to import the plugin module directly. ","As long as the plugin is installed, Mosaic\n","will be able to import it using the built-in plugin loader.","Default Plugins","The following plugins are always included by Mosaic, regardless of whether they are present in the plugins collection of the Mosaic config file:","$TagPlugin","$AliasPlugin","$CodeModPlugin","$RefPlugin","Plugin errors","Should a plugin fail, the failure will ","not"," cause a source to close or for any other plugin to not run.","Instead plugin errors are tracked by Mosaic and can be viewed in the "," property available on each source listed by the list sources ","admin API",".","Plugin errors will be split by lifecycle event and only the lifecycle events used by the loaded plugins used will be shown.","Multiple Instances","By default, Mosaic will only run one instance of a plugin.","It may be the case that you wish to run the same plugin twice with a slightly different config. ","To do this, you must have 2 instances listed in the plugins collection and they ","both"," must set the "," option to ",".","For example, the config below runs the ","SidebarPlugin"," twice:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/SidebarPlugin',\n"," options: { rootDirGlob: 'products/product-a' },\n"," allowMultiple: true\n"," },\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/SidebarPlugin',\n"," options: { rootDirGlob: '*/!(","product-a)/*' },\n"," allowMultiple: true\n"," }\n"," // other plugins\n","];"]},{"title":"LazyPagePlugin","route":"/mosaic/configure/plugins/lazy-page-plugin","content":["The "," attempts to reduce the size of the Mosaic filesystem in memory by moving page metadata and content to disk.","It then adds a hook, so that when a page is requested the data is loaded from disk and combined with what is already in the Mosaic filesystem.","It must be the very last to run so that it can strip off metadata and content after other plugins\n","have finished with them.","Priority","This plugin runs with a priority of -2. ","Needs to be the last to run for biggest impact.","Options","| Property | Description |\n","| -------- | ------------------------------------------------------------------------------ |\n","| cacheDir | The directory to store the cache. ","Defaults to "," |","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/LazyPagePlugin',\n"," // This plugin must be the very last to run, so it can strip off metadata and content after the other\n"," // plugins are done with them\n"," priority: -2,\n"," // Exclude this plugin in builds\n"," runTimeOnly: true,\n"," options: {\n"," cacheDir: '.tmp/.pull-docs-last-page-plugin-cache'\n"," }\n"," }\n"," // other plugins\n","];","This plugin needs to be a "," plugin because the goal is to reduce the in-memory\n","filesystem size."]},{"title":"PagesWithoutFileExtPlugin","route":"/mosaic/configure/plugins/pages-wthout-extensions-plugin","content":["The "," plugin creates ","aliases"," without the file extension for every page in the Mosaic filesystem.\n","This allows pages to be retrieved from the filesystem without specifying the extension e.g., ",".","The plugin also modifies the "," metadata property of a page to point to the shorter alias.","Priority","This plugin runs with a priority of 1. ","It must run after the ","$AliasPlugin",".","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/PagesWithoutFileExtPlugin',\n"," options: {},\n"," priority: 1\n"," }\n"," // other plugins\n","];"]},{"title":"PublicAssetsPlugin","route":"/mosaic/configure/plugins/public-assets-plugin","content":["The "," is responsible for finding \"assets\" in the Mosaic filesystem and copying them to another directory.","Typical usecase is for copying "," and "," to the public directory of a Next.js site as these are considered ","static assets"," for Next.js.","Priority","This plugin runs with no special priority.","Options","| Property | Description |\n","| --------- | ----------------------------------------------------------- |\n","| outputDir | The directory to copy the assets to. ","Defaults to "," |\n","| assets | A collection of filenames to copy to the outputDir |","Adding to Mosaic","This plugin is ","not"," included in the mosaic config shipped by the Mosaic standard generator so it must be added manually to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/PublicAssetsPlugin',\n"," priority: -1,\n"," options: {\n"," outputDir: './public',\n"," assets: ['sitemap.xml', 'search-data.json']\n"," }\n"," }\n"," // other plugins\n","];"]},{"title":"ReadingTimePlugin","route":"/mosaic/configure/plugins/reading-time-plugin","content":["The "," generates an estimation of how long a page written in MDX will take to read and adds the "," property to the metadata of a page.","Priority","This plugin runs with no special priority.","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/ReadingTimePlugin',\n"," options: {}\n"," }\n"," // other plugins\n","];"]},{"title":"$RefPlugin","route":"/mosaic/configure/plugins/ref-plugin","content":["The "," powers the ","refs"," feature of Mosaic.","The plugin scrapes "," properties from page metadata and also applies all refs stored in ",".","Other plugins can use "," to apply new refs, as long as they call it before this plugin has reaches ",".","Priority","This plugin runs with a priority of -1 so it runs ","after"," most other plugins."]},{"title":"SearchIndexPlugin","route":"/mosaic/configure/plugins/search-index-plugin","content":["The "," is responsible for generating the search index and configuration information for ","Fuse.js"," which is the matching engine powering the client-side search functionality of Mosaic sites.","It outputs 3 files:","Full Search Index - ","Condensed Search Index - ","Search Configuration - ","Full Search Index","On a Mosaic site, the full index is fetched after a page has loaded, thus removing the chance of a huge index slowing down first-load.","Practically, the full index should load in the background before a user searches for something, but should a search be initiated before that (e.g., slow-internet) then the condensed version of the search index is available.","Condensed Search Data","Search Index plugin creates a \"condensed\" version of the search index that only includes the "," and "," for each page. ","This is the \"Minimum Viable Index\" to provide somewhat useable search results client-side while the main search index is loaded in the background.","Search Configuration","Any ","options"," that need to be passed to Fuse.js.","Search relevancy configuration","| Property | Description |\n","| ---------------- | ----------------------------------------------------- |\n","| includeScore | https://www.fusejs.io/api/options.html#includescore |\n","| includeMatches | https://www.fusejs.io/api/options.html#includematches |\n","| maxPatternLength | TODO |\n","| ignoreLocation | https://www.fusejs.io/api/options.html#ignorelocation |\n","| threshold | https://www.fusejs.io/api/options.html#threshold |\n","| keys | https://www.fusejs.io/api/options.html#keys |","Priority","This plugin runs with no special priority.","Options","| Property | Description |\n","| ------------- | --------------------------------------------------- |\n","| maxLineLength | TODO |\n","| maxLineCount | TODO |\n","| keys | https://www.fusejs.io/api/options.html#keys |\n","| relevancy | ","search relevancy"," |","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/SearchIndexPlugin',\n"," previewDisabled: true,\n"," options: { maxLineLength: 240, maxLineCount: 240 }\n"," }\n"," // other plugins\n","];","It's usually a good idea to mark this plugin as disabled for preview sources otherwise the pages\n","from the preview will appear in search results."]},{"title":"SharedConfigPlugin","route":"/mosaic/configure/plugins/shared-config-plugin","content":["The "," crawls the page hierarchy to find the closest "," metadata from any parent index's page metadata. ","It then exports a JSON file into each directory with the merged config for that level.","Shared config is typically the place where the following is configured for a Mosaic site:","App Header configuration including site name and main navigation","Footer information","Help links for the left sidebar area","Namespace Shared Configs","Consider 2 sources the share the same ","namespace"," \"product-docs\":","Source A - multiple product directories and main product index page. ","The index page specifies "," metadata.","Source B - pages relevant to a single product. ","Index page does ","not"," have any "," metadata.","Let's also assume that the pages from Source B would also naturally \"fit\" within the pages of Source B (e.g. inside a products directory).","In this scenario, the "," will attempt to copy the shared config file from Source A into the root directory of Source B allowing the Source B pages to use the Source A "," as though it were a product sourced directly from Source A.","Priority","This plugin runs with a priority of 3.","Options","| Property | Description |\n","| -------- | ---------------------------------------------- |\n","| filename | the name of the JSON file output by the plugin |","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/SharedConfigPlugin',\n"," options: {\n"," filename: 'shared-config.json'\n"," },\n"," priority: 3\n"," }\n"," // other plugins\n","];"]},{"title":"SidebarPlugin","route":"/mosaic/configure/plugins/sidebar-plugin","content":["The "," generates the necessary page metadata needed for the vertical navigation shown on some Mosaic pages.","The output from the plugin is added to a "," metadata property of the page.","Configuration","The "," is used to determine the \"root\" directories of the sidebar. ","So for example:"," - generate sidebar data for the pages that are 3 directories deep in the filesystem hierarchy"," - same as above but ignore the product-a directory"," - generate a sidebar just for product-b in the products directory","To rearrange pages in the sidebar or to apply a different label to a page you can ","configure the sidebar"," using page frontmatter.","Priority","This plugin runs with a priority of 3.","Options","| Property | Description |\n","| ----------- | ----------------------------------------------------------------------------- |\n","| filename | filename of the sidebar json, linked to each related page via ref |\n","| rootDirGlob | Glob pattern for matching directories which should be the root of the sidebar |","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/SidebarPlugin',\n"," options: { rootDirGlob: '*/*/*' }\n"," }\n"," // other plugins\n","];"]},{"title":"SiteMapPlugin","route":"/mosaic/configure/plugins/site-map-plugin","content":["The "," generates a ","sitemap"," using the pages in the Mosaic filesystem that adheres to the ","sitemaps XML schema",".","The output of the plugin is a file is named ",".","Priority","This plugin runs with no special priority.","Options","| Property | Description |\n","| -------- | --------------------------------------------------------------------------------------------------- |\n","| siteUrl | The site URL. ","Used as the prefix for loc entries in the sitemap as these must start with a protocol |","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/SiteMapPlugin',\n"," previewDisabled: true,\n"," options: { siteUrl: process.env.SITE_URL || 'http://localhost:3000' }\n"," }\n"," // other plugins\n","];","Visualiser","To visualise your sitemap you can combine this plugin with the "," component provided by ",".","Rendering the "," component will render a tree view of your sitemap.","","Have a look at this site's pages, ","here","."]},{"title":"$TagPlugin","route":"/mosaic/configure/plugins/tag-plugin","content":["The "," powers the tags feature of Mosaic.","This plugin scrapes "," from page metadata and also applies all aliases stored in ",".","Tags ultimately resolve down into ","refs",", but are different from normal refs, in that they are applied to the\n","union filesystem (all merged filesystems), not to the individual source filesystem that they were defined on. ","This can be thought of as a ","global ref",".","Other plugins can use "," and modify the "," property, to apply new global refs, as long as\n","they do so before this plugin has reaches ",".","Priority","This plugin runs with no special priority but it must run before both the "," and the ",".","Example use case - Products Page","Let's assume there is a products page on your site and each product is shown as a tile. ","The information for each product tile is sourced from multiple Mosaic sources. ","How can tags be used to reference the product data needed for each tile on the products page?","The product page should add a "," metadata prop to its frontmatter:","---\n","title: Products\n","description: Product index\n","layout: ProductPreview\n","data:\n"," items:\n"," $tag: product#/data\n","---","The tag shown in the example above is saying populate "," of the Products index page with the "," metadata property of pages tagged with ",".","A tagged product page needs to have a "," property which is a collection of tags and one of these needs to be ",". ","This will allow the "," to correctly associate the product page to the product index page. ","It will also need a "," property because thats the property our product index page wants to use for the tiles.","---\n","title: Product A\n","description: My Product description\n","layout: ProductDiscover\n","tags:\n"," - product\n","data:\n"," name:\n"," $ref: '#/title'\n"," date: 2023/02/07\n"," action: Product Overview\n"," description:\n"," $ref: '#/description'\n"," link: /products/a/index\n","---","---\n","title: Product B\n","description: My Product description\n","layout: ProductDiscover\n","tags:\n"," - product\n","data:\n"," name:\n"," $ref: '#/title'\n"," date: 2023/02/07\n"," action: Product Overview\n"," description:\n"," $ref: '#/description'\n"," link: /products/b/index\n","---"]},{"title":"TableOfContentsPlugin","route":"/mosaic/configure/plugins/toc-plugin","content":["The "," generates a Table of Contents for each page in the Mosaic filesystem using the headings on the page.","Heading ranks are used to determine which page headings should be included in the Table of Contents:","| Heading Element (markdown syntax) | Rank |\n","| --------------------------------- | ---- |\n","| h1 (#) | 1 |\n","| h2 (##) | 2 |\n","| h3 (###) | 3 |\n","| h4 (####) | 4 |\n","| h5 (#####) | 5 |\n","| h6 (######) | 6 |","The plugin output is added to a "," metadata property of a page.","Priority","This plugin runs with no special priority.","Options","| Property | Description |\n","| -------- | ----------------------------- |\n","| minRank | The minimum page heading rank |\n","| maxRank | The maximum page heading rank |","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/TableOfContentsPlugin',\n"," options: {\n"," minRank: 2,\n"," maxRank: 3\n"," }\n"," }\n"," // other plugins\n","];"]},{"title":"Git Repo Source","route":"/mosaic/configure/sources/git-repo-source","content":["The Git Repo Source is used to pull content from a remote git repository e.g. github.","Installation","Credentials and Access tokens","To successfully clone the git repo, the source definition must include credentials that have sufficient permissions to clone the repository.","We recommend storing a ","personal access token"," in an environment variable and using the environment variable in the source definition.","This keeps credentials out of code where they may be accidentally exposed to third parties.","Example","export MOSAIC_DOCS_CLONE_CREDENTIALS=\":\",","Configuration","| Property | Description | Required |\n","| ------------------- | -------------------------------------------------------------------------------- | -------- |\n","| modulePath | The path to the installed module (@jpmorganchase/mosaic-source-git-repo) | Yes |\n","| namespace | The scope for this source. ","| Yes |\n","| disabled | When true, content from this source is not used | No |\n","| options.credentials | Collection of URLS to make requests | Yes |\n","| options.prefixDir | The root path used in the content URL | Yes |\n","| options.subfolder | The name of the folder within the cloned repo containing the docs | Yes |\n","| options.repo | The repo URL | Yes |\n","| options.branch | The branch or tag to clone | Yes |\n","| options.extensions | Collection of file extensions that the source will look for inside the subfolder | Yes |\n","| options.remote | The name of the git remote to use. ","Defaults to origin. ","| Yes |","Example Git Repo Source Definition","\n"," {\n"," modulePath: '@jpmorganchase/mosaic-source-git-repo',\n"," namespace: 'mosaic',\n"," options: {\n"," credentials: process.env.MOSAIC_DOCS_CLONE_CREDENTIALS,\n"," prefixDir: 'mosaic',\n"," subfolder: 'docs',\n"," repo: 'https://github.com/jpmorganchase/mosaic.git',\n"," branch: 'main',\n"," extensions: ['.mdx'],\n"," remote: 'origin'\n"," }\n"," }\n"]},{"title":"HTTP Source","route":"/mosaic/configure/sources/http-source","content":["The HTTP Source is used to pull content over HTTP.","Multiple endpoints can be specified and the source will combine and transform the response from each into a single collection of pages.","Installation","Configuration","| Property | Description | Required |\n","| ------------------------------------------ | ----------------------------------------------------------------------------- | -------- |\n","| modulePath | The path to the installed module (@jpmorganchase/mosaic-source-http) | Yes |\n","| namespace | The scope for this source | Yes |\n","| disabled | When true, content from this source is not used | No |\n","| options.endpoints | Collection of URLS to make requests | Yes |\n","| options.prefixDir | The root path used in the content URL | Yes |\n","| options.transformResponseToPagesModulePath | The path of the module used to transform endpoint responses into Mosaic pages | Yes |\n","| options.checkIntervalMins | Number of minutes to wait between requests. ","Defaults to 5 minutes | No |\n","| options.initialDelayMs | Number of milliseconds to wait for making initial request. ","Defaults to 1000 | No |","Example HTTP Source Definition"," {\n"," modulePath: '@jpmorganchase/mosaic-source-http',\n"," namespace: 'my-namespace',\n"," options: {\n"," prefixDir: 'docs',\n"," endpoints: [\n"," 'https://api.data.com/blah',\n"," 'https://api.data.com/hello'\n"," ],\n"," transformResponseToPagesModulePath: '@scope/transformer-package'\n"," }\n"," }"]},{"title":"Sources","route":"/mosaic/configure/sources/index","content":["Sources are what Mosaic uses to pull content from disparate locations and merge into a single virtual filesystem that can be used by a Mosaic Site.","Depending on the ","mode"," used, sources can update periodically ensuring that new content is made available automatically.","Source Definitions","Source Definitions are specified in the "," collection of a mosaic config file.","Each source uses a ","zod schema"," to validate the provided JSON to ensure that all required information for the source to pull content has been provided.","A source definition at a minimum needs to provide the module path of the source and the ","namespace"," that it will use. ","A namespace is not unique across sources though it is common that each source has a different namespace.","Lastly, the options field can be used as a bucket for configuration values needed to configure the source e.g. credentials.","Users are free to add any property as a source option but please read the ","gotchas","\n","first regarding the allowed ","values",".","Example Local Folder Source Definition"," /**\n"," * Demonstrates a local file-system source, in this case a relative path to where the\n"," * site was generated.\n"," * Access from your browser as http://localhost:3000/local\n"," */\n"," {\n"," modulePath: '@jpmorganchase/mosaic-source-local-folder',\n"," namespace: 'local', // each site has it's own namespace, think of this as your content's uid\n"," options: {\n"," rootDir: '..","/../docs', // relative path to content\n"," prefixDir: 'local', // root path used for namespace\n"," extensions: ['.mdx'] // extensions of content which should be pulled\n"," }\n"," }","Source Namespace","A Source Namespace is a scoping mechanism for Mosaic sources used to filter the content loaded by Mosaic. ","By default all sources specified in the mosaic config file are loaded.","sources: [\n"," {\n"," namespace: 'my-namespace',\n"," modulePath: '@jpmorganchase/mosaic-source-local-folder'\n"," }\n","];","The following command will ensure mosaic only loads sources with the "," scope.","yarn mosaic serve -c ''./mosaic.config.mjs' -p 8080 --scope \"local\"","Source Schedules","Source schedules define how often sources pull in content that exists remotely and if a failed source is retried. ","More information can be found ","here","Source Types","Out of the box, Mosaic provides 3 source \"types\":","Local Folder","Git Repo Source","HTTP Source","Sources must expose an observable interface so it is possible to compose sources together e.g. the Git Repo source uses the Local Folder source internally to watch the cloned folder for changes.","Watching for Updates","When running in ","active mode",", Mosaic will watch for any changes to the source content and if a change is detected, will initiate a pull of that new content.","How often to check for updates and how updates are triggered are a matter for the source to handle. ","Mosaic simply responds when a source emits new content.","Source Worker Thread","Sources are executed inside their own worker thread to ensure that the main thread is not overloaded. ","It is here that a local virtual filesystem for the source is created and where several of the ","Plugin Lifecycle"," events are triggered.","Gotchas","A service worker thread uses ","postMessage"," to communicate with the main thread and vice-versa.","This is important because it limits what values can be provided in the source definition to those that can be processed by the ","Structured Clone Algorithm","."]},{"title":"Local Folder Source","route":"/mosaic/configure/sources/local-folder-source","content":["The Local Folder Source is used to pull content from a folder located on the same machine as Mosaic is running.","It is common to use this source when running mosaic locally.","Installation","Configuration","| Property | Description | Required |\n","| ------------------ | ------------------------------------------------------------------------------ | -------- |\n","| modulePath | The path to the installed module (@jpmorganchase/mosaic-source-local-folder) | Yes |\n","| namespace | The scope for this source | Yes |\n","| disabled | When true, content from this source is not used | No |\n","| options.rootDir | The top level directory content will be pulled from | Yes |\n","| options.prefixDir | The root path used in the content URL | Yes |\n","| options.extensions | Collection of file extensions that the source will look for inside the rootDir | Yes |","Example Local Folder Source Definition","{\n"," modulePath: '@jpmorganchase/mosaic-source-local-folder',\n"," namespace: 'local', // each site has it's own namespace, think of this as your content's uid\n"," options: {\n"," rootDir: '..","/../docs', // relative path to content\n"," prefixDir: 'local', // root path used for namespace\n"," extensions: ['.mdx'] // extensions of content which should be pulled\n"," }\n","}","This source will look for content with the \".mdx\" extension in a \"docs\" directory 2 levels up from the Mosaic working directory. ","That content is included in the \"local\" namespace and available from a route that is prefixed with \"local\".","So if you had a file, "," then you would be able to view it at ","."]},{"title":"Source Schedules","route":"/mosaic/configure/sources/schedules","content":["A source schedule defines how often a source initiates a content pull and what to do when there is a failure.","A schedule can be specified for each source in the source definition, but should a source not provide a schedule it will inherit the \"global\" schedule.","Configuration","| Property | Description | Required | Default |\n","| ----------------- | -------------------------------------------------------------------------------------- | -------- | ------- |\n","| checkIntervalMins | The length of time in minutes before triggering a content refresh | Yes | 30 mins |\n","| initialDelayMs | Startup delay for the source. ","| Yes | 1000 ms |\n","| retryEnabled | When true, failures will trigger another content pull | No | true |\n","| retryDelayMins | The interval between retries. ","This will rise exponentially on every failure. ","| No | 5 |\n","| maxRetries | Maximum number of retry attempts | No | 100 |\n","| resetOnSuccess | If true, when a source recovers and emits pages it's retry counter is returned to zero | No | true |","Global Schedule","The global schedule applies to all sources that do ","not"," provide their own schedule. ","It can be configured as a top-level property of the Mosaic config file."," schedule: {\n"," checkIntervalMins: 60,\n"," initialDelayMs: 1000,\n"," retryDelayMins: 15,\n"," maxRetries: 20\n"," }","Example","Given the config file below:"," schedule: {\n"," checkIntervalMins: 30,\n"," initialDelayMs: 1000,\n"," retryDelayMins: 5,\n"," maxRetries: 10\n"," },\n"," sources: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-source-git-repo',\n"," namespace: 'sourceA',\n"," options: {\n"," credentials: 'credentials',\n"," prefixDir: 'sourceA',\n"," subfolder: 'docs',\n"," repo: 'source-a-repo-url',\n"," branch: 'develop',\n"," extensions: ['.mdx'],\n"," remote: 'origin'\n"," }\n"," },\n"," {\n"," modulePath: '@jpmorganchase/mosaic-source-git-repo',\n"," namespace: 'sourceB',\n"," schedule:{\n"," checkIntervalMins: 60,\n"," initialDelayMs: 5000,\n"," retryDelayMins: 30,\n"," maxRetries: 50\n"," }\n"," options: {\n"," credentials: 'credentials',\n"," prefixDir: 'sourceB',\n"," subfolder: 'docs',\n"," repo: 'source-b-repo-url',\n"," branch: 'develop',\n"," extensions: ['.mdx'],\n"," remote: 'origin'\n"," }\n"," }\n"," ]","Source A will inherit the global schedule so it will:","Start after a 1 second delay","Pull content every 30 minutes","Retry a failed content pull after an initial 5 minute delay","Retry 10 times and if still unsuccessful, closing","Source B has its own schedule so it will:","Start after a 5 second delay","Pull content every 60 minutes","Retry a failed content pull after an initial 30 minute delay","Retry 50 times and if still unsuccessful, closing","Retry Strategy","The retry strategy that Mosaic employs is ","Exponential Backoff",". ","This is a common strategy for networking applications that aims to prevent retries from causing more harm than good.","For example, given a source schedule that has a 1 minute retry delay and will retry a maximum of 3 times then the total time spent retrying is 7 minutes:","1 minute delay then 1st retry","2 minute delay then 2nd retry","4 minute delay then 3rd (and final) retry","Total delay: 1 + 2 + 4 = 7 minutes","As you can see, the delay between retries is growing exponentially giving the content source more time to recover after each retry."]},{"title":"Figma Source","route":"/mosaic/configure/sources/source-figma","content":["The Figma source is used to pull individual design patterns from Figma projects.\n","The source subscribes to Figma project groups, then extracts from project files, tagged patterns.","A Figma pattern tag is defined within a Figma project's ",".","For each retrieved/tagged pattern, a page is created in the Mosaic file-system.\n","Additional Mosaic metadata can be added, to each created page, using ","\n","For instance we could add metadata which defines which product owns a particular pattern and then\n","group patterns based on owner.","Installation","Configuration","The Figma source is an "," and shares the same base configuration.\n","The "," prop has a default transformer which creates a page for each matching Story.","| Property | Description | Required |\n","| ---------- | --------------------------------- | -------- |\n","| prefixDir | path to store figma patterns | Yes |\n","| figmaToken | figma access token | Yes |\n","| projects | array of projects to subscribe to | Yes |\n","| endpoints | figma endpoints | Yes |","Each project is configured from the "," array.","| Property | Description | Required |\n","| ------------- | --------------------------------------------- | -------- |\n","| id | numerical id of the subscribed project group | Yes |\n","| meta | metadata to add to each of the projects pages | Yes |\n","| patternPrefix | prefix to add to all pages created | Yes |"," defined the Figma REST API endpoints.","| Property | Description | Required |\n","| ----------------- | --------------------------------------------------------- | -------- |\n","| getProject | url to return a list of projects within the project group | Yes |\n","| getFile | url to return a project file | Yes |\n","| generateThumbnail | url to generate a thumbnail for the shared Figma node | Yes |","Example Figma Source Definition","sources: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-source-figma',\n"," namespace: 'some-namespace',\n"," options: {\n"," proxyEndpoint: 'http://path/to/optional/proxy',\n"," prefixDir: '/some/path/to/where/you/store/pattern/pages',\n"," figmaToken: process.env.FIGMA_TOKEN,\n"," projects: [{\n"," id: 99999,\n"," patternPrefix: 'yourPrefix',\n"," meta: {\n"," tags: [ 'some-tag'],\n"," data: {\n"," owner: 'some-owner'\n"," }\n"," }\n"," }],\n"," endpoints: {\n"," getFile: 'https://api.figma.com/v1/files/:file_id?","plugin_data=shared',\n"," getProject: 'https://api.figma.com/v1/projects/:project_id/files',\n"," generateThumbnail: 'https://api.figma.com/v1/images/:project_id?","ids=:node_id'\n"," }\n"," }\n"," }\n","]"]},{"title":"Readme Source","route":"/mosaic/configure/sources/source-readme","content":["The Readme source is used to pull individual "," text files from repositories.\n","This is a lighter weight version of a Git repository resource, which just pulls a single file,\n","rather the whole contents of the repo.","For each retrieved readme, a page is created in the Mosaic file-system.\n","Additional Mosaic metadata can be added, to each created page, using ","\n","For instance we could add metadata which defines which product owns a particular "," and then\n","group this page, with others, based on owner.","Installation","Configuration","The Readme source is an "," and shares the same base configuration.","| Property | Description | Required |\n","| ----------- | --------------------- | -------- |\n","| accessToken | request access token | Yes |\n","| prefixDir | path to store pages | Yes |\n","| readme | array of readme files | Yes |","Each readme is configured from the "," array.","| Property | Description | Required |\n","| --------------- | ---------------------------- | -------- |\n","| contentTemplate | template for content of page | No |\n","| name | page name used in route | Yes |\n","| readmeUrl | url of readme | Yes |\n","| meta | metadata for page | Yes |","Example Readme Source Definition"," sources: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-source-readme',\n"," namespace: 'your-namespace',\n"," schedule: { checkIntervalMins: 0.25, initialDelayMs: 0 },\n"," options: {\n"," prefixDir: '/salt/community-index/readme',\n"," accessToken: 'Bearer your-access-token',\n"," readme: [\n"," {\n"," name: 'your-mosaic-page-name',\n"," readmeUrl: 'https://some/repo/url/readme.md',\n"," contentTemplate: `a template which replaces ::content:: with the content`,\n"," meta: {\n"," layout: 'DetailTechnical',\n"," title: 'Your Page Title',\n"," tags: ['your-tag-if-required'],\n"," description: 'A description for your readme'\n"," }\n"," }]\n"," }\n"," }]"]},{"title":"Storybook Source","route":"/mosaic/configure/sources/source-storybook","content":["The Storybook source is used to pull individual stories from Storybook, based on tags.","The Mosaic source will filter your Storybook's stories, based on "," or ",".","For each matching story, a page is created in the Mosaic file-system.","additional Mosaic tags can be added to each page using ","additional Mosaic metadata can be added to each page using ","This information can be used to create a dynamic index of stories from Storybook.","Installation","Configuration","The Storybook source is an "," and shares the same base configuration.\n","The "," prop has a default transformer which creates a page for each matching Story.","The "," option is an array of Storybook urls that are used as Sources.\n","Each story is matched on "," using the "," Regexp (or by ",").","If specified, "," and "," can be added to any matching pages.","| Property | Description | Required |\n","| --------------- | ---------------------- | -------- |\n","| options.stories | array of story configs | Yes |"," is an array of Storybooks that you want to pull stories from","| Property | Description | Required |\n","| -------------- | ---------------------------------------- | -------- |\n","| storyUrlPrefix | prefix url of the storybook deployment | Yes |\n","| description | description of the storybook stories | Yes |\n","| storiesUrl | url of the storybook's "," | No |\n","| filter | RegExp filter to match on | No |\n","| filterTags | Array of Storybook tags to match on | No |\n","| meta | additional data to add to matching pages | No |","Example Local Folder Source Definition","sources: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-source-storybook',\n"," namespace: 'salt',\n"," options: {\n"," prefixDir: '/salt/internal/community-index/story-navigation',\n"," stories: [\n"," {\n"," storiesUrl: 'https://storybook.saltdesignsystem.com/stories.json',\n"," storyUrlPrefix: 'https://storybook.saltdesignsystem.com',\n"," description: 'Navigation patterns created in the Salt Labs',\n"," meta: { // can be any additional metadata you want added to the page's meta.data\n"," tags: ['some-tag'],\n"," data: {\n"," owner: 'Salt',\n"," source: 'STORYBOOK'\n"," }\n"," },\n"," filter: /Lab\\/Tabs/ // this is a Regexp that matches on Storybook title\n"," }\n"," ]\n"," }\n"," }\n","]","Example story metadata format","{\n"," \"type\": \"story\",\n"," \"id\": \"folder--story-1\",\n"," \"name\": \"Story 1\",\n"," \"title\": \"Folder/Story 1\",\n"," \"importPath\": \"./folder/story-1.stories.tsx\",\n"," \"tags\": [\n"," \"dev\",\n"," \"test\"\n"," ]\n","}"]},{"title":"Custom Components","route":"/mosaic/configure/theme/custom-components","content":["Learn how to add your own custom components to your Mosaic site.","Create Components Folder","To start, create a "," folder under "," where you'll store your custom components.","src/\n","└── components/","In this tutorial, we will create a custom "," component.","Create Card Component","Inside the "," folder, create a "," folder, which will contain your React "," component. ","The "," folder should include "," and "," files as shown in the structure below:","├── src/\n","│ ├── components/\n","│ │ └── card/\n","│ │ ├── index.tsx\n","│ │ └── card.module.css","Card Component: index.tsx","Create your "," component within the "," file:","import React from 'react';\n","import styles from './card.module.css';\n","\n","type CardProps = {\n"," title: string;\n"," content: string;\n","};\n","\n","export const Card: React.FC = ({ title, content }) => {\n"," return (\n","
\n","
{title}
\n","
{content}
\n","
\n"," );\n","};","Card Component: card.module.css","Define your component styles in the "," file:",".card {\n"," background-color: #f5f5f5;\n"," border: 1px solid #ccc;\n"," border-radius: 4px;\n"," box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n"," padding: 16px;\n"," transition: box-shadow 0.2s ease-in-out;\n","}\n","\n",".card:hover {\n"," box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n","}\n","\n",".card h2 {\n"," color: #333;\n"," font-size: 24px;\n"," margin-bottom: 8px;\n","}\n","\n",".card p {\n"," color: #666;\n"," font-size: 16px;\n"," line-height: 1.5;\n","}","In this example, we use a CSS file, but you can use whichever styling approach you prefer, such as ","vanilla extract",".","To export your "," component, create an "," file in the "," folder:","export * from './card';","Your final folder structure should look like this:","├── src/\n","│ ├── components/\n","│ │ ├── card/\n","│ │ │ ├── index.tsx\n","│ │ │ └── card.module.css\n","│ │ ├── index.ts","Import Custom Card Component","To use your custom "," component, import it into your site's "," file. ","Add the following line to your imports:","import * as myComponents from '../components';","Replace this line:","const components = mosaicComponents;","with:","const components = {\n"," ...mosaicComponents,\n"," ...myComponents\n","};","This will add your custom components to the site, and any custom components in "," will override the corresponding ones in ",". ","The spread operator (",") merges both "," and "," objects, giving priority to "," when there is a naming conflict.","Use Your Custom Card Component","Now you're ready to use your custom "," component. ","Build and run your site, and add the "," component to an MDX file in your "," folder or another source:","","You can create and add more custom components to your Mosaic site by following the same process."]},{"title":"Custom CSS","route":"/mosaic/configure/theme/custom-css","content":["You can customize the look and feel of your Mosaic site by creating cusotm CSS files. ","Here is a step-by-step guide to help you create your own CSS theme.","Create a CSS folder","To get started, create a folder named \"css\" in the \"src\" folder of your Mosaic project.","src/\n","└── css/","Create your theme","Inside the \"css\" folder, create a folder named \"global\". ","This is where you will add your custom styles.","src/\n","└── css/\n"," ├── global/\n"," ├── index.css","Create an \"index.css\" file inside the \"css\" folder. ","This file will import your custom styles.","@import './global/';","Inside your global folder, create a separate CSS file for each part of your site that you want to customize. ","For instance, if you want to change the text styling, create a \"text.css\" file inside the \"global\" folder. ","Here is an example of how your \"text.css\" file could look like:","h1 {\n"," /* Set custom font size and weight */\n"," font-size: /* insert value */ ;\n"," font-weight: /* insert value */ ;\n","}\n","\n","h2 {\n"," font-size: /* insert value */ ;\n"," font-weight: /* insert value */ ;\n","}\n","\n","h3 {\n"," font-size: /* insert value */ ;\n"," font-weight: /* insert value */ ;\n","}\n","\n","h4 {\n"," font-size: /* insert value */ ;\n"," font-weight: /* insert value */ ;\n","}\n","\n","h5 {\n"," font-size: /* insert value */ ;\n"," font-weight: /* insert value */ ;\n","}\n","\n","h6 {\n"," font-size: /* insert value */ ;\n"," font-weight: /* insert value */ ;\n","}\n","\n","p {\n"," font-size: /* insert value */ ;\n"," line-height: /* insert value */ ;\n","}","You can add as many CSS files as you need, depending on how much you want to customize your site.","Create an \"index.css\" file inside the \"global\" folder. ","This file will import your custom styles, in this example we are importing our \"text.css\" file.","@import './text.css';","Your \"css\" folder should now look like this:","src/\n","└── css/\n"," ├── global/\n"," │ ├── text.css\n"," │ ├── index.css\n"," ├── index.css","Import your custom CSS into your site","To apply your custom styles to your Mosaic site, open your \"_app.tsx\" file and add the following line to the bottom of your imports:","import '../css/index.css';","Congratulations! ","You have successfully applied your custom CSS styles to your site. ","This example demonstrated how to create text styles, but you can use the same approach to customize other aspects of your site as well."]},{"title":"Theming Your Site","route":"/mosaic/configure/theme/index","content":["Create a unique look and feel for your Mosaic site by customizing the CSS theme and integrating your own UI components.","Customize the CSS","Adapt various design elements of your Mosaic site to create a cohesive visual theme. ","Refer to our guide to learn more about crafting a custom CSS theme:","CSS Theme Guide","Import Custom Components","Incorporate your own UI components, to tailor the look and functionality of your content. ","This tutorial will walk you through the process of adding custom components to your site:","Adding Custom Components Tutorial"]},{"title":"Aliases Test","route":"/mosaic/test/aliases/index","content":["This page is the alias test page."]},{"title":"Detail Highlight Test Page","route":"/mosaic/test/layouts/detail-highlight","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 1","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 2","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 3","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 4","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Detail Overview Test Page","route":"/mosaic/test/layouts/detail-overview","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 1","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 2","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 3","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 4","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Detail Technical Test Page","route":"/mosaic/test/layouts/detail-technical","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 1","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 2","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 3","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 4","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Edit Layout","route":"/mosaic/test/layouts/edit","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Full Width Layout","route":"/mosaic/test/layouts/full-width","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Layouts","route":"/mosaic/test/layouts/index","content":["Pages for e2e testing of layouts."]},{"title":"Landing Layout Test Page","route":"/mosaic/test/layouts/landing","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Newsletter Test Page","route":"/mosaic/test/layouts/newsletter","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 1","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 2","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 3","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 4","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Product Discover Test Page","route":"/mosaic/test/layouts/product-discover","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 1","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 2","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 3","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 4","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Product Preview Test Page","route":"/mosaic/test/layouts/product-preview","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 1","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 2","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 3","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 4","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Refs Data","route":"/mosaic/test/refs/data","content":[]},{"title":"Refs Test","route":"/mosaic/test/refs/index","content":["The sidebar priority is ",".","The other page data is ","."]},{"title":"Tags Test","route":"/mosaic/test/tags/index","content":["In Stock","Out of Stock"]},{"title":"$afterSource","route":"/mosaic/configure/plugins/lifecycle/after-source","content":["The first lifecycle event to trigger after receiving pages from a source and runs in a child process.\n","The pages can safely be mutated and will be reflected in the final filesystem that gets generated.\n","It ","must"," return a collection of pages.","The "," lifecycle event is called with:","pages - the collection of pages emitted by the source","helpers - an object with useful methods","options - the options specified for the plugin in the mosaic config file","Helpers","The helpers provided with this lifecycle event are listed in the table below.","| Property | Description |\n","| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n","| serialiser | A matching "," for serialising/deserialising pages when reading/writing to the filesystem |\n","| config | A mutable object for sharing data with other lifecycle phases of all plugins for this source (including in the main thread) in this plugin |\n","| pageExtensions | A collection of pageExtensions the source is using |\n","| ignorePages | A collection of page globs that are to be ignored for this source |\n","| namespace | The namespace of the source running the plugin |","Example - Log out all page routes","async function $afterSource(pages, { config, ignorePages, pageExtensions }) {\n"," for (const page of pages) {\n"," console.log(page.route);\n"," }\n"," return pages;\n","}"]},{"title":"afterUpdate","route":"/mosaic/configure/plugins/lifecycle/after-update","content":["The third lifecycle event to trigger overall and the first to trigger inside the main Mosaic process.","Calls after the filesystem and symlinks have been reconstructed due to a change to the current source pages. ","Pages will ","not"," be cached when read at this stage, to allow for reading content and writing a new copy of it without the cached version taking effect.\n","This method is safe to use with lazy loading, as the filesystem should return the full page when read.","The "," lifecycle event is called with:","mutableFilesystem - Mutable filesystem instance with all of this source's pages inside (and symlinks re-applied)","helpers - an object with useful methods","options - the options specified for the plugin in the mosaic config file","Helpers","The helpers provided with this lifecycle event are listed in the table below.","| Property | Description |\n","| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n","| serialiser | A matching "," for serialising/deserialising pages when reading/writing to the filesystem |\n","| config | An immutable object for reading data from other lifecycle phases of all plugins for this source in the child process for this plugin. ","Shared only with this source. ","|\n","| globalConfig | An immutable object for reading data from other lifecycle phases of all plugins. ","Shared across all sources. ","|\n","| sharedFilesystem | Mutable filesystem instance independent of any sources. ","Useful for global pages, like sitemaps |\n","| globalFilesystem | Immutable union filesystem instance with all source's pages (and symlinks applied) |\n","| pageExtensions | A collection of pageExtensions the source is using |\n","| ignorePages | A collection of page globs that are to be ignored for this source |\n","| namespace | The namespace of the source running the plugin |"]},{"title":"$beforeSend","route":"/mosaic/configure/plugins/lifecycle/before-send","content":["The second lifecycle event to trigger and does so after a filesystem has been built up from the source pages.","It is the last lifecycle event to run in a source child process before the filesystem is sent to the main Mosaic process and should ","not"," return a value.","The "," lifecycle event is called with:","mutableFilesystem - Mutable virtual filesystem instance with all of this source's pages inside (and symlinks applied)","helpers - an object with useful methods","options - the options specified for the plugin in the mosaic config file","Helpers","The helpers provided with this lifecycle event are listed in the table below.","| Property | Description |\n","| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n","| serialiser | A matching "," for serialising/deserialising pages when reading/writing to the filesystem |\n","| config | A mutable object for sharing data with other lifecycle phases of all plugins for this source (including in the main thread) in this plugin |\n","| pageExtensions | A collection of pageExtensions the source is using |\n","| ignorePages | A collection of page globs that are to be ignored for this source |\n","| namespace | The namespace of the source running the plugin |"]},{"title":"Lifecycle Events","route":"/mosaic/configure/plugins/lifecycle/index","content":["Plugin lifecycle","The plugin lifecycle is triggered when a source emits content.","Each Mosaic source has its own worker thread and plugin lifecycle events that start with a "," will execute inside the worker thread.\n","All other lifecycle events will execute in the main Mosaic process.","The 5 lifecycle events are:","$afterSource","$beforeSend","afterUpdate","shouldClearCache","shouldUpdateNamespaceSources","Plugin methods that trigger inside the main thread should be asynchronous and highly optimised to\n","avoid holding up the main thread."]},{"title":"shouldClearCache","route":"/mosaic/configure/plugins/lifecycle/should-clear-cache","content":["The fourth lifecycle event to trigger overall and the second to trigger inside the main Mosaic process.","It is called every time ","any"," source emits new pages and should return a boolean to indicate if ","other"," sources should clear their cache in response to the source updating.","Only sources that have already run "," will call this lifecycle hook since there is no\n","cache to clear if they haven't reached that stage in the lifecycle.","The "," lifecycle event is called with:","updatedSourceFilesystem - Immutable filesystem for the source that changed i.e, not the source filesystem","helpers - an object with useful methods","options - the options specified for the plugin in the mosaic config file","Helpers","The helpers provided with this lifecycle event are listed in the table below.","| Property | Description |\n","| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n","| serialiser | A matching "," for serialising/deserialising pages when reading/writing to the filesystem |\n","| config | An immutable object for reading data from other lifecycle phases of all plugins for this source in the child process for this plugin. ","Shared only with this source. ","|\n","| globalFilesystem | Immutable union filesystem instance with all source's pages (and symlinks applied) |\n","| pageExtensions | A collection of pageExtensions the source is using |\n","| ignorePages | A collection of page globs that are to be ignored for this source |\n","| namespace | The namespace of the source running the plugin |"]},{"title":"shouldUpdateNamespaceSources","route":"/mosaic/configure/plugins/lifecycle/should-update-namespace-sources","content":["The fifth lifecycle event to trigger overall and the third to trigger inside the main Mosaic process.","It is called every time ","any"," source emits new pages and should return a boolean to indicate if ","other sources that share the same ","source namespace"," should re-run ",".","The "," lifecycle event is called with:","updatedSourceFilesystem - Immutable filesystem for the source that changed i.e, not the source filesystem","helpers - an object with useful methods","options - the options specified for the plugin in the mosaic config file","Helpers","The helpers provided with this lifecycle event are listed in the table below.","| Property | Description |\n","| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n","| serialiser | A matching "," for serialising/deserialising pages when reading/writing to the filesystem |\n","| config | An immutable object for reading data from other lifecycle phases of all plugins for this source in the child process for this plugin. ","Shared only with this source. ","|\n","| globalFilesystem | Immutable union filesystem instance with all source's pages (and symlinks applied) |\n","| pageExtensions | A collection of pageExtensions the source is using |\n","| ignorePages | A collection of page globs that are to be ignored for this source |\n","| namespace | The namespace of the source running the plugin |"]}]
\ No newline at end of file
+[{"title":"Mosaic","route":"/mosaic/index","content":["True to its name, Mosaic brings together several concepts—including content, design and technical infrastructure—to deliver a unified website experience that is truly greater than the sum of its individual parts.","With Mosaic, you can:","Don't move your content where it does not belong. ","Compose content from remote data sources which\n","are pulled at runtime by our content aggregator.","Visualize your content with your own theme, layouts and components or use the Mosaic Design\n","language.","Extend the existing code and add your own content source types through our simple plugin\n","architecture.","Publish your content through Server Side Rendering (SSR) or generate a snapshot of your content\n","and serve it as a Statically Generated Site (SGS).","Creating a website has never been so easy!"]},{"title":"Sitemap","route":"/mosaic/sitemap","content":["Sitemap"]},{"title":"Aliases","route":"/mosaic/author/aliases","content":["Aliases are virtual 'symlinks' of pages, allowing one page to take on one or more other routes.\n","This is not the same as copying the page, it is a primitive filesystem link which is resolved by Mosaic.","Use Cases","Aliases are great for linking to an old route if you've moved a page to a new place.\n","They can also be used to create short hand links to pages or to 'clone' a copy of a page into\n","another section of the site where it may be relevant.","Example","This is the frontmatter for this page:","---\n","title: Aliases\n","layout: DetailTechnical\n","aliases:\n"," - /mosaic/example/aliases\n","---","Try accessing this page from ","/mosaic/example/aliases"]},{"title":"Fragments","route":"/mosaic/author/fragments","content":["Fragments, also known as content fragments, are powerful tools that allow you to incorporate content from other pages into your documentation. ","By creating an MDX file and using the ","generic directives"," syntax ",", you can easily render the fragment in another file, providing modularity and reusability to your content.","Use Cases","Fragments offer various use cases, such as:","Consistent Content",": Use fragments to maintain consistent content across multiple pages. ","For instance, if you have a table or a tile that appears on multiple pages, you can create a fragment for it and include it in all relevant files. ","This ensures that any updates made to the fragment automatically reflect across the entire documentation.","Reusable Components",": Fragments enable the creation of reusable components or sections. ","You can define a complex or commonly used section once and then include it in multiple pages as needed. ","This approach saves time and effort, as you only need to update the fragment file to propagate changes throughout your documentation.","Modular Documentation",": With fragments, you can break down your documentation into smaller, manageable pieces. ","Each fragment represents a specific topic or section, allowing you to organize and structure your content more efficiently. ","This modular approach simplifies maintenance and makes it easier to navigate and update your documentation.","Usage","Firstly, enable the Fragment Plugin by adding the following to your plugins in ",".","{\n"," modulePath: '@jpmorganchase/mosaic-plugins/FragmentPlugin',\n"," options: {}\n","}","To include a fragment in your content, follow these steps:","Create an MDX file for the fragment you want to reuse. ","Remember to set the sidebar property of your fragment's frontmatter to exclude: true if you don't want the fragment to appear in the vertical navigation menu.","---\n","title: Fragment Title\n","sidebar:\n"," exclude: true\n","---","In the target file where you want to include the fragment, use the remark directive syntax ",".","Markdown Content Example","This is the contents of a fragment located at ",":","---\n","title: Content Fragment\n","sidebar:\n"," exclude: true\n","---\n","\n","#### Fragment Title\n","\n","This is an example fragment of markdown content, being pulled from `../fragments/content-fragment.mdx`.\n","The below code snippet will render the content from the content-fragment.mdx file in your target file:",":fragment{src=\"../fragments/content-fragment.mdx\"}","Example output:","Fragment Title","This is an example fragment of markdown content, being pulled from ",".","Component Example","Here is another example, where the fragment files each contain a "," component.",":fragment{src=\"../fragments/tile-a.mdx\"} :fragment{src=\"../fragments/tile-b.mdx\"}","The above code will render the content from tile-a.mdx and tile-b.mdx files, demonstrated below:"," "]},{"title":"Frontmatter","route":"/mosaic/author/frontmatter","content":["Frontmatter",", also known as page metadata, is a powerful feature that allows easy configuration of a page and Mosaic site components e.g. the sidebar.","Frontmatter is written in yaml syntax and is found at the top of a page between 2 sets of 3 dashes: ",".","Example page yaml","---\n","title: Page Title\n","layout: DetailTechnical\n","sidebar:\n"," priority: 4\n","---\n","\n","// frontmatter is closed and now comes page content\n","# Page Title\n","\n","This is some content.\n","Accessing Frontmatter in content","With the syntax below it is possible to directly reference frontmatter inside content using curly brackets and the "," object.","You can think of "," as a JSON object that holds all the frontmatter of a page and when the Mosaic "," encounters the curly brackets then the value in the frontmatter will be resolved.","{meta.title}\n","{meta.description}\n","{meta.someValueYouHaveAddedToTheFrontmatter}","This is very common to see Mosaic pages that reference the title as shown below:","---\n","title: Title\n","---\n","\n","# {meta.title}","Plugins & Frontmatter","Mosaic plugins can also embed their output into page frontmatter in 2 different ways:","a property is directly added to the page object","a JSON file is generated and referenced using a ","ref","Adding a property to the page","A plugin can add a property to a page simply by extending the page object it receives in the "," lifecycle event:","async function $afterSource(pages) {\n"," for (const page of pages) {\n"," page.newProperty = 'Hello'\n"," }\n"," return pages;\n","}","You could use this property in the page content using ","JSON File","Let's take a look at the ",".","The purpose of this plugin is to crawl the page hierarchy to find the closest "," found in any parent page's frontmatter.","Finds all index pages among the source docs","Deserialises those pages so it can read the frontmatter and content of the page","If a property called "," in the page frontmatter is found a new file named shared-config.json is created","Adds a ref named "," to the shared config file that points to the shared config of the index page","import type { Page, Plugin as PluginType } from '@jpmorganchase/mosaic-types';\n","import { flatten } from 'lodash-es';\n","import path from 'path';\n","\n","function createFileGlob(url, pageExtensions) {\n","if (pageExtensions.length === 1) {\n","return `${url}${pageExtensions[0]}`;\n","}\n","return `${url}{${pageExtensions.join(',')}}`;\n","}\n","\n","interface SharedConfigPluginPage extends Page {\n","sharedConfig?: string;\n","}\n","\n","interface SharedConfigPluginOptions {\n","filename: string;\n","}\n","\n","const SharedConfigPlugin: PluginType = {\n","async $beforeSend(\n"," mutableFilesystem,\n"," { config, serialiser, ignorePages, pageExtensions },\n"," options\n"," ) {\n"," const pagePaths = await mutableFilesystem.promises.glob(\n"," createFileGlob('**/index', pageExtensions),\n"," {\n"," ignore: [options.filename, ...flatten(ignorePages.map(ignore => [ignore, `**/${ignore}`]))],\n","cwd: '/'\n","}\n",");\n","\n"," for (const pagePath of pagePaths) {\n"," const sharedConfigFile = path.join(path.dirname(String(pagePath)), options.filename);\n","\n"," const page = await serialiser.deserialise(\n"," String(pagePath),\n"," await mutableFilesystem.promises.readFile(String(pagePath))\n"," );\n"," if (page.sharedConfig) {\n"," config.setRef(sharedConfigFile, ['config', '$ref'], `${String(pagePath)}#/sharedConfig`);\n"," await mutableFilesystem.promises.writeFile(sharedConfigFile, '{}');\n"," } else {\n"," const baseDir = path.posix.resolve(path.dirname(String(pagePath)), '..","/');\n"," config.setAliases(path.join(baseDir, options.filename), [sharedConfigFile]);\n"," }\n"," }\n","\n","}\n","};\n","\n","export default SharedConfigPlugin;\n"]},{"title":"Author","route":"/mosaic/author/index","content":["Here you will learn how to author documentation using markdown, Mosaic components and page templates"]},{"title":"Markdown Syntax","route":"/mosaic/author/markdown-syntax","content":["Out of the box, Mosaic supports documents written in ","MDX"," which allows React components to be embedded within the ","basic syntax"," outlined in the original Markdown design document.","In addition to the basic markdown syntax, the MDX processor used by Mosaic has been configured to support additional markdown syntax and features:","GitHub flavored markdown (gfm)","Frontmatter","Mosaic Standard Components","All components that comprise the "," export from "," package are available to use out of the box in your documents.","This includes components for all standard markdown syntax and additional components like "," and ",".","Referencing Frontmatter","Frontmatter values can be embedded into the page using the "," object. ","See ","frontmatter"," for more information.","Configuring Supported components","TODO"]},{"title":"Refs","route":"/mosaic/author/refs","content":["Refs are a very powerful feature of Mosaic documents that use ","JSON References"," to reference\n","a property from the page frontmatter or frontmatter of other pages.","The key concept is that of a JSON pointer which takes the form ","A","#","B"," where:","A"," is the relative path from the current schema to a target schema. ","If A is empty, the reference is to a type or property in the same schema, an in-schema reference. ","Otherwise, the reference is to a different schema, a cross-schema reference.","B"," is the complete path from the root of the schema to a type or property in the schema. ","If # in not included or B is empty, the reference is to an entire schema.","To translate this for our purposes:","A"," is the relative path to a file in the filesystem.","B"," is the path to a property in the frontmatter of the file.","It's probably better explained with examples...","Local refs (In-schema reference)","It is possible to reference a page's own frontmatter to avoid duplication:","---\n","title: Refs\n","layout: DetailTechnical\n","sidebar:\n"," priority: 3\n","data:\n"," sidebarPriority:\n"," $ref: '#/sidebar/priority'\n","---","This page you are reading right now has a sidebar priority of ",".","The value of "," comes from "," in the frontmatter.","Notice that because we don't specify a path before the "," in the ref we need to put the whole\n","value inside quotes.","Remote Refs (Cross-schema reference)","It is possible to reference frontmatter of other pages. ","Again this helps avoid duplication but the real power is using refs to build the data model. ","See ","advanced"," for more information.","The ","index"," page of the Author section has this frontmatter:","---\n","title: Author\n","layout: DetailTechnical\n","sidebar:\n"," priority: 3\n","data:\n"," exampleRefData: Hello from Author page\n","---","This page you are currently looking at is referencing the "," in it's frontmatter like this:","---\n","title: Refs\n","layout: DetailTechnical\n","sidebar:\n"," priority: 3\n","data:\n"," authorRef:\n"," $ref: ./#/data/exampleRefData\n","---","I can then use the data and embed it in this page like this:","{meta.data.authorRef}","And here it is: ","Notice that we did not need to put "," in the ref since index pages are resolved\n","automatically.","Advanced","You have had a taste of the power and want to know more? ","OK, lets reference and then list out all the mosaic modes:","The Modes ","index"," page has this frontmatter:","---\n","title: Modes of operation\n","layout: DetailTechnical\n","sidebar:\n"," priority: 4\n","data:\n"," modes:\n"," $ref: ./*#/title\n","---","The ref here is essentially using a wildcard (the *) to grab the "," property from the frontmatter of every page in the modes folder.","We can reference that data just like before:","---\n","title: Refs\n","layout: DetailTechnical\n","sidebar:\n"," priority: 3\n","data:\n"," modes:\n"," $ref: ../configure/modes#/data/modes\n","---","Output","With the code below, the referenced data can be embedded in a page.","
\n"," {meta.data.modes.map(mode => (\n","
{mode}
\n"," ))}\n","
","Output with Mosaic Components","You can use Mosaic components with referenced data as well. ","Below we are using the "," and "," components.","\n"," {meta.data.modes.map(mode => (\n"," \n"," ))}\n","","Setting Refs using Plugins","Mosaic plugins can create new refs, create new ","global"," refs and see existing refs created by the page or other plugins. ","This is achieved using a special "," property available in the plugin helpers.","Create new refs","Use the "," function from the helpers provided to plugin lifecycle events. ","You need to provide","The file/fullpath to write the ref to","The path to the ptoperty where the ref will be applied","The value of the ref, which can use wildcards","For example, the following would add a property to pages named ",". ","The value is the title of all pages in the ","same"," directory as the current page"," async $afterSource(pages, { config }) {\n"," for (const page of pages) {\n"," config.setRef(page.fullPath, ['titles', '$ref'], `**#/title`);\n"," }\n"," return pages;\n"," }","When setting the property path the last string must be "," otherwise you're not creating a ref\n","that will be resolved by the RefPlugin.","Existing refs","To view refs that already exist you can use ",". ","For example to see all refs for a page:"," config.data.refs[fullPathToPage]","Create global refs","Global refs are similar to regular refs except they do not pre-resolve. ","This means they are resolved when the referenced file is read and the global mosaic filesystem, made up of multiple sources, is used rather than the filesystem of a single source."]},{"title":"Sidebar Configuration","route":"/mosaic/author/sidebars","content":["Sidebar data is generated by the the ","Sidebar Plugin"," which by default uses alphabetical ordering of page names to order the sidebar.","Sidebar frontmatter","A page can add a "," property to its ","frontmatter"," to change the ordering of a sidebar and what title is used for a page in the sidebar.","To rearrange pages in the sidebar or to apply a different label to a page you can specify the following in the page frontmatter:","Sidebar group label","A sidebar group when expanded will reveal the pages contained within the group.\n","Each group has a default page, ",", which is the default for the group and any breadcrumb link.","The"," can define a "," which defines the name of the sidebar group.\n","If no ","groupLabel"," is defined, sidebar group labels will be defined by either ","label"," or ","title",".","To specify the label of the default page, refer to [Sidebar label](.","/Sidebar label)","---\n","title: Sidebar Configuration\n","layout: DetailTechnical\n","sidebar:\n"," groupLabel: Group label\n","---","Sidebar label","By default the ","title"," of a page is used in the sidebar as the label but this can be changed to another label using page frontmatter.","---\n","title: Sidebar Configuration\n","layout: DetailTechnical\n","sidebar:\n"," label: A New Label\n","---","Sidebar priority","Sidebar priority is a number used to sort the sidebar. ","Higher the priority pages appear first in the sidebar ordering.","---\n","title: Sidebar Configuration\n","layout: DetailTechnical\n","sidebar:\n"," priority: 10\n","---","Sidebar Sort Configuration","Sidebar sort configuration allows the sidebar to be sorted using a more sophisticated approach and only needs to be applied to the "," page of the directory you want to sort.","Priority takes precedence over sort configuration so it can be used to override the sort\n","configuration if required.","You must add the sidebar sort configuration to the "," property of an ","index"," page e.g.,","sharedConfig:\n"," sidebar:\n"," sort:\n"," field: data/title\n"," dataType: string\n"," arrange: desc","The properties of the sort configuration are described in the table below:","| Property | Description | Required |\n","| -------- | ------------------------------------------------------------------------------------------ | -------- |\n","| field | the path, separated by ",", used to find the value in page frontmatter you wish to sort by | Yes |\n","| dataType | is the type of the value. ","Can be a "," or "," or ",". ","| Yes |\n","| arrange | "," or "," order | yes |","Newsletters Example","Let's say you have a ","Newsletters"," directory and each page in the directory represents a newsletter. ","You wish to sort the newsletter sidebar by publication date in descending order (newest first).","One way to do this is to edit each page and add a "," which is manually incremented every time a news newsletter is added. ","Alternatively you can add the following sort configuration to the newsletters index page:","sharedConfig:\n"," sidebar:\n"," sort:\n"," field: data/publicationDate\n"," dataType: date\n"," arrange: desc","This will use the "," property in each newsletter to sort the newsletters in the sidebar. ","The publication date is converted to a "," by the Sidebar Plugin to ensure accurate ordering. ","There is now no need to increment a priority when a new newsletter is added.","Example newsletter page frontmatter:","---\n","title: Newsletter 01 Jan 2023\n","description: Newsletter 01 Jan 2023\n","data:\n"," title:\n"," $ref: '#/title'\n"," link: /newsletters/2023-01-01\n"," publicationDate: '2023-01-01'\n","---"]},{"title":"Tags","route":"/mosaic/author/tags","content":["Tags are very similar to ","Refs"," with one very important distinction: Tags work ","across multiple sources",".","In Mosaic, each source has it's own filesystem which are then merged together to form a union of all source filesystems. ","It is in this union filesystem that tags are applied and not to the individual source filesystem that the tag was defined on.","Tags are slower to apply than refs. ","Multiple sources need to run and update before tagged data\n","will be resolved. ","If possible, stick to refs and only use tags when dealing with multiple sources.","Tagging a page","To tag a page, add a "," property to the page frontmatter. ","For example, the Product A page is tagged with \"in-stock\":","---\n","title: Product A\n","description: Mosaic Product A\n","layout: ProductDiscover\n","tags:\n"," - in-stock\n","data:\n"," name:\n"," $ref: '#/title'\n","---"," is always an array","Subscribing to a tag","To subscribe to a tag, use the "," property. ","For example, the Products page has subscribed to the "," property of pages tagged with ",".","---\n","title: Products\n","data:\n"," in-stock:\n"," $tag: in-stock#/data\n","---","A "," can provide a path to a specific piece of metadata on tagged pages, just like a ref.","Example","This page has subscribed to "," and "," tags and is displaying them using 2 Mosaic "," components.","Both the Product A and Product B pages are part of a different source than this page.","In Stock","Out of Stock"]},{"title":"UI Components","route":"/mosaic/author/ui-components","content":[""]},{"title":"Configure","route":"/mosaic/configure/index","content":["Mosaic is a tool which retrieves, formats and combines documentation pages from any number of different external sources (such as GitHub repositories, local disks or REST endpoints), into a single filesystem for you to use in your websites."]},{"title":"Content Fragment","route":"/mosaic/fragments/content-fragment","content":["Fragment Title","This is an example fragment of markdown content, being pulled from ","."]},{"title":"Fragments","route":"/mosaic/fragments/index","content":["This folder contains example fragments that are referenced and rendered in the Fragments docs page."]},{"title":"Tile A","route":"/mosaic/fragments/tile-a","content":[]},{"title":"Tile B","route":"/mosaic/fragments/tile-b","content":[]},{"title":"Create a Site","route":"/mosaic/getting-started/create-a-site","content":["In this guide you will learn how to generate and serve a Mosaic site.","Prerequisites","To begin setting up a Mosaic site, you need to have the following software installed:","Yarn v1","Node.js v18 or higher","Step 1: Generate a Mosaic site","Run the following command in your project directory to generate a new Mosaic site:","npx @jpmorganchase/mosaic-create-site create -o my-sample-site","This command creates a new Mosaic site in the my-sample-site directory.","Next, navigate to the site directory:","cd my-sample-site","Step 2: Serve the site","The example site you have generated comes preconfigured with two ","sources",": a remote repository and a local docs folder. ","Sources are used by Mosaic to pull content from disparate locations and merge them into a single virtual filesystem that can be used by a Mosaic site.","Set up Git credentials","If you want the site to read from remote repositories, you need to set up an environment variable to store your Git credentials. ","Follow these steps:","Open a terminal or command prompt.","Replace "," and "," in the following commands with your actual Git username and personal access token.","On Unix:","export MOSAIC_DOCS_CLONE_CREDENTIALS=\":\"","On Windows:","set MOSAIC_DOCS_CLONE_CREDENTIALS=\":\"","This sets the MOSAIC_DOCS_CLONE_CREDENTIALS environment variable with your Git credentials.","Serve command","Now you can serve your Mosaic site by running the following command:","yarn serve","Access your Mosaic site from a browser using the following URLs:","To browse the content from your local source: http://localhost:3000/local","To browse the content from the Mosaic Git repo source: http://localhost:3000/mosaic","That's it! ","Your Mosaic site is now up and running.","Next Steps:","Deploy your Mosaic site to AWS or Vercel for production use.","Create more pages to expand your site's content.","Configure your own sources in the mosaic.config.mjs file to pull content from different locations.","Theme your site"]},{"title":"Getting Started","route":"/mosaic/getting-started/index","content":["Getting Started with Mosaic","Follow our step-by-step guides to quickly create and deploy your first Mosaic site."]},{"title":"Publish a site to AWS","route":"/mosaic/getting-started/publish-site-to-aws","content":["Publish a site to AWS using S3 snapshots.","Step 1: Generate a Mosaic site","If you have already created your Mosaic site, skip ahead to step 2.","> npx @jpmorganchase/mosaic-create-site -o my-sample-site\n","> cd my-sample-site","Step 2: Create a Github repository","> git init\n","> git remote add origin git@github.com:username/my-sample-site.git\n","> git add .\n","> git commit -m \"initial commit\"\n","> git push origin main","Step 3: Generate a snapshot of content","Consider a snapshot as a directory of static content previously pulled from your content sources, which does not update itself.","> yarn gen:snapshot","Step 4: Configure environment for S3","> export MOSAIC_MODE=\"snapshot-s3\"\n","> export MOSAIC_S3_BUCKET=\"\"\n","> export MOSAIC_S3_REGION=\"\"\n","> export MOSAIC_S3_ACCESS_KEY_ID=\"\"\"\n","> export MOSAIC_S3_SECRET_ACCESS_KEY=\"\"\n","> yarn mosaic upload -S ./snapshots/latest","Step 5: Setup AWS","Switch to the ","AWS Amplify"," console and deploy your app as a SSR application by following the ","AWS docs",".","Setup an S3 bucket as per the ","AWS S3 docs",".","Step 7: Configure your AWS app","Add the environment vars to the hosted app via your console","MOSAIC_MODE=\"snapshot-s3\"\n","MOSAIC_S3_BUCKET=\"\"\n","MOSAIC_S3_REGION=\"\"\n","MOSAIC_S3_ACCESS_KEY_ID=\"\"\"\n","MOSAIC_S3_SECRET_ACCESS_KEY=\"\"","Add the following build settings","version: 1\n","frontend:\n"," phases:\n"," preBuild:\n"," commands:\n"," - yarn install\n"," - env | grep -e MOSAIC >> .env.production\n"," build:\n"," commands:\n"," - yarn run build\n"," artifacts:\n"," baseDirectory: .next\n"," files:\n"," - '**/*'\n"," cache:\n"," paths:\n"," - node_modules/**/*","Ensure the Node is set to 16","Step 8: Upload your snapshot","Upload your snapshot to S3 storage.","> yarn mosaic upload -S ./snapshots/latest"]},{"title":"Publish","route":"/mosaic/publish/index","content":["To create your first Mosaic site, we have created a command line generator that scaffolds a ","standard"," site.","A ","standard"," site offers","an out the box, working site, which showcases local and remote content sources","a minimal set of files that can be configured with your own components, themes, layouts, sources and plugins","an update path that enables you to update Mosaic, independently of your own configuration","Create your first site","Install the Mosaic create site script.","> yarn global add @jpmorganchase/mosaic-create-site","Create a directory for your site and run the "," script.","> mkdir mosaic-sample-site\n","> cd mosaic-sample-site\n","> mosaic-create-site -f .","Define the environment variable, which enables us to access your remote repo.","> export MOSAIC_DOCS_CLONE_CREDENTIALS=\"\"","The "," environment variable is composed of your git username and your PAT token.\n","Follow these ","docs"," to see how to create your own PAT token.","Your site is ready to run.","> yarn serve","In your browser load ","Congratulations, you have created your first Mosaic site."]},{"title":"Publish a site to AWS","route":"/mosaic/publish/publish-site-to-aws","content":["A Mosaic site is a ","Next.Js"," app.","To publish a Next.Js App to AWS, deploy your app as a SSR application by following the ","AWS docs",".","Once the basic app has been configured, add the Mosaic specifics.","Add the environment vars to the hosted app via the Amplify console","MOSAIC_MODE=\"snapshot-s3\"\n","MOSAIC_S3_BUCKET=\"\"\n","MOSAIC_S3_REGION=\"\"\n","MOSAIC_S3_ACCESS_KEY_ID=\"\"\"\n","MOSAIC_S3_SECRET_ACCESS_KEY=\"\"","Add the following build settings","version: 1\n","frontend:\n"," phases:\n"," preBuild:\n"," commands:\n"," - yarn install\n"," - env | grep -e MOSAIC >> .env.production\n"," build:\n"," commands:\n"," - yarn run build\n"," artifacts:\n"," baseDirectory: .next\n"," files:\n"," - '**/*'\n"," cache:\n"," paths:\n"," - node_modules/**/*","Ensure the Node is set to 16"]},{"title":"Publish a site to Vercel","route":"/mosaic/publish/publish-site-to-vercel","content":["A Mosaic site is a ","Next.Js"," app.","To publish a Next.Js App to Vercel, refer to the ","Vercel docs",".","Deployment","As the ","vercel platform"," hosts static content you will need to deploy a mosaic snapshot. ","There is no option to run mosaic in ","active mode",".","1. ","Update Config File","Add the following to the mosaic config file used by your site:"," deployment: { mode: 'snapshot-file', platform: 'vercel' }","2. ","Set Environment Variables","Set 2 ","environment variables"," in the vercel dashboard.","| Variable Name | Value |\n","| ------------------- | ----------------- |\n","| MOSAIC_MODE | snapshot-file |\n","| MOSAIC_SNAPSHOT_DIR | snapshots/latest. ","|","3. ","Run Build and Deploy","The "," command used by vercel must run "," followed by ","The "," command is needed to workaround an ","output file tracing"," problem.","Example:","yarn build && yarn deploy","Output File Tracing","Output File Tracing"," is a feature of Next.js that uses static analysis\n","to determine what files are needed to deploy a production version of an application.","Due to the architecture of mosaic, snapshot files can be ignored by this process and therefore excluded from the build artifacts deployed by vercel.","If you are deploying your site to the ","vercel platform"," then the mosaic site has a "," command that will update the nextjs output trace to include the snapshot files."]},{"title":"Test","route":"/mosaic/test/index","content":["Pages for e2e testing."]},{"title":"Admin","route":"/mosaic/configure/admin/index","content":["There are several admin urls exposed by Mosaic that provide an insight into how the filesystem has been configured and a way to remotely manage sources.","Endpoints","| Endpoint | Method | Description | Params |\n","| -------------------------- | ------ | -------------------------------------------- | ---------------------- |\n","| "," | GET | Returns the JSON from the Mosaic config file | n/a |\n","| "," | GET | Returns the entire mosaic filesystem as JSON | n/a |\n","| "," | GET | Returns a collection of active sources | n/a |\n","| "," | POST | Adds the source | definition & isPreview |\n","| "," | PUT | Stops the source with the provided name | name |\n","| "," | PUT | Restarts the source with the provided name | name |"]},{"title":"Detail Highlight","route":"/mosaic/configure/layouts/detail-highlight","content":["Layout: Detail Highlight","Initialize with "," in your page's frontmatter.","This layout is used to promote, share insights, and statistics for a line of business.","This layout should be used for pages with only one level of nesting, therefore, pagination is not eligible for this\n","layout.","Page geometry"]},{"title":"Detail Overview","route":"/mosaic/configure/layouts/detail-overview","content":["Layout: Detail Overview","Initialize with "," in your page's frontmatter.","This layout is used to present an overview of expected documentation, statisitics, and ability to\n","navigate to more documents.","Avoid making this page too long. ","If it gets too long, we recommend the ","Detail Technical"," template.","Page geometry","Other Layouts","Detail Highlight","Detail Technical","Landing","Product Discover","Product Preview","Filler content","Eiusmod veniam adipisicing est magna id sunt occaecat minim adipisicing ad do pariatur id aliqua.\n","Officia officia deserunt consequat ullamco irure. ","Excepteur deserunt esse occaecat ex aute. ","Duis do\n","do in incididunt cupidatat dolore veniam magna aliquip voluptate laborum. ","Non irure magna amet\n","ullamco culpa esse dolore nostrud. ","Id ea id ipsum incididunt do velit aliquip fugiat do non\n","consequat.","A sub heading","Deserunt sunt pariatur mollit dolor eiusmod. ","Anim sunt officia cillum anim. ","Laborum ullamco\n","consectetur elit dolore quis laborum. ","Eiusmod cillum amet veniam sunt Lorem reprehenderit commodo.\n","Cupidatat cillum ea consequat anim. ","Duis voluptate nulla veniam labore quis tempor.","Commodo reprehenderit excepteur amet aliquip cillum veniam ad. ","Ullamco proident deserunt laboris\n","duis laborum consequat laboris est eu enim nulla. ","Mollit velit consectetur ea aliqua consectetur\n","mollit eu ex deserunt. ","Aute excepteur exercitation esse proident excepteur Lorem. ","Quis cillum\n","occaecat sint voluptate incididunt ea ipsum incididunt duis sint magna magna fugiat.","Third-level heading","Ea do magna aute proident nulla cupidatat esse consectetur anim eu esse. ","Consectetur est voluptate\n","excepteur non dolore consequat fugiat deserunt. ","Est nostrud est ea irure reprehenderit commodo\n","nostrud nulla tempor ipsum tempor sit id exercitation. ","Sunt reprehenderit officia anim id quis\n","pariatur velit cillum incididunt officia sunt. ","Ullamco ipsum cillum minim deserunt eiusmod nostrud\n","irure et nulla laborum ipsum ipsum incididunt. ","Voluptate reprehenderit in occaecat ipsum nulla\n","excepteur excepteur mollit laboris id ad laborum do. ","Qui in laborum nostrud quis occaecat proident\n","ipsum tempor laborum consequat id ut velit occaecat.Aliquip quis qui ullamco ipsum exercitation\n","exercitation excepteur ea ex. ","Proident elit incididunt incididunt ad adipisicing quis deserunt sint\n","laboris deserunt ipsum culpa est. ","Id do ex duis Lorem exercitation amet reprehenderit. ","Voluptate qui\n","tempor qui sit minim sit qui ea id dolor excepteur. ","Laborum elit excepteur enim sunt consequat\n","officia cillum. ","Do ea occaecat ut voluptate ea proident duis minim ad pariatur dolore magna enim\n","duis. ","Sit aliqua aliqua ea mollit enim cupidatat proident incididunt. ","Eu dolore sit non incididunt.\n","Mollit reprehenderit sunt sunt cillum labore velit exercitation officia aliqua ea adipisicing do ea.\n","Commodo et fugiat velit dolore consectetur.","Amet dolore deserunt in ut amet officia exercitation sint excepteur voluptate proident tempor enim\n","est. ","Culpa proident tempor in voluptate laboris sunt consectetur sit cillum excepteur culpa enim\n","velit laboris. ","Pariatur elit amet nostrud tempor nostrud ea. ","Exercitation do aliquip nisi amet id.\n","Lorem labore incididunt sit sit veniam tempor do consectetur do culpa qui.","Id sint deserunt laborum mollit id excepteur","mollit excepteur labore labore dolor. ","Sit cupidatat nostrud ad consequat amet excepteur id sunt\n","labore adipisicing non irure. ","Fugiat exercitation laborum officia minim duis dolor do officia Lorem\n","cillum excepteur. ","Sint elit mollit duis sit ad commodo.","Cillum amet irure ut tempor tempor culpa dolore sint.","Lorem qui ipsum reprehenderit est incididunt duis exercitation ea duis fugiat. ","Consectetur enim id\n","sunt exercitation et dolore ea proident sunt excepteur fugiat dolor. ","Veniam proident dolore irure\n","incididunt deserunt pariatur quis. ","Incididunt ea elit deserunt occaecat eiusmod velit fugiat eiusmod\n","dolor eiusmod ullamco. ","Fugiat fugiat eiusmod occaecat nulla consequat pariatur.","Aliquip non cupidatat irure magna et fugiat sunt amet ex est excepteur irure quis. ","Non culpa magna\n","nisi enim eu nulla esse laborum amet ipsum. ","Eu consectetur labore do id occaecat adipisicing."]},{"title":"Detail Technical","route":"/mosaic/configure/layouts/detail-technical","content":["Layout: Detail Technical","Initialize with "," in your page's frontmatter.","This layout is used for longer, technical, detailed content about the product.","This layout shows less marketing-type visuals and more visual of diagrams, screenshots, and code\n","snippets.","This page can be short or very lengthy.","Page geometry","Other Layouts","Detail Highlight","Detail Overview","Landing","Product Discover","Product Preview","Filler content","Eiusmod veniam adipisicing est magna id sunt occaecat minim adipisicing ad do pariatur id aliqua.\n","Officia officia deserunt consequat ullamco irure. ","Excepteur deserunt esse occaecat ex aute. ","Duis do\n","do in incididunt cupidatat dolore veniam magna aliquip voluptate laborum. ","Non irure magna amet\n","ullamco culpa esse dolore nostrud. ","Id ea id ipsum incididunt do velit aliquip fugiat do non\n","consequat.","A sub heading","Deserunt sunt pariatur mollit dolor eiusmod. ","Anim sunt officia cillum anim. ","Laborum ullamco\n","consectetur elit dolore quis laborum. ","Eiusmod cillum amet veniam sunt Lorem reprehenderit commodo.\n","Cupidatat cillum ea consequat anim. ","Duis voluptate nulla veniam labore quis tempor.","Commodo reprehenderit excepteur amet aliquip cillum veniam ad. ","Ullamco proident deserunt laboris\n","duis laborum consequat laboris est eu enim nulla. ","Mollit velit consectetur ea aliqua consectetur\n","mollit eu ex deserunt. ","Aute excepteur exercitation esse proident excepteur Lorem. ","Quis cillum\n","occaecat sint voluptate incididunt ea ipsum incididunt duis sint magna magna fugiat.","Third-level heading","Ea do magna aute proident nulla cupidatat esse consectetur anim eu esse. ","Consectetur est voluptate\n","excepteur non dolore consequat fugiat deserunt. ","Est nostrud est ea irure reprehenderit commodo\n","nostrud nulla tempor ipsum tempor sit id exercitation. ","Sunt reprehenderit officia anim id quis\n","pariatur velit cillum incididunt officia sunt. ","Ullamco ipsum cillum minim deserunt eiusmod nostrud\n","irure et nulla laborum ipsum ipsum incididunt. ","Voluptate reprehenderit in occaecat ipsum nulla\n","excepteur excepteur mollit laboris id ad laborum do. ","Qui in laborum nostrud quis occaecat proident\n","ipsum tempor laborum consequat id ut velit occaecat.Aliquip quis qui ullamco ipsum exercitation\n","exercitation excepteur ea ex. ","Proident elit incididunt incididunt ad adipisicing quis deserunt sint\n","laboris deserunt ipsum culpa est. ","Id do ex duis Lorem exercitation amet reprehenderit. ","Voluptate qui\n","tempor qui sit minim sit qui ea id dolor excepteur. ","Laborum elit excepteur enim sunt consequat\n","officia cillum. ","Do ea occaecat ut voluptate ea proident duis minim ad pariatur dolore magna enim\n","duis. ","Sit aliqua aliqua ea mollit enim cupidatat proident incididunt. ","Eu dolore sit non incididunt.\n","Mollit reprehenderit sunt sunt cillum labore velit exercitation officia aliqua ea adipisicing do ea.\n","Commodo et fugiat velit dolore consectetur.","Amet dolore deserunt in ut amet officia exercitation sint excepteur voluptate proident tempor enim\n","est. ","Culpa proident tempor in voluptate laboris sunt consectetur sit cillum excepteur culpa enim\n","velit laboris. ","Pariatur elit amet nostrud tempor nostrud ea. ","Exercitation do aliquip nisi amet id.\n","Lorem labore incididunt sit sit veniam tempor do consectetur do culpa qui.","Id sint deserunt laborum mollit id excepteur","mollit excepteur labore labore dolor. ","Sit cupidatat nostrud ad consequat amet excepteur id sunt\n","labore adipisicing non irure. ","Fugiat exercitation laborum officia minim duis dolor do officia Lorem\n","cillum excepteur. ","Sint elit mollit duis sit ad commodo.","Cillum amet irure ut tempor tempor culpa dolore sint.","Lorem qui ipsum reprehenderit est incididunt duis exercitation ea duis fugiat. ","Consectetur enim id\n","sunt exercitation et dolore ea proident sunt excepteur fugiat dolor. ","Veniam proident dolore irure\n","incididunt deserunt pariatur quis. ","Incididunt ea elit deserunt occaecat eiusmod velit fugiat eiusmod\n","dolor eiusmod ullamco. ","Fugiat fugiat eiusmod occaecat nulla consequat pariatur.","Aliquip non cupidatat irure magna et fugiat sunt amet ex est excepteur irure quis. ","Non culpa magna\n","nisi enim eu nulla esse laborum amet ipsum. ","Eu consectetur labore do id occaecat adipisicing."]},{"title":"Layouts","route":"/mosaic/configure/layouts/index","content":["Todo..."]},{"title":"Landing Layout","route":"/mosaic/configure/layouts/landing","content":["Layout: Landing","Initialize with "," in your page's frontmatter.","Use this layout as a landing page to show large branded visuals, and high-level content about the\n","line of business.","Set the tone and voice for your LOB’s experience.","Use components that support your content with places to insert visuals, share any stats or an\n","introduction of LOB’s story.","Use heading styles to show the grouping of content of a section.","Page geometry"]},{"title":"Product Discover Layout","route":"/mosaic/configure/layouts/product-discover","content":["Layout: Product Discover","Initialize with "," in your page's frontmatter.","Use this layout to introduce a product feature with a description and large visual.","This layout is use for marketing and discovery content.","Page geometry"]},{"title":"Product Preview Layout","route":"/mosaic/configure/layouts/product-preview","content":["Layout: Product Preview","Initialize with "," in your page's frontmatter.","This layout has been used to introduce a product and showcase their suite of product offerings.","Use heading styles to show the grouping of content of a section.","Page geometry"]},{"title":"Active mode","route":"/mosaic/configure/modes/active","content":["In "," mode content can be ","pulled"," from heterogeneous data sources and normalized via plugins, to the configured components/theme.\n","As your content changes, the site will ","re-pull"," the content and update your site in real-time.","The standard generated site comes with 2 sources to demonstrate, how 'active' mode work.","a local source, which loads content from ","a remote source, which loads content from a ","sample Github repository","Configuring your content sources","All content is composed together within a ","namespace",".","A ","namespace"," is the scope for aggregated content, represented by the root path.\n","e.g Our sample docs are aggregated into a ","namespace"," called "," and served by the user journey ","Mosaic doc sources are defined by a file called ","Here is how that might look for a standard site.","Pull your local content","To tryout local content creation, add a file called","The load ","Each directory should contain an "," which is the default page, when a page is loaded without a path","Now create other pages and subdirectories and explore how Mosaic, builds your user-journeys from your fileset.","Pull your remote content","To tryout remote content creation, your standard site comes pre-configured to load our Mosaic sample docs.","Edit the "," and change your "," and "," to pull content from other repos."]},{"title":"Modes of operation","route":"/mosaic/configure/modes/index","content":["Mosaic can operate in 3 different modes","Active updates","In ","active"," mode, content updates in real-time.","active"," mode content is pulled at configured intervals in real-time, as defined by ",".","Read the ","active"," configuration docs.","Static content","Consider a snapshot as a directory of static content previously pulled from your content sources, which does not update itself.","In a snapshot mode, the snapshot does update itself.","File based snapshots","In "," mode, immutable snapshots of content are loaded at startup from the local file-system.","Read the ","snapshot-file"," configuration docs.","S3 based snapshots","In "," mode, snapshots of content are loaded at startup from a remote S3 bucket.","Read the ","snapshot-s3"," configuration docs."]},{"title":"Snapshot file mode","route":"/mosaic/configure/modes/snapshot-file","content":["In "," mode a local immutable snapshot can be loaded by the site. ","Typically, the snapshot and the site are\n","deployed together and upon startup the site can load the snapshot from the local file-system.","To use "," mode","export MOSAIC_MODE=\"snapshot-file\"\n","export MOSAIC_SNAPSHOT_DIR=\"./snapshot/latest\"","Generating a snapshot","To generate a snapshot, run","yarn gen:snapshot","Commit the snapshot to your Git repo and push the site+snapshot to your Git repo, within the same branch."]},{"title":"Snapshot AWS/S3 mode","route":"/mosaic/configure/modes/snapshot-s3","content":["In "," mode a snapshot can be loaded from a pre-configured AWS S3 bucket.","To use "," mode","> export MOSAIC_MODE=\"snapshot-s3\"\n","> MOSAIC_S3_BUCKET=\"\"\n","> MOSAIC_S3_REGION=\"\"\n","> MOSAIC_S3_ACCESS_KEY_ID=\"\"\n","> MOSAIC_S3_SECRET_ACCESS_KEY=\"\"","Generating a snapshot","To generate a snapshot, run","yarn gen:snapshot","Uploading a snapshot to S3","To upload a snapshot to S3, define the required environment variables and run","yarn mosaic upload -S "]},{"title":"$AliasPlugin","route":"/mosaic/configure/plugins/alias-plugin","content":["The "," is what powers the ","aliases"," feature of Mosaic.","It does this by scrapes "," from page metadata and also applies all aliases stored in ","Other plugins can use "," to apply new aliases, as long as they call it before this plugin has reaches the "," lifecycle event.","This plugin is added to the plugins collection by Mosaic itself so users do ","not"," need to include it in their own mosaic config file.","Priority","This plugin runs with a priority of -1 so it runs ","after"," most other plugins."]},{"title":"BreadcrumbsPlugin","route":"/mosaic/configure/plugins/breadcrumbs-plugin","content":["The "," is responsible for generating the data needed to show breadcrumbs navigation on pages. ","It then appends this data to a "," property in the page metadata.","Should a page already have a "," property in it's metadata then it is respected and not overwritten.","If a page has a "," property in it's metadata then this is used as the label for the breadcrumb, otherwise the page "," is used.","When the "," is traversing up directories, it needs to know what page in the directory represents the ","breadcrumb"," for that directory. ","It is recommended to use the "," page for this but the page to use is a configurable option of the breadcrumbs plugin.","Priority","This plugin runs with no special priority.","Options","| Property | Description |\n","| ------------- | ------------------------------------------------ |\n","| indexPageName | The page name to use for \"directory\" breadcrumbs |","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the breadcrumbs plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/BreadcrumbsPlugin',\n"," options: {\n"," indexPageName: 'index.mdx'\n"," }\n"," }\n"," // other plugins\n","];"]},{"title":"BrokenLinksPlugin","route":"/mosaic/configure/plugins/broken-links-plugin","content":["The "," will identify any broken links in pages Mosaic has pulled into it's filesystem by making use of the ","check-links"," package.","It can identify broken links between the pages themselves and external links that pages link out to.","What this plugin is really checking is \"liveness\" of a link.","alive if the URL is reachable (2XX status code)","dead if the URL is not reachable","invalid if the URL was parsed as invalid or used an unsupported protocol","Links may be \"alive\", but the ","content"," of the linked page may not be what you want so continue\n","to check links show what you expect.","Priority","This plugin runs with no special priority.","Options","| Property | Description |\n","| ------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n","| baseUrl | This is used to calculate the full url for links between pages. ","It should be the url Mosaic is running on |\n","| proxyEndpoint | If you are behind a corporate proxy, external link checking will not work unless you specify the proxy endpoint using this option |","Adding to Mosaic","This plugin is ","not"," included in the mosaic config shipped by the Mosaic standard generator so it must be added manually to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/BrokenLinksPlugin',\n"," priority: -1,\n"," // Exclude this plugin in builds\n"," runTimeOnly: true,\n"," options: {\n"," baseUrl: process.env.MOSAIC_ACTIVE_MODE_URL || 'http://localhost:8080',\n"," proxyEndpoint: 'http://some-proxy-url'\n"," }\n"," }\n"," // other plugins\n","];","This plugin needs to be a "," plugin because it needs Mosaic to be running in order to\n","make requests to all of the page links.","Example Output","When a link is found to be broken, you will see the following output in the console:","@jpmorganchase/mosaic-site:serve: 8080 [Mosaic] Broken links found in /local/docs/publish-site-to-vercel.mdx\n","@jpmorganchase/mosaic-site:serve: 8080 Link to https://nextjs.org/davie is dead {\n","@jpmorganchase/mosaic-site:serve: 8080 type: 'link',\n","@jpmorganchase/mosaic-site:serve: 8080 title: null,\n","@jpmorganchase/mosaic-site:serve: 8080 url: 'https://nextjs.org/davie',\n","@jpmorganchase/mosaic-site:serve: 8080 children: [ { type: 'text', value: 'Next.Js', position: [Object] } ],\n","@jpmorganchase/mosaic-site:serve: 8080 position: {\n","@jpmorganchase/mosaic-site:serve: 8080 start: { line: 4, column: 20, offset: 36 },\n","@jpmorganchase/mosaic-site:serve: 8080 end: { line: 4, column: 55, offset: 71 }\n","@jpmorganchase/mosaic-site:serve: 8080 }\n","@jpmorganchase/mosaic-site:serve: 8080 }"]},{"title":"$CodeModPlugin","route":"/mosaic/configure/plugins/codemod-plugin","content":["Todo"]},{"title":"Plugins","route":"/mosaic/configure/plugins/index","content":["Mosaic Plugins are ","lifecycle-based"," hooks that are called on ","every"," source at different stages. ","You will never need to invoke a lifecycle method directly as their execution is managed by a plugin runner.","Plugins enable Mosaic to have a lightweight and flexible, modular architecture by encapsulating features and functionality as plugins.","Installation","Configuration","Plugins are added to the "," collection of the mosaic config file. ","Like ","sources",", plugins have an options property that can be used to provide plugin specific configuration.","| Property | Description | Required |\n","| --------------- | -------------------------------------------------------------------------- | -------- |\n","| modulePath | The path to the installed plugin module | Yes |\n","| disabled | Exclude this plugin completely. ","Defaults to false | No |\n","| runtimeOnly | Exclude this plugin when generating a snapshot. ","Defaults to false | No |\n","| previewDisabled | Exclude this plugin for \"preview\" sources | No |\n","| allowMultiple | Allow multiple instances of this plugin to run. ","| No |\n","| priority | The importance of this plugin. ","Plugins with the highest priority run first | No |\n","| options | Collection of other configuration values | No |"," plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/PagesWithoutFileExtPlugin',\n"," options: {},\n"," priority: 1\n"," },\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/SidebarPlugin',\n"," options: {}\n"," },\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/ReadingTimePlugin',\n"," options: {}\n"," }\n","],","There is no need to import the plugin module directly. ","As long as the plugin is installed, Mosaic\n","will be able to import it using the built-in plugin loader.","Default Plugins","The following plugins are always included by Mosaic, regardless of whether they are present in the plugins collection of the Mosaic config file:","$TagPlugin","$AliasPlugin","$CodeModPlugin","$RefPlugin","Plugin errors","Should a plugin fail, the failure will ","not"," cause a source to close or for any other plugin to not run.","Instead plugin errors are tracked by Mosaic and can be viewed in the "," property available on each source listed by the list sources ","admin API",".","Plugin errors will be split by lifecycle event and only the lifecycle events used by the loaded plugins used will be shown.","Multiple Instances","By default, Mosaic will only run one instance of a plugin.","It may be the case that you wish to run the same plugin twice with a slightly different config. ","To do this, you must have 2 instances listed in the plugins collection and they ","both"," must set the "," option to ",".","For example, the config below runs the ","SidebarPlugin"," twice:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/SidebarPlugin',\n"," options: { rootDirGlob: 'products/product-a' },\n"," allowMultiple: true\n"," },\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/SidebarPlugin',\n"," options: { rootDirGlob: '*/!(","product-a)/*' },\n"," allowMultiple: true\n"," }\n"," // other plugins\n","];"]},{"title":"LazyPagePlugin","route":"/mosaic/configure/plugins/lazy-page-plugin","content":["The "," attempts to reduce the size of the Mosaic filesystem in memory by moving page metadata and content to disk.","It then adds a hook, so that when a page is requested the data is loaded from disk and combined with what is already in the Mosaic filesystem.","It must be the very last to run so that it can strip off metadata and content after other plugins\n","have finished with them.","Priority","This plugin runs with a priority of -2. ","Needs to be the last to run for biggest impact.","Options","| Property | Description |\n","| -------- | ------------------------------------------------------------------------------ |\n","| cacheDir | The directory to store the cache. ","Defaults to "," |","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/LazyPagePlugin',\n"," // This plugin must be the very last to run, so it can strip off metadata and content after the other\n"," // plugins are done with them\n"," priority: -2,\n"," // Exclude this plugin in builds\n"," runTimeOnly: true,\n"," options: {\n"," cacheDir: '.tmp/.pull-docs-last-page-plugin-cache'\n"," }\n"," }\n"," // other plugins\n","];","This plugin needs to be a "," plugin because the goal is to reduce the in-memory\n","filesystem size."]},{"title":"PagesWithoutFileExtPlugin","route":"/mosaic/configure/plugins/pages-wthout-extensions-plugin","content":["The "," plugin creates ","aliases"," without the file extension for every page in the Mosaic filesystem.\n","This allows pages to be retrieved from the filesystem without specifying the extension e.g., ",".","The plugin also modifies the "," metadata property of a page to point to the shorter alias.","Priority","This plugin runs with a priority of 1. ","It must run after the ","$AliasPlugin",".","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/PagesWithoutFileExtPlugin',\n"," options: {},\n"," priority: 1\n"," }\n"," // other plugins\n","];"]},{"title":"PublicAssetsPlugin","route":"/mosaic/configure/plugins/public-assets-plugin","content":["The "," is responsible for finding \"assets\" in the Mosaic filesystem and copying them to another directory.","Typical usecase is for copying "," and "," to the public directory of a Next.js site as these are considered ","static assets"," for Next.js.","Priority","This plugin runs with no special priority.","Options","| Property | Description |\n","| --------- | ----------------------------------------------------------- |\n","| outputDir | The directory to copy the assets to. ","Defaults to "," |\n","| assets | A collection of filenames to copy to the outputDir |","Adding to Mosaic","This plugin is ","not"," included in the mosaic config shipped by the Mosaic standard generator so it must be added manually to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/PublicAssetsPlugin',\n"," priority: -1,\n"," options: {\n"," outputDir: './public',\n"," assets: ['sitemap.xml', 'search-data.json']\n"," }\n"," }\n"," // other plugins\n","];"]},{"title":"ReadingTimePlugin","route":"/mosaic/configure/plugins/reading-time-plugin","content":["The "," generates an estimation of how long a page written in MDX will take to read and adds the "," property to the metadata of a page.","Priority","This plugin runs with no special priority.","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/ReadingTimePlugin',\n"," options: {}\n"," }\n"," // other plugins\n","];"]},{"title":"$RefPlugin","route":"/mosaic/configure/plugins/ref-plugin","content":["The "," powers the ","refs"," feature of Mosaic.","The plugin scrapes "," properties from page metadata and also applies all refs stored in ",".","Other plugins can use "," to apply new refs, as long as they call it before this plugin has reaches ",".","Priority","This plugin runs with a priority of -1 so it runs ","after"," most other plugins."]},{"title":"SearchIndexPlugin","route":"/mosaic/configure/plugins/search-index-plugin","content":["The "," is responsible for generating the search index and configuration information for ","Fuse.js"," which is the matching engine powering the client-side search functionality of Mosaic sites.","It outputs 3 files:","Full Search Index - ","Condensed Search Index - ","Search Configuration - ","Full Search Index","On a Mosaic site, the full index is fetched after a page has loaded, thus removing the chance of a huge index slowing down first-load.","Practically, the full index should load in the background before a user searches for something, but should a search be initiated before that (e.g., slow-internet) then the condensed version of the search index is available.","Condensed Search Data","Search Index plugin creates a \"condensed\" version of the search index that only includes the "," and "," for each page. ","This is the \"Minimum Viable Index\" to provide somewhat useable search results client-side while the main search index is loaded in the background.","Search Configuration","Any ","options"," that need to be passed to Fuse.js.","Search relevancy configuration","| Property | Description |\n","| ---------------- | ----------------------------------------------------- |\n","| includeScore | https://www.fusejs.io/api/options.html#includescore |\n","| includeMatches | https://www.fusejs.io/api/options.html#includematches |\n","| maxPatternLength | TODO |\n","| ignoreLocation | https://www.fusejs.io/api/options.html#ignorelocation |\n","| threshold | https://www.fusejs.io/api/options.html#threshold |\n","| keys | https://www.fusejs.io/api/options.html#keys |","Priority","This plugin runs with no special priority.","Options","| Property | Description |\n","| ------------- | --------------------------------------------------- |\n","| maxLineLength | TODO |\n","| maxLineCount | TODO |\n","| keys | https://www.fusejs.io/api/options.html#keys |\n","| relevancy | ","search relevancy"," |","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/SearchIndexPlugin',\n"," previewDisabled: true,\n"," options: { maxLineLength: 240, maxLineCount: 240 }\n"," }\n"," // other plugins\n","];","It's usually a good idea to mark this plugin as disabled for preview sources otherwise the pages\n","from the preview will appear in search results."]},{"title":"SharedConfigPlugin","route":"/mosaic/configure/plugins/shared-config-plugin","content":["The "," crawls the page hierarchy to find the closest "," metadata from any parent index's page metadata. ","It then exports a JSON file into each directory with the merged config for that level.","Shared config is typically the place where the following is configured for a Mosaic site:","App Header configuration including site name and main navigation","Footer information","Help links for the left sidebar area","Namespace Shared Configs","Consider 2 sources the share the same ","namespace"," \"product-docs\":","Source A - multiple product directories and main product index page. ","The index page specifies "," metadata.","Source B - pages relevant to a single product. ","Index page does ","not"," have any "," metadata.","Let's also assume that the pages from Source B would also naturally \"fit\" within the pages of Source B (e.g. inside a products directory).","In this scenario, the "," will attempt to copy the shared config file from Source A into the root directory of Source B allowing the Source B pages to use the Source A "," as though it were a product sourced directly from Source A.","Priority","This plugin runs with a priority of 3.","Options","| Property | Description |\n","| -------- | ---------------------------------------------- |\n","| filename | the name of the JSON file output by the plugin |","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/SharedConfigPlugin',\n"," options: {\n"," filename: 'shared-config.json'\n"," },\n"," priority: 3\n"," }\n"," // other plugins\n","];"]},{"title":"SidebarPlugin","route":"/mosaic/configure/plugins/sidebar-plugin","content":["The "," generates the necessary page metadata needed for the vertical navigation shown on some Mosaic pages.","The output from the plugin is added to a "," metadata property of the page.","Configuration","The "," is used to determine the \"root\" directories of the sidebar. ","So for example:"," - generate sidebar data for the pages that are 3 directories deep in the filesystem hierarchy"," - same as above but ignore the product-a directory"," - generate a sidebar just for product-b in the products directory","To rearrange pages in the sidebar or to apply a different label to a page you can ","configure the sidebar"," using page frontmatter.","Priority","This plugin runs with a priority of 3.","Options","| Property | Description |\n","| ----------- | ----------------------------------------------------------------------------- |\n","| filename | filename of the sidebar json, linked to each related page via ref |\n","| rootDirGlob | Glob pattern for matching directories which should be the root of the sidebar |","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/SidebarPlugin',\n"," options: { rootDirGlob: '*/*/*' }\n"," }\n"," // other plugins\n","];"]},{"title":"SiteMapPlugin","route":"/mosaic/configure/plugins/site-map-plugin","content":["The "," generates a ","sitemap"," using the pages in the Mosaic filesystem that adheres to the ","sitemaps XML schema",".","The output of the plugin is a file is named ",".","Priority","This plugin runs with no special priority.","Options","| Property | Description |\n","| -------- | --------------------------------------------------------------------------------------------------- |\n","| siteUrl | The site URL. ","Used as the prefix for loc entries in the sitemap as these must start with a protocol |","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/SiteMapPlugin',\n"," previewDisabled: true,\n"," options: { siteUrl: process.env.SITE_URL || 'http://localhost:3000' }\n"," }\n"," // other plugins\n","];","Visualiser","To visualise your sitemap you can combine this plugin with the "," component provided by ",".","Rendering the "," component will render a tree view of your sitemap.","","Have a look at this site's pages, ","here","."]},{"title":"$TagPlugin","route":"/mosaic/configure/plugins/tag-plugin","content":["The "," powers the tags feature of Mosaic.","This plugin scrapes "," from page metadata and also applies all aliases stored in ",".","Tags ultimately resolve down into ","refs",", but are different from normal refs, in that they are applied to the\n","union filesystem (all merged filesystems), not to the individual source filesystem that they were defined on. ","This can be thought of as a ","global ref",".","Other plugins can use "," and modify the "," property, to apply new global refs, as long as\n","they do so before this plugin has reaches ",".","Priority","This plugin runs with no special priority but it must run before both the "," and the ",".","Example use case - Products Page","Let's assume there is a products page on your site and each product is shown as a tile. ","The information for each product tile is sourced from multiple Mosaic sources. ","How can tags be used to reference the product data needed for each tile on the products page?","The product page should add a "," metadata prop to its frontmatter:","---\n","title: Products\n","description: Product index\n","layout: ProductPreview\n","data:\n"," items:\n"," $tag: product#/data\n","---","The tag shown in the example above is saying populate "," of the Products index page with the "," metadata property of pages tagged with ",".","A tagged product page needs to have a "," property which is a collection of tags and one of these needs to be ",". ","This will allow the "," to correctly associate the product page to the product index page. ","It will also need a "," property because thats the property our product index page wants to use for the tiles.","---\n","title: Product A\n","description: My Product description\n","layout: ProductDiscover\n","tags:\n"," - product\n","data:\n"," name:\n"," $ref: '#/title'\n"," date: 2023/02/07\n"," action: Product Overview\n"," description:\n"," $ref: '#/description'\n"," link: /products/a/index\n","---","---\n","title: Product B\n","description: My Product description\n","layout: ProductDiscover\n","tags:\n"," - product\n","data:\n"," name:\n"," $ref: '#/title'\n"," date: 2023/02/07\n"," action: Product Overview\n"," description:\n"," $ref: '#/description'\n"," link: /products/b/index\n","---"]},{"title":"TableOfContentsPlugin","route":"/mosaic/configure/plugins/toc-plugin","content":["The "," generates a Table of Contents for each page in the Mosaic filesystem using the headings on the page.","Heading ranks are used to determine which page headings should be included in the Table of Contents:","| Heading Element (markdown syntax) | Rank |\n","| --------------------------------- | ---- |\n","| h1 (#) | 1 |\n","| h2 (##) | 2 |\n","| h3 (###) | 3 |\n","| h4 (####) | 4 |\n","| h5 (#####) | 5 |\n","| h6 (######) | 6 |","The plugin output is added to a "," metadata property of a page.","Priority","This plugin runs with no special priority.","Options","| Property | Description |\n","| -------- | ----------------------------- |\n","| minRank | The minimum page heading rank |\n","| maxRank | The maximum page heading rank |","Adding to Mosaic","This plugin is included in the mosaic config shipped by the Mosaic standard generator. ","So if you use the below import in your "," file then the plugin is included already:","import mosaicConfig from '@jpmorganchase/mosaic-standard-generator/dist/fs.config.js';","To add it yourself, add the following to the "," collection:","plugins: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-plugins/TableOfContentsPlugin',\n"," options: {\n"," minRank: 2,\n"," maxRank: 3\n"," }\n"," }\n"," // other plugins\n","];"]},{"title":"Git Repo Source","route":"/mosaic/configure/sources/git-repo-source","content":["The Git Repo Source is used to pull content from a remote git repository e.g. github.","Installation","Credentials and Access tokens","To successfully clone the git repo, the source definition must include credentials that have sufficient permissions to clone the repository.","We recommend storing a ","personal access token"," in an environment variable and using the environment variable in the source definition.","This keeps credentials out of code where they may be accidentally exposed to third parties.","Example","export MOSAIC_DOCS_CLONE_CREDENTIALS=\":\",","Configuration","| Property | Description | Required |\n","| ------------------- | -------------------------------------------------------------------------------- | -------- |\n","| modulePath | The path to the installed module (@jpmorganchase/mosaic-source-git-repo) | Yes |\n","| namespace | The scope for this source. ","| Yes |\n","| disabled | When true, content from this source is not used | No |\n","| options.credentials | Collection of URLS to make requests | Yes |\n","| options.prefixDir | The root path used in the content URL | Yes |\n","| options.subfolder | The name of the folder within the cloned repo containing the docs | Yes |\n","| options.repo | The repo URL | Yes |\n","| options.branch | The branch or tag to clone | Yes |\n","| options.extensions | Collection of file extensions that the source will look for inside the subfolder | Yes |\n","| options.remote | The name of the git remote to use. ","Defaults to origin. ","| Yes |","Example Git Repo Source Definition","\n"," {\n"," modulePath: '@jpmorganchase/mosaic-source-git-repo',\n"," namespace: 'mosaic',\n"," options: {\n"," credentials: process.env.MOSAIC_DOCS_CLONE_CREDENTIALS,\n"," prefixDir: 'mosaic',\n"," subfolder: 'docs',\n"," repo: 'https://github.com/jpmorganchase/mosaic.git',\n"," branch: 'main',\n"," extensions: ['.mdx'],\n"," remote: 'origin'\n"," }\n"," }\n"]},{"title":"HTTP Source","route":"/mosaic/configure/sources/http-source","content":["The HTTP Source is used to pull content over HTTP.","Multiple endpoints can be specified and the source will combine and transform the response from each into a single collection of pages.","Installation","Configuration","| Property | Description | Required |\n","| ------------------------------------------ | ----------------------------------------------------------------------------- | -------- |\n","| modulePath | The path to the installed module (@jpmorganchase/mosaic-source-http) | Yes |\n","| namespace | The scope for this source | Yes |\n","| disabled | When true, content from this source is not used | No |\n","| options.endpoints | Collection of URLS to make requests | Yes |\n","| options.prefixDir | The root path used in the content URL | Yes |\n","| options.transformResponseToPagesModulePath | The path of the module used to transform endpoint responses into Mosaic pages | Yes |\n","| options.checkIntervalMins | Number of minutes to wait between requests. ","Defaults to 5 minutes | No |\n","| options.initialDelayMs | Number of milliseconds to wait for making initial request. ","Defaults to 1000 | No |","Example HTTP Source Definition"," {\n"," modulePath: '@jpmorganchase/mosaic-source-http',\n"," namespace: 'my-namespace',\n"," options: {\n"," prefixDir: 'docs',\n"," endpoints: [\n"," 'https://api.data.com/blah',\n"," 'https://api.data.com/hello'\n"," ],\n"," transformResponseToPagesModulePath: '@scope/transformer-package'\n"," }\n"," }"]},{"title":"Sources","route":"/mosaic/configure/sources/index","content":["Sources are what Mosaic uses to pull content from disparate locations and merge into a single virtual filesystem that can be used by a Mosaic Site.","Depending on the ","mode"," used, sources can update periodically ensuring that new content is made available automatically.","Source Definitions","Source Definitions are specified in the "," collection of a mosaic config file.","Each source uses a ","zod schema"," to validate the provided JSON to ensure that all required information for the source to pull content has been provided.","A source definition at a minimum needs to provide the module path of the source and the ","namespace"," that it will use. ","A namespace is not unique across sources though it is common that each source has a different namespace.","Lastly, the options field can be used as a bucket for configuration values needed to configure the source e.g. credentials.","Users are free to add any property as a source option but please read the ","gotchas","\n","first regarding the allowed ","values",".","Example Local Folder Source Definition"," /**\n"," * Demonstrates a local file-system source, in this case a relative path to where the\n"," * site was generated.\n"," * Access from your browser as http://localhost:3000/local\n"," */\n"," {\n"," modulePath: '@jpmorganchase/mosaic-source-local-folder',\n"," namespace: 'local', // each site has it's own namespace, think of this as your content's uid\n"," options: {\n"," rootDir: '..","/../docs', // relative path to content\n"," prefixDir: 'local', // root path used for namespace\n"," extensions: ['.mdx'] // extensions of content which should be pulled\n"," }\n"," }","Source Namespace","A Source Namespace is a scoping mechanism for Mosaic sources used to filter the content loaded by Mosaic. ","By default all sources specified in the mosaic config file are loaded.","sources: [\n"," {\n"," namespace: 'my-namespace',\n"," modulePath: '@jpmorganchase/mosaic-source-local-folder'\n"," }\n","];","The following command will ensure mosaic only loads sources with the "," scope.","yarn mosaic serve -c ''./mosaic.config.mjs' -p 8080 --scope \"local\"","Source Schedules","Source schedules define how often sources pull in content that exists remotely and if a failed source is retried. ","More information can be found ","here","Source Types","Out of the box, Mosaic provides 3 source \"types\":","Local Folder","Git Repo Source","HTTP Source","Sources must expose an observable interface so it is possible to compose sources together e.g. the Git Repo source uses the Local Folder source internally to watch the cloned folder for changes.","Watching for Updates","When running in ","active mode",", Mosaic will watch for any changes to the source content and if a change is detected, will initiate a pull of that new content.","How often to check for updates and how updates are triggered are a matter for the source to handle. ","Mosaic simply responds when a source emits new content.","Source Worker Thread","Sources are executed inside their own worker thread to ensure that the main thread is not overloaded. ","It is here that a local virtual filesystem for the source is created and where several of the ","Plugin Lifecycle"," events are triggered.","Gotchas","A service worker thread uses ","postMessage"," to communicate with the main thread and vice-versa.","This is important because it limits what values can be provided in the source definition to those that can be processed by the ","Structured Clone Algorithm","."]},{"title":"Local Folder Source","route":"/mosaic/configure/sources/local-folder-source","content":["The Local Folder Source is used to pull content from a folder located on the same machine as Mosaic is running.","It is common to use this source when running mosaic locally.","Installation","Configuration","| Property | Description | Required |\n","| ------------------ | ------------------------------------------------------------------------------ | -------- |\n","| modulePath | The path to the installed module (@jpmorganchase/mosaic-source-local-folder) | Yes |\n","| namespace | The scope for this source | Yes |\n","| disabled | When true, content from this source is not used | No |\n","| options.rootDir | The top level directory content will be pulled from | Yes |\n","| options.prefixDir | The root path used in the content URL | Yes |\n","| options.extensions | Collection of file extensions that the source will look for inside the rootDir | Yes |","Example Local Folder Source Definition","{\n"," modulePath: '@jpmorganchase/mosaic-source-local-folder',\n"," namespace: 'local', // each site has it's own namespace, think of this as your content's uid\n"," options: {\n"," rootDir: '..","/../docs', // relative path to content\n"," prefixDir: 'local', // root path used for namespace\n"," extensions: ['.mdx'] // extensions of content which should be pulled\n"," }\n","}","This source will look for content with the \".mdx\" extension in a \"docs\" directory 2 levels up from the Mosaic working directory. ","That content is included in the \"local\" namespace and available from a route that is prefixed with \"local\".","So if you had a file, "," then you would be able to view it at ","."]},{"title":"Source Schedules","route":"/mosaic/configure/sources/schedules","content":["A source schedule defines how often a source initiates a content pull and what to do when there is a failure.","A schedule can be specified for each source in the source definition, but should a source not provide a schedule it will inherit the \"global\" schedule.","Configuration","| Property | Description | Required | Default |\n","| ----------------- | -------------------------------------------------------------------------------------- | -------- | ------- |\n","| checkIntervalMins | The length of time in minutes before triggering a content refresh | Yes | 30 mins |\n","| initialDelayMs | Startup delay for the source. ","| Yes | 1000 ms |\n","| retryEnabled | When true, failures will trigger another content pull | No | true |\n","| retryDelayMins | The interval between retries. ","This will rise exponentially on every failure. ","| No | 5 |\n","| maxRetries | Maximum number of retry attempts | No | 100 |\n","| resetOnSuccess | If true, when a source recovers and emits pages it's retry counter is returned to zero | No | true |","Global Schedule","The global schedule applies to all sources that do ","not"," provide their own schedule. ","It can be configured as a top-level property of the Mosaic config file."," schedule: {\n"," checkIntervalMins: 60,\n"," initialDelayMs: 1000,\n"," retryDelayMins: 15,\n"," maxRetries: 20\n"," }","Example","Given the config file below:"," schedule: {\n"," checkIntervalMins: 30,\n"," initialDelayMs: 1000,\n"," retryDelayMins: 5,\n"," maxRetries: 10\n"," },\n"," sources: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-source-git-repo',\n"," namespace: 'sourceA',\n"," options: {\n"," credentials: 'credentials',\n"," prefixDir: 'sourceA',\n"," subfolder: 'docs',\n"," repo: 'source-a-repo-url',\n"," branch: 'develop',\n"," extensions: ['.mdx'],\n"," remote: 'origin'\n"," }\n"," },\n"," {\n"," modulePath: '@jpmorganchase/mosaic-source-git-repo',\n"," namespace: 'sourceB',\n"," schedule:{\n"," checkIntervalMins: 60,\n"," initialDelayMs: 5000,\n"," retryDelayMins: 30,\n"," maxRetries: 50\n"," }\n"," options: {\n"," credentials: 'credentials',\n"," prefixDir: 'sourceB',\n"," subfolder: 'docs',\n"," repo: 'source-b-repo-url',\n"," branch: 'develop',\n"," extensions: ['.mdx'],\n"," remote: 'origin'\n"," }\n"," }\n"," ]","Source A will inherit the global schedule so it will:","Start after a 1 second delay","Pull content every 30 minutes","Retry a failed content pull after an initial 5 minute delay","Retry 10 times and if still unsuccessful, closing","Source B has its own schedule so it will:","Start after a 5 second delay","Pull content every 60 minutes","Retry a failed content pull after an initial 30 minute delay","Retry 50 times and if still unsuccessful, closing","Retry Strategy","The retry strategy that Mosaic employs is ","Exponential Backoff",". ","This is a common strategy for networking applications that aims to prevent retries from causing more harm than good.","For example, given a source schedule that has a 1 minute retry delay and will retry a maximum of 3 times then the total time spent retrying is 7 minutes:","1 minute delay then 1st retry","2 minute delay then 2nd retry","4 minute delay then 3rd (and final) retry","Total delay: 1 + 2 + 4 = 7 minutes","As you can see, the delay between retries is growing exponentially giving the content source more time to recover after each retry."]},{"title":"Figma Source","route":"/mosaic/configure/sources/source-figma","content":["The Figma source is used to pull individual design patterns from Figma projects.\n","The source subscribes to Figma project groups, then extracts from project files, tagged patterns.","A Figma pattern tag is defined within a Figma project's ",".","For each retrieved/tagged pattern, a page is created in the Mosaic file-system.\n","Additional Mosaic metadata can be added, to each created page, using ","\n","For instance we could add metadata which defines which product owns a particular pattern and then\n","group patterns based on owner.","Installation","Configuration","The Figma source is an "," and shares the same base configuration.\n","The "," prop has a default transformer which creates a page for each matching Story.","| Property | Description | Required |\n","| ---------- | --------------------------------- | -------- |\n","| prefixDir | path to store figma patterns | Yes |\n","| figmaToken | figma access token | Yes |\n","| projects | array of projects to subscribe to | Yes |\n","| endpoints | figma endpoints | Yes |","Each project is configured from the "," array.","| Property | Description | Required |\n","| ------------- | --------------------------------------------- | -------- |\n","| id | numerical id of the subscribed project group | Yes |\n","| meta | metadata to add to each of the projects pages | Yes |\n","| patternPrefix | prefix to add to all pages created | Yes |"," defined the Figma REST API endpoints.","| Property | Description | Required |\n","| ----------------- | --------------------------------------------------------- | -------- |\n","| getProject | url to return a list of projects within the project group | Yes |\n","| getFile | url to return a project file | Yes |\n","| generateThumbnail | url to generate a thumbnail for the shared Figma node | Yes |","Example Figma Source Definition","sources: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-source-figma',\n"," namespace: 'some-namespace',\n"," options: {\n"," proxyEndpoint: 'http://path/to/optional/proxy',\n"," prefixDir: '/some/path/to/where/you/store/pattern/pages',\n"," figmaToken: process.env.FIGMA_TOKEN,\n"," projects: [{\n"," id: 99999,\n"," patternPrefix: 'yourPrefix',\n"," meta: {\n"," tags: [ 'some-tag'],\n"," data: {\n"," owner: 'some-owner'\n"," }\n"," }\n"," }],\n"," endpoints: {\n"," getFile: 'https://api.figma.com/v1/files/:file_id?","plugin_data=shared',\n"," getProject: 'https://api.figma.com/v1/projects/:project_id/files',\n"," generateThumbnail: 'https://api.figma.com/v1/images/:project_id?","ids=:node_id'\n"," }\n"," }\n"," }\n","]"]},{"title":"Readme Source","route":"/mosaic/configure/sources/source-readme","content":["The Readme source is used to pull individual "," text files from repositories.\n","This is a lighter weight version of a Git repository resource, which just pulls a single file,\n","rather the whole contents of the repo.","For each retrieved readme, a page is created in the Mosaic file-system.\n","Additional Mosaic metadata can be added, to each created page, using ","\n","For instance we could add metadata which defines which product owns a particular "," and then\n","group this page, with others, based on owner.","Installation","Configuration","The Readme source is an "," and shares the same base configuration.","| Property | Description | Required |\n","| ----------- | --------------------- | -------- |\n","| accessToken | request access token | Yes |\n","| prefixDir | path to store pages | Yes |\n","| readme | array of readme files | Yes |","Each readme is configured from the "," array.","| Property | Description | Required |\n","| --------------- | ---------------------------- | -------- |\n","| contentTemplate | template for content of page | No |\n","| name | page name used in route | Yes |\n","| readmeUrl | url of readme | Yes |\n","| meta | metadata for page | Yes |","Example Readme Source Definition"," sources: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-source-readme',\n"," namespace: 'your-namespace',\n"," schedule: { checkIntervalMins: 0.25, initialDelayMs: 0 },\n"," options: {\n"," prefixDir: '/salt/community-index/readme',\n"," accessToken: 'Bearer your-access-token',\n"," readme: [\n"," {\n"," name: 'your-mosaic-page-name',\n"," readmeUrl: 'https://some/repo/url/readme.md',\n"," contentTemplate: `a template which replaces ::content:: with the content`,\n"," meta: {\n"," layout: 'DetailTechnical',\n"," title: 'Your Page Title',\n"," tags: ['your-tag-if-required'],\n"," description: 'A description for your readme'\n"," }\n"," }]\n"," }\n"," }]"]},{"title":"Storybook Source","route":"/mosaic/configure/sources/source-storybook","content":["The Storybook source is used to pull individual stories from Storybook, based on tags.","The Mosaic source will filter your Storybook's stories, based on "," or ",".","For each matching story, a page is created in the Mosaic file-system.","additional Mosaic tags can be added to each page using ","additional Mosaic metadata can be added to each page using ","This information can be used to create a dynamic index of stories from Storybook.","Installation","Configuration","The Storybook source is an "," and shares the same base configuration.\n","The "," prop has a default transformer which creates a page for each matching Story.","The "," option is an array of Storybook urls that are used as Sources.\n","Each story is matched on "," using the "," Regexp (or by ",").","If specified, "," and "," can be added to any matching pages.","| Property | Description | Required |\n","| --------------- | ---------------------- | -------- |\n","| options.stories | array of story configs | Yes |"," is an array of Storybooks that you want to pull stories from","| Property | Description | Required |\n","| -------------- | ---------------------------------------- | -------- |\n","| storyUrlPrefix | prefix url of the storybook deployment | Yes |\n","| description | description of the storybook stories | Yes |\n","| storiesUrl | url of the storybook's "," | No |\n","| filter | RegExp filter to match on | No |\n","| filterTags | Array of Storybook tags to match on | No |\n","| meta | additional data to add to matching pages | No |","Example Local Folder Source Definition","sources: [\n"," {\n"," modulePath: '@jpmorganchase/mosaic-source-storybook',\n"," namespace: 'salt',\n"," options: {\n"," prefixDir: '/salt/internal/community-index/story-navigation',\n"," stories: [\n"," {\n"," storiesUrl: 'https://storybook.saltdesignsystem.com/stories.json',\n"," storyUrlPrefix: 'https://storybook.saltdesignsystem.com',\n"," description: 'Navigation patterns created in the Salt Labs',\n"," meta: { // can be any additional metadata you want added to the page's meta.data\n"," tags: ['some-tag'],\n"," data: {\n"," owner: 'Salt',\n"," source: 'STORYBOOK'\n"," }\n"," },\n"," filter: /Lab\\/Tabs/ // this is a Regexp that matches on Storybook title\n"," }\n"," ]\n"," }\n"," }\n","]","Example story metadata format","{\n"," \"type\": \"story\",\n"," \"id\": \"folder--story-1\",\n"," \"name\": \"Story 1\",\n"," \"title\": \"Folder/Story 1\",\n"," \"importPath\": \"./folder/story-1.stories.tsx\",\n"," \"tags\": [\n"," \"dev\",\n"," \"test\"\n"," ]\n","}"]},{"title":"Custom Components","route":"/mosaic/configure/theme/custom-components","content":["Learn how to add your own custom components to your Mosaic site.","Create Components Folder","To start, create a "," folder under "," where you'll store your custom components.","src/\n","└── components/","In this tutorial, we will create a custom "," component.","Create Card Component","Inside the "," folder, create a "," folder, which will contain your React "," component. ","The "," folder should include "," and "," files as shown in the structure below:","├── src/\n","│ ├── components/\n","│ │ └── card/\n","│ │ ├── index.tsx\n","│ │ └── card.module.css","Card Component: index.tsx","Create your "," component within the "," file:","import React from 'react';\n","import styles from './card.module.css';\n","\n","type CardProps = {\n"," title: string;\n"," content: string;\n","};\n","\n","export const Card: React.FC = ({ title, content }) => {\n"," return (\n","
\n","
{title}
\n","
{content}
\n","
\n"," );\n","};","Card Component: card.module.css","Define your component styles in the "," file:",".card {\n"," background-color: #f5f5f5;\n"," border: 1px solid #ccc;\n"," border-radius: 4px;\n"," box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n"," padding: 16px;\n"," transition: box-shadow 0.2s ease-in-out;\n","}\n","\n",".card:hover {\n"," box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);\n","}\n","\n",".card h2 {\n"," color: #333;\n"," font-size: 24px;\n"," margin-bottom: 8px;\n","}\n","\n",".card p {\n"," color: #666;\n"," font-size: 16px;\n"," line-height: 1.5;\n","}","In this example, we use a CSS file, but you can use whichever styling approach you prefer, such as ","vanilla extract",".","To export your "," component, create an "," file in the "," folder:","export * from './card';","Your final folder structure should look like this:","├── src/\n","│ ├── components/\n","│ │ ├── card/\n","│ │ │ ├── index.tsx\n","│ │ │ └── card.module.css\n","│ │ ├── index.ts","Import Custom Card Component","To use your custom "," component, import it into your site's "," file. ","Add the following line to your imports:","import * as myComponents from '../components';","Replace this line:","const components = mosaicComponents;","with:","const components = {\n"," ...mosaicComponents,\n"," ...myComponents\n","};","This will add your custom components to the site, and any custom components in "," will override the corresponding ones in ",". ","The spread operator (",") merges both "," and "," objects, giving priority to "," when there is a naming conflict.","Use Your Custom Card Component","Now you're ready to use your custom "," component. ","Build and run your site, and add the "," component to an MDX file in your "," folder or another source:","","You can create and add more custom components to your Mosaic site by following the same process."]},{"title":"Custom CSS","route":"/mosaic/configure/theme/custom-css","content":["You can customize the look and feel of your Mosaic site by creating cusotm CSS files. ","Here is a step-by-step guide to help you create your own CSS theme.","Create a CSS folder","To get started, create a folder named \"css\" in the \"src\" folder of your Mosaic project.","src/\n","└── css/","Create your theme","Inside the \"css\" folder, create a folder named \"global\". ","This is where you will add your custom styles.","src/\n","└── css/\n"," ├── global/\n"," ├── index.css","Create an \"index.css\" file inside the \"css\" folder. ","This file will import your custom styles.","@import './global/';","Inside your global folder, create a separate CSS file for each part of your site that you want to customize. ","For instance, if you want to change the text styling, create a \"text.css\" file inside the \"global\" folder. ","Here is an example of how your \"text.css\" file could look like:","h1 {\n"," /* Set custom font size and weight */\n"," font-size: /* insert value */ ;\n"," font-weight: /* insert value */ ;\n","}\n","\n","h2 {\n"," font-size: /* insert value */ ;\n"," font-weight: /* insert value */ ;\n","}\n","\n","h3 {\n"," font-size: /* insert value */ ;\n"," font-weight: /* insert value */ ;\n","}\n","\n","h4 {\n"," font-size: /* insert value */ ;\n"," font-weight: /* insert value */ ;\n","}\n","\n","h5 {\n"," font-size: /* insert value */ ;\n"," font-weight: /* insert value */ ;\n","}\n","\n","h6 {\n"," font-size: /* insert value */ ;\n"," font-weight: /* insert value */ ;\n","}\n","\n","p {\n"," font-size: /* insert value */ ;\n"," line-height: /* insert value */ ;\n","}","You can add as many CSS files as you need, depending on how much you want to customize your site.","Create an \"index.css\" file inside the \"global\" folder. ","This file will import your custom styles, in this example we are importing our \"text.css\" file.","@import './text.css';","Your \"css\" folder should now look like this:","src/\n","└── css/\n"," ├── global/\n"," │ ├── text.css\n"," │ ├── index.css\n"," ├── index.css","Import your custom CSS into your site","To apply your custom styles to your Mosaic site, open your \"_app.tsx\" file and add the following line to the bottom of your imports:","import '../css/index.css';","Congratulations! ","You have successfully applied your custom CSS styles to your site. ","This example demonstrated how to create text styles, but you can use the same approach to customize other aspects of your site as well."]},{"title":"Theming Your Site","route":"/mosaic/configure/theme/index","content":["Create a unique look and feel for your Mosaic site by customizing the CSS theme and integrating your own UI components.","Customize the CSS","Adapt various design elements of your Mosaic site to create a cohesive visual theme. ","Refer to our guide to learn more about crafting a custom CSS theme:","CSS Theme Guide","Import Custom Components","Incorporate your own UI components, to tailor the look and functionality of your content. ","This tutorial will walk you through the process of adding custom components to your site:","Adding Custom Components Tutorial"]},{"title":"Aliases Test","route":"/mosaic/test/aliases/index","content":["This page is the alias test page."]},{"title":"Detail Highlight Test Page","route":"/mosaic/test/layouts/detail-highlight","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 1","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 2","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 3","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 4","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Detail Overview Test Page","route":"/mosaic/test/layouts/detail-overview","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 1","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 2","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 3","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 4","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Detail Technical Test Page","route":"/mosaic/test/layouts/detail-technical","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 1","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 2","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 3","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 4","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Edit Layout","route":"/mosaic/test/layouts/edit","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Full Width Layout","route":"/mosaic/test/layouts/full-width","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Layouts","route":"/mosaic/test/layouts/index","content":["Pages for e2e testing of layouts."]},{"title":"Landing Layout Test Page","route":"/mosaic/test/layouts/landing","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Newsletter Test Page","route":"/mosaic/test/layouts/newsletter","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 1","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 2","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 3","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 4","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Product Discover Test Page","route":"/mosaic/test/layouts/product-discover","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 1","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 2","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 3","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 4","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Product Preview Test Page","route":"/mosaic/test/layouts/product-preview","content":["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 1","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 2","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 3","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum","Heading 4","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n","Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n","Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n","Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum"]},{"title":"Refs Data","route":"/mosaic/test/refs/data","content":[]},{"title":"Refs Test","route":"/mosaic/test/refs/index","content":["The sidebar priority is ",".","The other page data is ","."]},{"title":"Tags Test","route":"/mosaic/test/tags/index","content":["In Stock","Out of Stock"]},{"title":"$afterSource","route":"/mosaic/configure/plugins/lifecycle/after-source","content":["The first lifecycle event to trigger after receiving pages from a source and runs in a child process.\n","The pages can safely be mutated and will be reflected in the final filesystem that gets generated.\n","It ","must"," return a collection of pages.","The "," lifecycle event is called with:","pages - the collection of pages emitted by the source","helpers - an object with useful methods","options - the options specified for the plugin in the mosaic config file","Helpers","The helpers provided with this lifecycle event are listed in the table below.","| Property | Description |\n","| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n","| serialiser | A matching "," for serialising/deserialising pages when reading/writing to the filesystem |\n","| config | A mutable object for sharing data with other lifecycle phases of all plugins for this source (including in the main thread) in this plugin |\n","| pageExtensions | A collection of pageExtensions the source is using |\n","| ignorePages | A collection of page globs that are to be ignored for this source |\n","| namespace | The namespace of the source running the plugin |","Example - Log out all page routes","async function $afterSource(pages, { config, ignorePages, pageExtensions }) {\n"," for (const page of pages) {\n"," console.log(page.route);\n"," }\n"," return pages;\n","}"]},{"title":"afterUpdate","route":"/mosaic/configure/plugins/lifecycle/after-update","content":["The third lifecycle event to trigger overall and the first to trigger inside the main Mosaic process.","Calls after the filesystem and symlinks have been reconstructed due to a change to the current source pages. ","Pages will ","not"," be cached when read at this stage, to allow for reading content and writing a new copy of it without the cached version taking effect.\n","This method is safe to use with lazy loading, as the filesystem should return the full page when read.","The "," lifecycle event is called with:","mutableFilesystem - Mutable filesystem instance with all of this source's pages inside (and symlinks re-applied)","helpers - an object with useful methods","options - the options specified for the plugin in the mosaic config file","Helpers","The helpers provided with this lifecycle event are listed in the table below.","| Property | Description |\n","| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n","| serialiser | A matching "," for serialising/deserialising pages when reading/writing to the filesystem |\n","| config | An immutable object for reading data from other lifecycle phases of all plugins for this source in the child process for this plugin. ","Shared only with this source. ","|\n","| globalConfig | An immutable object for reading data from other lifecycle phases of all plugins. ","Shared across all sources. ","|\n","| sharedFilesystem | Mutable filesystem instance independent of any sources. ","Useful for global pages, like sitemaps |\n","| globalFilesystem | Immutable union filesystem instance with all source's pages (and symlinks applied) |\n","| pageExtensions | A collection of pageExtensions the source is using |\n","| ignorePages | A collection of page globs that are to be ignored for this source |\n","| namespace | The namespace of the source running the plugin |"]},{"title":"$beforeSend","route":"/mosaic/configure/plugins/lifecycle/before-send","content":["The second lifecycle event to trigger and does so after a filesystem has been built up from the source pages.","It is the last lifecycle event to run in a source child process before the filesystem is sent to the main Mosaic process and should ","not"," return a value.","The "," lifecycle event is called with:","mutableFilesystem - Mutable virtual filesystem instance with all of this source's pages inside (and symlinks applied)","helpers - an object with useful methods","options - the options specified for the plugin in the mosaic config file","Helpers","The helpers provided with this lifecycle event are listed in the table below.","| Property | Description |\n","| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n","| serialiser | A matching "," for serialising/deserialising pages when reading/writing to the filesystem |\n","| config | A mutable object for sharing data with other lifecycle phases of all plugins for this source (including in the main thread) in this plugin |\n","| pageExtensions | A collection of pageExtensions the source is using |\n","| ignorePages | A collection of page globs that are to be ignored for this source |\n","| namespace | The namespace of the source running the plugin |"]},{"title":"Lifecycle Events","route":"/mosaic/configure/plugins/lifecycle/index","content":["Plugin lifecycle","The plugin lifecycle is triggered when a source emits content.","Each Mosaic source has its own worker thread and plugin lifecycle events that start with a "," will execute inside the worker thread.\n","All other lifecycle events will execute in the main Mosaic process.","The 5 lifecycle events are:","$afterSource","$beforeSend","afterUpdate","shouldClearCache","shouldUpdateNamespaceSources","Plugin methods that trigger inside the main thread should be asynchronous and highly optimised to\n","avoid holding up the main thread."]},{"title":"shouldClearCache","route":"/mosaic/configure/plugins/lifecycle/should-clear-cache","content":["The fourth lifecycle event to trigger overall and the second to trigger inside the main Mosaic process.","It is called every time ","any"," source emits new pages and should return a boolean to indicate if ","other"," sources should clear their cache in response to the source updating.","Only sources that have already run "," will call this lifecycle hook since there is no\n","cache to clear if they haven't reached that stage in the lifecycle.","The "," lifecycle event is called with:","updatedSourceFilesystem - Immutable filesystem for the source that changed i.e, not the source filesystem","helpers - an object with useful methods","options - the options specified for the plugin in the mosaic config file","Helpers","The helpers provided with this lifecycle event are listed in the table below.","| Property | Description |\n","| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n","| serialiser | A matching "," for serialising/deserialising pages when reading/writing to the filesystem |\n","| config | An immutable object for reading data from other lifecycle phases of all plugins for this source in the child process for this plugin. ","Shared only with this source. ","|\n","| globalFilesystem | Immutable union filesystem instance with all source's pages (and symlinks applied) |\n","| pageExtensions | A collection of pageExtensions the source is using |\n","| ignorePages | A collection of page globs that are to be ignored for this source |\n","| namespace | The namespace of the source running the plugin |"]},{"title":"shouldUpdateNamespaceSources","route":"/mosaic/configure/plugins/lifecycle/should-update-namespace-sources","content":["The fifth lifecycle event to trigger overall and the third to trigger inside the main Mosaic process.","It is called every time ","any"," source emits new pages and should return a boolean to indicate if ","other sources that share the same ","source namespace"," should re-run ",".","The "," lifecycle event is called with:","updatedSourceFilesystem - Immutable filesystem for the source that changed i.e, not the source filesystem","helpers - an object with useful methods","options - the options specified for the plugin in the mosaic config file","Helpers","The helpers provided with this lifecycle event are listed in the table below.","| Property | Description |\n","| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n","| serialiser | A matching "," for serialising/deserialising pages when reading/writing to the filesystem |\n","| config | An immutable object for reading data from other lifecycle phases of all plugins for this source in the child process for this plugin. ","Shared only with this source. ","|\n","| globalFilesystem | Immutable union filesystem instance with all source's pages (and symlinks applied) |\n","| pageExtensions | A collection of pageExtensions the source is using |\n","| ignorePages | A collection of page globs that are to be ignored for this source |\n","| namespace | The namespace of the source running the plugin |"]}]
\ No newline at end of file
diff --git a/packages/standard-generator/src/templates/next.config.js.hbs b/packages/standard-generator/src/templates/next.config.js.hbs
index d8a8fbff..2dabaa1d 100755
--- a/packages/standard-generator/src/templates/next.config.js.hbs
+++ b/packages/standard-generator/src/templates/next.config.js.hbs
@@ -32,11 +32,6 @@ module.exports = {
]
},
webpack(config) {
- // Swaps out Buble for a smaller version that removes the latest Regex spec features.
- // See https://github.com/FormidableLabs/react-live#what-bundle-size-can-i-expect
- config.plugins.push(
- new webpack.NormalModuleReplacementPlugin(/^buble$/, require.resolve('@philpl/buble'))
- );
// Required by MDX-JS
if (config.resolve.fallback) {
config.resolve.fallback.fs = false;
diff --git a/packages/standard-generator/src/templates/package.json.hbs b/packages/standard-generator/src/templates/package.json.hbs
index c513c890..5cdc517b 100644
--- a/packages/standard-generator/src/templates/package.json.hbs
+++ b/packages/standard-generator/src/templates/package.json.hbs
@@ -20,7 +20,6 @@
},
"dependencies": {
{{{ printDependencies dependencies }}}
- "@philpl/buble": "^0.19.7",
"@types/react": "^18.0.26",
"next": "^13.4.1",
"next-auth": "^4.24.5"
diff --git a/yarn.lock b/yarn.lock
index ab8374b7..22883282 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2246,21 +2246,6 @@
resolved "https://registry.yarnpkg.com/@panva/hkdf/-/hkdf-1.0.4.tgz#4e02bb248402ff6c5c024e23a68438e2b0e69d67"
integrity sha512-003xWiCuvePbLaPHT+CRuaV4GlyCAVm6XYSbBZDHoWZGn1mNkVKFaDbGJjjxmEFvizUwlCoM6O18FCBMMky2zQ==
-"@philpl/buble@^0.19.7":
- version "0.19.7"
- resolved "https://registry.yarnpkg.com/@philpl/buble/-/buble-0.19.7.tgz#27231e6391393793b64bc1c982fc7b593198b893"
- integrity sha512-wKTA2DxAGEW+QffRQvOhRQ0VBiYU2h2p8Yc1oBNlqSKws48/8faxqKNIuub0q4iuyTuLwtB8EkwiKwhlfV1PBA==
- dependencies:
- acorn "^6.1.1"
- acorn-class-fields "^0.2.1"
- acorn-dynamic-import "^4.0.0"
- acorn-jsx "^5.0.1"
- chalk "^2.4.2"
- magic-string "^0.25.2"
- minimist "^1.2.0"
- os-homedir "^1.0.1"
- regexpu-core "^4.5.4"
-
"@pkgjs/parseargs@^0.11.0":
version "0.11.0"
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
@@ -3336,13 +3321,6 @@
resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-5.0.4.tgz#1a31c3d378850d2778dabb6374d036dcba4ba708"
integrity sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==
-"@types/buble@^0.20.0":
- version "0.20.1"
- resolved "https://registry.yarnpkg.com/@types/buble/-/buble-0.20.1.tgz#cba009801fd417b0d2eb8fa6824b537842e05803"
- integrity sha512-itmN3lGSTvXg9IImY5j290H+n0B3PpZST6AgEfJJDXfaMx2cdJJZro3/Ay+bZZdIAa25Z5rnoo9rHiPCbANZoQ==
- dependencies:
- magic-string "^0.25.0"
-
"@types/cookie@^0.6.0":
version "0.6.0"
resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.6.0.tgz#eac397f28bf1d6ae0ae081363eca2f425bedf0d5"
@@ -3540,6 +3518,11 @@
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301"
integrity sha1-0zV0eaD9/dWQf+Z+F+CoXJBuEwE=
+"@types/prismjs@^1.26.0":
+ version "1.26.4"
+ resolved "https://registry.yarnpkg.com/@types/prismjs/-/prismjs-1.26.4.tgz#1a9e1074619ce1d7322669e5b46fbe823925103a"
+ integrity sha512-rlAnzkW2sZOjbqZ743IHUhFcvzaGbqijwOu8QZnZCjfQzBqFE3s4lOTJEsxikImav9uzz/42I+O7YUs1mWgMlg==
+
"@types/prop-types@*":
version "15.7.5"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf"
@@ -3988,31 +3971,11 @@ abstract-logging@^2.0.1:
resolved "https://registry.yarnpkg.com/abstract-logging/-/abstract-logging-2.0.1.tgz#6b0c371df212db7129b57d2e7fcf282b8bf1c839"
integrity sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==
-acorn-class-fields@^0.2.1:
- version "0.2.1"
- resolved "https://registry.yarnpkg.com/acorn-class-fields/-/acorn-class-fields-0.2.1.tgz#748058bceeb0ef25164bbc671993984083f5a085"
- integrity sha512-US/kqTe0H8M4LN9izoL+eykVAitE68YMuYZ3sHn3i1fjniqR7oQ3SPvuMK/VT1kjOQHrx5Q88b90TtOKgAv2hQ==
-
-acorn-dynamic-import@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948"
- integrity sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==
-
acorn-jsx@^5.0.0, acorn-jsx@^5.3.1:
version "5.3.1"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b"
integrity sha1-/IZh4Rt6wVOcR9v+oucrOvNNJns=
-acorn-jsx@^5.0.1:
- version "5.3.2"
- resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
- integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==
-
-acorn@^6.1.1:
- version "6.4.2"
- resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6"
- integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==
-
acorn@^7.4.0:
version "7.4.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa"
@@ -4141,6 +4104,11 @@ ansi-styles@^6.0.0, ansi-styles@^6.1.0:
resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5"
integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==
+any-promise@^1.0.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"
+ integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==
+
anymatch@~3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
@@ -4542,18 +4510,6 @@ browserslist@^4.23.1:
node-releases "^2.0.18"
update-browserslist-db "^1.1.0"
-buble@0.19.6:
- version "0.19.6"
- resolved "https://registry.yarnpkg.com/buble/-/buble-0.19.6.tgz#915909b6bd5b11ee03b1c885ec914a8b974d34d3"
- integrity sha512-9kViM6nJA1Q548Jrd06x0geh+BG2ru2+RMDkIHHgJY/8AcyCs34lTHwra9BX7YdPrZXd5aarkpr/SY8bmPgPdg==
- dependencies:
- chalk "^2.4.1"
- magic-string "^0.25.1"
- minimist "^1.2.0"
- os-homedir "^1.0.1"
- regexpu-core "^4.2.0"
- vlq "^1.0.0"
-
buffer@^5.5.0:
version "5.7.1"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0"
@@ -4988,21 +4944,11 @@ comma-separated-tokens@^2.0.0:
resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee"
integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==
-commander@7, commander@^9.3.0, commander@^9.4.0, commander@^9.4.1:
+commander@7, commander@^4.0.0, commander@^9.3.0, commander@^9.4.0, commander@^9.4.1:
version "9.4.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd"
integrity sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==
-component-props@1.1.1:
- version "1.1.1"
- resolved "https://registry.yarnpkg.com/component-props/-/component-props-1.1.1.tgz#f9b7df9b9927b6e6d97c9bd272aa867670f34944"
- integrity sha512-69pIRJs9fCCHRqCz3390YF2LV1Lu6iEMZ5zuVqqUn+G20V9BNXlMs0cWawWeW9g4Ynmg29JmkG6R7/lUJoGd1Q==
-
-component-xor@0.0.4:
- version "0.0.4"
- resolved "https://registry.yarnpkg.com/component-xor/-/component-xor-0.0.4.tgz#c55d83ccc1b94cd5089a4e93fa7891c7263e59aa"
- integrity sha512-ZIt6sla8gfo+AFVRZoZOertcnD5LJaY2T9CKE2j13NJxQt/mUafD69Bl7/Y4AnpI2LGjiXH7cOfJDx/n2G9edA==
-
compute-scroll-into-view@^3.0.0:
version "3.0.3"
resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-3.0.3.tgz#c418900a5c56e2b04b885b54995df164535962b1"
@@ -5085,11 +5031,6 @@ core-js-pure@^3.30.2:
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.31.0.tgz#052fd9e82fbaaf86457f5db1fadcd06f15966ff2"
integrity sha512-/AnE9Y4OsJZicCzIe97JP5XoPKQJfTuEG43aEVLFJGOJpyqELod+pE6LEl63DfG1Mp8wX97LDaDpy1GmLEUxlg==
-core-js@^3.14.0:
- version "3.26.1"
- resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.26.1.tgz#7a9816dabd9ee846c1c0fe0e8fcad68f3709134e"
- integrity sha512-21491RRQVzUn0GGM9Z1Jrpr6PNPxPi+Za8OM9q4tksTSnlbXXGKK1nXNg/QvwFYettXvSX6zWKCtHHfjN4puyA==
-
cors@^2.8.5:
version "2.8.5"
resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29"
@@ -5771,14 +5712,6 @@ dom-helpers@^5.0.1:
"@babel/runtime" "^7.8.7"
csstype "^3.0.2"
-dom-iterator@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/dom-iterator/-/dom-iterator-1.0.0.tgz#9c09899846ec41c2d257adc4d6015e4759ef05ad"
- integrity sha512-7dsMOQI07EMU98gQM8NSB3GsAiIeBYIPKpnxR3c9xOvdvBjChAcOM0iJ222I3p5xyiZO9e5oggkNaCusuTdYig==
- dependencies:
- component-props "1.1.1"
- component-xor "0.0.4"
-
dompurify@2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.4.1.tgz#f9cb1a275fde9af6f2d0a2644ef648dd6847b631"
@@ -7279,7 +7212,7 @@ glob@10.3.10:
minipass "^5.0.0 || ^6.0.2 || ^7.0.0"
path-scurry "^1.10.1"
-glob@^10.4.1:
+glob@^10.3.10, glob@^10.4.1:
version "10.4.5"
resolved "https://registry.yarnpkg.com/glob/-/glob-10.4.5.tgz#f4d9f0b90ffdbab09c9d77f5f29b4262517b0956"
integrity sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==
@@ -8456,11 +8389,6 @@ jsesc@^2.5.1:
resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4"
integrity sha1-gFZNLkg9rPbo7yCWUKZ98/DCg6Q=
-jsesc@~0.5.0:
- version "0.5.0"
- resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
- integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=
-
json-buffer@3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13"
@@ -8823,13 +8751,6 @@ lz-string@^1.5.0:
resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.5.0.tgz#c1ab50f77887b712621201ba9fd4e3a6ed099941"
integrity sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==
-magic-string@^0.25.0, magic-string@^0.25.1, magic-string@^0.25.2:
- version "0.25.9"
- resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c"
- integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==
- dependencies:
- sourcemap-codec "^1.4.8"
-
magic-string@^0.30.10:
version "0.30.11"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.11.tgz#301a6f93b3e8c2cb13ac1a7a673492c0dfd12954"
@@ -9744,6 +9665,15 @@ mute-stream@^1.0.0:
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-1.0.0.tgz#e31bd9fe62f0aed23520aa4324ea6671531e013e"
integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==
+mz@^2.7.0:
+ version "2.7.0"
+ resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32"
+ integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==
+ dependencies:
+ any-promise "^1.0.0"
+ object-assign "^4.0.1"
+ thenify-all "^1.0.0"
+
nan@^2.14.0, nan@^2.14.1, nan@^2.17.0:
version "2.17.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb"
@@ -9996,7 +9926,7 @@ oauth@^0.9.15:
resolved "https://registry.yarnpkg.com/oauth/-/oauth-0.9.15.tgz#bd1fefaf686c96b75475aed5196412ff60cfb9c1"
integrity sha512-a5ERWK1kh38ExDEfoO6qUHJb32rd7aYmPHuyCu3Fta/cnICvYmgd2uhuKXvPD+PXB+gCEYYEaQdIRAjCOwAKNA==
-object-assign@^4, object-assign@^4.1.1:
+object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
@@ -10216,11 +10146,6 @@ ora@^5.4.1:
strip-ansi "^6.0.0"
wcwidth "^1.0.1"
-os-homedir@^1.0.1:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
- integrity sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==
-
os-tmpdir@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
@@ -10575,6 +10500,11 @@ pino@^8.12.0:
sonic-boom "^3.1.0"
thread-stream "^2.0.0"
+pirates@^4.0.1:
+ version "4.0.6"
+ resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9"
+ integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==
+
pkg-dir@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3"
@@ -10681,11 +10611,19 @@ pretty-format@^3.8.0:
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-3.8.0.tgz#bfbed56d5e9a776645f4b1ff7aa1a3ac4fa3c385"
integrity sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==
-prism-react-renderer@^1.1.1, prism-react-renderer@^1.2.1:
+prism-react-renderer@^1.1.1:
version "1.3.5"
resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-1.3.5.tgz#786bb69aa6f73c32ba1ee813fbe17a0115435085"
integrity sha512-IJ+MSwBWKG+SM3b2SUfdrhC+gu01QkV2KmRQgREThBfSQRoufqRfxfHUxpG1WcaFjP+kojcFyO9Qqtpgt3qLCg==
+prism-react-renderer@^2.0.6:
+ version "2.4.0"
+ resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-2.4.0.tgz#c5ea692029c2f8b3fd04f63662d04ffd4eaf10a0"
+ integrity sha512-327BsVCD/unU4CNLZTWVHyUHKnsqcvj2qbPlQ8MiBE2eq2rgctjigPA1Gp9HLF83kZ20zNN6jgizHJeEsyFYOw==
+ dependencies:
+ "@types/prismjs" "^1.26.0"
+ clsx "^2.0.0"
+
prismjs@^1.23.0, prismjs@^1.27.0:
version "1.29.0"
resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.29.0.tgz#f113555a8fa9b57c35e637bba27509dcf802dd12"
@@ -10711,7 +10649,7 @@ progress@^2.0.0:
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
integrity sha1-foz42PW48jnBvGi+tOt4Vn1XLvg=
-prop-types@^15.5.10, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1:
+prop-types@^15.5.10, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.6.2, prop-types@^15.8.1:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
@@ -10950,19 +10888,14 @@ react-is@^18.0.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b"
integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==
-react-live@^2.2.3:
- version "2.4.1"
- resolved "https://registry.yarnpkg.com/react-live/-/react-live-2.4.1.tgz#65e674ff9ca9a9a95f83117acc21ffd968aca619"
- integrity sha512-r+32f7oV/kBs3QZBRvaT+9vOkQW47UZrDpgwUe5FiIMOl7sdo5pmISgb7Zpj5PGHgY6XQaiXs3FEh+IWw3KbRg==
- dependencies:
- "@types/buble" "^0.20.0"
- buble "0.19.6"
- core-js "^3.14.0"
- dom-iterator "^1.0.0"
- prism-react-renderer "^1.2.1"
- prop-types "^15.7.2"
- react-simple-code-editor "^0.11.0"
- unescape "^1.0.1"
+react-live@^4.0.0:
+ version "4.1.7"
+ resolved "https://registry.yarnpkg.com/react-live/-/react-live-4.1.7.tgz#a451054bee78e6c9b4410dfc3940b318d9bc7880"
+ integrity sha512-NTzl0POOAW3dkp7+QL30duOrIu2Vzf2LHdx4TaQ0BqOAtQcSTKEXujfm9jR2VoCHko0oi35PYp38yKQBXz4mrg==
+ dependencies:
+ prism-react-renderer "^2.0.6"
+ sucrase "^3.31.0"
+ use-editable "^2.3.3"
react-markdown@^9.0.0:
version "9.0.1"
@@ -11001,11 +10934,6 @@ react-responsive-carousel@3.2.10:
prop-types "^15.5.8"
react-easy-swipe "^0.0.21"
-react-simple-code-editor@^0.11.0:
- version "0.11.3"
- resolved "https://registry.yarnpkg.com/react-simple-code-editor/-/react-simple-code-editor-0.11.3.tgz#6e5af1c2e51588aded2c89b86e98fac144212f61"
- integrity sha512-7bVI4Yd1aNCeuldErXUt8ksaAG5Fi+GZ6vp3mtFBnckKdzsQtrgkDvdwMFXIhwTGG+mUYmk5ZpMo0axSW9JBzA==
-
react-split@^2.0.14:
version "2.0.14"
resolved "https://registry.yarnpkg.com/react-split/-/react-split-2.0.14.tgz#ef198259bf43264d605f792fb3384f15f5b34432"
@@ -11222,18 +11150,6 @@ refractor@^3.6.0:
parse-entities "^2.0.0"
prismjs "~1.27.0"
-regenerate-unicode-properties@^9.0.0:
- version "9.0.0"
- resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz#54d09c7115e1f53dc2314a974b32c1c344efe326"
- integrity sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA==
- dependencies:
- regenerate "^1.4.2"
-
-regenerate@^1.4.2:
- version "1.4.2"
- resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a"
- integrity sha1-uTRtiCfo9aMve6KWN9OYtpAUhIo=
-
regenerator-runtime@^0.13.10:
version "0.13.10"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz#ed07b19616bcbec5da6274ebc75ae95634bfc2ee"
@@ -11273,30 +11189,6 @@ regexpp@^3.1.0:
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2"
integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==
-regexpu-core@^4.2.0, regexpu-core@^4.5.4:
- version "4.8.0"
- resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.8.0.tgz#e5605ba361b67b1718478501327502f4479a98f0"
- integrity sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg==
- dependencies:
- regenerate "^1.4.2"
- regenerate-unicode-properties "^9.0.0"
- regjsgen "^0.5.2"
- regjsparser "^0.7.0"
- unicode-match-property-ecmascript "^2.0.0"
- unicode-match-property-value-ecmascript "^2.0.0"
-
-regjsgen@^0.5.2:
- version "0.5.2"
- resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.2.tgz#92ff295fb1deecbf6ecdab2543d207e91aa33733"
- integrity sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==
-
-regjsparser@^0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.7.0.tgz#a6b667b54c885e18b52554cb4960ef71187e9968"
- integrity sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ==
- dependencies:
- jsesc "~0.5.0"
-
rehype-slug@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/rehype-slug/-/rehype-slug-6.0.0.tgz#1d21cf7fc8a83ef874d873c15e6adaee6344eaf1"
@@ -11990,11 +11882,6 @@ source-map@^0.7.0:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656"
integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==
-sourcemap-codec@^1.4.8:
- version "1.4.8"
- resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"
- integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==
-
space-separated-tokens@^1.0.0:
version "1.1.5"
resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899"
@@ -12356,6 +12243,19 @@ stylis@^4.2.0:
resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.3.0.tgz#abe305a669fc3d8777e10eefcfc73ad861c5588c"
integrity sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==
+sucrase@^3.31.0:
+ version "3.35.0"
+ resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.35.0.tgz#57f17a3d7e19b36d8995f06679d121be914ae263"
+ integrity sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==
+ dependencies:
+ "@jridgewell/gen-mapping" "^0.3.2"
+ commander "^4.0.0"
+ glob "^10.3.10"
+ lines-and-columns "^1.1.6"
+ mz "^2.7.0"
+ pirates "^4.0.1"
+ ts-interface-checker "^0.1.9"
+
supports-color@^5.3.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
@@ -12523,6 +12423,20 @@ text-table@^0.2.0:
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=
+thenify-all@^1.0.0:
+ version "1.6.0"
+ resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726"
+ integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==
+ dependencies:
+ thenify ">= 3.1.0 < 4"
+
+"thenify@>= 3.1.0 < 4":
+ version "3.3.1"
+ resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f"
+ integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==
+ dependencies:
+ any-promise "^1.0.0"
+
thread-stream@^2.0.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/thread-stream/-/thread-stream-2.4.0.tgz#5def29598d1d4171ba3bace7e023a71d87d99c07"
@@ -12680,6 +12594,11 @@ ts-api-utils@^1.0.1, ts-api-utils@^1.3.0:
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1"
integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==
+ts-interface-checker@^0.1.9:
+ version "0.1.13"
+ resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699"
+ integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==
+
ts-toolbelt@^9.6.0:
version "9.6.0"
resolved "https://registry.yarnpkg.com/ts-toolbelt/-/ts-toolbelt-9.6.0.tgz#50a25426cfed500d4a09bd1b3afb6f28879edfd5"
@@ -12963,36 +12882,6 @@ undici@^6.19.5:
resolved "https://registry.yarnpkg.com/undici/-/undici-6.19.7.tgz#7d4cf26dc689838aa8b6753a3c5c4288fc1e0216"
integrity sha512-HR3W/bMGPSr90i8AAp2C4DM3wChFdJPLrWYpIS++LxS8K+W535qftjt+4MyjNYHeWabMj1nvtmLIi7l++iq91A==
-unescape@^1.0.1:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/unescape/-/unescape-1.0.1.tgz#956e430f61cad8a4d57d82c518f5e6cc5d0dda96"
- integrity sha512-O0+af1Gs50lyH1nUu3ZyYS1cRh01Q/kUKatTOkSs7jukXE6/NebucDVxyiDsA9AQ4JC1V1jUH9EO8JX2nMDgGQ==
- dependencies:
- extend-shallow "^2.0.1"
-
-unicode-canonical-property-names-ecmascript@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc"
- integrity sha1-MBrNxSVjFnDTn2FG4Od/9rvevdw=
-
-unicode-match-property-ecmascript@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3"
- integrity sha1-VP0W4OyxZ88Ezx91a9zJLrp5dsM=
- dependencies:
- unicode-canonical-property-names-ecmascript "^2.0.0"
- unicode-property-aliases-ecmascript "^2.0.0"
-
-unicode-match-property-value-ecmascript@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz#1a01aa57247c14c568b89775a54938788189a714"
- integrity sha1-GgGqVyR8FMVouJd1pUk4eIGJpxQ=
-
-unicode-property-aliases-ecmascript@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz#0a36cb9a585c4f6abd51ad1deddb285c165297c8"
- integrity sha1-CjbLmlhcT2q9Ua0d7dsoXBZSl8g=
-
unified@^11.0.0:
version "11.0.5"
resolved "https://registry.yarnpkg.com/unified/-/unified-11.0.5.tgz#f66677610a5c0a9ee90cab2b8d4d66037026d9e1"
@@ -13165,6 +13054,11 @@ url@~0.11.0:
punycode "1.3.2"
querystring "0.2.0"
+use-editable@^2.3.3:
+ version "2.3.3"
+ resolved "https://registry.yarnpkg.com/use-editable/-/use-editable-2.3.3.tgz#a292fe9ba4c291cd28d1cc2728c75a5fc8d9a33f"
+ integrity sha512-7wVD2JbfAFJ3DK0vITvXBdpd9JAz5BcKAAolsnLBuBn6UDDwBGuCIAGvR3yA2BNKm578vAMVHFCWaOcA+BhhiA==
+
use-memo-one@^1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/use-memo-one/-/use-memo-one-1.1.3.tgz#2fd2e43a2169eabc7496960ace8c79efef975e99"
@@ -13339,11 +13233,6 @@ vitest@^2.0.0:
vite-node "2.0.5"
why-is-node-running "^2.3.0"
-vlq@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/vlq/-/vlq-1.0.1.tgz#c003f6e7c0b4c1edd623fd6ee50bbc0d6a1de468"
- integrity sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==
-
w3c-xmlserializer@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz#f925ba26855158594d907313cedd1476c5967f6c"