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.
- package/dist/compatibility_checker.d.ts.map +1 -1
- package/dist/compatibility_checker.js +2 -1
- package/dist/compatibility_checker.js.map +1 -1
- package/dist/compiler.js +11 -6
- package/dist/compiler.js.map +1 -1
- package/dist/module_collector.d.ts +1 -1
- package/dist/module_collector.d.ts.map +1 -1
- package/dist/module_collector.js +11 -5
- package/dist/module_collector.js.map +1 -1
- package/dist/module_set.d.ts +24 -19
- package/dist/module_set.d.ts.map +1 -1
- package/dist/module_set.js +327 -136
- package/dist/module_set.js.map +1 -1
- package/dist/snapshotter.js +6 -4
- package/dist/snapshotter.js.map +1 -1
- package/package.json +1 -1
- package/src/compatibility_checker.ts +2 -1
- package/src/compiler.ts +17 -6
- package/src/module_collector.ts +13 -4
- package/src/module_set.ts +406 -157
- package/src/snapshotter.ts +6 -4
package/src/snapshotter.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
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
|
|
203
|
-
|
|
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 {
|