Skip to content

Commit 00ade0d

Browse files
authored
Merge pull request #1221 from pact-foundation/chore/update_imports_to_pact-cli
chore: update pact cli invocation usage to @pact-foundation/pact-cli
2 parents 54087fa + bfc05dc commit 00ade0d

31 files changed

+8358
-1612
lines changed

.mocharc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"bail": true,
33
"require": [
44
"ts-node/register",
5-
"./test/helper.ts",
65
"source-map-support/register"
76
],
87
"fullTrace": true,

MIGRATION.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Pact-js migration guide
22

3+
# 12.x.x -> 13.x.x
4+
5+
## Breaking Changes
6+
7+
All CLI/API functionality provided by the Pact CLI tools (ruby based) now migrated to
8+
9+
* Repo
10+
11+
* https://github.com/pact-foundation/pact-js-cli/
12+
13+
* NPM Package
14+
15+
* https://www.npmjs.com/package/@pact-foundation/pact-cli
16+
17+
* imports
18+
19+
* `@pact-foundation/pact-core` imports will now become `@pact-foundation/pact-cli` for programatic usage of the CLI tools
20+
21+
* npx usage
22+
23+
* `npx --package=@pact-foundation/pact-cli@15.0.0 -c pact-broker`
24+
325
# 11.x.x -> 12.x.x
426

527
- Node versions less than 16 are no longer supported

docs/consumer.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,40 @@ describe('GET /dogs', () => {
153153
```
154154

155155
Read on about [matching](/docs/matching.md)
156+
157+
## Publishing Pacts to a Broker
158+
159+
Sharing is caring - to simplify sharing Pacts between Consumers and Providers, we have created the [Pact Broker](https://docs.pact.io/pact_broker).
160+
161+
The Broker:
162+
163+
- versions your contracts
164+
- tells you which versions of your applications can be deployed safely together
165+
- allows you to deploy your services independently
166+
- provides API documentation of your applications that is guaranteed to be up-to date
167+
- visualises the relationships between your services
168+
- integrates with other systems, such as Slack or your CI server, via webhooks
169+
- ...and much much [more](https://docs.pact.io/getting_started/sharing_pacts).
170+
171+
[Host your own using the open source docker image](https://docs.pact.io/pact_broker/docker_images), or sign-up for a [free hosted Pact Broker](https://pactflow.io) with our friends at PactFlow.
172+
173+
### Publish in npm scripts
174+
175+
The easiest way to publish pacts to the broker is via an npm script in your package.json:
176+
177+
```
178+
179+
"test:publish": "./node_modules/.bin/pact-broker publish <YOUR_PACT_FILES_OR_DIR> --consumer-app-version=\"$(npx absolute-version)\" --auto-detect-version-properties --broker-base-url=https://your-broker-url.example.com"
180+
```
181+
182+
You'll need to install [`@pact-foundation/pact-cli`](https://github.com/pact-foundation/pact-js-cli) package to use the `pact-broker` command. This is a standalone package that can be installed via npm.
183+
184+
For a full list of the options, see the [CLI usage instructions](https://github.com/pact-foundation/pact-ruby-standalone/releases).
185+
186+
All CLI binaries are available in npm scripts when using pact-js-cli `@pact-foundation/pact-cli`.
187+
188+
If you want to pass your username and password to the broker without including
189+
them in scripts, you can provide it via the environment variables
190+
`PACT_BROKER_USERNAME` and `PACT_BROKER_PASSWORD`. If your broker supports an
191+
access token instead of a password, use the environment variable
192+
`PACT_BROKER_TOKEN`.

docs/provider.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -274,40 +274,6 @@ For each _interaction_ in a pact file, the order of execution is as follows:
274274

275275
If any of the middleware or hooks fail, the tests will also fail.
276276

277-
### Publishing Pacts to a Broker
278-
279-
Sharing is caring - to simplify sharing Pacts between Consumers and Providers, we have created the [Pact Broker](https://docs.pact.io/pact_broker).
280-
281-
The Broker:
282-
283-
- versions your contracts
284-
- tells you which versions of your applications can be deployed safely together
285-
- allows you to deploy your services independently
286-
- provides API documentation of your applications that is guaranteed to be up-to date
287-
- visualises the relationships between your services
288-
- integrates with other systems, such as Slack or your CI server, via webhooks
289-
- ...and much much [more](https://docs.pact.io/getting_started/sharing_pacts).
290-
291-
[Host your own using the open source docker image](https://docs.pact.io/pact_broker/docker_images), or sign-up for a [free hosted Pact Broker](https://pactflow.io) with our friends at PactFlow.
292-
293-
#### Publish in npm scripts
294-
295-
The easiest way to publish pacts to the broker is via an npm script in your package.json:
296-
297-
```
298-
299-
"test:publish": "./node_modules/.bin/pact-broker publish <YOUR_PACT_FILES_OR_DIR> --consumer-app-version=\"$(npx absolute-version)\" --auto-detect-version-properties --broker-base-url=https://your-broker-url.example.com"
300-
```
301-
302-
For a full list of the options, see the [CLI usage instructions](https://github.com/pact-foundation/pact-ruby-standalone/releases).
303-
All CLI binaries are available in npm scripts when using pact-js.
304-
305-
If you want to pass your username and password to the broker without including
306-
them in scripts, you can provide it via the environment variables
307-
`PACT_BROKER_USERNAME` and `PACT_BROKER_PASSWORD`. If your broker supports an
308-
access token instead of a password, use the environment variable
309-
`PACT_BROKER_TOKEN`.
310-
311277
#### Publishing Verification Results to a Pact Broker
312278

313279
If you're using a [Pact Broker](https://docs.pact.io/pact_broker), (e.g. a hosted one with our friends at [PactFlow](https://pactflow.io)), you can

0 commit comments

Comments
 (0)