monorepo-next 9.0.0 → 9.0.2

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 +2 -2
  2. package/src/releasable.js +12 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monorepo-next",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
4
4
  "description": "Detach monorepo packages from normal linking",
5
5
  "bin": {
6
6
  "next": "bin/next.js"
@@ -68,7 +68,7 @@
68
68
  "minimatch": "^5.0.0",
69
69
  "npm-packlist": "^6.0.0",
70
70
  "rfc6902": "^5.0.0",
71
- "semver": "7.3.7",
71
+ "semver": "7.3.8",
72
72
  "standard-version": "9.5.0",
73
73
  "superset": "^2.0.1",
74
74
  "tmp": "0.2.1",
package/src/releasable.js CHANGED
@@ -29,9 +29,7 @@ function removeSubDirs(files) {
29
29
  return false;
30
30
  }
31
31
 
32
- let relative = path.relative(file, nextFile);
33
-
34
- let isSubDir = !relativePathRegex.test(relative);
32
+ let isSubDir = nextFile.startsWith(file);
35
33
 
36
34
  return isSubDir;
37
35
  });
@@ -73,7 +71,17 @@ async function prepareTmpPackage({
73
71
 
74
72
  await fs.mkdir(path.dirname(filePath), { recursive: true });
75
73
 
76
- await fs.writeFile(filePath, '');
74
+ let text;
75
+
76
+ if (path.basename(filePath) === 'package.json') {
77
+ // removed packages will still match the root package.json's workspaces
78
+ // and packlist will throw if they aren't readable.
79
+ text = JSON.stringify({});
80
+ } else {
81
+ text = '';
82
+ }
83
+
84
+ await fs.writeFile(filePath, text);
77
85
  }
78
86
  }
79
87