-
Notifications
You must be signed in to change notification settings - Fork 121
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
Docs versioning #298
Docs versioning #298
Conversation
- Makes for easier comparisons to other versions
- Get version from mapping of current branch to SB monorepo branch - Add current version to FrameworkSelector
525965e
to
e94eb2d
Compare
ed97294
to
83d065c
Compare
@domyen to design a banner to point to the latest version |
e720a86
to
09c591b
Compare
gatsby-node.js
Outdated
} | ||
|
||
let versions; |
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.
I need access to this inside onPostBuild
, but it's created with data that (I think) is only available inside createPages
. So mutating the value is how I share it across closures. Have a better idea?
const { BRANCH } = process.env; | ||
let versionFromBranch; | ||
const nextVersion = shortenVersion(nextVersionFull); | ||
const NEXT_BRANCH = 'next'; |
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.
I tried to build this in a way that could (eventually) support more than one "next" version. But because we need all available versions ahead of time, we need to know which branches from which to grab those versions, so the 'next'
portion has to be hard-coded. Supporting, e.g. 'next-minor'
& 'next-major'
will require refactoring.
@@ -0,0 +1,14 @@ | |||
#!/bin/bash - |
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.
If there's a better way to do this, I'm all ears.
I noticed https://github.com/storybookjs/storybook/blob/next/docs/versions/next.json, but when we're extracting docs from the main
branch, the version is incorrect (for our usage, at least): https://github.com/storybookjs/storybook/blob/main/docs/versions/next.json.
site-metadata.js
Outdated
@@ -18,7 +18,8 @@ const siteMetadata = { | |||
ogImageAddons: '/images/social/og-addons.png', | |||
siteUrl: homepageUrl, // Used for gatsby-plugin-sitemap | |||
googleSiteVerification: '_OxxMv1o0aRcxPfieLW0BRsMxxIzkpA9Vv6O0AB5xg0', | |||
latestVersion: 'v6.3', | |||
latestVersion: '6.3', // TODO: Could get this from monorepo... |
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.
Not sure if that's worth another curl (assuming there's not a better way), but pulling this from the monorepo would remove a step from the process to document another version.
@domyen — This is nearly the only thing remaining. Remember that the header changes coming with the Component Catalog work will likely affect the placement. Even a rough sketch just demonstrating visual placement would be helpful for me to get started. Thanks! |
- Build versions list from filtered releases edges
- Preserve relative links
Broken: - Breaks on branch names like "release/6.2" - SB monorepo convention - BRANCH is a Netlify convention - Ensure branch names other than "next" and "release/*" extract docs from monorepo's main branch - Can also use locally
- Was `release/6.2`, which caused character escaping problems
- Store in `context.versions`
- "Stable" and "Pre-release"
Can we re-order the versions so that the latest appears as the top? Current:
Proposed:
|
Yep. That makes sense now that we have a separate section for pre-release(s). 👍 |
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.
LGTM the only open issue for me is regarding SB version in the header.
@@ -18,7 +18,8 @@ const siteMetadata = { | |||
ogImageAddons: '/images/social/og-addons.png', | |||
siteUrl: homepageUrl, // Used for gatsby-plugin-sitemap | |||
googleSiteVerification: '_OxxMv1o0aRcxPfieLW0BRsMxxIzkpA9Vv6O0AB5xg0', | |||
latestVersion: 'v6.3', | |||
latestVersion: 6.3, // TODO: Could get this from monorepo... |
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.
We use this latestVersion
in the header for frontpage, blog and tutorials. Like so:
It looks like we don't do that on frontpage any more. Should the other sites be updated to match this? cc: @domyen
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.
We actually grab the version from this file in the blog and tutorials repo.
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.
Oof. Had no idea other repos were referencing this property.
There was actually a bug, pushed a fix for it. |
@winkerVSbecks — 🤦♂️ Thank you! |
- Use pre-release label instead of "New" in VersionCTA badge - Reword messages in VersionCTA - Sort-by-newest in VersionSelector - Remove VersionSelectorTitle styled component - Move versions list generation into `buildVersions` - Refactor shape of versions list
All comments addressed except for the use of |
As I understand it, the primary reason this wasn't done initially was shared components between Addon Catalog and the rest of frontpage. We'll be pulling those components into the design system, so that we can use them for https://github.com/storybookjs/component-catalog. At which point, extracting Addon Catalog into its own repo should be relatively straightforward. |
- storybookjs/frontpage#298 updates `latestVersion` to be a number - As this project pulls the value from that one, it needs to support either format (at least temporarily)
I created PRs in each to
|
Description
Add versioning to Storybook docs.
latestVersion
Screenshot
Note: The messaging in the callout above the content is subject to change.
How to Test
yarn start
&yarn build
)BRANCH=next yarn start
, same forbuild
)yarn extract-monorepo-docs
andyarn link-monorepo-docs
still work, with their various argumentsTODO
release-6-0
,release-6-1
, andrelease-6-2
branches from theirrelease/*.*
counterparts in monorepoAfter merging...
release-6-0
,release-6-1
,release-6-2