Skip to content

Commit 6657d17

Browse files
committed
Merge pull request #82 from gary-kim/enh/noid/dev-version-indication
Make version name indicate in-development versions
2 parents b6d70b0 + cbc3ee1 commit 6657d17

File tree

13 files changed

+66
-39
lines changed

13 files changed

+66
-39
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ For a new file, add this license header to the top of the file:
9292
3. Run `npm ci` to install all dependencies for building from [package-lock.json](package-lock.json).
9393
4. Update [CHANGELOG.md](CHANGELOG.md) with the update changelog for the new version.
9494
5. Make a new git commit and tag with `git commit -S`, `git tag VERSION -a`, add the new version name as the annotation, then run `git push origin VERSION`.
95-
6. Run `npm run clean`, `npm run webpack:build:firefox`, then `npm run package`. Upload the resulting package to [AMO](https://addons.mozilla.org/en-US/developers/addons) to have the extension signed. Upload the result into GitHub releases then update the update server to point to the new release.
96-
7. Run `npm run clean`, `npm run webpack:build:chromium`, then `npm run package`. Upload the resulting package to [CWS](https://chrome.google.com/webstore/developer/dashboard) to have the new version signed and released.
95+
6. Run `npm run libraries` to generate third-party library attributions.
96+
7. Run `npm run clean`, `SASPES_OFFICIAL_RELEASE=true npm run webpack:build:firefox`, then `npm run package`. Upload the resulting package to [AMO](https://addons.mozilla.org/en-US/developers/addons) to have the extension signed. Upload the result into GitHub releases then update the update server to point to the new release.
97+
8. Run `npm run clean`, `SASPES_OFFICIAL_RELEASE=true npm run webpack:build:chromium`, then `npm run package`. Upload the resulting package to [CWS](https://chrome.google.com/webstore/developer/dashboard) to have the new version signed and released.
9798

9899
### Developer Certificate of Origin
99100
```

package-lock.json

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"ava": "^2.4.0",
3636
"babel-loader": "^8.0.6",
3737
"chromedriver": "^78.0.1",
38+
"command-exists": "^1.2.8",
3839
"copy-webpack-plugin": "^5.1.1",
3940
"css-loader": "^3.4.0",
4041
"eslint": "^6.8.0",

src/.eslintrc.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"globals": {
1414
"Atomics": "readonly",
1515
"SharedArrayBuffer": "readonly",
16-
"EXTENSION_VERSION_NAME": true
16+
"SASPES_VERSION_NAME": true,
17+
"SASPES_IS_OFFICIAL_RELEASE": true
1718
},
1819
"parserOptions": {
1920
"parser": "babel-eslint",
@@ -44,4 +45,4 @@
4445
"warn"
4546
]
4647
}
47-
}
48+
}

src/js/components/ExtensionInfo.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<!--
22
- @copyright Copyright (c) 2018-2019 Gary Kim <[email protected]>
3-
-
3+
-
44
- @author Gary Kim <[email protected]>
5-
-
5+
-
66
- SAS Powerschool Enhancement Suite - A browser extension to improve the experience of SAS Powerschool.
77
-
88
- This program is free software: you can redistribute it and/or modify
9-
- it under the terms of the GNU Affero General Public License as
9+
- it under the terms of the GNU Affero General Public License as
1010
- published by the Free Software Foundation, version 3.
1111
-
1212
- This program is distributed in the hope that it will be useful,
@@ -81,7 +81,7 @@ export default {
8181
data() {
8282
return {
8383
logo: browser.runtime.getURL("icons/128.png"),
84-
version: EXTENSION_VERSION_NAME,
84+
version: SASPES_VERSION_NAME,
8585
showInfo: false,
8686
};
8787
},

src/ui/options.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
4+
55
</head>
66
<body>
7-
<form>
7+
<h3>Version: <span id="version"></span></h3>
8+
<form>
89
<label><input type="checkbox" id="analytics" />Enable Analytics</label>
9-
<br />
10+
<br />
1011
<label><input type="checkbox" id="percent-mp" />Load final percent on overall grade page</label>
1112
<br />
1213
<!--<label><input type="checkbox" id="save-grades" />Save last seen grades (requires previous option to work)</label>-->
1314
</form>
1415
<br />
15-
16+
1617
<footer>
1718
<br />
1819
Last Seen Grades has been temporarily removed to be improved upon.<br />

src/ui/options.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/**
2-
*
2+
*
33
* @copyright Copyright (c) 2018-2019 Gary Kim <[email protected]>
4-
*
4+
*
55
* @author Gary Kim <[email protected]>
6-
*
6+
*
77
* SAS Powerschool Enhancement Suite - A browser extension to improve the experience of SAS Powerschool.
88
*
99
* This program is free software: you can redistribute it and/or modify
10-
* it under the terms of the GNU Affero General Public License as
10+
* it under the terms of the GNU Affero General Public License as
1111
* published by the Free Software Foundation, version 3.
1212
*
1313
* This program is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
1717
*
1818
* You should have received a copy of the GNU Affero General Public License
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20-
*
20+
*
2121
*/
2222

2323
'use strict';
@@ -37,6 +37,7 @@ function main() {
3737
analyticsid = returned.id;
3838
});
3939
document.getElementById("third-party-libraries").href = browser.extension.getURL("web_accessible_resources/libraries.txt");
40+
document.getElementById("version").innerText = SASPES_VERSION_NAME;
4041
document.getElementById("analytics").addEventListener("click", function() {
4142
let value = document.getElementById("analytics").checked;
4243
if(!value) {

tests/extensionInfo.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/**
2-
*
3-
* @copyright Copyright (c) 2019 Gary Kim <[email protected]>
4-
*
2+
*
3+
* @copyright Copyright (c) 2019-2020 Gary Kim <[email protected]>
4+
*
55
* @author Gary Kim <[email protected]>
66
*
77
* @license GNU AGPL version 3
88
*
99
* SAS Powerschool Enhancement Suite - A browser extension to improve the experience of SAS Powerschool.
1010
*
1111
* This program is free software: you can redistribute it and/or modify
12-
* it under the terms of the GNU Affero General Public License as
12+
* it under the terms of the GNU Affero General Public License as
1313
* published by the Free Software Foundation, version 3.
1414
*
1515
* This program is distributed in the hope that it will be useful,
@@ -19,10 +19,10 @@
1919
*
2020
* You should have received a copy of the GNU Affero General Public License
2121
* along with this program. If not, see <https://www.gnu.org/licenses/>.
22-
*
22+
*
2323
*/
2424

25-
const package = require('../package.json');
25+
const version_name = require('../webpack-helpers').versionName();
2626

2727
module.exports = {
2828
"Show Extension Info": browser => {
@@ -33,7 +33,7 @@ module.exports = {
3333
"Extension Version Correct": browser => {
3434
browser
3535
.assert.containsText('#saspes-info', 'SAS Powerschool Enhancement Suite')
36-
.assert.containsText("#saspes-info", `Version: ${package.version_name}`)
36+
.assert.containsText("#saspes-info", `Version: ${version_name}`)
3737
},
3838
"Extension Info Remember Open State": browser => {
3939
browser

webpack-helpers.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
const package = require('./package.json');
2+
const { execSync } = require('child_process');
3+
const commandExistsSync = require('command-exists').sync;
4+
5+
module.exports = {
6+
setManifestVersion: function(contents, version, version_name) {
7+
let manifest = JSON.parse(contents);
8+
manifest.version = version;
9+
if (typeof version_name !== 'undefined') {
10+
manifest.version_name = version_name;
11+
}
12+
return JSON.stringify(manifest);
13+
},
14+
isRelease: function() {
15+
return !!process.env.SASPES_OFFICIAL_RELEASE;
16+
},
17+
versionName: function () {
18+
if (this.isRelease()) {
19+
return package.version_name;
20+
}
21+
return package.version_name + " Development " + (commandExistsSync('git')? execSync('git describe --tags'): "(Exact Version Unknown)");
22+
}
23+
}

webpack.chromium.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const merge = require('webpack-merge');
22
const common = require('./webpack.common.js');
3-
const helpers = require('./webpack.helpers.js');
3+
const helpers = require('./webpack-helpers.js');
44
const CopyPlugin = require('copy-webpack-plugin');
55
const package = require('./package.json');
66
const path = require('path');

0 commit comments

Comments
 (0)