sku 12.6.0 → 12.6.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.
- package/CHANGELOG.md +12 -0
- package/context/defaultCompilePackages.js +6 -14
- package/lib/buildFileUtils.js +12 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# sku
|
|
2
2
|
|
|
3
|
+
## 12.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix default compile package detection in PNPM repos ([#975](https://github.com/seek-oss/sku/pull/975))
|
|
8
|
+
|
|
9
|
+
## 12.6.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- When cleaning the build output directory, only delete files within the directory, rather than the entire directory ([#969](https://github.com/seek-oss/sku/pull/969))
|
|
14
|
+
|
|
3
15
|
## 12.6.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -2,7 +2,6 @@ const { posix: path } = require('node:path');
|
|
|
2
2
|
const chalk = require('chalk');
|
|
3
3
|
const { fdir: Fdir } = require('fdir');
|
|
4
4
|
|
|
5
|
-
const { cwd } = require('../lib/cwd');
|
|
6
5
|
const toPosixPath = require('../lib/toPosixPath');
|
|
7
6
|
|
|
8
7
|
const { rootDir, isPnpm } = require('../lib/packageManager');
|
|
@@ -15,18 +14,17 @@ let detectedCompilePackages = [];
|
|
|
15
14
|
// package manager. In either case, we can't correctly detect compile packages.
|
|
16
15
|
if (rootDir) {
|
|
17
16
|
try {
|
|
18
|
-
|
|
17
|
+
// Always use full paths so we don't need to worry about joining paths later
|
|
18
|
+
let crawler = new Fdir().withFullPaths();
|
|
19
19
|
|
|
20
20
|
if (isPnpm) {
|
|
21
21
|
// Follow symlinks inside node_modules into the pnpm virtual store
|
|
22
|
-
crawler = crawler.withSymlinks()
|
|
23
|
-
} else {
|
|
24
|
-
crawler = crawler.withBasePath();
|
|
22
|
+
crawler = crawler.withSymlinks();
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
const seekDependencyGlob = '**/@seek/*/package.json';
|
|
28
26
|
|
|
29
|
-
|
|
27
|
+
const results = crawler
|
|
30
28
|
.glob(seekDependencyGlob)
|
|
31
29
|
.crawl('./node_modules/@seek')
|
|
32
30
|
.sync();
|
|
@@ -43,23 +41,17 @@ if (rootDir) {
|
|
|
43
41
|
);
|
|
44
42
|
|
|
45
43
|
const pnpmVirtualStoreResults = new Fdir()
|
|
46
|
-
.
|
|
44
|
+
.withFullPaths()
|
|
47
45
|
.glob(seekDependencyGlob)
|
|
48
46
|
.crawl(pnpmVirtualStoreRelativePath)
|
|
49
47
|
.sync();
|
|
50
48
|
|
|
51
49
|
results.push(...pnpmVirtualStoreResults);
|
|
52
|
-
|
|
53
|
-
// All results will be relative to the virtual store directory, so we need
|
|
54
|
-
// to prepend the relative path from the current directory to the virtual store
|
|
55
|
-
results = results.map((file) =>
|
|
56
|
-
path.join(pnpmVirtualStoreRelativePath, file),
|
|
57
|
-
);
|
|
58
50
|
}
|
|
59
51
|
|
|
60
52
|
detectedCompilePackages = results
|
|
61
53
|
.map((packagePath) => {
|
|
62
|
-
const packageJson = require(
|
|
54
|
+
const packageJson = require(packagePath);
|
|
63
55
|
|
|
64
56
|
return {
|
|
65
57
|
isCompilePackage: Boolean(packageJson.skuCompilePackage),
|
package/lib/buildFileUtils.js
CHANGED
|
@@ -8,7 +8,18 @@ const exists = require('./exists');
|
|
|
8
8
|
const copyDirContents = require('./copyDirContents');
|
|
9
9
|
|
|
10
10
|
const cleanTargetDirectory = async () => {
|
|
11
|
-
|
|
11
|
+
const files = await new Fdir()
|
|
12
|
+
.withBasePath()
|
|
13
|
+
.withMaxDepth(1)
|
|
14
|
+
.withDirs()
|
|
15
|
+
// This glob pattern is used to exclude the target directory itself
|
|
16
|
+
.glob(`${paths.target}/*`)
|
|
17
|
+
.crawl(paths.target)
|
|
18
|
+
.withPromise();
|
|
19
|
+
|
|
20
|
+
for (const file of files) {
|
|
21
|
+
await fs.rm(file, { recursive: true, force: true });
|
|
22
|
+
}
|
|
12
23
|
};
|
|
13
24
|
|
|
14
25
|
const copyPublicFiles = async () => {
|