Skip to content

Commit

Permalink
Merge pull request #160 from morganstanley/gatsby-theme
Browse files Browse the repository at this point in the history
Gatsby theme migration
  • Loading branch information
aidanm3341 authored Jan 13, 2025
2 parents 25a30ad + 971dd30 commit 02786a8
Show file tree
Hide file tree
Showing 76 changed files with 8,590 additions and 15,068 deletions.
50 changes: 32 additions & 18 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,37 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2

registries:
github-packages:
type: npm-registry
url: 'https://npm.pkg.github.com'
token: ${{ secrets.DEPENDABOT_GITHUB_PACKAGES }}

updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: 'weekly'

# Maintain dependencies for GitHub Actions
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'

- package-ecosystem: 'npm'
directory: '/site'
schedule:
interval: 'monthly'
groups:
gatsby:
patterns:
- 'gatsby*'

- package-ecosystem: npm
directory: "/site"
schedule:
interval: "monthly"
groups:
gatsby:
patterns:
- "gatsby*"
- package-ecosystem: 'npm'
registries:
- 'github-packages'
directory: '/site'
schedule:
interval: 'monthly'
38 changes: 38 additions & 0 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: GH Page Deploy

on:
push:
branches:
- main

defaults:
run:
working-directory: ./site

permissions:
contents: write
packages: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Use Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@morganstanley'
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npm run build
- name: Deploy
uses: crazy-max/ghaction-github-pages@fbf0a4fa4e00f45accd6cf3232368436ec06ed59 # v4.1.0
with:
target_branch: gh-pages
build_dir: docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/pr-build-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: GH Page PR Build

on:
pull_request:
branches:
- main

defaults:
run:
working-directory: ./site

permissions:
contents: read
packages: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Use Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@morganstanley'
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npm run build
35 changes: 0 additions & 35 deletions .github/workflows/site-deploy.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/site-pr-build.yml

This file was deleted.

51 changes: 0 additions & 51 deletions site/__mocks__/documentation.js

This file was deleted.

3 changes: 0 additions & 3 deletions site/__mocks__/file-mock.js

This file was deleted.

34 changes: 0 additions & 34 deletions site/__mocks__/gatsby.js

This file was deleted.

13 changes: 0 additions & 13 deletions site/content/alternatives.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions site/content/background.mdx

This file was deleted.

11 changes: 0 additions & 11 deletions site/content/documentation-hero.mdx

This file was deleted.

13 changes: 13 additions & 0 deletions site/content/documentation/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
order: 1
title: Documentation
---

<Hero title="Message Broker">
The Message Broker is a Typescript library which aims to provide asynchronous
communication between typescript components. It leverages the RxJS library to
facilitate a pub/sub pattern and accepts user-defined contracts to ensure type
safety across messages.
</Hero>

<Toc />
9 changes: 0 additions & 9 deletions site/content/hero.mdx

This file was deleted.

52 changes: 52 additions & 0 deletions site/content/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
order: 1
title: Homepage
---

import GettingStarted from './getting-started.mdx';

<Hero title="Message Broker">
The Message Broker is a Typescript library which aims to provide asynchronous
communication between typescript components. It leverages the RxJS library to
facilitate a pub/sub pattern and accepts user-defined contracts to ensure type
safety across messages.
</Hero>

<section className="content">
<Article title="Background">
This project was written at Morgan Stanley to provide an internal messaging system for large scale UI systems.
The project was later Open Sourced so others could benefit from it.
</Article>
<Article title="Use cases">
Here is an example of a usecase in which the Message Broker could be useful.

#### Notification system

Let's say you have some document uploading functionality in your UI.
The uploading may take up to a minute and you don't want the user to have to wait, so once the upload is complete you want to have a pop-up notification appear which tells the user that their upload was successful.

The code for your pop-up notification can live anywhere in your codebase, and can "listen" for a "document_uploaded" message using the MessageBroker.
Now all that needs to happen is for the document upload service to publish that message when the upload completes.

**Note:** that with this model, our document uploading service doesn't even have to know about the existence of the notification service, so everything is nice and decoupled.

#### Mediator Pattern

More generically, the Message Broker essentially acts as a [Mediator](https://refactoring.guru/design-patterns/mediator) for your components.
Any time you would apply the Mediator pattern, the Message Broker is the perfect solution to avoid you some boilerplate coding.

</Article>
<Article title="Alternatives">
List of alternatives to the Message Broker.

- [BullMQ](https://docs.bullmq.io)
- Relies on Redis
- [@node-ts/bus](https://bus.node-ts.com)

Both of these alternatives lack the same level of type safety that the Message Broker provides.
</Article>
<Article title="Getting Started">
<GettingStarted />
</Article>

</section>
Loading

0 comments on commit 02786a8

Please sign in to comment.