Skip to content

Commit

Permalink
update formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ecraig12345 committed Aug 30, 2023
1 parent 6fa7577 commit 23c071e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
*.log
*.snap
*.styl
*.svg
.*ignore
.DS_Store
.nojekyll
.nvmrc
docs/.vuepress/dist
/change/
/CHANGELOG.*
Expand Down
33 changes: 16 additions & 17 deletions src/__e2e__/bump.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,12 @@ describe('version bumping', () => {
const jsonPath = path.join(packagePath, 'package.json');
expect(fs.readJSONSync(jsonPath).version).toBe('1.1.0');
},
}
};

await bump({
path: repo.rootPath,
bumpDeps: false,
hooks
hooks,
} as BeachballOptions);

expect(postBumpCalled).toBe(true);
Expand All @@ -610,16 +610,16 @@ describe('version bumping', () => {
let postbumpCalled = false;

const hooks: BeachballOptions['hooks'] = {
postbump: async (packagePath, name, version) => {
postbumpCalled = true;
expect(packagePath.endsWith(path.join('packages', 'pkg-1'))).toBeTruthy();
expect(name).toBe('pkg-1');
expect(version).toBe('1.1.0');
postbump: async (packagePath, name, version) => {
postbumpCalled = true;
expect(packagePath.endsWith(path.join('packages', 'pkg-1'))).toBeTruthy();
expect(name).toBe('pkg-1');
expect(version).toBe('1.1.0');

const jsonPath = path.join(packagePath, 'package.json');
expect((await fs.readJSON(jsonPath)).version).toBe('1.1.0');
},
}
const jsonPath = path.join(packagePath, 'package.json');
expect((await fs.readJSON(jsonPath)).version).toBe('1.1.0');
},
};

await bump({
path: repo.rootPath,
Expand All @@ -642,17 +642,16 @@ describe('version bumping', () => {

repo.push();


const hooks: BeachballOptions['hooks'] = {
postbump: async (_packagePath, _name, _version): Promise<void> => {
throw new Error('Foo');
},
}
postbump: async (_packagePath, _name, _version): Promise<void> => {
throw new Error('Foo');
},
};

const bumpResult = bump({
path: repo.rootPath,
bumpDeps: false,
hooks
hooks,
} as BeachballOptions);

await expect(bumpResult).rejects.toThrow('Foo');
Expand Down
21 changes: 18 additions & 3 deletions src/types/BeachballOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,12 @@ export interface HooksOptions {
* @param version The post-bump version of the package to be published
* @param packageInfos Metadata about other packages processed by Beachball. Computed post-bump. Readonly.
*/
prepublish?: (packagePath: string, name: string, version: string, packageInfos: Readonly<PackageInfos>) => void | Promise<void>;
prepublish?: (
packagePath: string,
name: string,
version: string,
packageInfos: Readonly<PackageInfos>
) => void | Promise<void>;

/**
* Runs for each package after the publish command.
Expand All @@ -215,7 +220,12 @@ export interface HooksOptions {
* @param version The post-bump version of the package to be published
* @param packageInfos Metadata about other packages processed by Beachball. Computed post-bump. Readonly.
*/
postpublish?: (packagePath: string, name: string, version: string, packageInfos: Readonly<PackageInfos>) => void | Promise<void>;
postpublish?: (
packagePath: string,
name: string,
version: string,
packageInfos: Readonly<PackageInfos>
) => void | Promise<void>;

/**
* Runs for each package, before writing changelog and package.json updates
Expand All @@ -236,7 +246,12 @@ export interface HooksOptions {
* @param version The post-bump version of the package to be published
* @param packageInfos Metadata about other packages processed by Beachball. Computed post-bump. Readonly.
*/
postbump?: (packagePath: string, name: string, version: string, packageInfos: Readonly<PackageInfos>) => void | Promise<void>;
postbump?: (
packagePath: string,
name: string,
version: string,
packageInfos: Readonly<PackageInfos>
) => void | Promise<void>;

/**
* Runs once after all bumps to all packages before committing changes
Expand Down

0 comments on commit 23c071e

Please sign in to comment.