Skip to content

Commit

Permalink
Update dependencies.
Browse files Browse the repository at this point in the history
Also replaces the prepublish script with prepublishOnly per npm, and replaces
the browser field in package.json with unpkg and jsdelivr; see d3/d3#3138.
  • Loading branch information
mbostock committed Sep 2, 2017
1 parent 04e4363 commit d635b89
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
8 changes: 5 additions & 3 deletions bin/rollup-node
Expand Up @@ -5,12 +5,14 @@ var fs = require("fs"),
dependencies = require("../package.json").dependencies;

rollup.rollup({
entry: "index.js",
input: "index.js",
external: Object.keys(dependencies)
}).then(function(bundle) {
var code = bundle.generate({
return bundle.generate({
format: "cjs"
}).code.replace(
});
}).then(function(bundle) {
var code = bundle.code.replace(
/^'use strict';$/m,
"'use strict';\n\nvar XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;"
);
Expand Down
15 changes: 8 additions & 7 deletions package.json
Expand Up @@ -16,17 +16,18 @@
"url": "http://bost.ocks.org/mike"
},
"main": "build/d3-request.node.js",
"browser": "build/d3-request.js",
"unpkg": "build/d3-request.js",
"jsdelivr": "build/d3-request.js",
"module": "index",
"jsnext:main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/d3/d3-request.git"
},
"scripts": {
"pretest": "rm -rf build && mkdir build && bin/rollup-node && rollup --banner \"$(preamble)\" -f umd -g d3-collection:d3,d3-dispatch:d3,d3-dsv:d3 -n d3 -o build/d3-request.js -- index.js",
"pretest": "rm -rf build && mkdir build && bin/rollup-node && rollup -c --banner \"$(preamble)\"",
"test": "tape 'test/**/*-test.js' && eslint index.js src",
"prepublish": "npm run test && uglifyjs --preamble \"$(preamble)\" build/d3-request.js -c -m -o build/d3-request.min.js",
"prepublishOnly": "npm run test && uglifyjs -b beautify=false,preamble=\"'$(preamble)'\" build/d3-request.js -c -m -o build/d3-request.min.js",
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3-request/build/d3-request.js d3-request.v1.js && cp ../d3-request/build/d3-request.min.js d3-request.v1.min.js && git add d3-request.v1.js d3-request.v1.min.js && git commit -m \"d3-request ${npm_package_version}\" && git push && cd - && zip -j build/d3-request.zip -- LICENSE README.md build/d3-request.js build/d3-request.min.js"
},
"dependencies": {
Expand All @@ -36,10 +37,10 @@
"xmlhttprequest": "1"
},
"devDependencies": {
"eslint": "3",
"package-preamble": "0.0",
"rollup": "0.41",
"eslint": "4",
"package-preamble": "0.1",
"rollup": "0.49",
"tape": "4",
"uglify-js": "^2.8.11"
"uglify-js": "3"
}
}
19 changes: 19 additions & 0 deletions rollup.config.js
@@ -0,0 +1,19 @@
export default {
input: "index",
external: [
"d3-collection",
"d3-dispatch",
"d3-dsv"
],
output: {
extend: true,
file: "build/d3-request.js",
format: "umd",
globals: {
"d3-collection": "d3",
"d3-dispatch": "d3",
"d3-dsv": "d3"
},
name: "d3"
}
};

0 comments on commit d635b89

Please sign in to comment.