Skip to content

Commit

Permalink
rebase on beta.51
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-tate committed Oct 6, 2023
1 parent 3f7df12 commit 44353fd
Show file tree
Hide file tree
Showing 14 changed files with 404 additions and 115 deletions.
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
"engines": {
"node": ">=16.10.0 || >=18.0.0"
},
"bin": {
"mosaic": "yarn workspace @jpmorganchase/mosaic-cli"
},
"scripts": {
"build:site": "turbo run build --filter=@jpmorganchase/mosaic-site",
"build": "turbo run build",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@jpmorganchase/mosaic-source-local-folder": "^0.1.0-beta.51",
"@aws-sdk/client-s3": "^3.359.0",
"@fastify/middie": "^8.3.0",
"@fastify/static": "^6.11.2",
"commander": "^9.4.1",
"cors": "^2.8.5",
"deepmerge": "^4.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const options = program.opts();
if (program.args[0] === 'export:static') {
exportStatic();
} else if (program.args[0] === 'serve:static') {
serveStatic(path.resolve(process.cwd(), options.out));
serveStatic(path.resolve(process.cwd(), options.out), options.port);
} else {
let config;
if (options.config !== undefined) {
Expand Down
41 changes: 17 additions & 24 deletions packages/cli/src/serveStatic.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
#!/usr/bin/env node
import fs from 'node:fs';
import path from 'node:path';
import express from 'express';
import Fastify from 'fastify';
import fastifyStatic from '@fastify/static';

export default function serveStatic(staticPath, rootURL = 'mosaic/index.html', port = 3000) {
function loadPage(res, fullPath) {
const extension = path.extname(fullPath) || 'html';
if (extension !== 'html') {
return;
export default async function serveStatic(staticPath, port) {
const start = async () => {
try {
await server.listen({ port });
console.log(`[Mosaic] Listening on port ${port}`);
} catch (err) {
server.log.error(err);
process.exit(1);
}
const fsPath = `${fullPath}.${extension}`;
fs.access(fsPath, fs.constants.F_OK, err => {
if (err) {
res.sendFile(path.join(staticPath, `404.html`));
} else {
res.sendFile(fsPath);
}
});
}
};

const server = express();
server.use(express.static(staticPath));
server.get(/^\/$/, (_req, res) => {
loadPage(res, path.join(staticPath, rootURL));
const server = Fastify();
await server.register(fastifyStatic, {
root: staticPath
});
server.get(`*`, (req, res) => {
loadPage(res, path.join(staticPath, req.path));
server.setNotFoundHandler((_request, reply) => {
reply.sendFile(`404.html`);
});
server.listen(port, () => console.log(`Server is listening on port ${port}`));
await start();
}
4 changes: 2 additions & 2 deletions packages/icons/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@jpmorganchase/mosaic-icons",
"description": "Mosaic - Icons",
"version": "0.1.0-beta.47",
"version": "0.1.0-beta.51",
"author": "",
"license": "Apache-2.0",
"repository": {
Expand Down Expand Up @@ -41,7 +41,7 @@
"typescript": "^4.8.3"
},
"dependencies": {
"@jpmorganchase/mosaic-theme": "^0.1.0-beta.47",
"@jpmorganchase/mosaic-theme": "^0.1.0-beta.51",
"@salt-ds/core": "^1.8.0-rc.0"
},
"peerDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/mdx-components-client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@jpmorganchase/mosaic-mdx-components-client",
"description": "Mosaic - Markdown Components",
"version": "0.1.0-beta.47",
"version": "0.1.0-beta.51",
"author": "",
"license": "Apache-2.0",
"repository": {
Expand Down Expand Up @@ -40,9 +40,9 @@
"typescript": "^4.8.3"
},
"dependencies": {
"@jpmorganchase/mosaic-components": "^0.1.0-beta.47",
"@jpmorganchase/mosaic-site-components": "^0.1.0-beta.47",
"@jpmorganchase/mosaic-theme": "^0.1.0-beta.47",
"@jpmorganchase/mosaic-components": "^0.1.0-beta.51",
"@jpmorganchase/mosaic-site-components": "^0.1.0-beta.51",
"@jpmorganchase/mosaic-theme": "^0.1.0-beta.51",
"clsx": "^2.0.0",
"hoist-non-react-statics": "^3.3.2",
"prism-react-renderer": "^1.1.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/mdx-components-server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@jpmorganchase/mosaic-mdx-components-server",
"description": "Mosaic - MDX Components",
"version": "0.1.0-beta.47",
"version": "0.1.0-beta.51",
"author": "",
"license": "Apache-2.0",
"repository": {
Expand Down Expand Up @@ -40,7 +40,7 @@
"typescript": "^4.8.3"
},
"dependencies": {
"@jpmorganchase/mosaic-mdx-components-client": "^0.1.0-beta.47",
"@jpmorganchase/mosaic-mdx-components-client": "^0.1.0-beta.51",
"@mdx-js/mdx": "^2.3.0"
},
"peerDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions packages/site-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jpmorganchase/mosaic-site-components",
"version": "0.1.0-beta.47",
"version": "0.1.0-beta.51",
"license": "Apache-2.0",
"description": "Mosaic - Site components",
"repository": {
Expand Down Expand Up @@ -40,11 +40,11 @@
"typescript": "^4.8.3"
},
"dependencies": {
"@jpmorganchase/mosaic-components": "^0.1.0-beta.47",
"@jpmorganchase/mosaic-content-editor-plugin": "^0.1.0-beta.47",
"@jpmorganchase/mosaic-open-api-component": "^0.1.0-beta.47",
"@jpmorganchase/mosaic-store": "^0.1.0-beta.47",
"@jpmorganchase/mosaic-theme": "^0.1.0-beta.47",
"@jpmorganchase/mosaic-components": "^0.1.0-beta.51",
"@jpmorganchase/mosaic-content-editor-plugin": "^0.1.0-beta.51",
"@jpmorganchase/mosaic-open-api-component": "^0.1.0-beta.51",
"@jpmorganchase/mosaic-store": "^0.1.0-beta.51",
"@jpmorganchase/mosaic-theme": "^0.1.0-beta.51",
"@salt-ds/core": "^1.8.1",
"@salt-ds/lab": "1.0.0-alpha.16",
"@types/mdast": "^3.0.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/site-mdx-loader/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@jpmorganchase/mosaic-site-mdx-loader",
"description": "Mosaic - MDX Site Loader",
"version": "0.1.0-beta.47",
"version": "0.1.0-beta.51",
"author": "",
"license": "Apache-2.0",
"repository": {
Expand Down Expand Up @@ -29,17 +29,17 @@
"dev": "node ./scripts/bundle.mjs watch"
},
"devDependencies": {
"@jpmorganchase/mosaic-types": "^0.1.0-beta.47",
"@jpmorganchase/mosaic-types": "^0.1.0-beta.51",
"del-cli": "^4.0.1",
"esbuild": "0.17.19",
"esbuild-node-externals": "^1.7.0",
"fast-glob": "^3.2.7",
"typescript": "^4.8.3"
},
"dependencies": {
"@jpmorganchase/mosaic-mdx-components-client": "^0.1.0-beta.47",
"@jpmorganchase/mosaic-store": "^0.1.0-beta.47",
"@jpmorganchase/mosaic-schemas": "^0.1.0-beta.47",
"@jpmorganchase/mosaic-mdx-components-client": "^0.1.0-beta.51",
"@jpmorganchase/mosaic-store": "^0.1.0-beta.51",
"@jpmorganchase/mosaic-schemas": "^0.1.0-beta.51",
"@types/node": "^18.15.3",
"deepmerge": "^4.2.2",
"gray-matter": "^4.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"e2e": "npx playwright test",
"e2e:codegen": "npx playwright codegen localhost:3000",
"serve:fs": "yarn mosaic serve -c ./mosaic.config.mjs -p 8080",
"serve:static": "yarn mosaic serve:static -o ./out",
"serve:static": "yarn mosaic serve:static -o ./out -p 3000",
"serve": "concurrently --kill-others \"yarn dev\" \"yarn mosaic serve -c ./mosaic.config.mjs\" -p 8080"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/site/public/search-data-condensed.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"title":"Mosaic","route":"/mosaic/index"},{"title":"Aliases","route":"/mosaic/author/aliases"},{"title":"Fragments","route":"/mosaic/author/fragments"},{"title":"Frontmatter","route":"/mosaic/author/frontmatter"},{"title":"Author","route":"/mosaic/author/index"},{"title":"Markdown Syntax","route":"/mosaic/author/markdown-syntax"},{"title":"Page Templates","route":"/mosaic/author/page-templates"},{"title":"Refs","route":"/mosaic/author/refs"},{"title":"UI Components","route":"/mosaic/author/ui-components"},{"title":"Configure","route":"/mosaic/configure/index"},{"title":"Content Fragment","route":"/mosaic/fragments/content-fragment"},{"title":"Fragments","route":"/mosaic/fragments/index"},{"title":"Tile A","route":"/mosaic/fragments/tile-a"},{"title":"Tile B","route":"/mosaic/fragments/tile-b"},{"title":"Create a Site","route":"/mosaic/getting-started/create-a-site"},{"title":"Getting Started","route":"/mosaic/getting-started/index"},{"title":"Publish a site to AWS","route":"/mosaic/getting-started/publish-site-to-aws"},{"title":"Publish","route":"/mosaic/publish/index"},{"title":"Publish a site to AWS","route":"/mosaic/publish/publish-site-to-aws"},{"title":"Publish a site to Vercel","route":"/mosaic/publish/publish-site-to-vercel"},{"title":"Test","route":"/mosaic/test/index"},{"title":"Admin","route":"/mosaic/configure/admin/index"},{"title":"Layouts","route":"/mosaic/configure/layouts/index"},{"title":"Active mode","route":"/mosaic/configure/modes/active"},{"title":"Modes of operation","route":"/mosaic/configure/modes/index"},{"title":"Snapshot file mode","route":"/mosaic/configure/modes/snapshot-file"},{"title":"Snapshot AWS/S3 mode","route":"/mosaic/configure/modes/snapshot-s3"},{"title":"$afterSource","route":"/mosaic/configure/plugins/after-source"},{"title":"afterUpdate","route":"/mosaic/configure/plugins/after-update"},{"title":"$beforeSend","route":"/mosaic/configure/plugins/before-send"},{"title":"Plugins","route":"/mosaic/configure/plugins/index"},{"title":"shouldClearCache","route":"/mosaic/configure/plugins/should-clear-cache"},{"title":"Git Repo Source","route":"/mosaic/configure/sources/git-repo-source"},{"title":"HTTP Source","route":"/mosaic/configure/sources/http-source"},{"title":"Sources","route":"/mosaic/configure/sources/index"},{"title":"Local Folder Source","route":"/mosaic/configure/sources/local-folder-source"},{"title":"Source Schedules","route":"/mosaic/configure/sources/schedules"},{"title":"Custom Components","route":"/mosaic/configure/theme/custom-components"},{"title":"Custom CSS","route":"/mosaic/configure/theme/custom-css"},{"title":"Theming Your Site","route":"/mosaic/configure/theme/index"},{"title":"Aliases Test","route":"/mosaic/test/aliases/index"},{"title":"Detail Highlight Test Page","route":"/mosaic/test/layouts/detail-highlight"},{"title":"Detail Overview Test Page","route":"/mosaic/test/layouts/detail-overview"},{"title":"Detail Technical Test Page","route":"/mosaic/test/layouts/detail-technical"},{"title":"Edit Layout","route":"/mosaic/test/layouts/edit"},{"title":"Full Width Layout","route":"/mosaic/test/layouts/full-width"},{"title":"Layouts","route":"/mosaic/test/layouts/index"},{"title":"Landing Layout Test Page","route":"/mosaic/test/layouts/landing"},{"title":"Newsletter Test Page","route":"/mosaic/test/layouts/newsletter"},{"title":"Product Discover Test Page","route":"/mosaic/test/layouts/product-discover"},{"title":"Product Preview Test Page","route":"/mosaic/test/layouts/product-preview"},{"title":"Refs Data","route":"/mosaic/test/refs/data"},{"title":"Refs Test","route":"/mosaic/test/refs/index"}]
[{"title":"Mosaic","route":"/mosaic/index"},{"title":"Aliases","route":"/mosaic/author/aliases"},{"title":"Fragments","route":"/mosaic/author/fragments"},{"title":"Frontmatter","route":"/mosaic/author/frontmatter"},{"title":"Author","route":"/mosaic/author/index"},{"title":"Markdown Syntax","route":"/mosaic/author/markdown-syntax"},{"title":"Page Templates","route":"/mosaic/author/page-templates"},{"title":"Refs","route":"/mosaic/author/refs"},{"title":"UI Components","route":"/mosaic/author/ui-components"},{"title":"Configure","route":"/mosaic/configure/index"},{"title":"Content Fragment","route":"/mosaic/fragments/content-fragment"},{"title":"Fragments","route":"/mosaic/fragments/index"},{"title":"Tile A","route":"/mosaic/fragments/tile-a"},{"title":"Tile B","route":"/mosaic/fragments/tile-b"},{"title":"Create a Site","route":"/mosaic/getting-started/create-a-site"},{"title":"Getting Started","route":"/mosaic/getting-started/index"},{"title":"Publish a site to AWS","route":"/mosaic/getting-started/publish-site-to-aws"},{"title":"Publish","route":"/mosaic/publish/index"},{"title":"Publish a site to AWS","route":"/mosaic/publish/publish-site-to-aws"},{"title":"Publish a site to Vercel","route":"/mosaic/publish/publish-site-to-vercel"},{"title":"Test","route":"/mosaic/test/index"},{"title":"Admin","route":"/mosaic/configure/admin/index"},{"title":"Detail Highlight","route":"/mosaic/configure/layouts/detail-highlight"},{"title":"Detail Overview","route":"/mosaic/configure/layouts/detail-overview"},{"title":"Detail Technical","route":"/mosaic/configure/layouts/detail-technical"},{"title":"Layouts","route":"/mosaic/configure/layouts/index"},{"title":"Landing Layout","route":"/mosaic/configure/layouts/landing"},{"title":"Product Discover Layout","route":"/mosaic/configure/layouts/product-discover"},{"title":"Product Preview Layout","route":"/mosaic/configure/layouts/product-preview"},{"title":"Active mode","route":"/mosaic/configure/modes/active"},{"title":"Modes of operation","route":"/mosaic/configure/modes/index"},{"title":"Snapshot file mode","route":"/mosaic/configure/modes/snapshot-file"},{"title":"Snapshot AWS/S3 mode","route":"/mosaic/configure/modes/snapshot-s3"},{"title":"$AliasPlugin","route":"/mosaic/configure/plugins/alias-plugin"},{"title":"BreadcrumbsPlugin","route":"/mosaic/configure/plugins/breadcrumbs-plugin"},{"title":"BrokenLinksPlugin","route":"/mosaic/configure/plugins/broken-links-plugin"},{"title":"$CodeModPlugin","route":"/mosaic/configure/plugins/codemod-plugin"},{"title":"Plugins","route":"/mosaic/configure/plugins/index"},{"title":"LazyPagePlugin","route":"/mosaic/configure/plugins/lazy-page-plugin"},{"title":"PagesWithoutFileExtPlugin","route":"/mosaic/configure/plugins/pages-wthout-extensions-plugin"},{"title":"PublicAssetsPlugin","route":"/mosaic/configure/plugins/public-assets-plugin"},{"title":"ReadingTimePlugin","route":"/mosaic/configure/plugins/reading-time-plugin"},{"title":"$RefPlugin","route":"/mosaic/configure/plugins/ref-plugin"},{"title":"SearchIndexPlugin","route":"/mosaic/configure/plugins/search-index-plugin"},{"title":"SharedConfigPlugin","route":"/mosaic/configure/plugins/shared-config-plugin"},{"title":"SidebarPlugin","route":"/mosaic/configure/plugins/sidebar-plugin"},{"title":"SiteMapPlugin","route":"/mosaic/configure/plugins/site-map-plugin"},{"title":"$TagPlugin","route":"/mosaic/configure/plugins/tag-plugin"},{"title":"TableOfContentsPlugin","route":"/mosaic/configure/plugins/toc-plugin"},{"title":"Git Repo Source","route":"/mosaic/configure/sources/git-repo-source"},{"title":"HTTP Source","route":"/mosaic/configure/sources/http-source"},{"title":"Sources","route":"/mosaic/configure/sources/index"},{"title":"Local Folder Source","route":"/mosaic/configure/sources/local-folder-source"},{"title":"Source Schedules","route":"/mosaic/configure/sources/schedules"},{"title":"Custom Components","route":"/mosaic/configure/theme/custom-components"},{"title":"Custom CSS","route":"/mosaic/configure/theme/custom-css"},{"title":"Theming Your Site","route":"/mosaic/configure/theme/index"},{"title":"Aliases Test","route":"/mosaic/test/aliases/index"},{"title":"Detail Highlight Test Page","route":"/mosaic/test/layouts/detail-highlight"},{"title":"Detail Overview Test Page","route":"/mosaic/test/layouts/detail-overview"},{"title":"Detail Technical Test Page","route":"/mosaic/test/layouts/detail-technical"},{"title":"Edit Layout","route":"/mosaic/test/layouts/edit"},{"title":"Full Width Layout","route":"/mosaic/test/layouts/full-width"},{"title":"Layouts","route":"/mosaic/test/layouts/index"},{"title":"Landing Layout Test Page","route":"/mosaic/test/layouts/landing"},{"title":"Newsletter Test Page","route":"/mosaic/test/layouts/newsletter"},{"title":"Product Discover Test Page","route":"/mosaic/test/layouts/product-discover"},{"title":"Product Preview Test Page","route":"/mosaic/test/layouts/product-preview"},{"title":"Refs Data","route":"/mosaic/test/refs/data"},{"title":"Refs Test","route":"/mosaic/test/refs/index"},{"title":"$afterSource","route":"/mosaic/configure/plugins/lifecycle/after-source"},{"title":"afterUpdate","route":"/mosaic/configure/plugins/lifecycle/after-update"},{"title":"$beforeSend","route":"/mosaic/configure/plugins/lifecycle/before-send"},{"title":"Lifecycle Events","route":"/mosaic/configure/plugins/lifecycle/index"},{"title":"shouldClearCache","route":"/mosaic/configure/plugins/lifecycle/should-clear-cache"},{"title":"shouldUpdateNamespaceSources","route":"/mosaic/configure/plugins/lifecycle/should-update-namespace-sources"}]
2 changes: 0 additions & 2 deletions packages/theme/src/icon/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/theme/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export * from './config';
export * from './feature';
export * from './grid';
export * from './hero';
export * from './icon';
export * from './impact';
export * from './link';
export * from './list';
Expand Down
Loading

0 comments on commit 44353fd

Please sign in to comment.