From 23c071e2e4245a5ef3a96e50c766bc56794ebfd6 Mon Sep 17 00:00:00 2001 From: Elizabeth Craig Date: Wed, 30 Aug 2023 16:26:03 -0700 Subject: [PATCH] update formatting --- .prettierignore | 3 +++ src/__e2e__/bump.test.ts | 33 ++++++++++++++++----------------- src/types/BeachballOptions.ts | 21 ++++++++++++++++++--- 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/.prettierignore b/.prettierignore index 36a5c5a18..50b89dc22 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,8 +1,11 @@ +*.log *.snap *.styl *.svg .*ignore +.DS_Store .nojekyll +.nvmrc docs/.vuepress/dist /change/ /CHANGELOG.* diff --git a/src/__e2e__/bump.test.ts b/src/__e2e__/bump.test.ts index a11e93c6a..40fb07678 100644 --- a/src/__e2e__/bump.test.ts +++ b/src/__e2e__/bump.test.ts @@ -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); @@ -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, @@ -642,17 +642,16 @@ describe('version bumping', () => { repo.push(); - const hooks: BeachballOptions['hooks'] = { - postbump: async (_packagePath, _name, _version): Promise => { - throw new Error('Foo'); - }, - } + postbump: async (_packagePath, _name, _version): Promise => { + throw new Error('Foo'); + }, + }; const bumpResult = bump({ path: repo.rootPath, bumpDeps: false, - hooks + hooks, } as BeachballOptions); await expect(bumpResult).rejects.toThrow('Foo'); diff --git a/src/types/BeachballOptions.ts b/src/types/BeachballOptions.ts index 902dcbc2a..39b196732 100644 --- a/src/types/BeachballOptions.ts +++ b/src/types/BeachballOptions.ts @@ -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) => void | Promise; + prepublish?: ( + packagePath: string, + name: string, + version: string, + packageInfos: Readonly + ) => void | Promise; /** * Runs for each package after the publish command. @@ -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) => void | Promise; + postpublish?: ( + packagePath: string, + name: string, + version: string, + packageInfos: Readonly + ) => void | Promise; /** * Runs for each package, before writing changelog and package.json updates @@ -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) => void | Promise; + postbump?: ( + packagePath: string, + name: string, + version: string, + packageInfos: Readonly + ) => void | Promise; /** * Runs once after all bumps to all packages before committing changes