UNPKG

@hclsoftware/secagent

Version:

IAST agent

35 lines (29 loc) 1.21 kB
// util script - takes package.json and adds bundledDependencies section // that includes all the packages in the dependencies // the effect of the new package.json with this section is that when running npm pack, the created tar will include the dependencies, which is needed for ASE release // it is done by script so we won't have to maintain two package.json files // normally we want to pack/publish without the bundled dependencies. // optional: update version with input argument // Usage: // UpdateNpmForRelease.js 1.0.6 /* * **************************************************** * Licensed Materials - Property of HCL. * (c) Copyright HCL Technologies Ltd. 2017, 2025. * Note to U.S. Government Users *Restricted Rights. * **************************************************** */ 'use strict' const fs = require('fs'); const config = require('./package.json') config['bundledDependencies'] = Object.keys(config.dependencies) if (process.argv[2] != null) { config['version'] = process.argv[2] } const target = 'package.json' try{ fs.writeFileSync(target, JSON.stringify(config, null, 4)) console.log("JSON data is saved to " + target); } catch (error) { console.error(error); }