@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/fs",
3
- "version": "2.13.2-dev.3689+7a2e6e783",
3
+ "version": "2.14.1-canary.3710+d874396ab",
4
4
  "description": "Blazing fast, zero configuration web application bundler",
5
5
  "license": "(MIT OR Apache-2.0)",
6
6
  "publishConfig": {
@@ -52,17 +52,17 @@
52
52
  "check-ts": "tsc --noEmit index.d.ts"
53
53
  },
54
54
  "dependencies": {
55
- "@atlaspack/build-cache": "2.13.2-dev.3689+7a2e6e783",
56
- "@atlaspack/feature-flags": "2.13.2-dev.3689+7a2e6e783",
57
- "@atlaspack/logger": "2.13.2-dev.3689+7a2e6e783",
58
- "@atlaspack/rust": "2.13.2-dev.3689+7a2e6e783",
59
- "@atlaspack/types-internal": "2.13.2-dev.3689+7a2e6e783",
60
- "@atlaspack/utils": "2.13.2-dev.3689+7a2e6e783",
61
- "@atlaspack/workers": "2.13.2-dev.3689+7a2e6e783",
55
+ "@atlaspack/build-cache": "2.13.3-canary.3710+d874396ab",
56
+ "@atlaspack/feature-flags": "2.14.1-canary.3710+d874396ab",
57
+ "@atlaspack/logger": "2.14.1-canary.3710+d874396ab",
58
+ "@atlaspack/rust": "3.0.1-canary.3710+d874396ab",
59
+ "@atlaspack/types-internal": "2.14.1-canary.3710+d874396ab",
60
+ "@atlaspack/utils": "2.14.1-canary.3710+d874396ab",
61
+ "@atlaspack/workers": "2.14.1-canary.3710+d874396ab",
62
62
  "@parcel/watcher": "^2.0.7"
63
63
  },
64
64
  "devDependencies": {
65
- "@atlaspack/watcher-watchman-js": "2.13.2-dev.3689+7a2e6e783",
65
+ "@atlaspack/watcher-watchman-js": "2.14.1-canary.3710+d874396ab",
66
66
  "graceful-fs": "^4.2.4",
67
67
  "ncp": "^2.0.0",
68
68
  "nullthrows": "^1.1.1",
@@ -72,5 +72,6 @@
72
72
  "@atlaspack/fs": "./lib/browser.js",
73
73
  "./src/NodeFS.js": "./src/NodeFS.browser.js"
74
74
  },
75
- "gitHead": "7a2e6e7835fa846b27021b374097c6a4f37541ba"
75
+ "type": "commonjs",
76
+ "gitHead": "d874396ab648d0d5505d66c7eb73e1748f1eaf68"
76
77
  }
@@ -6,7 +6,7 @@ import {getVcsStateSnapshot, getEventsSince} from '@atlaspack/rust';
6
6
  import type {FilePath} from '@atlaspack/types-internal';
7
7
  import type {Event, Options as WatcherOptions} from '@parcel/watcher';
8
8
  import {registerSerializableClass} from '@atlaspack/build-cache';
9
- import {instrument, instrumentAsync} from '@atlaspack/logger';
9
+ import logger, {instrumentAsync} from '@atlaspack/logger';
10
10
  import {getFeatureFlagValue} from '@atlaspack/feature-flags';
11
11
 
12
12
  // $FlowFixMe
@@ -87,15 +87,19 @@ export class NodeVCSAwareFS extends NodeFS {
87
87
  );
88
88
  let watcherEventsSince = [];
89
89
 
90
- const vcsEventsSince = instrument(
91
- 'NodeVCSAwareFS::rust.getEventsSince',
92
- () => getEventsSince(gitRepoPath, vcsState, null),
93
- ).map((e) => ({
94
- path: e.path,
95
- type: e.changeType,
96
- }));
97
-
98
- if (getFeatureFlagValue('vcsMode') !== 'NEW') {
90
+ const vcsEventsSince =
91
+ vcsState != null
92
+ ? (
93
+ await instrumentAsync('NodeVCSAwareFS::rust.getEventsSince', () =>
94
+ getEventsSince(gitRepoPath, vcsState, null),
95
+ )
96
+ ).map((e) => ({
97
+ path: e.path,
98
+ type: e.changeType,
99
+ }))
100
+ : null;
101
+
102
+ if (getFeatureFlagValue('vcsMode') !== 'NEW' && vcsEventsSince != null) {
99
103
  watcherEventsSince = await instrumentAsync(
100
104
  'NodeVCSAwareFS::watchman.getEventsSince',
101
105
  () => this.watcher().getEventsSince(dir, nativeSnapshotPath, opts),
@@ -104,6 +108,19 @@ export class NodeVCSAwareFS extends NodeFS {
104
108
  }
105
109
 
106
110
  if (['NEW_AND_CHECK', 'NEW'].includes(getFeatureFlagValue('vcsMode'))) {
111
+ if (vcsEventsSince == null) {
112
+ logger.error({
113
+ origin: '@atlaspack/fs',
114
+ message:
115
+ 'Missing VCS state. There was an error when writing the snapshot. Please clear your cache.',
116
+ meta: {
117
+ trackableEvent: 'vcs_state_snapshot_read_failed',
118
+ },
119
+ });
120
+
121
+ return [];
122
+ }
123
+
107
124
  return vcsEventsSince;
108
125
  }
109
126
 
@@ -137,9 +154,22 @@ export class NodeVCSAwareFS extends NodeFS {
137
154
  );
138
155
  }
139
156
 
140
- const vcsState = instrument('NodeVCSAwareFS::getVcsStateSnapshot', () =>
141
- getVcsStateSnapshot(gitRepoPath, this.#excludePatterns),
142
- );
157
+ let vcsState = null;
158
+ try {
159
+ vcsState = await instrumentAsync(
160
+ 'NodeVCSAwareFS::getVcsStateSnapshot',
161
+ () => getVcsStateSnapshot(gitRepoPath, this.#excludePatterns),
162
+ );
163
+ } catch (err) {
164
+ logger.error({
165
+ origin: '@atlaspack/fs',
166
+ message: `Failed to get VCS state snapshot: ${err.message}`,
167
+ meta: {
168
+ trackableEvent: 'vcs_state_snapshot_failed',
169
+ error: err,
170
+ },
171
+ });
172
+ }
143
173
 
144
174
  const snapshotContents = {
145
175
  vcsState,