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 19d9715 commit 411fefb
Show file tree
Hide file tree
Showing 9 changed files with 1,018 additions and 37 deletions.
11 changes: 0 additions & 11 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
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*.sublime-workspace
.DS_Store
build/
dist/
node_modules
npm-debug.log
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*.sublime-*
build/*.zip
dist/*.zip
test/
16 changes: 10 additions & 6 deletions d3-dsv.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"
}
]
}
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"name": "Mike Bostock",
"url": "http://bost.ocks.org/mike"
},
"main": "build/d3-dsv.js",
"main": "dist/d3-dsv.min.js",
"module": "index",
"jsnext:main": "index.js",
"jsnext:main": "index",
"bin": {
"csv2json": "bin/dsv2json",
"csv2tsv": "bin/dsv2dsv",
Expand All @@ -34,10 +34,10 @@
"url": "https://github.com/d3/d3-dsv.git"
},
"scripts": {
"pretest": "rm -rf build && mkdir build && rollup -c --banner \"$(preamble)\"",
"test": "tape 'test/**/*-test.js' && eslint index.js src",
"prepublish": "npm run test && uglifyjs -b beautify=false,preamble=\"'$(preamble)'\" build/d3-dsv.js -c -m -o build/d3-dsv.min.js",
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3-dsv/build/d3-dsv.js d3-dsv.v1.js && cp ../d3-dsv/build/d3-dsv.min.js d3-dsv.v1.min.js && git add d3-dsv.v1.js d3-dsv.v1.min.js && git commit -m \"d3-dsv ${npm_package_version}\" && git push && cd - && zip -j build/d3-dsv.zip -- LICENSE README.md build/d3-dsv.js build/d3-dsv.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"
},
"dependencies": {
"commander": "2",
Expand All @@ -46,10 +46,9 @@
},
"devDependencies": {
"csv-spectrum": "1",
"eslint": "4",
"package-preamble": "0.1",
"rollup": "0.49",
"tape": "4",
"uglify-js": "3"
"eslint": "5",
"rollup": "0.64",
"rollup-plugin-terser": "1",
"tape": "4"
}
}
39 changes: 33 additions & 6 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
export default {
input: "index",
import {terser} from "rollup-plugin-terser";
import * as meta from "./package.json";

const config = {
input: "index.js",
external: Object.keys(meta.dependencies || {}),
output: {
extend: true,
file: "build/d3-dsv.js",
file: `dist/${meta.name}.js`,
name: "d3",
format: "umd",
name: "d3"
}
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: 1 addition & 1 deletion test/csv-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ tape("csvParse(string, row) skips rows if row returns null or undefined", functi
tape("csvParse(string, row) calls row(d, i) for each row d, in order", function(test) {
var rows = [];
dsv.csvParse("a\n1\n2\n3\n4", function(d, i) { rows.push({d: d, i: i}); });
test.deepEqual(rows, [{d: {a: "1"}, i: 0}, {d: {a: "2"}, i: 1}, {d: {a: "3"}, i: 2}, {d: {a: "4"}, i: 3}]);;
test.deepEqual(rows, [{d: {a: "1"}, i: 0}, {d: {a: "2"}, i: 1}, {d: {a: "3"}, i: 2}, {d: {a: "4"}, i: 3}]);
test.end();
});

Expand Down
Loading

0 comments on commit 411fefb

Please sign in to comment.