Skip to content

Commit

Permalink
Update dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Aug 24, 2018
1 parent 9f24171 commit 7f25224
Show file tree
Hide file tree
Showing 12 changed files with 1,055 additions and 28 deletions.
9 changes: 0 additions & 9 deletions .eslintrc

This file was deleted.

15 changes: 15 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 8
},
"env": {
"es6": true,
"node": true,
"browser": true
},
"rules": {
"no-cond-assign": 0
}
}
16 changes: 10 additions & 6 deletions d3-hierarchy.sublime-project
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
"folders": [
{
"path": ".",
"file_exclude_patterns": [
"*.sublime-workspace"
],
"folder_exclude_patterns": [
"build"
]
"file_exclude_patterns": ["*.sublime-workspace"],
"folder_exclude_patterns": ["build"]
}
],
"build_systems": [
{
"name": "yarn test",
"cmd": ["yarn", "test"],
"file_regex": "\\((...*?):([0-9]*):([0-9]*)\\)",
"working_dir": "$project_path"
}
]
}
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,28 @@
"name": "Mike Bostock",
"url": "http://bost.ocks.org/mike"
},
"main": "dist/d3-hierarchy.js",
"main": "dist/d3-hierarchy.min.js",
"module": "index",
"jsnext:main": "index",
"repository": {
"type": "git",
"url": "https://github.com/d3/d3-hierarchy.git"
},
"scripts": {
"pretest": "rm -rf dist && mkdir dist && rollup --banner \"$(preamble)\" -f umd -n d3 -o dist/d3-hierarchy.js -- index.js",
"test": "tape 'test/**/*-test.js' && eslint index.js src",
"prepublishOnly": "npm run test && uglifyjs -b beautify=false,preamble=\"'$(preamble)'\" dist/d3-hierarchy.js -c -m -o dist/d3-hierarchy.min.js",
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3-hierarchy/dist/d3-hierarchy.js d3-hierarchy.v1.js && cp ../d3-hierarchy/dist/d3-hierarchy.min.js d3-hierarchy.v1.min.js && git add d3-hierarchy.v1.js d3-hierarchy.v1.min.js && git commit -m \"d3-hierarchy ${npm_package_version}\" && git push && cd - && zip -j dist/d3-hierarchy.zip -- LICENSE README.md dist/d3-hierarchy.js dist/d3-hierarchy.min.js"
"pretest": "rollup -c",
"test": "tape 'test/**/*-test.js' && eslint index.js src test",
"prepublishOnly": "rm -rf dist && yarn test",
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v1.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v1.min.js && git add ${npm_package_name}.v1.js ${npm_package_name}.v1.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd - && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js"
},
"devDependencies": {
"benchmark": "^2.1.4",
"d3-array": "^1.2.0",
"d3-dsv": "1",
"d3-queue": "3",
"d3-random": "^1.1.0",
"eslint": "3",
"package-preamble": "0.0",
"rollup": "0.42",
"tape": "4",
"uglify-js": "^3.0.15"
"eslint": "5",
"rollup": "0.64",
"rollup-plugin-terser": "1",
"tape": "4"
}
}
36 changes: 36 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import {terser} from "rollup-plugin-terser";
import * as meta from "./package.json";

const config = {
input: "index.js",
external: Object.keys(meta.dependencies || {}),
output: {
file: `dist/${meta.name}.js`,
name: "d3",
format: "umd",
indent: false,
extend: true,
banner: `// ${meta.homepage} v${meta.version} Copyright ${(new Date).getFullYear()} ${meta.author.name}`,
globals: Object.assign({}, ...Object.keys(meta.dependencies || {}).map(key => ({[key]: "d3"})))
},
plugins: []
};

export default [
config,
{
...config,
output: {
...config.output,
file: `dist/${meta.name}.min.js`
},
plugins: [
...config.plugins,
terser({
output: {
preamble: config.output.banner
}
})
]
}
];
2 changes: 2 additions & 0 deletions test/pack/bench-enclose.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable */

var d3 = Object.assign({}, require("../../"), require("d3-array"), require("d3-random")),
benchmark = require("benchmark");

Expand Down
2 changes: 2 additions & 0 deletions test/pack/find-bugs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable */

var d3 = Object.assign({}, require("../../"), require("d3-random"));

var n = 0, r = d3.randomLogNormal(4);
Expand Down
2 changes: 2 additions & 0 deletions test/pack/find-enclose-bugs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable */

var d3 = Object.assign({}, require("../../"), require("d3-array"), require("d3-random"));

var n = 0,
Expand Down
2 changes: 2 additions & 0 deletions test/pack/find-place-bugs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable */

// Look for numerical inconsistencies between the place() and intersects()
// methods from pack/siblings.js

Expand Down
2 changes: 1 addition & 1 deletion test/pack/flare-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tape("pack(flare) produces the expected result", test(
"test/data/flare-pack.json"
));

function test(input, expected, tile) {
function test(input, expected) {
return function(test) {

d3_queue.queue()
Expand Down
4 changes: 2 additions & 2 deletions test/pack/siblings-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ function circleRadius(radius) {

function intersectsAny(circles) {
for (var i = 0, n = circles.length; i < n; ++i) {
for (var j = i + 1, ci = circles[i], cj; j < n; ++j) {
if (intersects(ci, cj = circles[j])) {
for (var j = i + 1, ci = circles[i]; j < n; ++j) {
if (intersects(ci, circles[j])) {
return true;
}
}
Expand Down
Loading

0 comments on commit 7f25224

Please sign in to comment.