Skip to content

Commit

Permalink
chore: remove pact-plugin-cli as not used with ruby-core
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Feb 23, 2024
1 parent 628ebf4 commit 940932e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 56 deletions.
13 changes: 0 additions & 13 deletions bin/pact-plugin-cli.ts

This file was deleted.

2 changes: 2 additions & 0 deletions src/can-deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export class CanDeploy {
public static convertForSpawnBinary(
options: CanDeployOptions
): CanDeployOptions[] {
// @ts-expect-error Property 'pacticipants' is missing in type
return _.flatten(
[_.omit(options, 'pacticipants')].concat(
// @ts-expect-error Property 'pactBroker' is missing in type
options.pacticipants.map(({ name, latest, version }) => [
{ name },
version
Expand Down
32 changes: 0 additions & 32 deletions src/pact-standalone.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ describe('Pact Standalone', function forMocha() {
expect(pact.pactFullPath).to.contain('pact');
expect(pact.pactflowPath).to.contain('pactflow');
expect(pact.pactflowFullPath).to.contain('pactflow');
expect(pact.pactPluginCliPath).to.contain('pact-plugin-cli');
expect(pact.pactPluginCliFullPath).to.contain('pact-plugin-cli');
});

it("should return the base directory of the project with 'cwd' (where the package.json file is)", () => {
Expand Down Expand Up @@ -102,14 +100,6 @@ describe('Pact Standalone', function forMocha() {
it('pactflow full path', () => {
expect(fs.existsSync(pact.pactflowFullPath)).to.be.true;
});
it('pact-plugin-cli relative path', () => {
expect(fs.existsSync(path.resolve(basePath, pact.pactPluginCliPath)))
.to.be.true;
});

it('pact-plugin-cli full path', () => {
expect(fs.existsSync(pact.pactPluginCliFullPath)).to.be.true;
});
});

describe('Linux X64', () => {
Expand Down Expand Up @@ -172,15 +162,6 @@ describe('Pact Standalone', function forMocha() {
it('pactflow full path', () => {
expect(fs.existsSync(pact.pactflowFullPath)).to.be.true;
});

it('pact-plugin-cli relative path', () => {
expect(fs.existsSync(path.resolve(basePath, pact.pactPluginCliPath)))
.to.be.true;
});

it('pact-plugin-cli full path', () => {
expect(fs.existsSync(pact.pactPluginCliFullPath)).to.be.true;
});
});
}

Expand All @@ -206,10 +187,6 @@ describe('Pact Standalone', function forMocha() {
expect(pact.pactflowPath).to.contain('pactflow.bat');
expect(pact.pactflowFullPath).to.contain('pactflow.bat');
});
it("should add '.exe' to the end of the binary names", () => {
expect(pact.pactPluginCliPath).to.contain('pact-plugin-cli.exe');
expect(pact.pactPluginCliFullPath).to.contain('pact-plugin-cli.exe');
});

it('broker relative path', () => {
console.log('broker path', {
Expand Down Expand Up @@ -265,15 +242,6 @@ describe('Pact Standalone', function forMocha() {
it('pactflow full path', () => {
expect(fs.existsSync(pact.pactflowPath)).to.be.true;
});

it('pact-plugin-cli relative path', () => {
expect(fs.existsSync(path.resolve(basePath, pact.pactPluginCliPath))).to
.be.true;
});

it('pact-plugin-cli full path', () => {
expect(fs.existsSync(pact.pactPluginCliFullPath)).to.be.true;
});
});
});
});
9 changes: 0 additions & 9 deletions src/pact-standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export interface PactStandalone {
pactFullPath: string;
pactflowPath: string;
pactflowFullPath: string;
pactPluginCliPath: string;
pactPluginCliFullPath: string;
}

export const standalone = (
Expand All @@ -28,16 +26,13 @@ export const standalone = (
): PactStandalone => {
const binName = (name: string): string =>
`${name}${pactEnvironment.isWindows(platform) ? '.bat' : ''}`;
const exeName = (name: string): string =>
`${name}${pactEnvironment.isWindows(platform) ? '.exe' : ''}`;
const mock = binName('pact-mock-service');
const message = binName('pact-message');
const verify = binName('pact-provider-verifier');
const broker = binName('pact-broker');
const stub = binName('pact-stub-service');
const pact = binName('pact');
const pactflow = binName('pactflow');
const pactPluginCli = exeName('pact-plugin-cli');
const basePath = path.join(
'standalone',
getBinaryEntry(platform, arch).folderName,
Expand Down Expand Up @@ -65,10 +60,6 @@ export const standalone = (
pactflowFullPath: path
.resolve(pactEnvironment.cwd, basePath, pactflow)
.trim(),
pactPluginCliPath: path.join(basePath, pactPluginCli),
pactPluginCliFullPath: path
.resolve(pactEnvironment.cwd, basePath, pactPluginCli)
.trim(),
verifierPath: path.join(basePath, verify),
verifierFullPath: path
.resolve(pactEnvironment.cwd, basePath, verify)
Expand Down
2 changes: 2 additions & 0 deletions src/pact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ export class Pact {

// Remove all the servers and stubs
public removeAll(): q.Promise<AbstractService[]> {
// @ts-expect-error Type 'Promise<[AbstractService, unknown, unknown, unknown, unknown, unknown]>' is not assignable to type 'Promise<AbstractService[]>'
return q.all<AbstractService>(
// @ts-expect-error Argument of type '(Promise<Server[]> | Promise<Stub[]>)[]' is not assignable to parameter of type 'IWhenable<IWhenable<AbstractService>[]>'.
_.flatten([this.removeAllStubs(), this.removeAllServers()])
);
// .tap(endDestination);
Expand Down
4 changes: 2 additions & 2 deletions standalone/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export function createConfig(location: string = process.cwd()): Config {
folderName: `linux-arm64-${PACT_STANDALONE_VERSION}`,
downloadLocation: PACT_BINARY_LOCATION,
},
],
],
};
}

Expand Down Expand Up @@ -376,7 +376,7 @@ function extract(data: Data): Promise<Data> {

export function getBinaryEntry(platform?: string, arch?: string): BinaryEntry {
platform = platform || process.platform;
arch = arch || process.arch;
arch = arch || process.arch;
for (let value of CONFIG.binaries) {
if (
value.platform === platform &&
Expand Down

0 comments on commit 940932e

Please sign in to comment.