Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ docs/.vuepress/.temp/
docs/.yarn
/CHANGELOG.*
change/
coverage/
dist/
lib/
LICENSE
Expand Down
11 changes: 11 additions & 0 deletions change/change-337918d3-ea78-4c2e-9b54-f1fe3587642e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"type": "none",
"comment": "Update formatting",
"packageName": "beachball",
"email": "elcraig@microsoft.com",
"dependentChangeType": "none"
}
]
}
6 changes: 3 additions & 3 deletions docs/concepts/groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ Example:
"name": "group name",
"include": ["packages/groupfoo/*"],
"exclude": ["!packages/groupfoo/bar"],
"disallowedChangeTypes": ["major"]
}
]
"disallowedChangeTypes": ["major"],
},
],
}
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"jest": "^29.0.0",
"lage": "^2.15.0",
"lint-staged": "^16.0.0",
"prettier": "~2.8.4",
"prettier": "~3.8.3",
"syncpack": "^9.0.0",
"ts-jest": "29.2.6",
"typescript": "~6.0.0",
Expand Down
7 changes: 5 additions & 2 deletions packages/beachball/src/__fixtures__/mockStdin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class MockStdin extends stream.Readable {
};
// This is a private property of the parent class. As of TS ES2022 output, it's necessary to use
// `declare` to prevent TS from emitting an unset property which overwrites the one from the parent.
protected declare _readableState?: {
declare protected _readableState?: {
length: number;
ended: boolean;
endEmitted: boolean;
Expand Down Expand Up @@ -162,7 +162,10 @@ class MockData {
pos = 0;
done = false;

constructor(private data: Buffer | string | null, public encoding?: BufferEncoding) {}
constructor(
private data: Buffer | string | null,
public encoding?: BufferEncoding
) {}

get length() {
if (Buffer.isBuffer(this.data)) {
Expand Down
6 changes: 3 additions & 3 deletions packages/beachball/src/__fixtures__/repositoryFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ export class RepositoryFactory {
fixtureParam === 'single'
? getSinglePackageFixture()
: fixtureParam === 'monorepo'
? getMonorepoFixture()
: // Clone the user-provided fixture so it's safe to modify
cloneObject(fixtureParam),
? getMonorepoFixture()
: // Clone the user-provided fixture so it's safe to modify
cloneObject(fixtureParam),
};
}

Expand Down
6 changes: 3 additions & 3 deletions packages/beachball/src/__functional__/git/fetch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('gitFetch', () => {
const logs = initMockLogs();

/** To speed things up, some tests only check the arguments and skip the git operation */
const noOpSuccess = () => ({ success: true, stdout: '', stderr: '', status: 0 } as GitProcessOutput);
const noOpSuccess = () => ({ success: true, stdout: '', stderr: '', status: 0 }) as GitProcessOutput;

const { git: realGit, gitFailFast: _realGitFailFast } = jest.requireActual<typeof workspaceTools>('workspace-tools');
const gitFailFast: typeof _realGitFailFast = (args, options) =>
Expand Down Expand Up @@ -81,7 +81,7 @@ describe('gitFetch', () => {

it('returns error but does not throw or log on failure by default', () => {
// This test uses controlled non-localized fake stdio so we can test the whole output
gitOverride = () => ({ success: false, stdout: 'some logs', stderr: 'oh no', status: 1 } as GitProcessOutput);
gitOverride = () => ({ success: false, stdout: 'some logs', stderr: 'oh no', status: 1 }) as GitProcessOutput;

const res = gitFetch({ cwd: repo.rootPath, remote: '', branch: defaultBranchName });
expect(res).toMatchObject({
Expand Down Expand Up @@ -125,7 +125,7 @@ describe('gitFetch', () => {
});

it('logs git output with failed fetch if verbose is true', () => {
gitOverride = () => ({ success: false, stdout: 'some logs', stderr: 'oh no', status: 1 } as GitProcessOutput);
gitOverride = () => ({ success: false, stdout: 'some logs', stderr: 'oh no', status: 1 }) as GitProcessOutput;

const res = gitFetch({ cwd: repo.rootPath, verbose: true, remote: '', branch: defaultBranchName });
expect(gitSpy).toHaveBeenCalledWith(['fetch'], expect.anything());
Expand Down
4 changes: 2 additions & 2 deletions packages/beachball/src/__tests__/publish/bumpAndPush.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ describe('bumpAndPush', () => {
/** Create a mock workspace-tools git() result */
function makeGitResult(opts: { success: boolean; output?: string }): GitProcessOutput {
return {
stderr: opts.success ? '' : opts.output ?? '',
stdout: opts.success ? opts.output ?? '' : '',
stderr: opts.success ? '' : (opts.output ?? ''),
stdout: opts.success ? (opts.output ?? '') : '',
success: opts.success,
status: opts.success ? 0 : 1,
} as GitProcessOutput;
Expand Down
14 changes: 7 additions & 7 deletions packages/beachball/src/changefile/isPackageIncluded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export function isPackageIncluded(
const reason = !packageInfo
? 'no corresponding package found'
: packageInfo.private
? `${packageInfo.name} is private`
: // This is a package-only option (can't be set at repo level or via CLI)
packageInfo.packageOptions?.shouldPublish === false
? `${packageInfo.name} has beachball.shouldPublish=false`
: !scopedPackages.has(packageInfo.name)
? `${packageInfo.name} is out of scope`
: ''; // not ignored
? `${packageInfo.name} is private`
: // This is a package-only option (can't be set at repo level or via CLI)
packageInfo.packageOptions?.shouldPublish === false
? `${packageInfo.name} has beachball.shouldPublish=false`
: !scopedPackages.has(packageInfo.name)
? `${packageInfo.name} is out of scope`
: ''; // not ignored

return { isIncluded: !reason, reason };
}
Expand Down
4 changes: 2 additions & 2 deletions packages/beachball/src/changefile/readChangeFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ export function readChangeFiles(
const warningType = !packageInfos[change.packageName]
? 'nonexistent'
: packageInfos[change.packageName].private
? 'private'
: undefined;
? 'private'
: undefined;
if (warningType) {
const resolution = options.groupChanges ? 'remove the entry from this file' : 'delete this file';
console.warn(
Expand Down
6 changes: 4 additions & 2 deletions packages/beachball/src/changelog/renderChangelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { renderPackageChangelog, defaultRenderers } from './renderPackageChangel
import type { ChangelogOptions, PackageChangelogRenderInfo } from '../types/ChangelogOptions';
import type { PackageChangelog } from '../types/ChangeLog';

export interface MarkdownChangelogRenderOptions
extends Omit<PackageChangelogRenderInfo, 'renderers' | 'defaultRenderers'> {
export interface MarkdownChangelogRenderOptions extends Omit<
PackageChangelogRenderInfo,
'renderers' | 'defaultRenderers'
> {
previousContent: string;
changelogOptions: ChangelogOptions;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function resolveSpecialVersion(params: {
return workspaceRange === '*'
? packageInfo.version
: workspaceRange === '^' || workspaceRange === '~'
? `${workspaceRange}${packageInfo.version}`
: workspaceRange;
? `${workspaceRange}${packageInfo.version}`
: workspaceRange;
}
}
74 changes: 37 additions & 37 deletions packages/beachball/src/types/BeachballOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,40 @@ export interface ParsedOptions {
options: BeachballOptions;
}

export interface CliOptions
extends Pick<
RepoOptions,
| 'access'
| 'authType'
| 'branch'
| 'bump'
| 'bumpDeps'
| 'canaryName'
| 'changehint'
| 'changeDir'
| 'commit'
| 'concurrency'
| 'depth'
| 'disallowedChangeTypes'
| 'disallowDeletedChangeFiles'
| 'fetch'
| 'fromRef'
| 'gitTags'
| 'gitTimeout'
| 'keepChangeFiles'
| 'message'
| 'new'
| 'npmReadConcurrency'
| 'packToPath'
| 'path'
| 'prereleasePrefix'
| 'publish'
| 'push'
| 'registry'
| 'retries'
| 'scope'
| 'tag'
| 'timeout'
> {
export interface CliOptions extends Pick<
RepoOptions,
| 'access'
| 'authType'
| 'branch'
| 'bump'
| 'bumpDeps'
| 'canaryName'
| 'changehint'
| 'changeDir'
| 'commit'
| 'concurrency'
| 'depth'
| 'disallowedChangeTypes'
| 'disallowDeletedChangeFiles'
| 'fetch'
| 'fromRef'
| 'gitTags'
| 'gitTimeout'
| 'keepChangeFiles'
| 'message'
| 'new'
| 'npmReadConcurrency'
| 'packToPath'
| 'path'
| 'prereleasePrefix'
| 'publish'
| 'push'
| 'registry'
| 'retries'
| 'scope'
| 'tag'
| 'timeout'
> {
/** Consider all packages to have changed */
all: boolean;
command: string;
Expand Down Expand Up @@ -291,8 +290,9 @@ export interface RepoOptions {
new: boolean;
}

export interface PackageOptions
extends Partial<Pick<RepoOptions, 'gitTags' | 'disallowedChangeTypes' | 'defaultNpmTag'>> {
export interface PackageOptions extends Partial<
Pick<RepoOptions, 'gitTags' | 'disallowedChangeTypes' | 'defaultNpmTag'>
> {
tag?: string | null;
/**
* Disable publishing a particular package.
Expand Down
18 changes: 9 additions & 9 deletions packages/beachball/src/types/DeepReadonly.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
export type DeepReadonly<T> = T extends (infer R)[]
? DeepReadonlyArray<R>
: // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
T extends Function
? T
: T extends Set<infer V>
? ReadonlySet<DeepReadonly<V>>
: T extends Map<infer K, infer V>
? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>
: T extends object
? DeepReadonlyObject<T>
: T;
T extends Function
? T
: T extends Set<infer V>
? ReadonlySet<DeepReadonly<V>>
: T extends Map<infer K, infer V>
? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>
: T extends object
? DeepReadonlyObject<T>
: T;

type DeepReadonlyArray<T> = ReadonlyArray<DeepReadonly<T>>;

Expand Down
4 changes: 2 additions & 2 deletions packages/beachball/src/validation/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ export function validate(
const message = options.all
? 'Considering the following packages due to --all'
: options.package
? 'Considering the specific --package'
: 'Found changes in the following packages';
? 'Considering the specific --package'
: 'Found changes in the following packages';
console.log(`${message}:\n${bulletedList([...changedPackages].sort())}`);
}

Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ __metadata:
jest: "npm:^29.0.0"
lage: "npm:^2.15.0"
lint-staged: "npm:^16.0.0"
prettier: "npm:~2.8.4"
prettier: "npm:~3.8.3"
syncpack: "npm:^9.0.0"
ts-jest: "npm:29.2.6"
typescript: "npm:~6.0.0"
Expand Down Expand Up @@ -5722,12 +5722,12 @@ __metadata:
languageName: node
linkType: hard

"prettier@npm:~2.8.4":
version: 2.8.8
resolution: "prettier@npm:2.8.8"
"prettier@npm:~3.8.3":
version: 3.8.3
resolution: "prettier@npm:3.8.3"
bin:
prettier: bin-prettier.js
checksum: 10c0/463ea8f9a0946cd5b828d8cf27bd8b567345cf02f56562d5ecde198b91f47a76b7ac9eae0facd247ace70e927143af6135e8cf411986b8cb8478784a4d6d724a
prettier: bin/prettier.cjs
checksum: 10c0/754816fd7593eb80f6376d7476d463e832c38a12f32775a82683adb6e35b772b1f484d65f19401507b983a8c8a7cd5a4a9f12006bd56491e8f35503473f77473
languageName: node
linkType: hard

Expand Down
Loading