@atlaspack/fs 2.13.2-dev.3689 → 2.14.1-canary.3710

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/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.13.2-dev.3689+7a2e6e783\",\"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.2-dev.3689+7a2e6e783\",\"@atlaspack/feature-flags\":\"2.13.2-dev.3689+7a2e6e783\",\"@atlaspack/logger\":\"2.13.2-dev.3689+7a2e6e783\",\"@atlaspack/rust\":\"2.13.2-dev.3689+7a2e6e783\",\"@atlaspack/types-internal\":\"2.13.2-dev.3689+7a2e6e783\",\"@atlaspack/utils\":\"2.13.2-dev.3689+7a2e6e783\",\"@atlaspack/workers\":\"2.13.2-dev.3689+7a2e6e783\",\"@parcel/watcher\":\"^2.0.7\"},\"devDependencies\":{\"@atlaspack/watcher-watchman-js\":\"2.13.2-dev.3689+7a2e6e783\",\"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\"},\"gitHead\":\"7a2e6e7835fa846b27021b374097c6a4f37541ba\"}");
1021
+ $d7f6ae9f917393f7$exports = JSON.parse("{\"name\":\"@atlaspack/fs\",\"version\":\"2.14.1-canary.3710+d874396ab\",\"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-canary.3710+d874396ab\",\"@atlaspack/feature-flags\":\"2.14.1-canary.3710+d874396ab\",\"@atlaspack/logger\":\"2.14.1-canary.3710+d874396ab\",\"@atlaspack/rust\":\"3.0.1-canary.3710+d874396ab\",\"@atlaspack/types-internal\":\"2.14.1-canary.3710+d874396ab\",\"@atlaspack/utils\":\"2.14.1-canary.3710+d874396ab\",\"@atlaspack/workers\":\"2.14.1-canary.3710+d874396ab\",\"@parcel/watcher\":\"^2.0.7\"},\"devDependencies\":{\"@atlaspack/watcher-watchman-js\":\"2.14.1-canary.3710+d874396ab\",\"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\",\"gitHead\":\"d874396ab648d0d5505d66c7eb73e1748f1eaf68\"}");
1022
1022
 
1023
1023
 
1024
1024
 
@@ -2318,18 +2318,30 @@ class $907e69a4d4f6f904$export$80de92554c03942a extends (0, $94eb45ad74bb764d$ex
2318
2318
  return JSON.parse(snapshotFileContent);
2319
2319
  });
2320
2320
  let watcherEventsSince = [];
2321
- const vcsEventsSince = (0, $2V2hx$atlaspacklogger.instrument)('NodeVCSAwareFS::rust.getEventsSince', ()=>(0, $2V2hx$atlaspackrust.getEventsSince)(gitRepoPath, vcsState, null)).map((e)=>({
2321
+ const vcsEventsSince = vcsState != null ? (await (0, $2V2hx$atlaspacklogger.instrumentAsync)('NodeVCSAwareFS::rust.getEventsSince', ()=>(0, $2V2hx$atlaspackrust.getEventsSince)(gitRepoPath, vcsState, null))).map((e)=>({
2322
2322
  path: e.path,
2323
2323
  type: e.changeType
2324
- }));
2325
- if ((0, $2V2hx$atlaspackfeatureflags.getFeatureFlagValue)('vcsMode') !== 'NEW') {
2324
+ })) : null;
2325
+ if ((0, $2V2hx$atlaspackfeatureflags.getFeatureFlagValue)('vcsMode') !== 'NEW' && vcsEventsSince != null) {
2326
2326
  watcherEventsSince = await (0, $2V2hx$atlaspacklogger.instrumentAsync)('NodeVCSAwareFS::watchman.getEventsSince', ()=>this.watcher().getEventsSince(dir, nativeSnapshotPath, opts));
2327
2327
  this.#logEventDiff?.(watcherEventsSince, vcsEventsSince);
2328
2328
  }
2329
2329
  if ([
2330
2330
  'NEW_AND_CHECK',
2331
2331
  'NEW'
2332
- ].includes((0, $2V2hx$atlaspackfeatureflags.getFeatureFlagValue)('vcsMode'))) return vcsEventsSince;
2332
+ ].includes((0, $2V2hx$atlaspackfeatureflags.getFeatureFlagValue)('vcsMode'))) {
2333
+ if (vcsEventsSince == null) {
2334
+ (0, ($parcel$interopDefault($2V2hx$atlaspacklogger))).error({
2335
+ origin: '@atlaspack/fs',
2336
+ message: 'Missing VCS state. There was an error when writing the snapshot. Please clear your cache.',
2337
+ meta: {
2338
+ trackableEvent: 'vcs_state_snapshot_read_failed'
2339
+ }
2340
+ });
2341
+ return [];
2342
+ }
2343
+ return vcsEventsSince;
2344
+ }
2333
2345
  return watcherEventsSince;
2334
2346
  }
2335
2347
  async writeSnapshot(dir, snapshot, opts) {
@@ -2344,11 +2356,24 @@ class $907e69a4d4f6f904$export$80de92554c03942a extends (0, $94eb45ad74bb764d$ex
2344
2356
  if ((0, $2V2hx$atlaspackfeatureflags.getFeatureFlagValue)('vcsMode') !== 'NEW') await (0, $2V2hx$atlaspacklogger.instrumentAsync)('NodeVCSAwareFS::watchman.writeSnapshot', async ()=>{
2345
2357
  await this.watcher().writeSnapshot(dir, nativeSnapshotPath, opts);
2346
2358
  });
2347
- const vcsState = (0, $2V2hx$atlaspacklogger.instrument)('NodeVCSAwareFS::getVcsStateSnapshot', ()=>(0, $2V2hx$atlaspackrust.getVcsStateSnapshot)(gitRepoPath, this.#excludePatterns));
2348
- await this.writeFile(snapshot, JSON.stringify({
2359
+ let vcsState = null;
2360
+ try {
2361
+ vcsState = await (0, $2V2hx$atlaspacklogger.instrumentAsync)('NodeVCSAwareFS::getVcsStateSnapshot', ()=>(0, $2V2hx$atlaspackrust.getVcsStateSnapshot)(gitRepoPath, this.#excludePatterns));
2362
+ } catch (err) {
2363
+ (0, ($parcel$interopDefault($2V2hx$atlaspacklogger))).error({
2364
+ origin: '@atlaspack/fs',
2365
+ message: `Failed to get VCS state snapshot: ${err.message}`,
2366
+ meta: {
2367
+ trackableEvent: 'vcs_state_snapshot_failed',
2368
+ error: err
2369
+ }
2370
+ });
2371
+ }
2372
+ const snapshotContents = {
2349
2373
  vcsState: vcsState,
2350
2374
  nativeSnapshotPath: nativeSnapshotPath
2351
- }));
2375
+ };
2376
+ await this.writeFile(snapshot, JSON.stringify(snapshotContents));
2352
2377
  }
2353
2378
  }
2354
2379
  (0, $2V2hx$atlaspackbuildcache.registerSerializableClass)(`${(0, (/*@__PURE__*/$parcel$interopDefault($d7f6ae9f917393f7$exports))).version}:NodeVCSAwareFS`, $907e69a4d4f6f904$export$80de92554c03942a);