Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

add package.json script - npm run notes, add release notes tasks script, add documentation

Ed Plato7e235ebd0a5c
diff --git a/doc/developing.md b/doc/developing.md
index 06734e3ea..e3c4cc17a 100644
--- a/doc/developing.md
+++ b/doc/developing.md
@@ -30,6 +30,8 @@ To build the app with an incomplete configuration, prefix the command like this:
**`npm run analyze`**: Runs Webpack Bundle Analyzer to visualize size of output files with an interactive zoomable treemap. Default analyze interface is served at [http://127.0.0.1:8888/](http://127.0.0.1:8888/).
+**`npm run notes`**: Runs [github-changelog-generator](https://github.com/github-changelog-generator/github-changelog-generator) to automatically build release notes. For individual release notes, add release tag option as first argument after script, for example `npm run notes v3.3.1`. Will use `docker` by default. To use `ruby`, add `ruby` as second argument after script command. For example `npm run notes '' ruby`.
+
**`npm run watch`**: Builds and serves local Development mode Webpack bundle in watch mode using Webpack Dev Server (*Note: It is necessary to wait for the initial build to finish before being able to develop*). JS and CSS bundles are updated automatically when source files change. You must run `npm run build` or `npm run build:config` first to make a request to the GIBS `GetCapabilities` API and build the configuration files.
**`npm run watch:debug`**: Injects a global `DEBUG` object into `main.js`. This will activate `react-logger` which logs the before and after state of each action.
diff --git a/package.json b/package.json
index c3caf3825..97c8e19dd 100644
--- a/package.json
+++ b/package.json
@@ -55,6 +55,7 @@
"lint": "run-s lint:*",
"lint:css": "stylelint ./web/css/**/*.css",
"lint:js": "eslint .",
+ "notes": "node ./tasks/releaseNotes.js",
"preinstall": "node tasks/checkNodeVersion.js",
"postinstall": "npm run python",
"python": "run-script-os",
diff --git a/tasks/releaseNotes.js b/tasks/releaseNotes.js
new file mode 100644
index 000000000..e7ba3566e
--- /dev/null
+++ b/tasks/releaseNotes.js
@@ -0,0 +1,32 @@
+/* eslint no-template-curly-in-string: "off" */
+const shell = require('shelljs');
+const args = process.argv.slice(2);
+const sinceArg = args[0];
+const rubyArg = args[1];
+
+const GITHUB_CHANGELOG_GENERATOR_TOKEN = process.env.GITHUB_CHANGELOG_GENERATOR_TOKEN;
+
+if (!GITHUB_CHANGELOG_GENERATOR_TOKEN) {
+ console.log('\u{1b}[33mA GitHub token is required to make the required number of requests to the GitHub API for release note generation.\u{1b}[0m');
+} else {
+ console.log('\u{1b}[32mA GitHub release note generation initiated. This will take a few minutes to complete.\u{1b}[0m');
+
+ let cmdPrefix;
+ // run docker command by default, but allow ruby using command line argument
+ if (rubyArg === 'ruby') {
+ cmdPrefix = 'github_changelog_generator';
+ } else {
+ cmdPrefix = 'docker run -it --rm -v /${PWD}:/wkDir ferrarimarco/github-changelog-generator';
+ }
+
+ // add --since v3.4.0 tag to limit compiled release notes
+ // NOTE: A complete API request of entire commit history is still required due to GitHub's API, so this won't save you much time
+ const sinceOption = sinceArg ? `--since-tag ${sinceArg} ` : '';
+
+ const cmd = `${cmdPrefix} -u nasa-gibs -p worldview --no-author --bugs-label '## Technical Updates / Bugs:' \
+--security-label '## External Dependency Updates:' --security-labels 'external dependency' --removed-label \
+'## Story Changes:' --removed-labels 'story,Story' --deprecated-label '## Layer Changes:' --deprecated-labels \
+'layer,Layer' ${sinceOption}--token ${GITHUB_CHANGELOG_GENERATOR_TOKEN}`;
+
+ shell.exec(cmd);
+}