Ensure package is published from dist/ with correct version number (#2963)
parent
fcdf6b5806
commit
33a1f59e01
|
@ -72,6 +72,7 @@
|
||||||
"webpack": "2.6.1"
|
"webpack": "2.6.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"prepublishOnly": "echo \"Error: must publish from dist/\" && exit 1",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"test-integration": "jest tests_integration",
|
"test-integration": "jest tests_integration",
|
||||||
"lint": "cross-env EFF_NO_LINK_RULES=true eslint . --format node_modules/eslint-friendly-formatter",
|
"lint": "cross-env EFF_NO_LINK_RULES=true eslint . --format node_modules/eslint-friendly-formatter",
|
||||||
|
|
|
@ -123,6 +123,10 @@ shell.cp("node_modules/sw-toolbox/sw-toolbox.js", `${docs}/sw-toolbox.js`);
|
||||||
shell.echo("Copy package.json");
|
shell.echo("Copy package.json");
|
||||||
const pkgWithoutDependencies = Object.assign({}, pkg);
|
const pkgWithoutDependencies = Object.assign({}, pkg);
|
||||||
delete pkgWithoutDependencies.dependencies;
|
delete pkgWithoutDependencies.dependencies;
|
||||||
|
pkgWithoutDependencies.scripts = {
|
||||||
|
prepublishOnly:
|
||||||
|
"node -e \"assert.equal(require('.').version, require('..').version)\""
|
||||||
|
};
|
||||||
pipe(JSON.stringify(pkgWithoutDependencies, null, 2)).to("dist/package.json");
|
pipe(JSON.stringify(pkgWithoutDependencies, null, 2)).to("dist/package.json");
|
||||||
|
|
||||||
shell.echo("Copy README.md");
|
shell.echo("Copy README.md");
|
||||||
|
|
Loading…
Reference in New Issue