You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+35-14Lines changed: 35 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,17 +22,6 @@ Beachball is a CLI tool for automating semantic version bumping, changelog gener
22
22
| Format |`yarn format`|
23
23
| Update snapshots |`yarn update-snapshots`|
24
24
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`.
@@ -52,7 +41,9 @@ Use `/beachball-change-files` to generate a Beachball change file. Use `yarn cha
52
41
53
42
**Option resolution:** CLI args > `beachball.config.js` (via cosmiconfig) > defaults. `getParsedOptions()` returns both raw `cliOptions` and merged `options`.
54
43
55
-
## Code Conventions
44
+
## Coding standards
45
+
46
+
### Style and conventions
56
47
57
48
**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`.
58
49
@@ -64,7 +55,27 @@ Use `/beachball-change-files` to generate a Beachball change file. Use `yarn cha
64
55
65
56
**Style:** Prettier with single quotes, 120 char width, trailing commas (ES5)
66
57
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
68
79
69
80
Three Jest projects:
70
81
@@ -74,7 +85,7 @@ Three Jest projects:
74
85
75
86
Test helpers in `src/__fixtures__/` provide mock factories for repos, logs, package infos, and change files.
76
87
77
-
### Test writing tips
88
+
### Test writing standards
78
89
79
90
- Avoid manually creating complex object structures (such as `PackageInfos`, `ChangeInfo`, `BumpInfo`, or `BeachballOptions`). Consider one of the following approaches instead:
80
91
- 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
84
95
- Any test of a function which writes to the console should call `initMockLogs()` to mock and capture output.
85
96
- Beachball's logs are its UI. Often, tests should include complete inline snapshots of output (especially if it's only a few lines).
86
97
- 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`.
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.
0 commit comments