New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cdk-codemod

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cdk-codemod - npm Package Compare versions

Comparing version 0.0.2 to 0.0.4

dist/reinstall.js

26

dist/cli.js

@@ -13,7 +13,7 @@ #!/usr/bin/env node

const Runner_1 = __importDefault(require("jscodeshift/dist/Runner"));
const package_json_1 = require("./package-json");
const args = process.argv.slice(2);
const example = args.includes("--example");
const dryRun = args.includes("--dry-run");
let options, positionalArguments;
function run(paths, options) {
const run = async (inputPaths) => {
const baseFolder = example ? path_1.default.resolve("test/fixtures") : cwd();

@@ -23,3 +23,3 @@ const transformPath = props.transformPath || example

: path_1.default.resolve("lib/transformers/index.js");
const options = props.options || {
const options = {
dry: dryRun || example,

@@ -30,12 +30,22 @@ print: true,

};
const paths = props.paths || listFiles(baseFolder, [], ".ts");
Runner_1.default.run(transformPath, paths, options);
}
const paths = inputPaths || listFiles(baseFolder, [], ".ts");
await Runner_1.default.run(transformPath, paths, options);
const updatedPackages = await (0, package_json_1.updatePackageJson)(baseFolder);
const updatedCdks = await updateCdkJson(baseFolder);
// write updatedPackages and updatedCdks to files
if (!dryRun) {
const jsonUpdates = { ...updatedPackages, ...updatedCdks };
Object.keys(jsonUpdates).forEach((key) => {
writeFileSync(key, jsonUpdates[key]);
});
await reinstall(updatedPackages);
}
};
if (options.stdin) {
let buffer = "";
process.stdin.on("data", (data) => (buffer += data));
process.stdin.on("end", () => run(buffer.split("\n"), options));
process.stdin.on("end", () => run(buffer.split("\n")));
}
else {
run(positionalArguments, options);
run();
}
{
"name": "cdk-codemod",
"version": "0.0.2",
"version": "0.0.4",
"description": "Collection of codemod scripts that help update AWS CDK from Version 1 to Version 2",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc