@rushstack/package-extractor 0.12.8 → 0.12.10
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.json +39 -0
- package/CHANGELOG.md +13 -1
- package/dist/scripts/create-links.js +48 -22
- package/dist/scripts/create-links.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib-commonjs/PackageExtractor.js +11 -1
- package/lib-commonjs/PackageExtractor.js.map +1 -1
- package/lib-dts/PackageExtractor.d.ts.map +1 -1
- package/lib-esm/PackageExtractor.js +11 -1
- package/lib-esm/PackageExtractor.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/package-extractor",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.12.10",
|
|
6
|
+
"tag": "@rushstack/package-extractor_v0.12.10",
|
|
7
|
+
"date": "Tue, 31 Mar 2026 15:14:15 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"dependency": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Updating dependency \"@rushstack/node-core-library\" to `5.21.0`"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"comment": "Updating dependency \"@rushstack/terminal\" to `0.22.4`"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"comment": "Updating dependency \"@rushstack/ts-command-line\" to `5.3.4`"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"comment": "Updating dependency \"@rushstack/heft-webpack5-plugin\" to `1.3.8`"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"comment": "Updating dependency \"@rushstack/heft\" to `1.2.8`"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"comment": "Updating dependency \"@rushstack/webpack-preserve-dynamic-require-plugin\" to `0.12.9`"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"version": "0.12.9",
|
|
33
|
+
"tag": "@rushstack/package-extractor_v0.12.9",
|
|
34
|
+
"date": "Wed, 25 Mar 2026 01:00:26 GMT",
|
|
35
|
+
"comments": {
|
|
36
|
+
"patch": [
|
|
37
|
+
{
|
|
38
|
+
"comment": "preventing duplicate-copy conflicts across npm-packlist versions"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
4
43
|
{
|
|
5
44
|
"version": "0.12.8",
|
|
6
45
|
"tag": "@rushstack/package-extractor_v0.12.8",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# Change Log - @rushstack/package-extractor
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 31 Mar 2026 15:14:15 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.12.10
|
|
6
|
+
Tue, 31 Mar 2026 15:14:15 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 0.12.9
|
|
11
|
+
Wed, 25 Mar 2026 01:00:26 GMT
|
|
12
|
+
|
|
13
|
+
### Patches
|
|
14
|
+
|
|
15
|
+
- preventing duplicate-copy conflicts across npm-packlist versions
|
|
4
16
|
|
|
5
17
|
## 0.12.8
|
|
6
18
|
Mon, 09 Mar 2026 15:14:08 GMT
|
|
@@ -58596,9 +58596,12 @@ class LockFile {
|
|
|
58596
58596
|
* Attempts to acquire the lock on a Linux or OSX machine
|
|
58597
58597
|
*/
|
|
58598
58598
|
static _tryAcquireMacOrLinux(resourceFolder, resourceName, pidLockFilePath) {
|
|
58599
|
-
|
|
58600
|
-
// get the current process' pid
|
|
58599
|
+
// get the current process identifier (PID)
|
|
58601
58600
|
const pid = process.pid;
|
|
58601
|
+
// Suppose that a process terminates unexpectedly without deleting its PID-based lockfile,
|
|
58602
|
+
// then we check to see if the process is still alive. The OS may have given the same PID
|
|
58603
|
+
// to a new process, how to detect that? We will rely on getProcessStartTime() which
|
|
58604
|
+
// is stored in the file itself for comparison.
|
|
58602
58605
|
const startTime = LockFile._getStartTime(pid);
|
|
58603
58606
|
if (!startTime) {
|
|
58604
58607
|
throw new Error(`Unable to calculate start time for current process.`);
|
|
@@ -58618,17 +58621,23 @@ class LockFile {
|
|
|
58618
58621
|
const files = FileSystem_1.FileSystem.readFolderItemNames(resourceFolder);
|
|
58619
58622
|
// look for anything ending with # then numbers and ".lock"
|
|
58620
58623
|
const lockFileRegExp = /^(.+)#([0-9]+)\.lock$/;
|
|
58624
|
+
// If we are the process to acquire the lock, it becomes our responsibility to clean up these
|
|
58625
|
+
// stale files. If there is at least 1 stale file, then the resource is assumed to be "dirty"
|
|
58626
|
+
// (for example, the previous process was interrupted before releasing or while acquiring).
|
|
58627
|
+
const staleFilesToDelete = [];
|
|
58621
58628
|
let match;
|
|
58622
58629
|
let otherPid;
|
|
58623
58630
|
for (const fileInFolder of files) {
|
|
58624
58631
|
if ((match = fileInFolder.match(lockFileRegExp)) &&
|
|
58625
58632
|
match[1] === resourceName &&
|
|
58626
58633
|
(otherPid = match[2]) !== pid.toString()) {
|
|
58627
|
-
//
|
|
58634
|
+
// We found at least one lockfile hanging around that isn't ours
|
|
58628
58635
|
const fileInFolderPath = `${resourceFolder}/${fileInFolder}`;
|
|
58629
|
-
dirtyWhenAcquired = true;
|
|
58630
58636
|
// console.log(`FOUND OTHER LOCKFILE: ${otherPid}`);
|
|
58637
|
+
// Actual start time of the other PID
|
|
58631
58638
|
const otherPidCurrentStartTime = LockFile._getStartTime(parseInt(otherPid, 10));
|
|
58639
|
+
// The start time from the file, which we will compare with otherPidCurrentStartTime
|
|
58640
|
+
// to determine whether the PID got reused by a new process.
|
|
58632
58641
|
let otherPidOldStartTime;
|
|
58633
58642
|
let otherBirthtimeMs;
|
|
58634
58643
|
try {
|
|
@@ -58638,41 +58647,53 @@ class LockFile {
|
|
|
58638
58647
|
}
|
|
58639
58648
|
catch (error) {
|
|
58640
58649
|
if (FileSystem_1.FileSystem.isNotExistError(error)) {
|
|
58641
|
-
//
|
|
58650
|
+
// ==> Properly closed lockfile, safe to ignore:
|
|
58651
|
+
// The other process deleted the file, which we assume means it completed successfully,
|
|
58652
|
+
// so the state is not dirty. This is equivalent to if readFolderItemNames() never saw
|
|
58653
|
+
// the file in the firstplace.
|
|
58642
58654
|
continue;
|
|
58643
58655
|
}
|
|
58644
58656
|
}
|
|
58645
|
-
//
|
|
58646
|
-
//
|
|
58647
|
-
|
|
58648
|
-
// will conservatively fail
|
|
58649
|
-
// otherwise it is an old lock file and will be deleted
|
|
58650
|
-
if (otherPidOldStartTime === '' && otherBirthtimeMs !== undefined) {
|
|
58657
|
+
// What the other process's file exists, but it is an empty file?
|
|
58658
|
+
// Either they were terminated while acquiring, or else they haven't finished writing it yet.
|
|
58659
|
+
if (otherBirthtimeMs !== undefined && otherPidOldStartTime === '') {
|
|
58651
58660
|
if (otherBirthtimeMs > currentBirthTimeMs) {
|
|
58652
|
-
//
|
|
58653
|
-
//
|
|
58661
|
+
// ==> Safe to ignore
|
|
58662
|
+
// If the other process was terminated, it happened before they finished acquiring.
|
|
58663
|
+
// If the other process is alive, their file is newer, so we will acquire instead of them.
|
|
58654
58664
|
// console.log(`Ignoring lock for pid ${otherPid} because its lockfile is newer than ours.`);
|
|
58655
58665
|
continue;
|
|
58656
58666
|
}
|
|
58657
|
-
else if (otherBirthtimeMs - currentBirthTimeMs < 0 &&
|
|
58667
|
+
else if (otherBirthtimeMs - currentBirthTimeMs < 0 &&
|
|
58658
58668
|
otherBirthtimeMs - currentBirthTimeMs > -1000) {
|
|
58659
|
-
//
|
|
58660
|
-
//
|
|
58661
|
-
|
|
58669
|
+
// ==> Race condition
|
|
58670
|
+
// The other process created their file first, so they will probably acquire the lock
|
|
58671
|
+
// after they finish writing the contents. But what if their process is actually dead
|
|
58672
|
+
// and replaced by a new process with the same PID? Normally the otherPidOldStartTime
|
|
58673
|
+
// gives the answer, but in this edge case we are missing that information.
|
|
58674
|
+
// So we conservatively assume that it should not take them more than 1000ms to
|
|
58675
|
+
// open a file, write a PID, and close the file.
|
|
58676
|
+
return undefined; // fail to acquire and retry later
|
|
58662
58677
|
}
|
|
58663
58678
|
}
|
|
58664
58679
|
// console.log(`Other pid ${otherPid} lockfile has start time: "${otherPidOldStartTime}"`);
|
|
58665
58680
|
// console.log(`Other pid ${otherPid} actually has start time: "${otherPidCurrentStartTime}"`);
|
|
58666
|
-
//
|
|
58681
|
+
// Time to compare
|
|
58667
58682
|
if (!otherPidCurrentStartTime || otherPidOldStartTime !== otherPidCurrentStartTime) {
|
|
58683
|
+
// ==> Stale lockfile
|
|
58684
|
+
// This file doesn't prevent us from acquiring the lock, but it does indicate that
|
|
58685
|
+
// the resource was left in a dirty state. (If we delete the file right now, that
|
|
58686
|
+
// information would be lost, so we clean up later when we acquire successfully.)
|
|
58668
58687
|
// console.log(`Other pid ${otherPid} is no longer executing!`);
|
|
58669
|
-
|
|
58688
|
+
staleFilesToDelete.push(fileInFolderPath);
|
|
58670
58689
|
continue;
|
|
58671
58690
|
}
|
|
58672
58691
|
// console.log(`Pid ${otherPid} lockfile has birth time: ${otherBirthtimeMs}`);
|
|
58673
58692
|
// console.log(`Pid ${pid} lockfile has birth time: ${currentBirthTimeMs}`);
|
|
58674
|
-
// this is a lockfile pointing at something valid
|
|
58675
58693
|
if (otherBirthtimeMs !== undefined) {
|
|
58694
|
+
// ==> We found a valid file belonging to another process.
|
|
58695
|
+
// With multiple parties trying to acquire, the winner is the smallestBirthTime,
|
|
58696
|
+
// so we need to sort.
|
|
58676
58697
|
// the other lock file was created before the current earliest lock file
|
|
58677
58698
|
// or the other lock file was created at the same exact time, but has earlier pid
|
|
58678
58699
|
// note that it is acceptable to do a direct comparison of the PIDs in this case
|
|
@@ -58693,9 +58714,14 @@ class LockFile {
|
|
|
58693
58714
|
// we do not have the lock
|
|
58694
58715
|
return undefined;
|
|
58695
58716
|
}
|
|
58696
|
-
|
|
58717
|
+
let dirtyWhenAcquired = false;
|
|
58718
|
+
for (const staleFileToDelete of staleFilesToDelete) {
|
|
58719
|
+
FileSystem_1.FileSystem.deleteFile(staleFileToDelete, { throwIfNotExists: false });
|
|
58720
|
+
dirtyWhenAcquired = true;
|
|
58721
|
+
}
|
|
58722
|
+
// We have the lock!
|
|
58697
58723
|
lockFile = new LockFile(lockFileHandle, pidLockFilePath, dirtyWhenAcquired);
|
|
58698
|
-
lockFileHandle = undefined; //
|
|
58724
|
+
lockFileHandle = undefined; // The LockFile object has taken ownership of our handle
|
|
58699
58725
|
}
|
|
58700
58726
|
finally {
|
|
58701
58727
|
if (lockFileHandle) {
|