@atlaspack/fs 2.15.3 → 2.15.4
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 +14 -0
- package/lib/browser.js +8 -4
- package/lib/browser.js.map +1 -1
- package/lib/index.js +9 -4
- package/lib/index.js.map +1 -1
- package/package.json +8 -8
- package/src/MemoryFS.js +6 -2
- package/src/NodeFS.js +1 -0
- package/src/NodeVCSAwareFS.js +1 -0
- package/src/index.js +6 -1
package/lib/index.js
CHANGED
|
@@ -1018,7 +1018,7 @@ function $1e76aa5674175761$var$ncp(source, dest, options, callback) {
|
|
|
1018
1018
|
|
|
1019
1019
|
|
|
1020
1020
|
var $d7f6ae9f917393f7$exports = {};
|
|
1021
|
-
$d7f6ae9f917393f7$exports = JSON.parse("{\"name\":\"@atlaspack/fs\",\"version\":\"2.15.
|
|
1021
|
+
$d7f6ae9f917393f7$exports = JSON.parse("{\"name\":\"@atlaspack/fs\",\"version\":\"2.15.4\",\"description\":\"Blazing fast, zero configuration web application bundler\",\"license\":\"(MIT OR Apache-2.0)\",\"publishConfig\":{\"access\":\"public\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/atlassian-labs/atlaspack.git\"},\"main\":\"lib/index.js\",\"source\":\"src/index.js\",\"types\":\"index.d.ts\",\"engines\":{\"node\":\">= 16.0.0\"},\"targets\":{\"types\":false,\"main\":{\"includeNodeModules\":{\"@atlaspack/build-cache\":false,\"@atlaspack/diagnostic\":false,\"@atlaspack/feature-flags\":false,\"@atlaspack/logger\":false,\"@atlaspack/rust\":false,\"@atlaspack/types-internal\":false,\"@atlaspack/utils\":false,\"@atlaspack/watcher-watchman-js\":false,\"@parcel/watcher\":false,\"@atlaspack/workers\":false}},\"browser\":{\"includeNodeModules\":{\"@atlaspack/build-cache\":false,\"@atlaspack/diagnostic\":false,\"@atlaspack/feature-flags\":false,\"@atlaspack/logger\":false,\"@atlaspack/rust\":false,\"@atlaspack/types-internal\":false,\"@atlaspack/utils\":false,\"@atlaspack/watcher-watchman-js\":false,\"@parcel/watcher\":false,\"@atlaspack/workers\":false}}},\"scripts\":{\"build-ts\":\"mkdir -p lib && flow-to-ts src/types.js > lib/types.d.ts\",\"check-ts\":\"tsc --noEmit index.d.ts\"},\"dependencies\":{\"@atlaspack/build-cache\":\"2.13.3\",\"@atlaspack/feature-flags\":\"2.16.0\",\"@atlaspack/logger\":\"2.14.9\",\"@atlaspack/rust\":\"3.3.4\",\"@atlaspack/types-internal\":\"2.14.7\",\"@atlaspack/utils\":\"2.14.9\",\"@parcel/watcher\":\"^2.0.7\",\"@atlaspack/workers\":\"2.14.9\"},\"devDependencies\":{\"@atlaspack/watcher-watchman-js\":\"2.14.9\",\"graceful-fs\":\"^4.2.4\",\"ncp\":\"^2.0.0\",\"nullthrows\":\"^1.1.1\",\"utility-types\":\"^3.10.0\"},\"browser\":{\"@atlaspack/fs\":\"./lib/browser.js\",\"./src/NodeFS.js\":\"./src/NodeFS.browser.js\"},\"type\":\"commonjs\"}");
|
|
1022
1022
|
|
|
1023
1023
|
|
|
1024
1024
|
|
|
@@ -1173,6 +1173,7 @@ class $94eb45ad74bb764d$export$c4e0ef2ab73c21e7 {
|
|
|
1173
1173
|
return this.watcher().getEventsSince(dir, snapshot, opts);
|
|
1174
1174
|
}
|
|
1175
1175
|
async writeSnapshot(dir, snapshot, opts) {
|
|
1176
|
+
await this.mkdirp((0, ($parcel$interopDefault($2V2hx$path))).dirname(snapshot));
|
|
1176
1177
|
await this.watcher().writeSnapshot(dir, snapshot, opts);
|
|
1177
1178
|
}
|
|
1178
1179
|
static deserialize() {
|
|
@@ -1583,6 +1584,7 @@ class $0846bf1c7ee89e90$export$3048eb7ec07c2c4e {
|
|
|
1583
1584
|
return new $0846bf1c7ee89e90$var$ReadStream(this, filePath);
|
|
1584
1585
|
}
|
|
1585
1586
|
createWriteStream(filePath, options) {
|
|
1587
|
+
this.mkdirp((0, ($parcel$interopDefault($2V2hx$path))).dirname(filePath));
|
|
1586
1588
|
return new $0846bf1c7ee89e90$var$WriteStream(this, filePath, options);
|
|
1587
1589
|
}
|
|
1588
1590
|
realpathSync(filePath) {
|
|
@@ -1621,7 +1623,8 @@ class $0846bf1c7ee89e90$export$3048eb7ec07c2c4e {
|
|
|
1621
1623
|
this._eventQueue = [];
|
|
1622
1624
|
for (let [dir, watchers] of this.watchers){
|
|
1623
1625
|
if (!dir.endsWith((0, ($parcel$interopDefault($2V2hx$path))).sep)) dir += (0, ($parcel$interopDefault($2V2hx$path))).sep;
|
|
1624
|
-
|
|
1626
|
+
const relevantEvents = events.filter((event)=>event.path.startsWith(dir));
|
|
1627
|
+
if (relevantEvents.length > 0) for (let watcher of watchers)watcher.trigger(relevantEvents);
|
|
1625
1628
|
}
|
|
1626
1629
|
}, 50);
|
|
1627
1630
|
}
|
|
@@ -2355,6 +2358,7 @@ class $907e69a4d4f6f904$export$80de92554c03942a extends (0, $94eb45ad74bb764d$ex
|
|
|
2355
2358
|
return;
|
|
2356
2359
|
}
|
|
2357
2360
|
const snapshotDirectory = (0, ($parcel$interopDefault($2V2hx$path))).dirname(snapshot);
|
|
2361
|
+
await this.mkdirp(snapshotDirectory);
|
|
2358
2362
|
const filename = (0, ($parcel$interopDefault($2V2hx$path))).basename(snapshot, '.txt');
|
|
2359
2363
|
const nativeSnapshotPath = (0, ($parcel$interopDefault($2V2hx$path))).join(snapshotDirectory, `${filename}.native-snapshot.txt`);
|
|
2360
2364
|
if ((0, $2V2hx$atlaspackfeatureflags.getFeatureFlagValue)('vcsMode') !== 'NEW') await (0, $2V2hx$atlaspacklogger.instrumentAsync)('NodeVCSAwareFS::watchman.writeSnapshot', async ()=>{
|
|
@@ -2393,15 +2397,16 @@ class $907e69a4d4f6f904$export$80de92554c03942a extends (0, $94eb45ad74bb764d$ex
|
|
|
2393
2397
|
|
|
2394
2398
|
|
|
2395
2399
|
const $5acbc033ab4ad011$var$pipeline = (0, $2V2hx$util.promisify)((0, ($parcel$interopDefault($2V2hx$stream))).pipeline);
|
|
2396
|
-
async function $5acbc033ab4ad011$export$d3a8044e3fef7335(sourceFS, source, destinationFS, destination) {
|
|
2400
|
+
async function $5acbc033ab4ad011$export$d3a8044e3fef7335(sourceFS, source, destinationFS, destination, filter) {
|
|
2397
2401
|
await destinationFS.mkdirp(destination);
|
|
2398
2402
|
let files = await sourceFS.readdir(source);
|
|
2399
2403
|
for (let file of files){
|
|
2404
|
+
if (filter && !filter(file)) continue;
|
|
2400
2405
|
let sourcePath = (0, ($parcel$interopDefault($2V2hx$path))).join(source, file);
|
|
2401
2406
|
let destPath = (0, ($parcel$interopDefault($2V2hx$path))).join(destination, file);
|
|
2402
2407
|
let stats = await sourceFS.stat(sourcePath);
|
|
2403
2408
|
if (stats.isFile()) await $5acbc033ab4ad011$var$pipeline(sourceFS.createReadStream(sourcePath), destinationFS.createWriteStream(destPath));
|
|
2404
|
-
else if (stats.isDirectory()) await $5acbc033ab4ad011$export$d3a8044e3fef7335(sourceFS, sourcePath, destinationFS, destPath);
|
|
2409
|
+
else if (stats.isDirectory()) await $5acbc033ab4ad011$export$d3a8044e3fef7335(sourceFS, sourcePath, destinationFS, destPath, filter);
|
|
2405
2410
|
}
|
|
2406
2411
|
}
|
|
2407
2412
|
$parcel$exportWildcard(module.exports, $94eb45ad74bb764d$exports);
|