The content in this file links to Elastic internal resources and is mainly meant for core maintainers within Elastic. For a more general guide for developing, please consult CONTRIBUTING.md.
The Search UI docs are built using an internal library (which hopefully moves into the open soon!).
An overview of the syntax used can be found here: https://github.com/elastic/docsmobile/blob/main/doc-site/docs/docs_syntax.mdx.
- Clone https://github.com/elastic/docs.elastic.co next to search-ui repo
- Create content-dev.js by moving into the
docs.elastic.co
folder and copying content.js:cp config/content.js config/content-dev.js
- Edit your content-dev.js file so that:
sources: [ { type: 'github', location: 'elastic/wordlake', }, { type: 'file', location: '../../search-ui' } ],
- Run
yarn
, thenyarn init-docs
, thenyarn dev
. - After the initial setup is done, simply use
yarn docs-start
from the search-ui root.
Releases should be performed directly in main (or a minor branch for patches), following the Publishing guide.
We will create branches for all minor releases.
Because all examples are declared as "private", when running lerna commands other than bootstrap, (like
publish
andtest
), the--no-private
flag should be appended.
(Example, publishing 0.6.0)
- Run
npx lerna version 0.6.0 --force-publish --exact
. - Verify the
0.6.0
tag was created as well as a "Release 0.6.0" commit. - Run
nvm use
to make sure you are running the correct version of node, and verify thatnpm run build
runs without error before publishing. - Run
npx lerna publish from-package
. - Verify the
0.6.0
has been published to npm. - Verify that the
v0.6.0
tag and commit has been pushed tomain
onorigin
. - Create new version branch,
0.6
from the0.6.0
tag and push toorigin
. - Create a release in Github.
- Close the release Milestone in Github.
- Verify the demo on Codesandbox is functioning: https://codesandbox.io/s/github/elastic/search-ui/tree/main/examples/sandbox
(Example, publish 0.6.1)
- Create a
0.6
branch from the0.6.0
tag, if one does not already exist. - Run
npx lerna version 0.6.1 --force-publish --exact
. - Verify the
v0.6.1
tag was created as well as a "Release 0.6.1" commit. - Run
nvm use
to make sure you are running the correct version of node, and verify thatnpm run build
runs without error before publishing. - Run
npx lerna publish from-package
. - Verify the
0.6.1
has been published to npm. - Verify that the
0.6.1
tag and commit has been pushed tomain
onorigin
. - Cherry-pick the changes forward to subsequent minor releases and main, and repeat the process.
- Create a release in Github.
- Close the release Milestone in Github.
- Verify the demo on Codesandbox is functioning: https://codesandbox.io/s/github/elastic/search-ui/tree/main/examples/sandbox
It can often be useful to publish a change and test it before doing a real live publish. For instance, it can be useful to publish something from a PR branch and test it with an actual install. Use lerna's canary option for this.
-
Check out pr branch
-
npx lerna publish --force-publish --canary --preid canary [patch|minor|major]
- Publishing with canary generates a unique new version number, publishes it to npm, then updates thecanary
tag in npm to point to that new version. -
In project you'll need to install all dependencies explicitly with the canary tag from npm:
npm install --save @elastic/react-search-ui@canary @elastic/search-ui-app-search-connector@canary @elastic/react-search-ui-views@canary search-ui-views@canary
-
To check your changes, simply push them to the
canary
branch, then visit https://codesandbox.io/s/github/elastic/search-ui/tree/canary/examples/sandbox
When pushing release candidates, the following lerna commands can be useful:
# Create a pre-release version, like 1.0.0-rc.0
npx lerna version [premajor | preminor | prepatch | prerelease] --exact --force-publish --no-private --preid rc
# Publish 1.0.0-rc.0 and update the `next` to point to this version
npx lerna publish from-package --force-publish --dist-tag next
We have a number of demos available that you can use to do quick smoke testing of releases in various stacks: