-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbundle-runtime-cli.js
More file actions
43 lines (37 loc) · 1.21 KB
/
bundle-runtime-cli.js
File metadata and controls
43 lines (37 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* To update the @wavemaker/app-ng-runtime package.json version
* Add the dependency of @wavemaker/app-ng-runtime in package.json file
* Update the TS config and TS config web app json with package version
*
* CONSOLE ARGUMENTS:-
* publishVersion: To generate the given version package.json file
*/
import fs from 'fs';
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
const argv = yargs(hideBin(process.argv))
.options({
publishVersion: { type: "string" }
})
.argv;
const DEBUG_LOG = 'NG-RUNTIME: ';
/**
* To update the wavemaker version in package.json
*/
const updateWMVersion = (path, wmPackageJSON) => {
wmPackageJSON.version = argv.publishVersion;
fs.writeFileSync(path, JSON.stringify(wmPackageJSON, null, 4));
console.log(`${DEBUG_LOG} Updated package.json wm:${argv.publishVersion} for publishing to npm`);
};
/**
* Update the wavemaker version
* Add wavemaker dependency
* Update packagename and version in the angular.json
* Update TS config with package name
*/
const init = () => {
const path = './libraries/package.json';
const wmPackageJSON = JSON.parse(fs.readFileSync(path, 'utf8'));
updateWMVersion(path, wmPackageJSON);
};
init();