Skip to content

Commit b7f5a06

Browse files
committedJul 9, 2019
Add check-version-tracker script
1 parent 04a30ab commit b7f5a06

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
 

‎check-version-tracker.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* @license
3+
* Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
4+
* This code may only be used under the BSD style license found at
5+
* http://polymer.github.io/LICENSE.txt
6+
* The complete set of authors may be found at
7+
* http://polymer.github.io/AUTHORS.txt
8+
* The complete set of contributors may be found at
9+
* http://polymer.github.io/CONTRIBUTORS.txt
10+
* Code distributed by Google as part of the polymer project is also
11+
* subject to an additional IP rights grant found at
12+
* http://polymer.github.io/PATENTS.txt
13+
*/
14+
15+
const fs = require('fs');
16+
const path = require('path');
17+
18+
const version = require(path.join(__dirname, 'package.json')).version;
19+
const ts = fs.readFileSync(path.join(__dirname, 'src', 'lit-html.ts'));
20+
if (!ts.includes(version)) {
21+
console.log(
22+
`\nExpected lit-html.ts to contain current version "${version}"`);
23+
console.log(
24+
`Don't forget to update the version tracker string before release!`);
25+
process.exit(1);
26+
}

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"quicktest": "wct -l chrome -p --npm",
2929
"format": "clang-format --version; find src test | grep '\\.js$\\|\\.ts$' | xargs clang-format --style=file -i",
3030
"lint": "tslint --project ./",
31+
"prepublishOnly": "node check-version-tracker.js && npm run lint && npm test",
3132
"prepare": "npm run build",
3233
"publish-dev": "npm test && VERSION=${npm_package_version%-*}-dev.`git rev-parse --short HEAD` && npm version --no-git-tag-version $VERSION && npm publish --tag dev"
3334
},

0 commit comments

Comments
 (0)
Please sign in to comment.