diff --git a/.gitignore b/.gitignore index 75704c6..8abcf6a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *.sublime-workspace .DS_Store -build/ +dist/ node_modules npm-debug.log diff --git a/.npmignore b/.npmignore index dfb770e..0de69fc 100644 --- a/.npmignore +++ b/.npmignore @@ -1,3 +1,4 @@ *.sublime-* -build/*.zip +dist/*.zip +img/ test/ diff --git a/d3-interpolate.sublime-project b/d3-interpolate.sublime-project index 858fc1c..772dfa5 100644 --- a/d3-interpolate.sublime-project +++ b/d3-interpolate.sublime-project @@ -3,7 +3,7 @@ { "path": ".", "file_exclude_patterns": ["*.sublime-workspace"], - "folder_exclude_patterns": ["build"] + "folder_exclude_patterns": ["dist"] } ], "build_systems": [ diff --git a/package.json b/package.json index 09ea84c..0fcdb82 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "name": "Mike Bostock", "url": "http://bost.ocks.org/mike" }, - "main": "build/d3-interpolate.js", + "main": "dist/d3-interpolate.min.js", "module": "index", "jsnext:main": "index", "repository": { @@ -23,10 +23,10 @@ "url": "https://github.com/d3/d3-interpolate.git" }, "scripts": { - "pretest": "rm -rf build && mkdir build && rollup -c", - "test": "tape 'test/**/*-test.js' && eslint index.js src test", - "prepublish": "yarn test", - "postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3-interpolate/build/d3-interpolate.js d3-interpolate.v1.js && cp ../d3-interpolate/build/d3-interpolate.min.js d3-interpolate.v1.min.js && git add d3-interpolate.v1.js d3-interpolate.v1.min.js && git commit -m \"d3-interpolate ${npm_package_version}\" && git push && cd - && zip -j build/d3-interpolate.zip -- LICENSE README.md build/d3-interpolate.js build/d3-interpolate.min.js" + "pretest": "rollup -c", + "test": "tape 'test/**/*-test.js' && eslint index.js 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}.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": { "d3-color": "1" diff --git a/rollup.config.js b/rollup.config.js index 93addc4..564ecba 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,14 +3,15 @@ import * as meta from "./package.json"; const config = { input: "index.js", - external: Object.keys(meta.dependencies), + external: Object.keys(meta.dependencies || {}), output: { - file: `build/${meta.name}.js`, + file: `dist/${meta.name}.js`, name: "d3", format: "umd", + indent: false, extend: true, - banner: `// ${meta.homepage} Version ${meta.version} Copyright ${(new Date).getFullYear()} ${meta.author.name}.`, - globals: Object.assign({}, ...Object.keys(meta.dependencies).map(key => ({[key]: "d3"}))) + 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: [] }; @@ -21,7 +22,7 @@ export default [ ...config, output: { ...config.output, - file: `build/${meta.name}.min.js` + file: `dist/${meta.name}.min.js` }, plugins: [ ...config.plugins, diff --git a/yarn.lock b/yarn.lock index b9f00cd..b962fd0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,14 +3,14 @@ "@babel/code-frame@^7.0.0-beta.47": - version "7.0.0-rc.2" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-rc.2.tgz#12b6daeb408238360744649d16c0e9fa7ab3859e" + version "7.0.0-rc.3" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-rc.3.tgz#d77a587401f818a3168700f596e41cd6905947b2" dependencies: - "@babel/highlight" "7.0.0-rc.2" + "@babel/highlight" "7.0.0-rc.3" -"@babel/highlight@7.0.0-rc.2": - version "7.0.0-rc.2" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-rc.2.tgz#0af688a69e3709d9cf392e1837cda18c08d34d4f" +"@babel/highlight@7.0.0-rc.3": + version "7.0.0-rc.3" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-rc.3.tgz#c2ee83f8e5c0c387279a8c48e06fef2e32027004" dependencies: chalk "^2.0.0" esutils "^2.0.2" @@ -187,8 +187,8 @@ cross-spawn@^6.0.5: which "^1.2.9" d3-color@1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-1.2.0.tgz#d1ea19db5859c86854586276ec892cf93148459a" + version "1.2.2" + resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-1.2.2.tgz#01ffc37603ac46357fb47d7ab02b0369d2a57766" debug@^3.1.0: version "3.1.0"