@furystack/mongodb-store 11.0.3 → 11.0.5

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,199 +1,215 @@
1
- # Changelog
2
-
3
- ## [11.0.3] - 2026-08-26
4
-
5
- ### ⬆️ Dependencies
6
-
7
- - Updated dependencies
8
- - Bumped `mongodb` to `7.5.0` and raised dev `typescript` to `^7.0.2`, `@types/node` to `^26.1.1`, and `vitest` to `^4.1.10`. No source changes — dependency bump only.
9
-
10
- ## [11.0.2] - 2026-06-05
11
-
12
- ### 👷 CI
13
-
14
- - Raised the minimum supported Node.js to `>=24.0.0` (Node 24 LTS) in `engines`, dropping Node 22.
15
-
16
- ### ⬆️ Dependencies
17
-
18
- - Bumped dev `vitest` to `^4.1.8`. No source changes — dev-tooling bump only.
19
-
20
- ## [11.0.1] - 2026-05-21
21
-
22
- ### ♻️ Refactoring
23
-
24
- ### `update` throws `NotFoundError` for missing entities
25
-
26
- `MongodbStore.update` now throws `NotFoundError` from `@furystack/core` (instead of a plain `Error`) when no document matches the given id. Callers can branch on `instanceof NotFoundError` without parsing messages. The message was tightened from `... cannot update!` to `... cannot update` — substring matches that look for `cannot update` keep working.
27
-
28
- ### ⬆️ Dependencies
29
-
30
- - Bump `mongodb` to `7.2.0`.
31
- - Bump dev `vitest` to `^4.1.5`.
32
- - Bumped `@types/node` to `^25.9.1` and `vitest` to `^4.1.7`. No source changes — dev-tooling bump only.
33
-
34
- ### 📚 Documentation
35
-
36
- - Rewrote JSDoc on `MongodbStore`, `defineMongodbStore`, and `MongoClientFactory` to follow the new value-test guidance: dropped restate-the-type narration, called out the lazy-init contract, the `_id`/`ObjectId` coercion behavior, and the fact that the store has no `[Symbol.asyncDispose]` because client lifetime belongs to the factory.
37
-
38
- ## [11.0.0] - 2026-04-25
39
-
40
- ### 💥 Breaking Changes
41
-
42
- Stores are now first-class DI tokens. See the [v7 migration guide](../../docs/migrations/v7-functional-di.md) for rationale, recipes, and pitfalls.
43
-
44
- - Removed `useMongoDb(...)`. Declare the store at module scope with `defineMongoDbStore<T, PK>({ name, model, primaryKey, url, db, collection, options? })`.
45
- - `MongoClientFactory` is now an exported interface + `defineService({ lifetime: 'singleton' })` token. It pools `MongoClient` instances per URL and closes every pooled client on injector teardown.
46
- - Dropped the unused `EventHub<{ onClientCreated, onDisposed }>` surface from the factory (no consumers in-repo).
47
-
48
- ## [10.1.7] - 2026-04-17
49
-
50
- ### ⬆️ Dependencies
51
-
52
- - Raised `@types/node` to ^25.6.0, `typescript` to ^6.0.3, and `vitest` to ^4.1.4 so package development matches the workspace toolchain.
53
-
54
- ## [10.1.6] - 2026-03-27
55
-
56
- ### ⬆️ Dependencies
57
-
58
- - Updated `vitest` to ^4.1.2
59
-
60
- ## [10.1.5] - 2026-03-25
61
-
62
- ### 📦 Build
63
-
64
- - Removed deprecated `baseUrl` from tsconfig.json for TypeScript 6 compatibility
65
-
66
- ### ⬆️ Dependencies
67
-
68
- - Upgraded `typescript` from ^5.9.3 to ^6.0.2
69
- - Upgraded `vitest` from ^4.1.0 to ^4.1.1
70
- - Upgraded `mongodb` from 7.1.0 to 7.1.1
71
-
72
- ## [10.1.4] - 2026-03-19
73
-
74
- ### ✨ Features
75
-
76
- - Updated `@furystack/core` dependency to the latest major version.
77
- - Added `MongoClientFactory` lifecycle events (`onClientCreated`, `onDisposed`).
78
-
79
- ### ⬆️ Dependencies
80
-
81
- - Upgraded `vite` from ^7.3.1 to ^8.0.0 for improved build performance and new features
82
- - Upgraded `vitest` from ^4.0.18 to ^4.1.0
83
- - Upgraded `@vitest/coverage-istanbul` from ^4.0.18 to ^4.1.0
84
-
85
- ## [10.1.3] - 2026-03-10
86
-
87
- ### ⬆️ Dependencies
88
-
89
- - Updated `@furystack/core` dependency to the new major version
90
-
91
- ## [10.1.2] - 2026-03-07
92
-
93
- ### ⬆️ Dependencies
94
-
95
- - Updated `@types/node` from `^25.3.1` to `^25.3.5`
96
-
97
- ## [10.1.1] - 2026-03-06
98
-
99
- ### ⬆️ Dependencies
100
-
101
- - Updated internal FuryStack dependencies
102
-
103
- ## [10.1.0] - 2026-03-03
104
-
105
- ### ✨ Features
106
-
107
- ### Lifecycle events in `MongoClientFactory`
108
-
109
- `MongoClientFactory` now extends `EventHub` and emits events for client lifecycle:
110
-
111
- - `onClientCreated` — emitted when a new MongoDB client is created, with `{ url }`
112
- - `onDisposed` — emitted when the factory is disposed
113
-
114
- ```typescript
115
- const factory = injector.getInstance(MongoClientFactory)
116
-
117
- factory.addListener('onClientCreated', ({ url }) => {
118
- console.log(`MongoDB client created for ${url}`)
119
- })
120
- ```
121
-
122
- ### 🧪 Tests
123
-
124
- - Added tests for `onClientCreated` event emission on new client creation
125
- - Added test verifying `onClientCreated` is not emitted when returning a cached client
126
-
127
- ## [10.0.41] - 2026-02-26
128
-
129
- ### ⬆️ Dependencies
130
-
131
- - Updated internal `@furystack/*` dependencies
132
- - Bumped `@types/node` from ^25.3.0 to ^25.3.1
133
-
134
- ## [10.0.40] - 2026-02-26
135
-
136
- ### 📝 Documentation
137
-
138
- - Added tip about wrapping the physical store with a Repository DataSet for application-level data access
139
-
140
- ## [10.0.39] - 2026-02-22
141
-
142
- ### ⬆️ Dependencies
143
-
144
- - Updated `@furystack/core` dependency
145
-
146
- ## [10.0.38] - 2026-02-19
147
-
148
- ### ⬆️ Dependencies
149
-
150
- - Updated `@furystack/core`
151
-
152
- ## [10.0.37] - 2026-02-11
153
-
154
- ### ♻️ Refactoring
155
-
156
- - Replaced semaphore-based initialization lock with promise deduplication for MongoDB collection setup. Concurrent calls to `getCollection()` now reuse a single in-flight initialization promise instead of queuing behind a semaphore. On initialization failure, the promise is reset to allow retry.
157
-
158
- ### ⬆️ Dependencies
159
-
160
- - Bump `mongodb` from `7.0.0` to `7.1.0`
161
- - Bump `vitest` from `^4.0.17` to `^4.0.18`
162
- - Bump `@types/node` from `^25.0.10` to `^25.2.3`
163
- - Removed `semaphore-async-await` dependency
164
- - Updated internal dependencies
165
-
166
- ## [10.0.36] - 2026-02-09
167
-
168
- ### ⬆️ Dependencies
169
-
170
- - Updated `@furystack/core` dependency
171
- - Updated `@furystack/*` dependencies
172
-
173
- ## [10.0.35] - 2026-01-26
174
-
175
- ### 🔧 Chores
176
-
177
- - Standardized author format, improved keywords, removed obsolete `gitHead`, added `engines` (Node 22+) and `sideEffects: false`
178
-
179
- ## [10.0.34] - 2026-01-26
180
-
181
- ### 🔧 Chores
182
-
183
- - Fixed repository URL in package.json from `furystack/core` to `furystack/furystack`
184
-
185
- ## [10.0.33] - 2026-01-26
186
-
187
- ### ⬆️ Dependencies
188
-
189
- - Updated `@furystack/inject` with fix for singleton injector reference being overwritten by child injectors
190
-
191
- ## [10.0.32] - 2026-01-22
192
-
193
- ### ⬆️ Dependencies
194
-
195
- - Dependency updates
196
-
197
- ### 🔧 Chores
198
-
199
- - Migrated to centralized changelog management system
1
+ # Changelog
2
+
3
+ ## [11.0.5] - 2026-11-14
4
+
5
+ ### Dependencies
6
+
7
+ - Patch release to include updated FuryStack dependency versions
8
+
9
+ ### ⬆️ Dependencies
10
+
11
+ - Updated dependencies
12
+
13
+ ## [11.0.4] - 2026-09-18
14
+
15
+ ### ⬆️ Dependencies
16
+
17
+ - Updated dependencies
18
+
19
+ ## [11.0.3] - 2026-08-26
20
+
21
+ ### ⬆️ Dependencies
22
+
23
+ - Updated dependencies
24
+ - Bumped `mongodb` to `7.5.0` and raised dev `typescript` to `^7.0.2`, `@types/node` to `^26.1.1`, and `vitest` to `^4.1.10`. No source changes — dependency bump only.
25
+
26
+ ## [11.0.2] - 2026-06-05
27
+
28
+ ### 👷 CI
29
+
30
+ - Raised the minimum supported Node.js to `>=24.0.0` (Node 24 LTS) in `engines`, dropping Node 22.
31
+
32
+ ### ⬆️ Dependencies
33
+
34
+ - Bumped dev `vitest` to `^4.1.8`. No source changes — dev-tooling bump only.
35
+
36
+ ## [11.0.1] - 2026-05-21
37
+
38
+ ### ♻️ Refactoring
39
+
40
+ ### `update` throws `NotFoundError` for missing entities
41
+
42
+ `MongodbStore.update` now throws `NotFoundError` from `@furystack/core` (instead of a plain `Error`) when no document matches the given id. Callers can branch on `instanceof NotFoundError` without parsing messages. The message was tightened from `... cannot update!` to `... cannot update` — substring matches that look for `cannot update` keep working.
43
+
44
+ ### ⬆️ Dependencies
45
+
46
+ - Bump `mongodb` to `7.2.0`.
47
+ - Bump dev `vitest` to `^4.1.5`.
48
+ - Bumped `@types/node` to `^25.9.1` and `vitest` to `^4.1.7`. No source changes — dev-tooling bump only.
49
+
50
+ ### 📚 Documentation
51
+
52
+ - Rewrote JSDoc on `MongodbStore`, `defineMongodbStore`, and `MongoClientFactory` to follow the new value-test guidance: dropped restate-the-type narration, called out the lazy-init contract, the `_id`/`ObjectId` coercion behavior, and the fact that the store has no `[Symbol.asyncDispose]` because client lifetime belongs to the factory.
53
+
54
+ ## [11.0.0] - 2026-04-25
55
+
56
+ ### 💥 Breaking Changes
57
+
58
+ Stores are now first-class DI tokens. See the [v7 migration guide](../../docs/migrations/v7-functional-di.md) for rationale, recipes, and pitfalls.
59
+
60
+ - Removed `useMongoDb(...)`. Declare the store at module scope with `defineMongoDbStore<T, PK>({ name, model, primaryKey, url, db, collection, options? })`.
61
+ - `MongoClientFactory` is now an exported interface + `defineService({ lifetime: 'singleton' })` token. It pools `MongoClient` instances per URL and closes every pooled client on injector teardown.
62
+ - Dropped the unused `EventHub<{ onClientCreated, onDisposed }>` surface from the factory (no consumers in-repo).
63
+
64
+ ## [10.1.7] - 2026-04-17
65
+
66
+ ### ⬆️ Dependencies
67
+
68
+ - Raised `@types/node` to ^25.6.0, `typescript` to ^6.0.3, and `vitest` to ^4.1.4 so package development matches the workspace toolchain.
69
+
70
+ ## [10.1.6] - 2026-03-27
71
+
72
+ ### ⬆️ Dependencies
73
+
74
+ - Updated `vitest` to ^4.1.2
75
+
76
+ ## [10.1.5] - 2026-03-25
77
+
78
+ ### 📦 Build
79
+
80
+ - Removed deprecated `baseUrl` from tsconfig.json for TypeScript 6 compatibility
81
+
82
+ ### ⬆️ Dependencies
83
+
84
+ - Upgraded `typescript` from ^5.9.3 to ^6.0.2
85
+ - Upgraded `vitest` from ^4.1.0 to ^4.1.1
86
+ - Upgraded `mongodb` from 7.1.0 to 7.1.1
87
+
88
+ ## [10.1.4] - 2026-03-19
89
+
90
+ ### ✨ Features
91
+
92
+ - Updated `@furystack/core` dependency to the latest major version.
93
+ - Added `MongoClientFactory` lifecycle events (`onClientCreated`, `onDisposed`).
94
+
95
+ ### ⬆️ Dependencies
96
+
97
+ - Upgraded `vite` from ^7.3.1 to ^8.0.0 for improved build performance and new features
98
+ - Upgraded `vitest` from ^4.0.18 to ^4.1.0
99
+ - Upgraded `@vitest/coverage-istanbul` from ^4.0.18 to ^4.1.0
100
+
101
+ ## [10.1.3] - 2026-03-10
102
+
103
+ ### ⬆️ Dependencies
104
+
105
+ - Updated `@furystack/core` dependency to the new major version
106
+
107
+ ## [10.1.2] - 2026-03-07
108
+
109
+ ### ⬆️ Dependencies
110
+
111
+ - Updated `@types/node` from `^25.3.1` to `^25.3.5`
112
+
113
+ ## [10.1.1] - 2026-03-06
114
+
115
+ ### ⬆️ Dependencies
116
+
117
+ - Updated internal FuryStack dependencies
118
+
119
+ ## [10.1.0] - 2026-03-03
120
+
121
+ ### ✨ Features
122
+
123
+ ### Lifecycle events in `MongoClientFactory`
124
+
125
+ `MongoClientFactory` now extends `EventHub` and emits events for client lifecycle:
126
+
127
+ - `onClientCreated` — emitted when a new MongoDB client is created, with `{ url }`
128
+ - `onDisposed` — emitted when the factory is disposed
129
+
130
+ ```typescript
131
+ const factory = injector.getInstance(MongoClientFactory)
132
+
133
+ factory.addListener('onClientCreated', ({ url }) => {
134
+ console.log(`MongoDB client created for ${url}`)
135
+ })
136
+ ```
137
+
138
+ ### 🧪 Tests
139
+
140
+ - Added tests for `onClientCreated` event emission on new client creation
141
+ - Added test verifying `onClientCreated` is not emitted when returning a cached client
142
+
143
+ ## [10.0.41] - 2026-02-26
144
+
145
+ ### ⬆️ Dependencies
146
+
147
+ - Updated internal `@furystack/*` dependencies
148
+ - Bumped `@types/node` from ^25.3.0 to ^25.3.1
149
+
150
+ ## [10.0.40] - 2026-02-26
151
+
152
+ ### 📝 Documentation
153
+
154
+ - Added tip about wrapping the physical store with a Repository DataSet for application-level data access
155
+
156
+ ## [10.0.39] - 2026-02-22
157
+
158
+ ### ⬆️ Dependencies
159
+
160
+ - Updated `@furystack/core` dependency
161
+
162
+ ## [10.0.38] - 2026-02-19
163
+
164
+ ### ⬆️ Dependencies
165
+
166
+ - Updated `@furystack/core`
167
+
168
+ ## [10.0.37] - 2026-02-11
169
+
170
+ ### ♻️ Refactoring
171
+
172
+ - Replaced semaphore-based initialization lock with promise deduplication for MongoDB collection setup. Concurrent calls to `getCollection()` now reuse a single in-flight initialization promise instead of queuing behind a semaphore. On initialization failure, the promise is reset to allow retry.
173
+
174
+ ### ⬆️ Dependencies
175
+
176
+ - Bump `mongodb` from `7.0.0` to `7.1.0`
177
+ - Bump `vitest` from `^4.0.17` to `^4.0.18`
178
+ - Bump `@types/node` from `^25.0.10` to `^25.2.3`
179
+ - Removed `semaphore-async-await` dependency
180
+ - Updated internal dependencies
181
+
182
+ ## [10.0.36] - 2026-02-09
183
+
184
+ ### ⬆️ Dependencies
185
+
186
+ - Updated `@furystack/core` dependency
187
+ - Updated `@furystack/*` dependencies
188
+
189
+ ## [10.0.35] - 2026-01-26
190
+
191
+ ### 🔧 Chores
192
+
193
+ - Standardized author format, improved keywords, removed obsolete `gitHead`, added `engines` (Node 22+) and `sideEffects: false`
194
+
195
+ ## [10.0.34] - 2026-01-26
196
+
197
+ ### 🔧 Chores
198
+
199
+ - Fixed repository URL in package.json from `furystack/core` to `furystack/furystack`
200
+
201
+ ## [10.0.33] - 2026-01-26
202
+
203
+ ### ⬆️ Dependencies
204
+
205
+ - Updated `@furystack/inject` with fix for singleton injector reference being overwritten by child injectors
206
+
207
+ ## [10.0.32] - 2026-01-22
208
+
209
+ ### ⬆️ Dependencies
210
+
211
+ - Dependency updates
212
+
213
+ ### 🔧 Chores
214
+
215
+ - Migrated to centralized changelog management system