Skip to content

Commit 7c8d340

Browse files
authored
Merge pull request #269 from pact-foundation/feat/pact-core
Rename to pact-core
2 parents fa5e190 + a74708d commit 7c8d340

13 files changed

Lines changed: 55 additions & 53 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Bug report
3-
about: Report a bug with pact-node
3+
about: Report a bug with pact-js-core
44
title: ''
55
labels: bug
66
assignees: ''

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ _This checklist is optional, but studies show that people who have followed it c
1919

2020
Before making a feature request, I have:
2121

22-
- [ ] [Searched the issues to check that this feature hasn't been requested before](https://github.com/pact-foundation/pact-node/issues?q=is%3Aissue)
22+
- [ ] [Searched the issues to check that this feature hasn't been requested before](https://github.com/pact-foundation/pact-js-core/issues?q=is%3Aissue)
2323
- [ ] Checked the documentation to see if it is possible to do what I want already
2424

2525
### Feature description
2626

27-
_Please describe what you would like Pact-node to do_
27+
_Please describe what you would like Pact-js-core to do_
2828

2929
### Use case
3030

3131
_What is the use case that motivates this feature request?_
3232

33-
_Please describe *why* you would like Pact-node to have this feature._
33+
_Please describe *why* you would like Pact-js-core to have this feature._

.github/issue_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ _Thank you for reporting an issue! We appreciate it very much. Issues are a big
22

33
_NOTE: If your issue is a how-to question, it is probably better asked in the pact-foundation slack channel, https://slack.pact.io/ _
44

5-
_This is the template for issues that aren't feature requests or bug reports. If your issue is a feature request or bug report, please use the relevant template from https://github.com/pact-foundation/pact-node/issues/new/choose - these will cover off the most common questions we ask and speed up a fix_
5+
_This is the template for issues that aren't feature requests or bug reports. If your issue is a feature request or bug report, please use the relevant template from https://github.com/pact-foundation/pact-js-core/issues/new/choose - these will cover off the most common questions we ask and speed up a fix_
66

77
_If you're reading this thinking "Hmmm, it is bug report/feature request, but neither of those templates work for what I want to report", then please feel free to ignore the template in whatever way you think best suits your issue. We trust you, you're awesome_
88

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ _Please read and then remove this section_
22

33
Thank you for making a pull request!
44

5-
Pact-node is built and maintained by developers like you, and we appreciate contributions very much. You are awesome!
5+
Pact-js-core is built and maintained by developers like you, and we appreciate contributions very much. You are awesome!
66

77
Our changelog is automatically built from our commit history, using conventional changelog. This means we'd like to take care that:
88

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Please provide the following information with your issue to enable us to respond
1313

1414
## I want to contribute code but don't know where to start
1515

16-
If you're not sure where to start, look for the [help wanted](https://github.com/pact-foundation/pact-node/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
17-
label in our issue tracker. If you have an idea that you think would be great, come and chat to us on [slack] in the `#pact-node` channel, or open a feature request issue.
16+
If you're not sure where to start, look for the [help wanted](https://github.com/pact-foundation/pact-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
17+
label in our issue tracker. If you have an idea that you think would be great, come and chat to us on [slack] in the `#pact-js` channel, or open a feature request issue.
1818

1919
## I'm ready to contribute code
2020

@@ -26,7 +26,7 @@ Pact Node uses the [Conventional Changelog](https://github.com/bcoe/conventional
2626
commit message conventions to simplify automation process. Please ensure you follow the guidelines.
2727

2828
You can take a look at the git history (`git log`) to get the gist of it.
29-
If you have questions, feel free to reach out in `#pact-node` in our [slack
29+
If you have questions, feel free to reach out in `#pact-js` in our [slack
3030
community](https://pact-foundation.slack.com/).
3131

3232
#### Release notes

README.md

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
<img src="https://raw.githubusercontent.com/pact-foundation/pact-logo/master/media/logo-black.png" width="200">
22

3-
![Build and test](https://github.com/pact-foundation/pact-node/workflows/Build%20and%20test/badge.svg)
4-
[![Known Vulnerabilities](https://snyk.io/test/github/pact-foundation/pact-node/badge.svg?targetFile=package.json)](https://snyk.io/test/github/pact-foundation/pact-node?targetFile=package.json)
5-
[![npm](https://img.shields.io/npm/v/@pact-foundation/pact-node.svg)](https://www.npmjs.com/package/@pact-foundation/pact-node)
6-
[![license](https://img.shields.io/github/license/pact-foundation/pact-node.svg)](https://github.com/pact-foundation/pact-node/blob/master/LICENSE)
7-
[![dependencies](https://img.shields.io/david/pact-foundation/pact-node.svg)](https://www.npmjs.com/package/@pact-foundation/pact-node)
3+
![Build and test](https://github.com/pact-foundation/pact-js-core/workflows/Build%20and%20test/badge.svg)
4+
[![Known Vulnerabilities](https://snyk.io/test/github/pact-foundation/pact-js-core/badge.svg?targetFile=package.json)](https://snyk.io/test/github/pact-foundation/pact-js-core?targetFile=package.json)
5+
[![npm](https://img.shields.io/npm/v/@pact-foundation/pact-core.svg)](https://www.npmjs.com/package/@pact-foundation/pact-core)
6+
[![license](https://img.shields.io/github/license/pact-foundation/pact-js-core.svg)](https://github.com/pact-foundation/pact-js-core/blob/master/LICENSE)
7+
[![dependencies](https://img.shields.io/david/pact-foundation/pact-js-core.svg)](https://www.npmjs.com/package/@pact-foundation/pact-core)
88
[![slack](http://slack.pact.io/badge.svg)](http://slack.pact.io)
99

10-
# Pact Node
10+
# Pact-JS Core
1111

12-
An idiomatic Node wrapper for the [Pact](http://pact.io) [CLI Tools](https://github.com/pact-foundation/pact-ruby-standalone).
12+
**This is the core of pact-js. Unless you are wanting to develop tools for the pact ecosystem, you almost certainly want to install [`@pact-foundation/pact`](https://github.com/pact-foundation/pact-js/) instead**.
1313

14-
***NOTE*: If you are new to Pact and are wanting to get started with contract testing, you almost certainly don't want to use this package. Head over to [Pact JS](https://github.com/pact-foundation/pact-js/) instead.**
14+
A wrapper for the [Pact](http://pact.io) [CLI Tools](https://github.com/pact-foundation/pact-ruby-standalone).
15+
16+
***If you are new to Pact and are wanting to get started with contract testing, you almost certainly don't want to use this package. Head over to [Pact JS](https://github.com/pact-foundation/pact-js/) instead.**
1517

1618
<!-- TOC -->
1719

18-
- [Pact Node](#pact-node)
20+
- [Pact Core](#pact-js-core)
1921
- [Installation](#installation)
2022
- [Do Not Track](#do-not-track)
2123
- [Pact Download Location](#pact-download-location)
@@ -47,7 +49,7 @@ An idiomatic Node wrapper for the [Pact](http://pact.io) [CLI Tools](https://git
4749

4850
## Installation
4951

50-
`npm install @pact-foundation/pact-node --save`
52+
`npm install @pact-foundation/pact-core --save-dev`
5153

5254
### Do Not Track
5355

@@ -79,7 +81,7 @@ For those that are behind a corporate firewall or are seeing issues where our pa
7981
}
8082
```
8183

82-
It will accept both a local path or an http(s) url. It must point to the directory containing the binary needed as the binary name is appended to the end of the location. For the example given above, Pact will look for the binary at `/home/some-user/Downloads/pact-1.44.0-win32.zip` for a Windows system. However, by using this method, you must use the correct Pact version binary associated with this version of Pact-Node. For extra security measurements, checksum validation has been added to prevent tampering with the binaries.
84+
It will accept both a local path or an http(s) url. It must point to the directory containing the binary needed as the binary name is appended to the end of the location. For the example given above, Pact will look for the binary at `/home/some-user/Downloads/pact-1.44.0-win32.zip` for a Windows system. However, by using this method, you must use the correct Pact version binary associated with this version of Pact-Core. For extra security measurements, checksum validation has been added to prevent tampering with the binaries.
8385

8486
If your environment uses self-signed certificates from an internal Certificate Authority (CA), you can configure this using the standard options in an [npmrc](https://docs.npmjs.com/configuring-npm/npmrc.html) file as per below:
8587

@@ -95,7 +97,7 @@ You can also force Pact to skip the installation of the binary during `npm insta
9597
setting `PACT_SKIP_BINARY_INSTALL=true`. This feature is useful if you want to speed up
9698
builds that don't need Pact and don't want to modify your projects dependencies.
9799

98-
Note that pact-node will not be functional without the binary.
100+
Note that pact-core will not be functional without the binary.
99101

100102
```bash
101103
PACT_SKIP_BINARY_INSTALL=true npm install
@@ -121,7 +123,7 @@ TL;DR - you almost always want Pact JS.
121123
Simply require the library and call the create function to start the mock service
122124

123125
```js
124-
var pact = require("@pact-foundation/pact-node");
126+
var pact = require("@pact-foundation/pact-core");
125127
var server = pact.createServer({ port: 9999 });
126128
server.start().then(function() {
127129
// Do your testing/development here
@@ -131,7 +133,7 @@ server.start().then(function() {
131133
Or if you're using Typescript instead of plain old Javascript
132134

133135
```ts
134-
import pact from "@pact-foundation/pact-node";
136+
import pact from "@pact-foundation/pact-core";
135137
const server = pact.createServer({ port: 9999 });
136138
server.start().then(() => {
137139
// Do your testing/development here
@@ -151,7 +153,7 @@ To see the list commands possible with the CLI, simply ask for help `$# pact --h
151153
### Set Log Level
152154

153155
```js
154-
var pact = require("@pact-foundation/pact-node");
156+
var pact = require("@pact-foundation/pact-core");
155157
pact.logLevel("debug");
156158
```
157159

@@ -162,7 +164,7 @@ Mock servers are used by Pact to record interactions and create pact contracts.
162164
#### Create Mock Server
163165

164166
```js
165-
var pact = require('@pact-foundation/pact-node');
167+
var pact = require('@pact-foundation/pact-core');
166168
var server = pact.createServer({
167169
...
168170
});
@@ -193,7 +195,7 @@ var server = pact.createServer({
193195
If you ever need to see which servers are currently created.
194196

195197
```js
196-
var pact = require("@pact-foundation/pact-node");
198+
var pact = require("@pact-foundation/pact-core");
197199
var servers = pact.listServers();
198200
console.log(JSON.stringify(servers));
199201
```
@@ -203,7 +205,7 @@ console.log(JSON.stringify(servers));
203205
Remove all servers once you're done with them in one fell swoop.
204206

205207
```js
206-
var pact = require("@pact-foundation/pact-node");
208+
var pact = require("@pact-foundation/pact-core");
207209
pact.removeAllServers();
208210
```
209211

@@ -212,7 +214,7 @@ pact.removeAllServers();
212214
Start the current server.
213215

214216
```js
215-
var pact = require("@pact-foundation/pact-node");
217+
var pact = require("@pact-foundation/pact-core");
216218
pact.createServer()
217219
.start()
218220
.then(function() {
@@ -225,7 +227,7 @@ pact.createServer()
225227
Stop the current server.
226228

227229
```js
228-
var pact = require("@pact-foundation/pact-node");
230+
var pact = require("@pact-foundation/pact-core");
229231
pact.createServer()
230232
.stop()
231233
.then(function() {
@@ -238,7 +240,7 @@ pact.createServer()
238240
Stop the current server and deletes it from the list.
239241

240242
```js
241-
var pact = require("@pact-foundation/pact-node");
243+
var pact = require("@pact-foundation/pact-core");
242244
pact.createServer()
243245
.delete()
244246
.then(function() {
@@ -249,7 +251,7 @@ pact.createServer()
249251
#### Check if a Mock server is running
250252

251253
```js
252-
var pact = require("@pact-foundation/pact-node");
254+
var pact = require("@pact-foundation/pact-core");
253255
pact.createServer().running;
254256
```
255257

@@ -258,7 +260,7 @@ pact.createServer().running;
258260
There's 3 different events available, 'start', 'stop' and 'delete'. They can be listened to the same way as an [EventEmitter](https://nodejs.org/api/events.html).
259261

260262
```js
261-
var pact = require("@pact-foundation/pact-node");
263+
var pact = require("@pact-foundation/pact-core");
262264
var server = pact.createServer();
263265
server.on("start", function() {
264266
console.log("started");
@@ -276,7 +278,7 @@ server.on("delete", function() {
276278
Read more about [Verify Pacts](https://github.com/realestate-com-au/pact/wiki/Verifying-pacts).
277279

278280
```js
279-
var pact = require('@pact-foundation/pact-node');
281+
var pact = require('@pact-foundation/pact-core');
280282

281283
pact.verifyPacts({
282284
...
@@ -313,7 +315,7 @@ pact.verifyPacts({
313315
### Pact Broker Publishing
314316

315317
```js
316-
var pact = require('@pact-foundation/pact-node');
318+
var pact = require('@pact-foundation/pact-core');
317319
var opts = {
318320
...
319321
};
@@ -339,7 +341,7 @@ pact.publishPacts(opts).then(function () {
339341
### Pact Broker Deployment Check
340342

341343
```js
342-
var pact = require('@pact-foundation/pact-node');
344+
var pact = require('@pact-foundation/pact-core');
343345
var opts = {
344346
...
345347
};
@@ -386,7 +388,7 @@ The interface is comparable to the Mock Server API.
386388
#### Create Stub Server
387389

388390
```js
389-
var pact = require('@pact-foundation/pact-node');
391+
var pact = require('@pact-foundation/pact-core');
390392
var server = pact.createStub({
391393
...
392394
});
@@ -411,7 +413,7 @@ var server = pact.createStub({
411413
#### Create Message Pacts
412414

413415
```js
414-
var pact = require('@pact-foundation/pact-node');
416+
var pact = require('@pact-foundation/pact-core');
415417
var message = pact.createMessage({
416418
...
417419
});
@@ -454,7 +456,7 @@ This means you may call them direct from scripts in your package json, for examp
454456
"scripts": {
455457
"pactPublish": "pact-broker publish ./pacts --consumer-app-version=$\(git describe\) --broker-base-url=$BROKER_BASE_URL --broker-username=$BROKER_USERNAME --broker-password=BROKER_PASSWORD"`
456458
}
457-
These are available in circumstances where `pact-node` has not yet implemented a feature or access via JavaScript APIs is not desirable. To run the binaries is as simple as the following:
459+
These are available in circumstances where `pact-core` has not yet implemented a feature or access via JavaScript APIs is not desirable. To run the binaries is as simple as the following:
458460
459461
*Example can-i-deploy check*:
460462
```sh
@@ -482,7 +484,7 @@ The following are the binaries currently made available:
482484

483485
### Enable Long Paths
484486

485-
[Windows has a default path length limit of 260](https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file#maximum-path-length-limitation) causing issues with projects that are nested deep inside several directory and with how npm handles node_modules directory structures. To fix this issue, please enable Windows Long Paths in the registry by running `regedit.exe`, find the key `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled` and change the value from `0` to `1`, then reboot your computer. Pact should now work as it should, if not, please [raise an issue on github](https://github.com/pact-foundation/pact-node/issues).
487+
[Windows has a default path length limit of 260](https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file#maximum-path-length-limitation) causing issues with projects that are nested deep inside several directory and with how npm handles node_modules directory structures. To fix this issue, please enable Windows Long Paths in the registry by running `regedit.exe`, find the key `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled` and change the value from `0` to `1`, then reboot your computer. Pact should now work as it should, if not, please [raise an issue on github](https://github.com/pact-foundation/pact-js-core/issues).
486488

487489
## Contributing
488490

RELEASING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies in `scripts/ci/lib`.
3636
## Kicking off a release
3737

3838
You must be able to create a github access token with `repo` scope to the
39-
pact-node repository.
39+
pact-js-core repository.
4040

4141
- Set an environment variable `GITHUB_ACCESS_TOKEN_FOR_PF_RELEASES` to this token.
4242
- Make sure master contains the code you want to release
@@ -69,7 +69,7 @@ may need to rebase them on top of the tagged release commit and force push.
6969

7070
## Releasing Pact Node Manually
7171

72-
If any changes needs to be released, let it be dependencies or code, you must have access to push directly to master on the pact-node repo, then follow these steps:
72+
If any changes needs to be released, let it be dependencies or code, you must have access to push directly to master on the pact-js-core repo, then follow these steps:
7373

7474
- Run `npm ci --ignore-scripts` to confirm that the dependencies are appropriately configured.
7575
- Run `npm test` first to make sure all tests pass. This will also build and download the appropriate checksums.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "@pact-foundation/pact-node",
2+
"name": "@pact-foundation/pact-core",
33
"version": "10.11.11",
4-
"description": "A wrapper for the Ruby version of Pact to work within Node",
4+
"description": "Core of @pact-foundation/pact. You almost certainly don't want to depend on this directly.",
55
"main": "src/index.js",
6-
"homepage": "https://github.com/pact-foundation/pact-node#readme",
6+
"homepage": "https://github.com/pact-foundation/pact-js-core#readme",
77
"types": "src/index.d.ts",
88
"bin": {
99
"pact": "bin/pact.js",
@@ -27,7 +27,7 @@
2727
},
2828
"repository": {
2929
"type": "git",
30-
"url": "git://github.com/pact-foundation/pact-node.git"
30+
"url": "git://github.com/pact-foundation/pact-js-core.git"
3131
},
3232
"keywords": [
3333
"pact",
@@ -44,7 +44,7 @@
4444
],
4545
"license": "MIT",
4646
"bugs": {
47-
"url": "https://github.com/pact-foundation/pact-node/issues"
47+
"url": "https://github.com/pact-foundation/pact-js-core/issues"
4848
},
4949
"publishConfig": {
5050
"access": "public"

script/ci/lib/publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ echo "--> Preparing npmrc file"
1212
echo "--> Releasing version ${VERSION}"
1313

1414
echo "--> Releasing artifacts"
15-
echo " Publishing pact-node@${VERSION}..."
15+
echo " Publishing pact-core@${VERSION}..."
1616
npm publish --access public --tag latest
1717
echo " done!"

src/logger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const createLogger = (level: LogLevels = DEFAULT_LEVEL): Logger =>
1212
pino({
1313
level: level.toLowerCase(),
1414
prettyPrint: {
15-
messageFormat: `pact-node@${pkg.version}: {msg}`,
15+
messageFormat: `pact-core@${pkg.version}: {msg}`,
1616
translateTime: true,
1717
},
1818
});

0 commit comments

Comments
 (0)