From 88ca30287cbd72d3abb6a18462e279c4c716d0f7 Mon Sep 17 00:00:00 2001 From: Matt Fellows Date: Thu, 7 Dec 2017 08:23:25 +1100 Subject: [PATCH] chore(release): update packaging for 5.x.x beta --- .travis.yml | 2 +- README.md | 15 +++++++++++++++ package.json | 8 +++----- package.json.web | 1 + scripts/publish.sh | 13 ++++++++++--- 5 files changed, 30 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4eca65b5c..950fa6030 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ node_js: - '8' os: - linux -- osx +# - osx matrix: fast_finish: true env: diff --git a/README.md b/README.md index bd08d8b44..cc2b8f7ac 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 diff --git a/package.json b/package.json index a649a33de..a82b6d659 100644 --- a/package.json +++ b/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", @@ -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", diff --git a/package.json.web b/package.json.web index 621d802c8..7a8c76125 100644 --- a/package.json.web +++ b/package.json.web @@ -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" diff --git a/scripts/publish.sh b/scripts/publish.sh index 37b8ab95c..0f69fecbe 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -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}" @@ -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!"