-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: New storybook documentation structure #419
Merged
Merged
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
a4288c9
feat: introducing new storybook structure
tibuurcio b273b97
chore: new documentation pages
tibuurcio f1e6590
chore: new documentation pages
tibuurcio 739f05f
chore: moving stories to the components section
tibuurcio 74129b9
chore: latest changes in docs
tibuurcio ea9da7e
chore: testing new preview workflow
tibuurcio a31dcbe
chore: update preview workflow to include GITHUB_TOKEN credentials
tibuurcio c50124b
chore: tries removing permissions from the workflow
tibuurcio 682ccd6
chore: trying the .nojekyll file creation approach
tibuurcio 6fee641
chore: trying a new publishing storybook workflow
tibuurcio 924ba44
chore: trying to remove remark-gfm dependency to see if gh-pages disp…
tibuurcio 7b17923
chore: back to old publishing workflow again
tibuurcio 8191712
chore: trying the preview.tsx approach
tibuurcio a3e59ea
chore: adds remark-gfm dependency again
tibuurcio 331a5ad
chore: back again at newer version of publishing storybook workflow
tibuurcio defb539
chore: trying the .nojekyll approach again
tibuurcio 5c3dc75
chore: better names for workflows
tibuurcio 60678a5
chore: addressing reviews
tibuurcio d3c12c5
chore: puts foundations in front of components in left nav
tibuurcio 71b9118
chore: adds new Date Range Picker candidate component docs
tibuurcio 977140e
chore: added date and removed example code for Date Range Filter
tibuurcio 7028945
Merge branch 'main' into feat/new-storybook-structure
tibuurcio d212218
chore: adding some ts-expect-errors for component candidate stories
tibuurcio a6cb11c
Merge branch 'feat/new-storybook-structure' of https://github.com/mPa…
tibuurcio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Deploy Storybook PR preview | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- closed | ||
|
||
concurrency: preview-${{ github.ref }} | ||
|
||
jobs: | ||
deploy-preview: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }} | ||
GIT_AUTHOR_NAME: mparticle-automation | ||
GIT_AUTHOR_EMAIL: developers@mparticle.com | ||
GIT_COMMITTER_NAME: mparticle-automation | ||
GIT_COMMITTER_EMAIL: developers@mparticle.com | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install and Build | ||
if: github.event.action != 'closed' # You might want to skip the build if the PR has been closed | ||
run: | | ||
npm install | ||
npm run build-storybook | ||
touch ./storybook-static/.nojekyll | ||
|
||
- name: Deploy preview | ||
uses: rossjrw/pr-preview-action@v1 | ||
with: | ||
source-dir: ./storybook-static/ |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks terrible in unified view. Please use split for a better experience reviewing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
name: Publish Storybook | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' # change to the branch you wish to deploy from | ||
|
||
- main | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
contents: write | ||
jobs: | ||
deploy: | ||
build-and-deploy: | ||
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: build-publish | ||
uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3 | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. | ||
run: | | ||
npm ci | ||
npm run build-storybook | ||
touch ./storybook-static/.nojekyll | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
path: storybook-static | ||
folder: storybook-static # The folder the action should deploy. | ||
clean-exclude: pr-preview/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import type { Preview } from '@storybook/react' | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
layout: 'centered', | ||
options: { | ||
storySort: { | ||
order: [ | ||
'About', | ||
['Introduction', 'Changelog', 'FAQ'], | ||
'Component Process', | ||
[ | ||
'Introduction', | ||
'Components', | ||
['Using components', 'Change process'], | ||
'Candidate Components', | ||
['Introducing new ones', 'Using existing ones', 'Promoting to a component'], | ||
'Design Templates', | ||
], | ||
'Foundations', | ||
'Components', | ||
['Colors', 'Typography', 'Icons', 'Errors', 'Loading'], | ||
'Candidate Components', | ||
'Design Templates', | ||
'Contributing', | ||
['Introduction', 'Commits', 'Testing in the platforms', 'Release Process', 'Maintainers'], | ||
], | ||
}, | ||
}, | ||
|
||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
export default preview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Markdown } from "@storybook/blocks" | ||
|
||
import changelog from '../../CHANGELOG.md?raw' | ||
|
||
# CHANGELOG | ||
|
||
<Markdown>{changelog}</Markdown> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# FAQ | ||
|
||
### What should I do if I can't implement my design specs using Antd atoms? | ||
|
||
Please ask questions about it in the #aquarium channel. Ideally have a branch with your work in progress and some Storybook | ||
stories so that we can see what you're trying to do. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Introduction | ||
|
||
This is where all component related documentation will live at mParticle. This is mainly a work in progress at this point | ||
and we are actively working on it. | ||
|
||
## How to read this | ||
|
||
TBD | ||
|
||
## Glossary | ||
|
||
| Term | Meaning | | ||
| -------- | ------- | | ||
| Component Candidate | TBD | | ||
| Template | TBD | | ||
| Eames | TBD | | ||
| Aquarium | TBD | | ||
| Antd | TBD | | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Component | ||
|
||
TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Introduction | ||
|
||
TBD |
3 changes: 3 additions & 0 deletions
3
docs/Component Process/Candidate Components/Introducing new ones.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Introducing new candidate components | ||
|
||
TBD |
3 changes: 3 additions & 0 deletions
3
docs/Component Process/Candidate Components/Promoting to a component.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Promoting to a component | ||
|
||
TBD |
19 changes: 19 additions & 0 deletions
19
docs/Component Process/Candidate Components/Using existing ones.mdx
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Mermaid } from 'mdx-mermaid/Mermaid'; | ||
|
||
# Using existings candidate components | ||
|
||
<Mermaid chart={`graph TD; | ||
classDef product stroke:#ddd; | ||
classDef design fill:#E4CCFF, stroke:gray; | ||
classDef engineering fill:#0D99FF, stroke:gray, color:white; | ||
|
||
A[Project is prioritized for design]:::product --> B | ||
|
||
B[Designer reviews the project needs and identifies a needs for customization or componetization]:::design --> C | ||
|
||
C[Unify: Trigger source of truth update by creating a ticket to Unify squad for updating Storybook. Start tracking usage in the rule of 3.]:::engineering --> D | ||
|
||
D[Design Handoff. Designer communicates to the project team that a new component candidate is introduced in the handoff]:::design --> E | ||
|
||
E[Implement it using Aquarium atoms directly in the platforms]:::engineering | ||
`} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Change process | ||
|
||
TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Using components | ||
|
||
TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Design Templates | ||
|
||
TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Introduction | ||
|
||
TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Commits | ||
|
||
## Commit conventions and PR titles | ||
|
||
- We use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) to help automating the release process. Both PR titles and commit messages should follow this convention. | ||
- [This repo is commitizen friendly](https://github.com/commitizen/cz-cli?tab=readme-ov-file#using-the-command-line-tool) so we can use `git cz` to commit changes. | ||
`npx cz` is also available if you don't have commitizen installed globally. | ||
- We also have a [commitlint](https://commitlint.js.org/) setup to enforce the commit message format. | ||
|
||
The standard format for commit messages is as follows: | ||
|
||
``` | ||
<type>[optional scope]: <description> | ||
|
||
[optional body] | ||
|
||
[optional footer] | ||
``` | ||
|
||
The following lists the different `types` allowed in the commit message: | ||
|
||
- feat: A new feature (automatic minor release) | ||
- fix: A bug fix (automatic patch release) | ||
- docs: Documentation only changes | ||
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) | ||
- refactor: A code change that neither fixes a bug nor adds a feature | ||
- perf: A code change that improves performance | ||
- test: Adding missing or correcting existing tests | ||
- chore: Changes that don't modify src or test files, such as automatic documentation generation, or building latest assets | ||
- ci: Changes to CI configuration files/scripts | ||
- revert: Revert commit | ||
- build: Changes that affect the build system or other dependencies | ||
|
||
In the footer, if there is a breaking change, start your footer with `BREAKING CHANGE:` followed by a description. | ||
|
||
## Editor configuration | ||
|
||
- **Prettier**: For configuring your editor to play nicely with Prettier, take a look at the [Editors doc page](https://prettier.io/docs/en/editors). | ||
- Also, if you're using VSCode you might want to set prettier as the default formatter and also turn on "Format on Save" option. | ||
- **ESLint**: Check [Integrations doc page](https://eslint.org/docs/latest/use/integrations) | ||
- **Stylelint**: Check [Editor integrations doc page](https://stylelint.io/awesome-stylelint/#editor-integrations) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Introduction | ||
|
||
Thanks for the interest in contributing to the Aquarium! Being a component library requires a different approach to development and testing. | ||
This document will guide you through the process of contributing to the Aquarium. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Maintainers | ||
|
||
TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Release Process | ||
|
||
We use [semantic-release](https://github.com/semantic-release/semantic-release) to automate the versioning and publishing | ||
of the mParticle Aquarium component library. Everything is handled by semantic-release, including determining the next version number, | ||
generating the release notes, and publishing to npm. You can use the Github Release Aquarium action from the `main` branch to release from it. | ||
|
||
> [!IMPORTANT] | ||
> Before releasing a version from main, send a message in the #aquarium Slack channel to align it and sync on other changes that can/should be included in the release. | ||
|
||
## Contributing with the release process | ||
|
||
To make changes to the release process, you can use the `--dry-run` from semantic-release flag to test the release | ||
process without actually publishing a new version. | ||
|
||
You will need two environment variables to run the release process locally: | ||
|
||
- NPM_TOKEN: You can create a personal npm account and use a personal token. | ||
Since we are using `--dry-run` it won't try to publish anything so having a valid read-only npm token works. | ||
|
||
- GITHUB_TOKEN: Create a [github personal access token (classic)](https://github.com/settings/tokens) | ||
and give it access to the mParticle organization via "Configure SSO" button. | ||
|
||
After settings both variables locally, run the following locally: | ||
|
||
``` | ||
npx semantic-release --dry-run | ||
``` | ||
|
||
## Additional readings: | ||
|
||
- [Semantic Release Workflow Configuration](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/workflow-configuration.md#workflow-configuration) | ||
- [Understanding npm distribution channels](https://docs.npmjs.com/cli/v8/commands/npm-dist-tag#purpose) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Testing in the platforms | ||
|
||
## Testing in the CDP | ||
|
||
In order to test your changes, you will need to link the local version of the library. To do this, run the following commands: | ||
|
||
- Make sure to have the library built by running `npx vite build`. The linked version will use the build files from _dist/_ folder. | ||
- Make sure the `resolve.symlinks` property in you webpack config is set to `false` | ||
- `yarn link` in the root of the library | ||
- `yarn link @mparticle/aquarium` in the root of Nancy | ||
- Make sure your _/node_modules/@mparticle/aquarium_ folder contains all of the Aquarium code | ||
|
||
## Testing in Analytics | ||
|
||
TODO | ||
|
||
## Testing by installing from a branch | ||
|
||
Another way to test your changes is by installing the library from a branch. To do this, we need to push the _dist/_ folder to the remote | ||
and install it directly from there with the following command: | ||
|
||
``` | ||
yarn add https://github.com/mParticle/aquarium#<branch-name> | ||
``` | ||
|
||
## Testing by releasing an ad-hoc version | ||
|
||
To test ad-hoc versions of the Aquarium we use `feat/`, `fix/` or `chore/` branchs on Github and their corresponding distribution channels on npm. | ||
This allows us to release specific versions for testing specific features and install them on the platforms. To release it, | ||
just run the Github Action from the the branch you want to release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Directory | ||
|
||
TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Colors | ||
|
||
TBD |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed otherwise Github Pages fails to pick up some of the bundled JS files generated by Storybook's build process.
https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages