@mnci/cli 1.19.7 → 1.19.8

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.
package/dist/cli.js CHANGED
@@ -1411,6 +1411,10 @@ function devcontainerJson(workspaceName, linter) {
1411
1411
  // `npm ci` first: every guard after it runs through the workspace's own
1412
1412
  // scripts and Nx, which do not exist until the install completes.
1413
1413
  postCreateCommand: [
1414
+ // Same pin the workflow applies, for the same reason — a container whose
1415
+ // npm major differs from CI's resolves dependencies differently, which is
1416
+ // precisely the drift this file exists to remove.
1417
+ `npm install -g npm@${NPM_VERSION}`,
1414
1418
  "npm ci",
1415
1419
  "npm run python:install",
1416
1420
  GOLANGCI_LINT_INSTALL_GUARD,
@@ -1784,6 +1788,7 @@ var GO_TOOL_PATH_AZURE = `node -e "${GO_TOOL_PATH_PRELUDE}console.log('##vso[tas
1784
1788
  var GO_TOOL_PATH_GITHUB = `node -e "${GO_TOOL_PATH_PRELUDE}if(!process.env.GITHUB_PATH){console.log('Not running in GitHub Actions - skipping.');process.exit(0)}fs.appendFileSync(process.env.GITHUB_PATH,bin+${String.raw`'\n'`})"`;
1785
1789
  var FLUTTER_SDK_VERSION = "3.44.8";
1786
1790
  var NODE_VERSION = "24";
1791
+ var NPM_VERSION = "11";
1787
1792
  var FLUTTER_SDK_DIRECTORY_EXPRESSION = `require('node:path').join(require('node:os').homedir(),'.mnci-flutter-${FLUTTER_SDK_VERSION}')`;
1788
1793
  var FLUTTER_SDK_INSTALL_GUARD = `node -e "const fs=require('node:fs'),cp=require('node:child_process');if(!fs.existsSync('pubspec.yaml')){console.log('No Flutter projects - skipping.');process.exit(0)}if(cp.spawnSync('flutter',['--version'],{stdio:'ignore',shell:process.platform==='win32'}).status===0){console.log('Flutter SDK already on PATH - skipping.');process.exit(0)}const sdk=${FLUTTER_SDK_DIRECTORY_EXPRESSION};if(fs.existsSync(sdk)){console.log('Flutter SDK already installed at '+sdk+' - skipping.');process.exit(0)}process.exit(cp.spawnSync('git',['clone','--depth','1','--branch','${FLUTTER_SDK_VERSION}','https://github.com/flutter/flutter.git',sdk],{stdio:'inherit'}).status ?? 1)"`;
1789
1794
  var FLUTTER_TOOL_PATH_PRELUDE = `const fs=require('node:fs'),path=require('node:path');if(!fs.existsSync('pubspec.yaml')){console.log('No Flutter projects - skipping.');process.exit(0)}const sdk=${FLUTTER_SDK_DIRECTORY_EXPRESSION};if(!fs.existsSync(sdk)){console.log('Flutter SDK was not installed by mnci (already on PATH) - skipping.');process.exit(0)}const bin=path.join(sdk,'bin');`;
@@ -2088,6 +2093,13 @@ jobs:
2088
2093
  # dependency change misses the cache and a no-op change hits it.
2089
2094
  cache: npm
2090
2095
 
2096
+ # setup-node installs whatever npm the Node image bundles, and npm's major
2097
+ # is part of the contract: npm 11 reuses an already-installed tree instead
2098
+ # of re-resolving, so it applies \`overrides\` differently from npm 10. See
2099
+ # NPM_VERSION's remarks for the measurement.
2100
+ - run: npm install -g npm@${NPM_VERSION}
2101
+ name: Pin npm to the major mnci verifies against
2102
+
2091
2103
  - run: npm ci
2092
2104
  name: Install dependencies
2093
2105
  env:
@@ -2599,6 +2611,7 @@ var import_node_path15 = require("path");
2599
2611
  var import_prompts8 = require("@inquirer/prompts");
2600
2612
 
2601
2613
  // src/commands/new.ts
2614
+ var import_node_fs8 = require("fs");
2602
2615
  var import_node_path13 = require("path");
2603
2616
  function nxCloudProviderValue(ci) {
2604
2617
  return ci === "azure" ? "azure" : "github";
@@ -2671,6 +2684,8 @@ async function runNew(name, options) {
2671
2684
  "Applying MoNecromanCI overlay (VS Code workspace, release config, .npmrc, commitlint, pipeline, stack)"
2672
2685
  );
2673
2686
  applyOverlay(workspaceRoot, { workspaceName, scope, registry, agent, variableGroup, ci, stack });
2687
+ (0, import_node_fs8.rmSync)((0, import_node_path13.join)(workspaceRoot, "node_modules"), { recursive: true, force: true });
2688
+ (0, import_node_fs8.rmSync)((0, import_node_path13.join)(workspaceRoot, "package-lock.json"), { force: true });
2674
2689
  logger.step("Installing the toolchain (commitlint + husky + linting/formatting)");
2675
2690
  const installStatus = runShell(
2676
2691
  "npm",
@@ -2702,7 +2717,7 @@ async function runNew(name, options) {
2702
2717
  }
2703
2718
 
2704
2719
  // src/commands/upgrade.ts
2705
- var import_node_fs8 = require("fs");
2720
+ var import_node_fs9 = require("fs");
2706
2721
  var import_node_path14 = require("path");
2707
2722
  function resolveRegistry2(options, persisted) {
2708
2723
  if (options.registry === "azure-artifacts" || options.organization && options.artifactsFeed) {
@@ -2732,7 +2747,7 @@ function resolveWorkspaceName(workspaceRoot, persisted) {
2732
2747
  return persisted.workspaceName;
2733
2748
  }
2734
2749
  try {
2735
- const existing = (0, import_node_fs8.readdirSync)(workspaceRoot).find(
2750
+ const existing = (0, import_node_fs9.readdirSync)(workspaceRoot).find(
2736
2751
  (file) => file.endsWith(".code-workspace") && file !== "undefined.code-workspace"
2737
2752
  );
2738
2753
  if (existing) {
@@ -2817,7 +2832,7 @@ async function runInteractive() {
2817
2832
  }
2818
2833
 
2819
2834
  // src/util/versionChecker.ts
2820
- var import_node_fs9 = require("fs");
2835
+ var import_node_fs10 = require("fs");
2821
2836
  var import_node_path16 = require("path");
2822
2837
  var import_cross_spawn2 = __toESM(require("cross-spawn"));
2823
2838
  var PACKAGE_NAME = "@mnci/cli";
@@ -2875,7 +2890,7 @@ function releaseTriple(version) {
2875
2890
  function readCliVersion(packageDirectory) {
2876
2891
  try {
2877
2892
  const manifestPath = (0, import_node_path16.join)(packageDirectory, "..", "package.json");
2878
- const manifest = JSON.parse((0, import_node_fs9.readFileSync)(manifestPath, "utf8"));
2893
+ const manifest = JSON.parse((0, import_node_fs10.readFileSync)(manifestPath, "utf8"));
2879
2894
  return manifest.version ?? "0.0.0";
2880
2895
  } catch {
2881
2896
  return "0.0.0";