From a1a78aef50504c0917dd7d85828f721e08f00e22 Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Fri, 12 Mar 2021 16:25:55 +1100 Subject: [PATCH] chore: Remove pact-web --- .gitignore | 1 - config/webpack.web.config.js | 55 --------------------------- examples/karma/jasmine/karma.conf.js | 1 - examples/karma/mocha/karma.conf.js | 2 - examples/nestjs-provider/package.json | 2 +- package.json | 14 ++----- package.json.web | 41 -------------------- scripts/ci/lib/prepare-release.sh | 17 +-------- scripts/ci/lib/publish-beta.sh | 6 +-- scripts/ci/lib/publish.sh | 4 -- 10 files changed, 6 insertions(+), 137 deletions(-) delete mode 100644 config/webpack.web.config.js delete mode 100644 package.json.web diff --git a/.gitignore b/.gitignore index 9d79e8f4e..8d8232fbb 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,6 @@ coverage # Compiled binary addons (http://nodejs.org/api/addons.html) build/Release dist -dist-web # Dependency directory node_modules diff --git a/config/webpack.web.config.js b/config/webpack.web.config.js deleted file mode 100644 index 4dbfe0ff8..000000000 --- a/config/webpack.web.config.js +++ /dev/null @@ -1,55 +0,0 @@ -/* eslint-disable */ -const path = require("path") -const webpack = require("webpack") -const DIST = path.resolve(__dirname, "../dist-web") -const APP = path.resolve(__dirname, "../dist") - -module.exports = { - entry: path.resolve(APP, "src/pact-web.js"), - mode: "production", - output: { - path: DIST, - library: "Pact", - libraryTarget: "umd", - umdNamedDefine: false, - filename: "pact-web.js", - }, - resolve: { - extensions: [".ts", ".tsx", ".js"], - }, - target: "web", - node: { - net: "empty", - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: [ - { - loader: "awesome-typescript-loader", - }, - ], - }, - { - test: APP, - exclude: /node_modules/, - use: [ - { - loader: "babel-loader", - query: { - presets: ["@babel/preset-env"], - }, - }, - ], - }, - ], - }, - - plugins: [ - new webpack.ProvidePlugin({ Promise: ["es6-promise", "Promise"] }), - new webpack.DefinePlugin({ "global.GENTLY": false }), - new webpack.IgnorePlugin(/vertx/), - ], - devtool: "source-map", -} diff --git a/examples/karma/jasmine/karma.conf.js b/examples/karma/jasmine/karma.conf.js index 357b856d6..5e6ff9ea4 100644 --- a/examples/karma/jasmine/karma.conf.js +++ b/examples/karma/jasmine/karma.conf.js @@ -15,7 +15,6 @@ module.exports = function (config) { // list of files / patterns to load in the browser files: [ // Local development - // '../../dist-web/pact-web.js', "../node_modules/@pact-foundation/pact-web/pact-web.js", "client.js", "client-spec.js", diff --git a/examples/karma/mocha/karma.conf.js b/examples/karma/mocha/karma.conf.js index b90c608c8..0e62cfd49 100644 --- a/examples/karma/mocha/karma.conf.js +++ b/examples/karma/mocha/karma.conf.js @@ -14,8 +14,6 @@ module.exports = function (config) { // list of files / patterns to load in the browser files: [ - // During development - // '../../dist-web/pact-web.js', // Example Using NPM package "../node_modules/@pact-foundation/pact-web/pact-web.js", "client.js", diff --git a/examples/nestjs-provider/package.json b/examples/nestjs-provider/package.json index 1e562732b..bed130ed1 100644 --- a/examples/nestjs-provider/package.json +++ b/examples/nestjs-provider/package.json @@ -53,7 +53,7 @@ "rootDir": ".", "testRegex": ".*\\.spec\\.ts$", "transform": { - "^.+\\.(t|j)s$": "ts-jest" + "^.+\\.ts$": "ts-jest" }, "collectCoverageFrom": [ "**/*.(t|j)s" diff --git a/package.json b/package.json index a0cffe3ce..6934460b0 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,10 @@ "build:v2": "npm run dist", "build:v3": "neon build --release", "compile": "rimraf dist && tsc", - "clean": "rimraf docs dist dist-web coverage .nyc_output logs pacts", + "clean": "rimraf docs dist coverage .nyc_output logs pacts", "clean:native": "rimraf native/target", "coverage": "nyc report --reporter=lcov", - "dist": "tsc && webpack --config ./config/webpack.web.config.js && copyfiles package.json ./dist", + "dist": "tsc && copyfiles package.json ./dist", "lint": "eslint --config .eslintrc.json '{src,test}/**/*.ts'", "lint:fix": "npm run lint -- --fix", "format:base": "prettier \"{src,test,examples}/**/*.{ts,js}\"", @@ -153,9 +153,7 @@ "@types/underscore": "^1.8.5", "@typescript-eslint/eslint-plugin": "^4.9.1", "@typescript-eslint/parser": "^4.9.1", - "awesome-typescript-loader": "^5.2.0", "babel-eslint": "~10.0.3", - "babel-loader": "^8.0.6", "chai": "~4.1.2", "chai-as-promised": "^7.1.1", "copyfiles": "^2.4.1", @@ -166,11 +164,8 @@ "eslint-import-resolver-typescript": "^2.3.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-prettier": "^3.2.0", - "imports-loader": "~0.7.1", "istanbul": "~0.4.5", "jasmine-core": "~2.9.1", - "json-loader": "~0.5.7", - "loader-utils": "^1.1.0", "lodash.clone": "^4.5.0", "mocha": "^7.2.0", "mocha-lcov-reporter": "^1.3.0", @@ -184,15 +179,12 @@ "sha256-file": "^1.0.0", "sinon": "^7.2.4", "sinon-chai": "^3.3.0", - "source-map-loader": "^0.2.1", "source-map-support": "^0.4.18", "standard-version": "^9.1.0", "superagent": "^3.8.2", "ts-mock-imports": "^1.2.6", "ts-node": "^3.3.0", - "typescript": "^3.8.3", - "webpack": "^4.45.0", - "webpack-cli": "^4.3.1" + "typescript": "^3.8.3" }, "binary": { "module_name": "index", diff --git a/package.json.web b/package.json.web deleted file mode 100644 index 543a54cb6..000000000 --- a/package.json.web +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@pact-foundation/pact-web", - "version": "VERSION", - "description": "Pact for the browser", - "main": "pact-web.js", - "scripts": {}, - "types": "./src/pact-web.d.ts", - "repository": { - "type": "git", - "url": "git+https://github.com/pact-foundation/pact-js.git" - }, - "engines": { - "node": ">=4" - }, - "keywords": [ - "pact", - "pact-js", - "javascript", - "contract testing", - "testing", - "consumer driven testing" - ], - "author": "Beth Skurrie (https://github.com/bethesque)", - "contributors": [ - { - "name": "Tarcio Saraiva", - "email": "tarcio@gmail.com", - "url": "http://twitter.com/tarciosaraiva" - }, - { - "name": "Matt Fellows", - "email": "m@onegeek.com.au", - "url": "http://twitter.com/matthewfellows" - } - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/pact-foundation/pact-js/issues" - }, - "homepage": "http://docs.pact.io/documentation/javascript.html" -} diff --git a/scripts/ci/lib/prepare-release.sh b/scripts/ci/lib/prepare-release.sh index 5ef1a430c..4b65100c5 100755 --- a/scripts/ci/lib/prepare-release.sh +++ b/scripts/ci/lib/prepare-release.sh @@ -6,29 +6,14 @@ require_binary grep require_binary sed require_binary find -mkdir -p dist-web VERSION="$("$SCRIPT_DIR/get-version.sh")" echo "--> Preparing release version ${VERSION}" -echo "--> Copy key artifacts into pact and pact-web distributions" +echo "--> Copy key artifacts into pact distribution" artifacts=(LICENSE *md package.json) for artifact in "${artifacts[@]}"; do echo " Copying ${artifact} => ./dist/${artifact}" cp "${artifact}" "./dist/${artifact}" - echo " Copying ${artifact} => ./dist-web/${artifact}" - cp "${artifact}" "./dist-web/${artifact}" -done - -echo "--> Creating pact-web package" -sed "s/VERSION/${VERSION}/g" < package.json.web > dist-web/package.json - -# Copy TS types across -types=( $(find dist -name "*.d.ts" | grep -v node_modules | sed 's/dist\///') ) -for type in "${types[@]}"; do - echo " Copying ${type} => ./dist-web/${type}" - echo "creating dir: $(dirname "./dist-web/${type}")" - mkdir -p "$(dirname "./dist-web/${type}")" - cp -r "dist/${type}" "./dist-web/${type}" done diff --git a/scripts/ci/lib/publish-beta.sh b/scripts/ci/lib/publish-beta.sh index d17ed2dc1..b7aa94ce5 100755 --- a/scripts/ci/lib/publish-beta.sh +++ b/scripts/ci/lib/publish-beta.sh @@ -15,8 +15,4 @@ echo "--> Releasing version ${VERSION}" echo "--> Releasing artifacts" echo " Publishing pact@${VERSION}..." npm publish dist --access public --tag beta -echo " done!" - -echo " Publishing pact-web@${VERSION}..." -npm publish dist-web --access public --tag beta -echo " done!" +echo " done!" \ No newline at end of file diff --git a/scripts/ci/lib/publish.sh b/scripts/ci/lib/publish.sh index 81582f593..094fc36bc 100755 --- a/scripts/ci/lib/publish.sh +++ b/scripts/ci/lib/publish.sh @@ -16,7 +16,3 @@ echo "--> Releasing artifacts" echo " Publishing pact@${VERSION}..." npm publish dist --access public --tag latest echo " done!" - -echo " Publishing pact-web@${VERSION}..." -npm publish dist-web --access public --tag latest -echo " done!"