Skip to content

Commit

Permalink
Merge 64f77cf into 5116316
Browse files Browse the repository at this point in the history
  • Loading branch information
Male Michael committed Feb 1, 2018
2 parents 5116316 + 64f77cf commit 16e87e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/manifest.webapp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.0",
"version": "1.0.0-beta",
"name": "openmrs-addOnManager",
"description": "This will help in uploading the openmrs open web apps and omod files",
"launch_path": "index.html",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"watch": "webpack --progress --colors --watch --mode=deploy --target=web --devtool source-map",
"lint": "node_modules/.bin/esw webpack.config.* app",
"lint:watch": "npm run lint -- --watch",
"test": "node_modules/.bin/mocha tests/**/*.test.* --require tests/setup.js --compilers js:babel-core/register",
"test": "node_modules/.bin/mocha tests/**/*.test.* --require tests/setup.js --compilers js:babel-core/register --exclude webpack.sample.config.js",
"coverage": "nyc -all -e .jsx npm test",
"coveralls": "npm run coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
},
Expand Down
10 changes: 9 additions & 1 deletion webpack.sample.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ const WebpackOnBuildPlugin = require('on-build-webpack');

const nodeModulesDir = path.resolve(__dirname, '../node_modules');

require.extensions['.webapp'] = function (module, filename) {
module.exports = fs.readFileSync(filename, 'utf8');
};
const manifest = require('./app/manifest.webapp');

const THIS_APP_ID = 'openmrs-addonmanager';

const THIS_APP_VERSION = JSON.parse(manifest).version;

let plugins = [];
const nodeModules = {};

Expand Down Expand Up @@ -84,7 +91,8 @@ if (env === 'production') {
plugins.push(new WebpackOnBuildPlugin(function(stats){
//create zip file
let archiver = require('archiver');
let output = fs.createWriteStream(THIS_APP_ID+'.zip');
let output = THIS_APP_VERSION ? fs.createWriteStream(`${THIS_APP_ID}-${THIS_APP_VERSION}.zip`)
:fs.createWriteStream(`${THIS_APP_ID}.zip`);
let archive = archiver('zip');

output.on('close', function () {
Expand Down

0 comments on commit 16e87e1

Please sign in to comment.