Skip to content

Commit

Permalink
Fix packages/* scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Oct 17, 2017
1 parent 8c1878d commit fe509d4
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 21 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_book/
build/
node_modules/
**/node_modules/
10 changes: 7 additions & 3 deletions packages/enzyme-adapter-react-14/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"main": "build",
"scripts": {
"clean": "rimraf build",
"lint": "eslint --ext js,jsx src test",
"lint": "eslint --ext js,jsx .",
"pretest": "npm run lint",
"prebuild": "npm run clean",
"build": "babel src --out-dir build",
"watch": "babel src --out-dir build -w"
"watch": "npm run build -- -w",
"prepublish": "npm run build && safe-publish-latest"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -48,6 +51,7 @@
"enzyme": "^3.0.0",
"eslint": "^4.4.1",
"in-publish": "^2.0.0",
"rimraf": "^2.6.1"
"rimraf": "^2.6.1",
"safe-publish-latest": "^1.1.1"
}
}
10 changes: 7 additions & 3 deletions packages/enzyme-adapter-react-15.4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"main": "build",
"scripts": {
"clean": "rimraf build",
"lint": "eslint --ext js,jsx src test",
"lint": "eslint --ext js,jsx .",
"pretest": "npm run lint",
"prebuild": "npm run clean",
"build": "babel src --out-dir build",
"watch": "babel src --out-dir build -w"
"watch": "npm run build -- -w",
"prepublish": "npm run build && safe-publish-latest"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -48,6 +51,7 @@
"enzyme": "^3.0.0",
"eslint": "^4.4.1",
"in-publish": "^2.0.0",
"rimraf": "^2.6.1"
"rimraf": "^2.6.1",
"safe-publish-latest": "^1.1.1"
}
}
10 changes: 7 additions & 3 deletions packages/enzyme-adapter-react-15/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"main": "build",
"scripts": {
"clean": "rimraf build",
"lint": "eslint --ext js,jsx src test",
"lint": "eslint --ext js,jsx .",
"pretest": "npm run lint",
"prebuild": "npm run clean",
"build": "babel src --out-dir build",
"watch": "babel src --out-dir build -w"
"watch": "npm run build -- -w",
"prepublish": "npm run build && safe-publish-latest"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -48,6 +51,7 @@
"enzyme": "^3.0.0",
"eslint": "^4.4.1",
"in-publish": "^2.0.0",
"rimraf": "^2.6.1"
"rimraf": "^2.6.1",
"safe-publish-latest": "^1.1.1"
}
}
10 changes: 7 additions & 3 deletions packages/enzyme-adapter-react-16/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"main": "build",
"scripts": {
"clean": "rimraf build",
"lint": "eslint --ext js,jsx src test",
"lint": "eslint --ext js,jsx .",
"pretest": "npm run lint",
"prebuild": "npm run clean",
"build": "babel src --out-dir build",
"watch": "babel src --out-dir build -w"
"watch": "npm run build -- -w",
"prepublish": "npm run build && safe-publish-latest"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -48,6 +51,7 @@
"enzyme": "^3.0.0",
"eslint": "^4.4.1",
"in-publish": "^2.0.0",
"rimraf": "^2.6.1"
"rimraf": "^2.6.1",
"safe-publish-latest": "^1.1.1"
}
}
10 changes: 7 additions & 3 deletions packages/enzyme-adapter-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"main": "build",
"scripts": {
"clean": "rimraf build",
"lint": "eslint --ext js,jsx src test",
"lint": "eslint --ext js,jsx .",
"pretest": "npm run lint",
"prebuild": "npm run clean",
"build": "babel src --out-dir build",
"watch": "babel src --out-dir build -w"
"watch": "npm run build -- -w",
"prepublish": "npm run build && safe-publish-latest"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -42,6 +45,7 @@
"babel-cli": "^6.24.1",
"eslint": "^4.4.1",
"in-publish": "^2.0.0",
"rimraf": "^2.6.1"
"rimraf": "^2.6.1",
"safe-publish-latest": "^1.1.1"
}
}
10 changes: 7 additions & 3 deletions packages/enzyme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"main": "build",
"scripts": {
"clean": "rimraf build",
"lint": "eslint --ext js,jsx src test",
"lint": "eslint --ext js,jsx .",
"pretest": "npm run lint",
"prebuild": "npm run clean",
"build": "babel src --out-dir build",
"watch": "babel src --out-dir build -w"
"watch": "npm run build -- -w",
"prepublish": "npm run build && safe-publish-latest"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -46,6 +49,7 @@
"babel-cli": "^6.24.1",
"eslint": "^4.4.1",
"in-publish": "^2.0.0",
"rimraf": "^2.6.1"
"rimraf": "^2.6.1",
"safe-publish-latest": "^1.1.1"
}
}
12 changes: 9 additions & 3 deletions packages/enzyme/withDom.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
require('raf/polyfill');

/* eslint
no-console: 0,
prefer-template: 0
*/

if (!global.document) {
try {
// eslint-disable-next-line global-require, import/no-extraneous-dependencies
const jsdom = require('jsdom').jsdom; // could throw

global.document = jsdom('');
global.window = document.defaultView;
Object.keys(document.defaultView).forEach((property) => {
global.window = global.document.defaultView;
Object.keys(global.document.defaultView).forEach((property) => {
if (typeof global[property] === 'undefined') {
global[property] = document.defaultView[property];
global[property] = global.document.defaultView[property];
}
});

Expand Down

0 comments on commit fe509d4

Please sign in to comment.