This monorepo contains a collection of packages which layer a number of configuration choices, code quality checks, and code generators on top of Next.js. Specifically, it provides:
- Baked in, zero-config typescript linting & prettier formatting via binary
- Code generators for base website templates, new pages, and new components via binary
- A pre-configured client for easily fetching from DatoCMS
- A strong set of default plugins, including:
- mdx-processed markdown with front-matter and layouts
- css files with pre-configured postcss-preset-env can be imported directly into components
- graphql file loader
- webpack bundle analyzer
Current packages:
@hashicorp/platform-analytics
@hashicorp/platform-content-conformance
@hashicorp/platform-cli
@hashicorp/platform-cms
@hashicorp/platform-code-highlighting
@hashicorp/platform-docs-mdx
@hashicorp/platform-edge-utils
@hashicorp/platform-markdown-utils
@hashicorp/platform-nextjs-plugin
@hashicorp/platform-packer-plugins
@hashicorp/platform-product-meta
@hashicorp/platform-remark-plugins
@hashicorp/platform-runtime-error-monitoring
@hashicorp/platform-tools
@hashicorp/platform-types
@hashicorp/platform-util
Publishing is handled through the changesets
library. Publishing is done in CI if changes are found. For more information on how to work with changesets, see this document.
Run the following command and follow the prompt:
npx changeset
To make any adjustments to your changeset, just edit the file!
The release process is handled mostly automatically via the changesets GitHub action. When changeset files get merged to main
, a Pull Request is opened which will, upon merge, release all pending changesets and remove the changeset files. We should not need to publish manually with this flow. See the changesets/action
(https://github.com/changesets/action) repo for more information.
If you want to test your changes before merging, you can add a release:canary
label to your pull request. If any changeset files are found, a release will be created and tagged with canary
. You can then install the canary version elsewhere:
npm install @hashicorp/platform-package@canary
Prereleases are also handled through a process integrated into changesets
. The full flow is outlined in this document. To enter a prerelease mode for the canary
tag, we would do something like this:
npx changeset pre enter canary
GITHUB_TOKEN=<your token> npx changeset version
GITHUB_TOKEN=<your token> npx changeset publish
To continue publishing preleases, use the npx changeset
command like normal and use the version
and publish
commands as appropriate.