@tsdoctor/snapshot 0.1.0 → 0.1.1
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/SnapshotServiceLive.js +4 -5
- package/index.d.ts +2 -3
- package/package.json +2 -2
package/SnapshotServiceLive.js
CHANGED
|
@@ -49,9 +49,8 @@ const migrations = [{
|
|
|
49
49
|
* @remarks
|
|
50
50
|
* Backed by `@effected/store`'s `Store.layerSqlite`: layer construction opens
|
|
51
51
|
* the database (WAL mode), ensures the migration ledger and applies pending
|
|
52
|
-
* migrations.
|
|
53
|
-
*
|
|
54
|
-
* the main database on clean shutdown.
|
|
52
|
+
* migrations. `checkpointOnClose` folds the WAL sidecar files back into the
|
|
53
|
+
* main database on clean shutdown.
|
|
55
54
|
*
|
|
56
55
|
* This is a parameterized layer factory: call it once per database path and
|
|
57
56
|
* bind the result to a `const` — layers memoize by reference, and a fresh
|
|
@@ -65,11 +64,11 @@ const migrations = [{
|
|
|
65
64
|
const SnapshotServiceLive = (dbPath) => {
|
|
66
65
|
const StoreLive = Store.layerSqlite({
|
|
67
66
|
filename: dbPath,
|
|
68
|
-
migrations
|
|
67
|
+
migrations,
|
|
68
|
+
checkpointOnClose: true
|
|
69
69
|
});
|
|
70
70
|
const ServiceImpl = Layer.effect(SnapshotService, Effect.gen(function* () {
|
|
71
71
|
const sql = (yield* Store).client;
|
|
72
|
-
yield* Effect.addFinalizer(() => sql`PRAGMA wal_checkpoint(TRUNCATE)`.pipe(Effect.ignore));
|
|
73
72
|
return {
|
|
74
73
|
hashContent,
|
|
75
74
|
getSnapshot: (outputDir, filePath) => sql`SELECT * FROM file_snapshots WHERE output_dir = ${outputDir} AND file_path = ${filePath}`.pipe(Effect.map((rows) => rows.length > 0 ? Option.some(toFileSnapshot(rows[0])) : Option.none()), Effect.mapError(toSnapshotDbError)),
|
package/index.d.ts
CHANGED
|
@@ -157,9 +157,8 @@ declare class SnapshotService extends SnapshotService_base {}
|
|
|
157
157
|
* @remarks
|
|
158
158
|
* Backed by `@effected/store`'s `Store.layerSqlite`: layer construction opens
|
|
159
159
|
* the database (WAL mode), ensures the migration ledger and applies pending
|
|
160
|
-
* migrations.
|
|
161
|
-
*
|
|
162
|
-
* the main database on clean shutdown.
|
|
160
|
+
* migrations. `checkpointOnClose` folds the WAL sidecar files back into the
|
|
161
|
+
* main database on clean shutdown.
|
|
163
162
|
*
|
|
164
163
|
* This is a parameterized layer factory: call it once per database path and
|
|
165
164
|
* bind the result to a `const` — layers memoize by reference, and a fresh
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsdoctor/snapshot",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Incremental-build snapshot tracking for static documentation pipelines: a schema-versioned SQLite store of per-file content hashes and timestamps, built on @effected/store, plus the pure SHA-256 content-hashing helpers that feed it.",
|
|
6
6
|
"keywords": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@effected/store": "^0.
|
|
40
|
+
"@effected/store": "^0.5.0",
|
|
41
41
|
"effect": "4.0.0-rc.109"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|