Skip to content

Commit 4a705e2

Browse files
authored
Add missed doc site page and update instructions (#1193)
1 parent 1ebacbb commit 4a705e2

11 files changed

Lines changed: 83 additions & 41 deletions

File tree

.github/workflows/pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ jobs:
5555

5656
- run: yarn checkchange --verbose
5757

58+
- run: yarn format:check
59+
if: matrix.os == 'ubuntu-latest'
60+
5861
- run: yarn lint
5962

6063
- run: yarn test:unit

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
.nojekyll
99
.nvmrc
1010
docs/.vuepress/dist/
11+
docs/.vuepress/.cache/
12+
docs/.vuepress/.temp/
13+
docs/.yarn
1114
/change/
1215
/CHANGELOG.*
1316
/lib/

.prettierrc.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"singleQuote": true,
55
"printWidth": 120,
66
"arrowParens": "avoid",
7+
"endOfLine": "lf",
78
"overrides": [
89
{
910
// format .json5 files as jsonc for VS Code support

CLAUDE.md

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@ Beachball is a CLI tool for automating semantic version bumping, changelog gener
2222
| Format | `yarn format` |
2323
| Update snapshots | `yarn update-snapshots` |
2424

25-
### Required before each commit
26-
27-
- `yarn build`
28-
- `yarn test`
29-
- `yarn lint`
30-
- `yarn format`
31-
32-
### Required before creating a PR
33-
34-
Use `/beachball-change-files` to generate a Beachball change file. Use `yarn change` for `beachball change` and `yarn checkchange` for `beachball check`.
35-
3625
## Architecture
3726

3827
**Entry point:** `src/cli.ts` dispatches to commands: `check`, `change`, `bump`, `publish`, `canary`, `sync`, `init`, `config`.
@@ -52,7 +41,9 @@ Use `/beachball-change-files` to generate a Beachball change file. Use `yarn cha
5241

5342
**Option resolution:** CLI args > `beachball.config.js` (via cosmiconfig) > defaults. `getParsedOptions()` returns both raw `cliOptions` and merged `options`.
5443

55-
## Code Conventions
44+
## Coding standards
45+
46+
### Style and conventions
5647

5748
**No global state:** `process.cwd()`, `process.chdir()`, and `process.exit()` are banned via ESLint. All operations take an explicit `cwd` parameter. `process.exit()` should only be called in `cli.ts`.
5849

@@ -64,7 +55,27 @@ Use `/beachball-change-files` to generate a Beachball change file. Use `yarn cha
6455

6556
**Style:** Prettier with single quotes, 120 char width, trailing commas (ES5)
6657

67-
## Test Structure
58+
### Documentation
59+
60+
- You must update the documentation site when adding a new option or command
61+
- Also consider whether documentation site updates are needed for other new features or behavior changes
62+
- All headings in the documentation site and other markdown files must use sentence case
63+
64+
### Required before each commit
65+
66+
- `yarn build`
67+
- `yarn test`
68+
- `yarn lint`
69+
- `yarn format`
70+
71+
### Required before creating a PR
72+
73+
- Use `/beachball-change-files` to generate a Beachball change file. Use `yarn change` for `beachball change` and `yarn checkchange` for `beachball check`.
74+
- Consider whether the
75+
76+
## Testing
77+
78+
### Test structure
6879

6980
Three Jest projects:
7081

@@ -74,7 +85,7 @@ Three Jest projects:
7485

7586
Test helpers in `src/__fixtures__/` provide mock factories for repos, logs, package infos, and change files.
7687

77-
### Test writing tips
88+
### Test writing standards
7889

7990
- Avoid manually creating complex object structures (such as `PackageInfos`, `ChangeInfo`, `BumpInfo`, or `BeachballOptions`). Consider one of the following approaches instead:
8091
- call the real function for generating the structure if possible
@@ -84,3 +95,13 @@ Test helpers in `src/__fixtures__/` provide mock factories for repos, logs, pack
8495
- Any test of a function which writes to the console should call `initMockLogs()` to mock and capture output.
8596
- Beachball's logs are its UI. Often, tests should include complete inline snapshots of output (especially if it's only a few lines).
8697
- Where reasonable, prefer complete tests of values: `expect(someObj).toEqual({...})` rather than `expect(someObj.foo).toEqual(...)` or `expect(someObj).toMatchObject({...})`, or `expect(someArray).toEqual([...])` rather than `expect(someArray).toContain(...)`
98+
99+
## Documentation site
100+
101+
The doc site uses Vuepress and is located under `/docs`. It uses a separate yarn installation with Node 22 + Yarn 4 to get rid of very outdated deps while keeping beachball v2 on Node 14.
102+
103+
### Editing and validating docs
104+
105+
- If running in a standalone agent environment, you must run `cd docs && yarn` to install dependencies first
106+
- Doc changes can be validated with `cd docs && yarn docs:build`
107+
- If adding a new page, you MUST add it to the sidebar in `docs/.vuepress/config.ts`.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ target branch from remote (default: as configured in `git config init.defaultBra
6666

6767
### `--type`
6868

69-
for the `change` command: change type for all changed packages
69+
for the `change` command: [change type](https://microsoft.github.io/beachball/concepts/change-types.html) for all changed packages
7070

7171
### `--package`
7272

beachball.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// @ts-check
22
/** @type {Partial<import('./src/types/BeachballOptions').RepoOptions>}*/
33
const config = {
4+
branch: 'main',
5+
commit: false,
46
disallowedChangeTypes: ['major'],
57
ignorePatterns: [
68
'.*ignore',
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Update scripts",
4+
"packageName": "beachball",
5+
"email": "elcraig@microsoft.com",
6+
"dependentChangeType": "none"
7+
}

docs/.vuepress/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export default defineUserConfig({
2727
children: [
2828
'/concepts/bump-algorithm',
2929
'/concepts/change-files',
30+
'/concepts/change-types',
3031
'/concepts/ci-integration',
3132
'/concepts/groups',
3233
],

docs/README.md

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
1-
---
2-
home: true
3-
# heroImage: /hero.png
4-
heroText: The Sunniest Semantic Version Bumper
5-
tagline: Makes automating npm publishing a breeze
6-
actions:
7-
- text: Get Started →
8-
link: /overview/getting-started
9-
type: primary
1+
# Beachball doc site
102

11-
features:
12-
- title: Synchronized in git and npm
13-
details: 'keep your git and npm versions in sync in CI and local workflows'
14-
- title: Generates Changelogs
15-
details: same command will generate changelogs for your users
16-
- title: Automated Version Bumps
17-
details: one command line to bump package(s) in your repo with semver
18-
- title: Single or Monorepo
19-
details: compatible out of the box for single repo or monorepos
20-
- title: Pre-Publish Validation Checks
21-
details: double and triple check git repo and npm registry before publish
22-
- title: Zero Config Versioning
23-
details: no config is required to get started, do more in one line
24-
25-
footer: MIT Licensed | Copyright © 2019-present Microsoft
26-
---
3+
This site is built with Vuepress v2. It uses a separate yarn installation with Node 22 + Yarn 4 to get rid of very outdated deps while keeping beachball v2 on Node 14.

docs/index.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
home: true
3+
# heroImage: /hero.png
4+
heroText: The Sunniest Semantic Version Bumper
5+
tagline: Makes automating npm publishing a breeze
6+
actions:
7+
- text: Get Started →
8+
link: /overview/getting-started
9+
type: primary
10+
11+
features:
12+
- title: Synchronized in git and npm
13+
details: 'keep your git and npm versions in sync in CI and local workflows'
14+
- title: Generates Changelogs
15+
details: same command will generate changelogs for your users
16+
- title: Automated Version Bumps
17+
details: one command line to bump package(s) in your repo with semver
18+
- title: Single or Monorepo
19+
details: compatible out of the box for single repo or monorepos
20+
- title: Pre-Publish Validation Checks
21+
details: double and triple check git repo and npm registry before publish
22+
- title: Zero Config Versioning
23+
details: no config is required to get started, do more in one line
24+
25+
footer: MIT Licensed | Copyright © 2019-present Microsoft
26+
---

0 commit comments

Comments
 (0)