monorepo-next 10.2.0 → 11.0.0

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/package.json +5 -5
  2. package/src/releasable.js +18 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monorepo-next",
3
- "version": "10.2.0",
3
+ "version": "11.0.0",
4
4
  "description": "Detach monorepo packages from normal linking",
5
5
  "bin": {
6
6
  "next": "bin/next.js"
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "homepage": "https://github.com/CrowdStrike/monorepo-next#readme",
57
57
  "engines": {
58
- "node": ">=16.13"
58
+ "node": ">=18.12"
59
59
  },
60
60
  "dependencies": {
61
61
  "conventional-changelog": "3.1.25",
@@ -83,7 +83,7 @@
83
83
  "eslint-config-crowdstrike": "10.1.0",
84
84
  "eslint-config-crowdstrike-node": "3.0.1",
85
85
  "eslint-plugin-json-files": "^2.0.0",
86
- "eslint-plugin-mocha": "^10.0.0",
86
+ "eslint-plugin-mocha": "^10.2.0",
87
87
  "eslint-plugin-node": "^11.0.0",
88
88
  "fixturify": "^3.0.0",
89
89
  "fs-extra": "^11.1.1",
@@ -95,7 +95,7 @@
95
95
  "renovate-config-standard": "^2.0.0",
96
96
  "sinon": "^15.0.0",
97
97
  "sinon-chai": "^3.5.0",
98
- "standard-node-template": "4.0.1",
99
- "yargs-help-output": "^3.0.0"
98
+ "standard-node-template": "4.1.0",
99
+ "yargs-help-output": "^4.0.0"
100
100
  }
101
101
  }
package/src/releasable.js CHANGED
@@ -9,6 +9,7 @@ const { createPatch } = require('rfc6902');
9
9
  const {
10
10
  getFileAtCommit,
11
11
  } = require('./git');
12
+ const { replaceJsonFile } = require('./fs');
12
13
 
13
14
  const filesContributingToReleasability = new Set([
14
15
  '.gitignore',
@@ -53,13 +54,30 @@ async function prepareTmpPackage({
53
54
 
54
55
  await fs.mkdir(path.dirname(to), { recursive: true });
55
56
 
57
+ let doesExist;
58
+
56
59
  try {
57
60
  await fs.copyFile(from, to);
61
+
62
+ doesExist = true;
58
63
  } catch (err) {
59
64
  if (err.code !== 'ENOENT') {
60
65
  throw err;
61
66
  }
62
67
  }
68
+
69
+ if (fileName === 'package.json' && doesExist) {
70
+ await replaceJsonFile(to, packageJson => {
71
+ // If complete packages are deleted that still match our current workspaces globs,
72
+ // AND their path basenames happen to be the same (because we zerod out their package.json names below),
73
+ // packlist will think the packages are duplicates without this line (when it's the monorepo root package).
74
+ // We already filtered out current package changes before we got to this point,
75
+ // so everything remaining shouldn't be considered packages anyways.
76
+ if (packageJson.workspaces) {
77
+ packageJson.workspaces = [];
78
+ }
79
+ });
80
+ }
63
81
  }
64
82
 
65
83
  let remainingFiles = changedFiles.diff(filesContributingToReleasability);