@pagopa/dx-cli 0.14.1 → 0.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/index.js +14 -2
  2. package/package.json +2 -2
package/bin/index.js CHANGED
@@ -203,6 +203,7 @@ import { getLogger as getLogger4 } from "@logtape/logtape";
203
203
  import { $ } from "execa";
204
204
  import * as fs from "fs/promises";
205
205
  import { replaceInFile as replaceInFile3 } from "replace-in-file";
206
+ import semver from "semver";
206
207
  import YAML4 from "yaml";
207
208
  var NPM = class {
208
209
  lockFileName = "package-lock.json";
@@ -329,6 +330,14 @@ async function writePnpmWorkspaceFile(workspaces, packageExtensions) {
329
330
  await fs.writeFile("pnpm-workspace.yaml", yamlContent, "utf-8");
330
331
  }
331
332
  var apply = async (info) => {
333
+ const minNodeVersion = "20.19.5";
334
+ const currentNodeVersion = process.versions.node;
335
+ if (!semver.gte(currentNodeVersion, minNodeVersion)) {
336
+ console.error(
337
+ `This codemod requires Node.js >= ${minNodeVersion}. Current version: ${currentNodeVersion}`
338
+ );
339
+ process.exit(1);
340
+ }
332
341
  if (info.packageManager === "pnpm") {
333
342
  throw new Error("Project is already using pnpm");
334
343
  }
@@ -805,7 +814,10 @@ var withSpinner = (text, successText, failText, promise) => ResultAsync6.fromPro
805
814
  successText,
806
815
  text
807
816
  }),
808
- (cause) => new Error(failText, { cause })
817
+ (cause) => {
818
+ console.error(`Something went wrong: ${JSON.stringify(cause, null, 2)}`);
819
+ return new Error(failText, { cause });
820
+ }
809
821
  );
810
822
  var validateAnswers = (answers) => okAsync2(answers);
811
823
  var runGeneratorActions = (generator) => (answers) => withSpinner(
@@ -984,7 +996,7 @@ var makeSavemoneyCommand = () => new Command5("savemoney").description(
984
996
  // src/adapters/commander/index.ts
985
997
  var makeCli = (deps2, config2, cliDeps) => {
986
998
  const program2 = new Command6();
987
- program2.name("dx").description("The CLI for DX-Platform").version("0.14.1");
999
+ program2.name("dx").description("The CLI for DX-Platform").version("0.14.3");
988
1000
  program2.addCommand(makeDoctorCommand(deps2, config2));
989
1001
  program2.addCommand(makeCodemodCommand(cliDeps));
990
1002
  program2.addCommand(makeInitCommand(deps2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagopa/dx-cli",
3
- "version": "0.14.1",
3
+ "version": "0.14.3",
4
4
  "type": "module",
5
5
  "description": "A CLI useful to manage DX tools.",
6
6
  "repository": {
@@ -48,7 +48,7 @@
48
48
  "typescript": "~5.8.3",
49
49
  "vitest": "^3.2.4",
50
50
  "vitest-mock-extended": "^3.1.0",
51
- "@pagopa/eslint-config": "^5.1.1"
51
+ "@pagopa/eslint-config": "^5.1.2"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22.0.0"