skir 1.1.2 → 1.1.3

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.
@@ -112,7 +112,7 @@ async function readLastSnapshot(
112
112
  const isNotFoundError =
113
113
  error instanceof Error && "code" in error && error.code === "ENOENT";
114
114
  if (isNotFoundError) {
115
- return ModuleSet.fromMap(new Map<string, string>());
115
+ return ModuleSet.compile(new Map<string, string>());
116
116
  } else {
117
117
  // Rethrow I/O error
118
118
  throw error;
@@ -149,7 +149,7 @@ export function snapshotFileContentToModuleSet(
149
149
  error: error,
150
150
  };
151
151
  }
152
- const moduleSet = ModuleSet.fromMap(pathToSourceCode);
152
+ const moduleSet = ModuleSet.compile(pathToSourceCode);
153
153
  if (moduleSet.errors.length) {
154
154
  const firstError = formatError(moduleSet.errors[0]!);
155
155
  return {
@@ -199,8 +199,10 @@ export async function viewSnapshot(args: { rootDir: string }): Promise<void> {
199
199
 
200
200
  function makeSnapshot(moduleSet: ModuleSet, now: Date): Snapshot {
201
201
  const modules: { [path: string]: string } = {};
202
- for (const module of moduleSet.resolvedModules) {
203
- modules[module.path] = module.sourceCode;
202
+ for (const [path, moduleResult] of moduleSet.modules) {
203
+ if (moduleResult.errors.length === 0) {
204
+ modules[path] = moduleResult.result.sourceCode;
205
+ }
204
206
  }
205
207
  const trackedRecordIds = collectTrackedRecords(moduleSet);
206
208
  return {