@furystack/filesystem-store 7.1.0 → 7.1.2
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [7.1.2] - 2026-03-07
|
|
4
|
+
|
|
5
|
+
### ⬆️ Dependencies
|
|
6
|
+
|
|
7
|
+
- Updated `@types/node` from `^25.3.1` to `^25.3.5`
|
|
8
|
+
|
|
9
|
+
## [7.1.1] - 2026-03-06
|
|
10
|
+
|
|
11
|
+
### 🧪 Tests
|
|
12
|
+
|
|
13
|
+
- Refactored `FileSystemStore` watcher error test to use `using()` wrapper for proper disposal, ensuring cleanup even if assertions fail
|
|
14
|
+
|
|
3
15
|
## [7.1.0] - 2026-03-03
|
|
4
16
|
|
|
5
17
|
### ✨ Features
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StoreManager } from '@furystack/core';
|
|
2
2
|
import { TestClass, createStoreTest } from '@furystack/core/create-physical-store-tests';
|
|
3
|
-
import { sleepAsync, usingAsync } from '@furystack/utils';
|
|
3
|
+
import { sleepAsync, using, usingAsync } from '@furystack/utils';
|
|
4
4
|
import { promises } from 'fs';
|
|
5
5
|
import { afterAll, describe, expect, it, vi } from 'vitest';
|
|
6
6
|
import { FileSystemStore } from './filesystem-store.js';
|
|
@@ -64,14 +64,14 @@ describe('FileSystemStore', () => {
|
|
|
64
64
|
describe('onWatcherError event', () => {
|
|
65
65
|
it('should emit onWatcherError when file watcher registration fails', () => {
|
|
66
66
|
const emitSpy = vi.spyOn(FileSystemStore.prototype, 'emit');
|
|
67
|
-
|
|
67
|
+
using(new FileSystemStore({
|
|
68
68
|
fileName: '/nonexistent-dir/impossible-path/test.json',
|
|
69
69
|
primaryKey: 'id',
|
|
70
70
|
model: TestClass,
|
|
71
|
+
}), () => {
|
|
72
|
+
expect(emitSpy).toHaveBeenCalledWith('onWatcherError', { error: expect.any(Error) });
|
|
73
|
+
emitSpy.mockRestore();
|
|
71
74
|
});
|
|
72
|
-
expect(emitSpy).toHaveBeenCalledWith('onWatcherError', { error: expect.any(Error) });
|
|
73
|
-
emitSpy.mockRestore();
|
|
74
|
-
store[Symbol.dispose]();
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
77
|
afterAll(async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem-store.spec.js","sourceRoot":"","sources":["../src/filesystem-store.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAA;AAExF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"filesystem-store.spec.js","sourceRoot":"","sources":["../src/filesystem-store.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAA;AAExF,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAE/D,IAAI,UAAU,GAAG,CAAC,CAAA;AAElB,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,MAAM,UAAU,GAAa,EAAE,CAAA;IAC/B,MAAM,WAAW,GAAG,CAAC,CAAW,EAAE,EAAE;QAClC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AAM,CAAC,OAAO,CAAC,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAU,EAAE,CAAC,CAAA;gBAC7F,OAAO,CAAC,WAAW,EAAE,CAAA;YACvB,CAAC,CACF,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,KAAK,IAAI,EAAE;QAClB,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;YAClC,IAAI,CAAC;gBACH,MAAM,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YACjC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,gCAAgC;YAClC,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@furystack/filesystem-store",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.2",
|
|
4
4
|
"description": "Simple File System store implementation for FuryStack",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/furystack/furystack",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@furystack/core": "^15.2.
|
|
42
|
-
"@furystack/inject": "^12.0.
|
|
43
|
-
"@furystack/utils": "^8.2.
|
|
41
|
+
"@furystack/core": "^15.2.5",
|
|
42
|
+
"@furystack/inject": "^12.0.32",
|
|
43
|
+
"@furystack/utils": "^8.2.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@types/node": "^25.3.
|
|
46
|
+
"@types/node": "^25.3.5",
|
|
47
47
|
"typescript": "^5.9.3",
|
|
48
48
|
"vitest": "^4.0.18"
|
|
49
49
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoreManager } from '@furystack/core'
|
|
2
2
|
import { TestClass, createStoreTest } from '@furystack/core/create-physical-store-tests'
|
|
3
3
|
import type { Injector } from '@furystack/inject'
|
|
4
|
-
import { sleepAsync, usingAsync } from '@furystack/utils'
|
|
4
|
+
import { sleepAsync, using, usingAsync } from '@furystack/utils'
|
|
5
5
|
import { promises } from 'fs'
|
|
6
6
|
import { afterAll, describe, expect, it, vi } from 'vitest'
|
|
7
7
|
import { FileSystemStore } from './filesystem-store.js'
|
|
@@ -80,14 +80,17 @@ describe('FileSystemStore', () => {
|
|
|
80
80
|
describe('onWatcherError event', () => {
|
|
81
81
|
it('should emit onWatcherError when file watcher registration fails', () => {
|
|
82
82
|
const emitSpy = vi.spyOn(FileSystemStore.prototype, 'emit')
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
using(
|
|
84
|
+
new FileSystemStore({
|
|
85
|
+
fileName: '/nonexistent-dir/impossible-path/test.json',
|
|
86
|
+
primaryKey: 'id' as const,
|
|
87
|
+
model: TestClass,
|
|
88
|
+
}),
|
|
89
|
+
() => {
|
|
90
|
+
expect(emitSpy).toHaveBeenCalledWith('onWatcherError', { error: expect.any(Error) as Error })
|
|
91
|
+
emitSpy.mockRestore()
|
|
92
|
+
},
|
|
93
|
+
)
|
|
91
94
|
})
|
|
92
95
|
})
|
|
93
96
|
|