Skip to content

Commit

Permalink
chore(release): update packaging for 5.x.x beta
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Dec 6, 2017
1 parent e21eee0 commit 88ca302
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -7,7 +7,7 @@ node_js:
- '8'
os:
- linux
- osx
# - osx
matrix:
fast_finish: true
env:
Expand Down
15 changes: 15 additions & 0 deletions README.md
Expand Up @@ -28,6 +28,8 @@ how to get going.

- [Pact JS](#pact-js)
- [Installation](#installation)
- [Beta (5.x.x)](#beta-5xx)
- [Stable (4.x.x)](#stable-4xx)
- [Using Pact JS](#using-pact-js)
- [Consumer Side Testing](#consumer-side-testing)
- [API](#api)
Expand Down Expand Up @@ -59,11 +61,24 @@ how to get going.

## Installation

### Beta (5.x.x)

It's easy, simply run the below:
```
npm install --save-dev @pact-foundation/pact
```

_NOTE_: the `5.x.x` release is currently in *beta*, for the previous stable version see the [`4.x.x` branch](https://github.com/pact-foundation/pact-js/tree/4.x.x).

### Stable (4.x.x)

It's easy, simply run the below:
```
npm install --save-dev pact
```

See [`4.x.x` documentation](https://github.com/pact-foundation/pact-js/tree/4.x.x) for usage details.

## Using Pact JS

### Consumer Side Testing
Expand Down
8 changes: 3 additions & 5 deletions package.json
@@ -1,10 +1,9 @@
{
"name": "@pact-foundation/pact",
"version": "5.0.0",
"version": "5.0.1",
"description": "Pact for all things Javascript",
"main": "./src/pact.js",
"types": "./src/pact.d.ts",
"typings": "./src/types/custom.d.ts",
"main": "./pact.js",
"types": "./pact.d.ts",
"scripts": {
"build": "tsc",
"clean": "rimraf docs dist dist-web coverage .nyc_output logs pacts jscpd.json",
Expand All @@ -17,7 +16,6 @@
"posttest": "npm run test:karma",
"predist": "npm run clean && npm run lint && npm run jscpd",
"prerelease": "npm i && rm package-lock.json",
"publish": "./scripts/publish.sh",
"release": "standard-version",
"test": "nyc --check-coverage --reporter=html --reporter=text-summary mocha",
"test:examples": "npm run test:e2e-examples && npm run test:jest-examples && npm run test:mocha-examples && npm run test:ava-examples",
Expand Down
1 change: 1 addition & 0 deletions package.json.web
Expand Up @@ -4,6 +4,7 @@
"description": "Pact for the browser",
"main": "pact-web.js",
"scripts": {},
"types": "./pact-web.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/pact-foundation/pact-js.git"
Expand Down
13 changes: 10 additions & 3 deletions scripts/publish.sh
Expand Up @@ -3,7 +3,7 @@
mkdir -p dist-web

echo "--> Copy key artifacts into pact and pact-web distributions"
artifacts=(LICENSE *md)
artifacts=(LICENSE *md package.json)

for artifact in "${artifacts[@]}"; do
echo " Copying ${artifact} => ./dist/${artifact}"
Expand All @@ -14,13 +14,20 @@ done

echo "--> Releasing artifacts"
echo " Publishing pact..."
npm publish dist --tag beta --access public
npm publish dist --tag=beta --access public
echo " done!"

echo "--> Creating pact-web package"
VERSION=$(cat package.json | grep '\"version\"' | egrep -o "([0-9.]+)")
sed "s/VERSION/$VERSION/g" < package.json.web > dist-web/package.json
# Copy TS types
types=( $(find dist -name "*.d.ts" | sed 's/dist\///') )
for type in "${types[@]}"; do
echo " Copying ${type} => ./dist-web/${type}"
mkdir -p $(basename "./dist-web/${type}")
cp -r "dist/${type}" "./dist-web/${type}"
done

echo " Publishing pact-web..."
npm publish dist-web --tag beta --access public
npm publish dist-web --tag=beta --access public
echo " done!"

0 comments on commit 88ca302

Please sign in to comment.