monsqlize 2.0.2 → 2.0.4
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 +13 -5
- package/README.md +66 -20
- package/changelogs/README.md +8 -4
- package/changelogs/v2.0.0.md +1 -1
- package/changelogs/v2.0.3.md +58 -0
- package/changelogs/v2.0.4.md +61 -0
- package/dist/cjs/index.cjs +911 -213
- package/dist/cjs/transaction/Transaction.cjs +88 -3
- package/dist/cjs/transaction/TransactionManager.cjs +135 -11
- package/dist/esm/index.mjs +906 -208
- package/dist/types/collection.d.ts +5 -3
- package/dist/types/model.d.ts +279 -175
- package/dist/types/mongodb.d.ts +8 -1
- package/dist/types/monsqlize.d.ts +37 -4
- package/dist/types/pool.d.ts +1 -1
- package/dist/types/runtime.d.ts +33 -8
- package/dist/types/transaction.d.ts +12 -0
- package/package.json +23 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
-
> Summary index — current release details are packaged in [changelogs/v2.0.
|
|
4
|
-
> **Last updated**: 2026-06-
|
|
3
|
+
> Summary index — current release details are packaged in [changelogs/v2.0.4.md](./changelogs/v2.0.4.md); historical details live in the repository changelog archive.
|
|
4
|
+
> **Last updated**: 2026-06-12
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
| Version | Date | Summary | Details |
|
|
11
11
|
|---------|------|---------|---------|
|
|
12
|
+
| [v2.0.4](./changelogs/v2.0.4.md) | 2026-06-12 | Patch: production-safe Model index rollout controls, `schema-dsl@2.0.9`, capability-index wording cleanup, and documentation home refinements | [View](./changelogs/v2.0.4.md) |
|
|
13
|
+
| [v2.0.3](./changelogs/v2.0.3.md) | 2026-06-11 | Patch: v1 compatibility fixes, public stats APIs, standalone docs-site link safety, bilingual docs consistency, and release preflight alignment | [View](./changelogs/v2.0.3.md) |
|
|
12
14
|
| [v2.0.2](./changelogs/v2.0.2.md) | 2026-06-09 | Patch: direct runtime, optional and development dependencies pinned to exact versions for deterministic consumer installs | [View](./changelogs/v2.0.2.md) |
|
|
13
15
|
| [v2.0.1](./changelogs/v2.0.1.md) | 2026-06-03 | Patch: model collection/pool compatibility, automatic-index task dedupe, runtime cache/pool v1 smooth-upgrade fixes, and current docs/types alignment | [View](./changelogs/v2.0.1.md) |
|
|
14
16
|
| [v2.0.0](./changelogs/v2.0.0.md) | 2026-06-01 | 🎉 **v2.0.0 — TypeScript rewrite**: full TypeScript source, cache-hub integration, schema-dsl `^2.0.3` TS dependency, Apache-2.0 licensing, English README, MultiLevel cache support, v1 API compat preserved, optimized npm artifact boundary without default sourcemaps, JSDoc coverage complete, `getPoolStats/getPoolHealth` keyed by pool name, v1 compat fixes included, workspace smooth-upgrade bridge validated for downstream consumers | [View](./changelogs/v2.0.0.md) |
|
|
@@ -445,7 +447,10 @@ const result = await msq.collection('orders').insertOne(dataFromMongoose);
|
|
|
445
447
|
changelogs/
|
|
446
448
|
├── README.md # 变更文档说明
|
|
447
449
|
├── TEMPLATE.md # 变更文档模板
|
|
448
|
-
├── v2.0.
|
|
450
|
+
├── v2.0.4.md # 当前发布详细变更
|
|
451
|
+
├── v2.0.3.md # v2.0.3 详细变更
|
|
452
|
+
├── v2.0.2.md # v2.0.2 详细变更
|
|
453
|
+
├── v2.0.1.md # v2.0.1 详细变更
|
|
449
454
|
├── v2.0.0.md # v2 TypeScript 重写发布详细变更
|
|
450
455
|
└── v1.x.y.md # 历史版本详细变更(仓库归档)
|
|
451
456
|
```
|
|
@@ -497,11 +502,14 @@ changelogs/
|
|
|
497
502
|
|
|
498
503
|
## 相关文档
|
|
499
504
|
|
|
500
|
-
- [changelogs/v2.0.
|
|
505
|
+
- [changelogs/v2.0.4.md](./changelogs/v2.0.4.md) - 当前发布详细变更文档
|
|
506
|
+
- [changelogs/v2.0.3.md](./changelogs/v2.0.3.md) - v2.0.3 详细变更文档
|
|
507
|
+
- [changelogs/v2.0.2.md](./changelogs/v2.0.2.md) - v2.0.2 详细变更文档
|
|
508
|
+
- [changelogs/v2.0.1.md](./changelogs/v2.0.1.md) - v2.0.1 详细变更文档
|
|
501
509
|
- [README.md](./README.md) - 项目说明
|
|
502
510
|
- [docs/](https://github.com/vextjs/monSQLize/blob/main/docs/index.md) - API 文档
|
|
503
511
|
|
|
504
512
|
---
|
|
505
513
|
|
|
506
|
-
**最后更新**: 2026-06-
|
|
514
|
+
**最后更新**: 2026-06-12
|
|
507
515
|
|
package/README.md
CHANGED
|
@@ -7,6 +7,8 @@ TypeScript-native MongoDB ODM and enhancement layer with v1-compatible APIs, mul
|
|
|
7
7
|
[](https://www.mongodb.com/)
|
|
8
8
|
[](https://nodejs.org/)
|
|
9
9
|
|
|
10
|
+
Documentation: [English](https://vextjs.github.io/monSQLize/) · [简体中文](https://vextjs.github.io/monSQLize/zh/)
|
|
11
|
+
|
|
10
12
|
```bash
|
|
11
13
|
npm install monsqlize
|
|
12
14
|
```
|
|
@@ -37,7 +39,7 @@ monSQLize keeps the MongoDB driver mental model while adding the production feat
|
|
|
37
39
|
|
|
38
40
|
- Drop-in collection helpers that preserve MongoDB-style CRUD, aggregation, indexes, transactions, and Change Streams.
|
|
39
41
|
- Smart caching through `cache-hub`, including local memory caching, optional Redis-backed L2 caching, automatic invalidation, and function-level caching.
|
|
40
|
-
- A lightweight Model layer with `schema-dsl` validation, hooks, relations, populate, custom methods, timestamps, soft delete, and
|
|
42
|
+
- A lightweight Model layer with `schema-dsl` validation, hooks, relations, populate, custom methods, timestamps, soft delete, optimistic locking, and production-safe index preflight.
|
|
41
43
|
- Multi-connection-pool support, pool health checks, pool-scoped collections/models, and fallback strategies.
|
|
42
44
|
- Business locks and distributed locks for multi-instance deployments.
|
|
43
45
|
- Saga orchestration for multi-step business workflows.
|
|
@@ -72,15 +74,8 @@ Runtime dependencies installed with the package:
|
|
|
72
74
|
- `schema-dsl` - model schema validation runtime dependency.
|
|
73
75
|
- `cache-hub` - cache and function-cache foundation.
|
|
74
76
|
- `async-lock` - local concurrency lock support.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- `ioredis` - required only when you enable Redis / L2 cache features.
|
|
79
|
-
- `ssh2` - required only when you connect through an SSH tunnel.
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
npm install ioredis ssh2
|
|
83
|
-
```
|
|
77
|
+
- `ioredis` - Redis-backed L2 cache, distributed invalidation, and distributed lock support.
|
|
78
|
+
- `ssh2` - SSH tunnel support for restricted/private network deployment.
|
|
84
79
|
|
|
85
80
|
## Quick Start
|
|
86
81
|
|
|
@@ -258,6 +253,27 @@ module.exports = {
|
|
|
258
253
|
|
|
259
254
|
Relative model paths are resolved from `process.cwd()`. In production services, prefer absolute paths such as `path.join(__dirname, 'models')`.
|
|
260
255
|
|
|
256
|
+
### Production Model Index Rollout
|
|
257
|
+
|
|
258
|
+
Model-declared indexes are still created automatically by default for backward compatibility. Production services can turn off automatic indexing and run an explicit preflight before creating missing indexes:
|
|
259
|
+
|
|
260
|
+
```js
|
|
261
|
+
const db = new MonSQLize({
|
|
262
|
+
type: 'mongodb',
|
|
263
|
+
databaseName: 'mydb',
|
|
264
|
+
config: { uri: 'mongodb://localhost:27017' },
|
|
265
|
+
autoIndex: false
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
const plan = await db.ensureModelIndexes({ models: ['users'], dryRun: true });
|
|
269
|
+
|
|
270
|
+
if (plan.totals.conflicts === 0) {
|
|
271
|
+
await db.ensureModelIndexes({ models: ['users'], throwOnError: true });
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
`ensureModelIndexes()` creates only missing indexes. It does not drop, rename, or rebuild conflicting indexes.
|
|
276
|
+
|
|
261
277
|
### Populate
|
|
262
278
|
|
|
263
279
|
```js
|
|
@@ -423,14 +439,14 @@ const user = await users.findOne({ email });
|
|
|
423
439
|
const list = await users.find({ status: 'active' }).toArray();
|
|
424
440
|
```
|
|
425
441
|
|
|
426
|
-
The
|
|
442
|
+
The v2 line has been validated against the workspace consumers `chat`, `payment`, `user`, `admin`, `search`, `vext`, and `permission-core` without requiring business-source changes in those projects.
|
|
427
443
|
|
|
428
444
|
## Compatibility
|
|
429
445
|
|
|
430
446
|
| Surface | Current Support |
|
|
431
447
|
|---|---|
|
|
432
448
|
| Node.js | `>=18.0.0`; CI covers Node 18 / 20 / 22. |
|
|
433
|
-
| MongoDB driver | `mongodb
|
|
449
|
+
| MongoDB driver | `mongodb@6.21.0` runtime baseline; driver 7.2.0 has additional compatibility coverage. |
|
|
434
450
|
| MongoDB server | Memory-server based 6.x / 7.x validation is covered by the project test matrix. |
|
|
435
451
|
| Module systems | CommonJS and ESM are both validated. |
|
|
436
452
|
| TypeScript | Public declarations are published from `dist/types/index.d.ts`. |
|
|
@@ -438,9 +454,11 @@ The current v2.0.1 release has been validated against the workspace consumers `c
|
|
|
438
454
|
|
|
439
455
|
See the current support and verification documents:
|
|
440
456
|
|
|
441
|
-
- [
|
|
442
|
-
- [
|
|
443
|
-
- [
|
|
457
|
+
- [English documentation](https://github.com/vextjs/monSQLize/blob/main/docs/en/README.md)
|
|
458
|
+
- [Chinese documentation](https://github.com/vextjs/monSQLize/blob/main/docs/zh/README.md)
|
|
459
|
+
- [English recipes](https://github.com/vextjs/monSQLize/blob/main/docs/en/recipes.md)
|
|
460
|
+
- [Support matrix](https://github.com/vextjs/monSQLize/blob/main/docs/en/support-matrix.md)
|
|
461
|
+
- [Verification entry points](https://github.com/vextjs/monSQLize/blob/main/docs/en/verification-entrypoints.md)
|
|
444
462
|
- [test/compatibility/README.md](https://github.com/vextjs/monSQLize/blob/main/test/compatibility/README.md)
|
|
445
463
|
- [test/validation/VERIFICATION-PROGRESS.md](https://github.com/vextjs/monSQLize/blob/main/test/validation/VERIFICATION-PROGRESS.md)
|
|
446
464
|
|
|
@@ -448,7 +466,10 @@ See the current support and verification documents:
|
|
|
448
466
|
|
|
449
467
|
Current TypeScript documentation and examples are the source of truth for the v2 package:
|
|
450
468
|
|
|
451
|
-
-
|
|
469
|
+
- Complete docs: [English](https://vextjs.github.io/monSQLize/) · [简体中文](https://vextjs.github.io/monSQLize/zh/)
|
|
470
|
+
- `docs/en/**` - default English documentation.
|
|
471
|
+
- `docs/zh/**` - Simplified Chinese documentation.
|
|
472
|
+
- `docs/en/recipes.md` / `docs/zh/recipes.md` - shortest copy-ready paths for common setup scenarios.
|
|
452
473
|
- `examples/**` - TypeScript examples.
|
|
453
474
|
- `test/compatibility/**` - package exports and compatibility guards.
|
|
454
475
|
- `test/validation/**` - verification ledgers and mapping notes.
|
|
@@ -470,27 +491,34 @@ npm run build
|
|
|
470
491
|
npm run type-check
|
|
471
492
|
npm test
|
|
472
493
|
npm run verify:fast
|
|
494
|
+
npm run verify:full
|
|
473
495
|
npm run release:preflight
|
|
474
496
|
```
|
|
475
497
|
|
|
476
|
-
Release preflight runs linting, type checks, size guards, runtime checks, compatibility checks, refactor guards, the default test suite, and `npm pack --dry-run`.
|
|
498
|
+
Release preflight runs linting, type checks, size guards, runtime checks, compatibility checks, refactor guards, production dependency audit, the default test suite, and `npm pack --dry-run`.
|
|
477
499
|
|
|
478
500
|
`npm run release:publish` runs the preflight gate once and then calls `npm publish --ignore-scripts` so the final publish step does not repeat the full lifecycle gate. Raw `npm publish` is still guarded by `prepublishOnly`.
|
|
479
501
|
|
|
480
502
|
Optional commands:
|
|
481
503
|
|
|
482
504
|
```bash
|
|
505
|
+
npm run check:docs-examples
|
|
483
506
|
npm run test:examples
|
|
484
507
|
npm run test:coverage
|
|
508
|
+
npm run test:audit
|
|
485
509
|
npm run test:server-matrix
|
|
486
510
|
npm run test:real-env:private
|
|
487
511
|
```
|
|
488
512
|
|
|
489
|
-
`
|
|
513
|
+
`check:docs-examples` verifies the 97/97 bilingual documentation matrix, runnable-example runner parity, shared-example targets, doc-check targets, and user-facing path text.
|
|
514
|
+
|
|
515
|
+
`test:examples`, `test:server-matrix`, and `config.useMemoryServer` use a fixed `mongodb-memory-server` policy: MongoDB `7.0.14` by default, binaries cached under `.cache/mongodb-memory-server/binaries`, and temporary data paths created under `.cache/mongodb-memory-server/db` with forced cleanup for project-managed paths. Stale managed data paths whose owner PID is no longer alive are pruned before new memory-server launches. Override with `MONSQLIZE_MEMORY_MONGO_BINARY_VERSION`, `MONSQLIZE_REPLSET_BINARY_VERSION`, `MONGOMS_DOWNLOAD_DIR`, or `MONSQLIZE_MEMORY_SERVER_DB_DIR` when needed.
|
|
516
|
+
|
|
517
|
+
`test:coverage` is the independent 90% coverage governance gate for the published CJS runtime artifact. `test:audit` checks production dependencies against the npm registry. `test:real-env:private` is intentionally opt-in and expects private environment variables. Coverage and private real-environment checks are not part of the default CI or release gate.
|
|
490
518
|
|
|
491
519
|
## Release Status
|
|
492
520
|
|
|
493
|
-
The current published release is `v2.0.
|
|
521
|
+
The current published release is `v2.0.4`.
|
|
494
522
|
|
|
495
523
|
Key release-readiness points:
|
|
496
524
|
|
|
@@ -498,11 +526,29 @@ Key release-readiness points:
|
|
|
498
526
|
- Package exports are consolidated under `dist/cjs`, `dist/esm`, and `dist/types`.
|
|
499
527
|
- npm packages include the runtime bundles and declaration files only; source maps are disabled by default and can be generated locally with `MONSQLIZE_BUILD_SOURCEMAPS=1 npm run build`.
|
|
500
528
|
- v1 smooth-upgrade compatibility has been validated against the target workspace consumers.
|
|
501
|
-
- `schema-dsl` follows the npm `latest` TypeScript line
|
|
529
|
+
- `schema-dsl` follows the npm `latest` TypeScript line `schema-dsl@2.0.9`; deprecated `2.3.x` mistake releases are intentionally excluded.
|
|
502
530
|
- GitHub Actions publishes to npm from `v*` tags after running `npm run release:preflight`; the publish step skips duplicate lifecycle scripts because the gate already ran in the same job.
|
|
503
531
|
|
|
504
532
|
## Roadmap
|
|
505
533
|
|
|
534
|
+
### v2.0.4
|
|
535
|
+
|
|
536
|
+
- Production-safe Model index rollout controls with `autoIndex`, dry-run preflight, conflict reporting, and explicit `ensureIndexes()` / `ensureModelIndexes()` APIs.
|
|
537
|
+
- `schema-dsl` updated to `2.0.9`, with transitive `cache-hub` aligned to `2.2.4`.
|
|
538
|
+
- User-facing capability and verification documentation wording cleaned up, plus documentation home experience refinements.
|
|
539
|
+
|
|
540
|
+
### v2.0.3
|
|
541
|
+
|
|
542
|
+
- v1 compatibility patch for documented `findPage({ cache })` behavior.
|
|
543
|
+
- Public transaction and distributed cache invalidator statistics APIs.
|
|
544
|
+
- Standalone documentation-site link safety and bilingual docs consistency fixes.
|
|
545
|
+
- Release preflight alignment for bilingual docs paths and production dependency audit.
|
|
546
|
+
|
|
547
|
+
### v2.0.2
|
|
548
|
+
|
|
549
|
+
- Deterministic dependency metadata patch.
|
|
550
|
+
- `ioredis` and `ssh2` are installed with monSQLize by default, so Redis-backed cache/locks and SSH tunnels no longer require a separate dependency install step.
|
|
551
|
+
|
|
506
552
|
### v2.0.1
|
|
507
553
|
|
|
508
554
|
- v1 smooth-upgrade compatibility patch for Model actual collection names, scoped pools/databases, automatic-index dedupe, and cache/pool option aliases.
|
package/changelogs/README.md
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
changelogs/
|
|
11
11
|
├── README.md # 本说明文档
|
|
12
12
|
├── TEMPLATE.md # 变更文档模板
|
|
13
|
+
├── v2.0.3.md # v2.0.3 详细变更
|
|
14
|
+
├── v2.0.2.md # v2.0.2 详细变更
|
|
13
15
|
├── v2.0.1.md # v2.0.1 详细变更
|
|
14
16
|
├── v2.0.0.md # v2.0.0 详细变更
|
|
15
17
|
└── v1.x.y.md # 历史版本详细变更(仓库归档)
|
|
@@ -44,19 +46,19 @@ changelogs/
|
|
|
44
46
|
|
|
45
47
|
### 按版本类型
|
|
46
48
|
|
|
47
|
-
- **正式发布**: v2.0.1, v2.0.0, v1.0.0
|
|
49
|
+
- **正式发布**: v2.0.3, v2.0.2, v2.0.1, v2.0.0, v1.0.0
|
|
48
50
|
- **功能版本**: v1.x
|
|
49
51
|
- **修复版本**: v1.x.y
|
|
50
52
|
|
|
51
53
|
### 按功能领域
|
|
52
54
|
|
|
53
|
-
- **TypeScript 重构与 v1 平滑升级**: v2.0.1, v2.0.0
|
|
55
|
+
- **TypeScript 重构与 v1 平滑升级**: v2.0.3, v2.0.2, v2.0.1, v2.0.0
|
|
54
56
|
- **实时监听 / 管理功能 / 核心功能**: v1.x 历史版本
|
|
55
57
|
|
|
56
58
|
### 按风险级别
|
|
57
59
|
|
|
58
60
|
- **P0 (Critical)**: v2.0.0
|
|
59
|
-
- **Patch**: v2.0.1
|
|
61
|
+
- **Patch**: v2.0.3, v2.0.2, v2.0.1
|
|
60
62
|
- **P1 (High)**: v1.x 破坏性或高风险历史版本
|
|
61
63
|
- **P2 (Low)**: v1.x 修复版本
|
|
62
64
|
|
|
@@ -151,6 +153,8 @@ git push origin main --tags
|
|
|
151
153
|
|
|
152
154
|
| 版本 | 文件 | 状态 | 发布日期 |
|
|
153
155
|
|------|------|------|---------|
|
|
156
|
+
| v2.0.3 | v2.0.3.md | ✅ 已发布 | 2026-06-11 |
|
|
157
|
+
| v2.0.2 | v2.0.2.md | ✅ 已发布 | 2026-06-09 |
|
|
154
158
|
| v2.0.1 | v2.0.1.md | ✅ 已发布 | 2026-06-03 |
|
|
155
159
|
| v2.0.0 | v2.0.0.md | ✅ 已发布 | 2026-06-01 |
|
|
156
160
|
| v1.x | 仓库历史归档 | ✅ 已发布 | 2025-12-03 起 |
|
|
@@ -158,6 +162,6 @@ git push origin main --tags
|
|
|
158
162
|
---
|
|
159
163
|
|
|
160
164
|
**目录版本**: 2.0
|
|
161
|
-
**最后更新**: 2026-06-
|
|
165
|
+
**最后更新**: 2026-06-11
|
|
162
166
|
**维护者**: monSQLize Team
|
|
163
167
|
|
package/changelogs/v2.0.0.md
CHANGED
|
@@ -109,7 +109,7 @@ const msq = new MonSQLize({
|
|
|
109
109
|
});
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
Historical v2.0.0 note: SSH tunneling originally expected `ssh2` to be present separately. In current `v2.0.2+` packages, `ssh2` is installed with `monsqlize`.
|
|
113
113
|
|
|
114
114
|
### Custom `CacheLike` pass-through (v1 compat)
|
|
115
115
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# v2.0.3 — 2026-06-11
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
v2.0.3 is a compatibility and documentation-quality patch. It keeps the public API backward compatible while restoring documented v1 behaviors, tightening release checks, and making the bilingual documentation site safer to consume as a standalone site.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Runtime Fixes
|
|
10
|
+
|
|
11
|
+
- Restored documented `findPage({ cache })` page-result caching, cache invalidation, after/before totals, and v1-style totals TTL / hint / collation behavior.
|
|
12
|
+
- Restored public transaction statistics parity through `getTransactionStats()`, including p95/p99 duration, success rate, read-only ratio, and bounded sample tracking.
|
|
13
|
+
- Wired documented transaction defaults and lock settings into runtime transaction creation.
|
|
14
|
+
- Added `getDistributedCacheInvalidatorStats()` so distributed cache invalidation statistics are available through a public API instead of private runtime fields.
|
|
15
|
+
- Aligned pool selection with public health status updates and forwarded direct pool `tags` preferences into automatic pool selection.
|
|
16
|
+
- Restored `SSHConfig.port` in public declarations and added a type guard against accidental `SSHConfig` shape drift.
|
|
17
|
+
|
|
18
|
+
## Documentation and Examples
|
|
19
|
+
|
|
20
|
+
- Replaced documentation-private runtime fields with public APIs across admin, database operations, explain, model relations, transaction, distributed deployment, sync backup, and pool health docs.
|
|
21
|
+
- Converted source/example file links in the standalone documentation site to GitHub URLs.
|
|
22
|
+
- Strengthened the 97/97 bilingual document example matrix and kept the final 56 runnable examples, 19 shared-example docs, and 22 doc-check docs in sync.
|
|
23
|
+
- Refreshed docs-site navigation, ObjectId/ID query grouping, localized top navigation, home hero, logo presentation, theme parity, and mobile wrapping.
|
|
24
|
+
- Added focused runnable examples for index management, aggregation-pipeline updates, upsert, function cache, model hooks, relations, nested populate, runtime events, CountQueue, pool chain routing, pool health checks, transaction optimization stats, and advanced Saga flows.
|
|
25
|
+
- Normalized source, type, test, example, script, config, and package output text to English-only wording.
|
|
26
|
+
|
|
27
|
+
## Dependencies and Release Gate
|
|
28
|
+
|
|
29
|
+
- Fixed the root `cache-hub` direct dependency at `2.2.4`.
|
|
30
|
+
- Updated `schema-dsl` to the current supported TypeScript line `2.0.8` while continuing to exclude deprecated `2.3.x` mistake releases.
|
|
31
|
+
- Kept `verify:full` as the reproducible full functional gate and left the 90% coverage threshold on the independent `test:coverage` governance command.
|
|
32
|
+
- Updated server-matrix runners to execute compiled integration tests from `.generated/test-dist`.
|
|
33
|
+
- Updated release preflight to validate the current bilingual documentation paths and include the production dependency audit gate.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Compatibility
|
|
38
|
+
|
|
39
|
+
- SemVer: patch release.
|
|
40
|
+
- Breaking changes: none.
|
|
41
|
+
- Existing v2 public imports remain under `dist/cjs`, `dist/esm`, and `dist/types`.
|
|
42
|
+
- Redis, SSH, Model, multi-pool, Saga, Change Stream, and cache features remain opt-in by configuration where applicable.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Validation
|
|
47
|
+
|
|
48
|
+
- `npm run check:docs-examples`
|
|
49
|
+
- `npm run type-check`
|
|
50
|
+
- targeted runtime / transaction / findPage regression tests
|
|
51
|
+
- `npm run test:unit`
|
|
52
|
+
- `npm run test:integration`
|
|
53
|
+
- `npm run test:examples`
|
|
54
|
+
- `npm run lint`
|
|
55
|
+
- `npm run test:audit`
|
|
56
|
+
- `git diff --check`
|
|
57
|
+
|
|
58
|
+
Full release validation is handled by `npm run release:preflight`, `npm pack --dry-run`, `npm publish --dry-run`, and pack install smoke before publishing.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# v2.0.4 — 2026-06-12
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
v2.0.4 is a production-safety and documentation-quality patch. It keeps the public API backward compatible while adding explicit Model index rollout controls, updating the schema validation dependency, and refining user-facing documentation language.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Runtime Fixes
|
|
10
|
+
|
|
11
|
+
- Added production-safe Model index controls:
|
|
12
|
+
- runtime-level and model-level `autoIndex` options.
|
|
13
|
+
- explicit `ModelInstance.ensureIndexes()` and `MonSQLize.ensureModelIndexes()` APIs.
|
|
14
|
+
- dry-run index preflight with `existing`, `missing`, `conflicts`, and `failed` classification.
|
|
15
|
+
- missing-index creation without dropping, renaming, or rebuilding conflicting indexes.
|
|
16
|
+
- `model-index-error` events for observable automatic-index creation failures.
|
|
17
|
+
- Kept automatic Model indexing enabled by default for backward compatibility.
|
|
18
|
+
- Moved runtime Model index aggregation into the Model runtime helper layer so the strict source-size gate remains clean.
|
|
19
|
+
|
|
20
|
+
## Dependencies
|
|
21
|
+
|
|
22
|
+
- Updated `schema-dsl` from `2.0.8` to npm `latest` `2.0.9`.
|
|
23
|
+
- Confirmed `schema-dsl@2.0.9` keeps the required `dsl()` and `validate()` runtime paths compatible with monSQLize.
|
|
24
|
+
- Confirmed the `schema-dsl` transitive `cache-hub` dependency now resolves to `2.2.4`, matching the root direct dependency.
|
|
25
|
+
|
|
26
|
+
## Documentation
|
|
27
|
+
|
|
28
|
+
- Documented the recommended production index rollout flow:
|
|
29
|
+
- set `autoIndex: false` in production services.
|
|
30
|
+
- run `ensureIndexes({ dryRun: true })` / `ensureModelIndexes({ dryRun: true })`.
|
|
31
|
+
- create only missing indexes during a low-traffic maintenance window.
|
|
32
|
+
- monitor TTL and index-build behavior.
|
|
33
|
+
- Corrected create-index documentation to distinguish local `INVALID_ARGUMENT` validation from raw MongoDB driver/server index conflicts.
|
|
34
|
+
- Reworded capability-index and verification-entry documentation to use user-facing availability and verification language instead of internal migration status terms.
|
|
35
|
+
- Refined the documentation home experience with the VextJS-style footer, aligned hero/feature layout, and updated hero data-flow visual.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Compatibility
|
|
40
|
+
|
|
41
|
+
- SemVer: patch release.
|
|
42
|
+
- Breaking changes: none.
|
|
43
|
+
- Existing v2 imports remain under `dist/cjs`, `dist/esm`, and `dist/types`.
|
|
44
|
+
- Existing default automatic Model indexing behavior remains enabled unless users opt into the new production-safe controls.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Validation
|
|
49
|
+
|
|
50
|
+
- `npm run lint`
|
|
51
|
+
- `npm run check:docs-examples`
|
|
52
|
+
- `npm run type-check`
|
|
53
|
+
- targeted Model/index unit and integration tests
|
|
54
|
+
- `npm run test:examples`
|
|
55
|
+
- `npm --prefix website run build`
|
|
56
|
+
- `npm run verify:fast`
|
|
57
|
+
- `npm run test:server-matrix`
|
|
58
|
+
- `npm run test:audit`
|
|
59
|
+
- `git diff --check`
|
|
60
|
+
|
|
61
|
+
Full release validation is handled by `npm run release:preflight`, `npm pack --dry-run`, `npm publish --dry-run`, and pack install smoke before publishing.
|