Skip to content

Commit

Permalink
Move index; add unpkg & jsdelivr fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Aug 24, 2018
1 parent de131ec commit bfc3372
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
4 changes: 0 additions & 4 deletions index.js

This file was deleted.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@
"name": "Mike Bostock",
"url": "http://bost.ocks.org/mike"
},
"main": "dist/d3-time-format.min.js",
"module": "index",
"jsnext:main": "index",
"main": "dist/d3-time-format.js",
"unpkg": "dist/d3-time-format.min.js",
"jsdelivr": "dist/d3-time-format.min.js",
"module": "src/index.js",
"repository": {
"type": "git",
"url": "https://github.com/d3/d3-time-format.git"
},
"scripts": {
"pretest": "rollup -c",
"test": "TZ=America/Los_Angeles tape 'test/**/*-test.js' && eslint index.js src",
"test": "TZ=America/Los_Angeles tape 'test/**/*-test.js' && eslint src",
"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}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.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"
},
Expand Down
6 changes: 3 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import {terser} from "rollup-plugin-terser";
import * as meta from "./package.json";

const config = {
input: "index.js",
external: Object.keys(meta.dependencies || {}),
input: "src/index.js",
external: Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)),
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"})))
globals: Object.assign({}, ...Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)).map(key => ({[key]: "d3"})))
},
plugins: []
};
Expand Down
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export {default as timeFormatDefaultLocale, timeFormat, timeParse, utcFormat, utcParse} from "./defaultLocale";
export {default as timeFormatLocale} from "./locale";
export {default as isoFormat} from "./isoFormat";
export {default as isoParse} from "./isoParse";

0 comments on commit bfc3372

Please sign in to comment.