monsqlize 2.0.2 → 2.0.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/CHANGELOG.md +10 -5
- package/README.md +35 -19
- package/changelogs/README.md +8 -4
- package/changelogs/v2.0.0.md +1 -1
- package/changelogs/v2.0.3.md +58 -0
- package/dist/cjs/index.cjs +648 -192
- package/dist/cjs/transaction/Transaction.cjs +88 -3
- package/dist/cjs/transaction/TransactionManager.cjs +135 -11
- package/dist/esm/index.mjs +643 -187
- package/dist/types/collection.d.ts +5 -3
- package/dist/types/model.d.ts +175 -175
- package/dist/types/mongodb.d.ts +8 -1
- package/dist/types/monsqlize.d.ts +28 -3
- package/dist/types/pool.d.ts +1 -1
- package/dist/types/runtime.d.ts +31 -7
- package/dist/types/transaction.d.ts +12 -0
- package/package.json +22 -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.3.md](./changelogs/v2.0.3.md); historical details live in the repository changelog archive.
|
|
4
|
+
> **Last updated**: 2026-06-11
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
| Version | Date | Summary | Details |
|
|
11
11
|
|---------|------|---------|---------|
|
|
12
|
+
| [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
13
|
| [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
14
|
| [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
15
|
| [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 +446,9 @@ const result = await msq.collection('orders').insertOne(dataFromMongoose);
|
|
|
445
446
|
changelogs/
|
|
446
447
|
├── README.md # 变更文档说明
|
|
447
448
|
├── TEMPLATE.md # 变更文档模板
|
|
448
|
-
├── v2.0.
|
|
449
|
+
├── v2.0.3.md # 当前发布详细变更
|
|
450
|
+
├── v2.0.2.md # v2.0.2 详细变更
|
|
451
|
+
├── v2.0.1.md # v2.0.1 详细变更
|
|
449
452
|
├── v2.0.0.md # v2 TypeScript 重写发布详细变更
|
|
450
453
|
└── v1.x.y.md # 历史版本详细变更(仓库归档)
|
|
451
454
|
```
|
|
@@ -497,11 +500,13 @@ changelogs/
|
|
|
497
500
|
|
|
498
501
|
## 相关文档
|
|
499
502
|
|
|
500
|
-
- [changelogs/v2.0.
|
|
503
|
+
- [changelogs/v2.0.3.md](./changelogs/v2.0.3.md) - 当前发布详细变更文档
|
|
504
|
+
- [changelogs/v2.0.2.md](./changelogs/v2.0.2.md) - v2.0.2 详细变更文档
|
|
505
|
+
- [changelogs/v2.0.1.md](./changelogs/v2.0.1.md) - v2.0.1 详细变更文档
|
|
501
506
|
- [README.md](./README.md) - 项目说明
|
|
502
507
|
- [docs/](https://github.com/vextjs/monSQLize/blob/main/docs/index.md) - API 文档
|
|
503
508
|
|
|
504
509
|
---
|
|
505
510
|
|
|
506
|
-
**最后更新**: 2026-06-
|
|
511
|
+
**最后更新**: 2026-06-11
|
|
507
512
|
|
package/README.md
CHANGED
|
@@ -72,15 +72,8 @@ Runtime dependencies installed with the package:
|
|
|
72
72
|
- `schema-dsl` - model schema validation runtime dependency.
|
|
73
73
|
- `cache-hub` - cache and function-cache foundation.
|
|
74
74
|
- `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
|
-
```
|
|
75
|
+
- `ioredis` - Redis-backed L2 cache, distributed invalidation, and distributed lock support.
|
|
76
|
+
- `ssh2` - SSH tunnel support for restricted/private network deployment.
|
|
84
77
|
|
|
85
78
|
## Quick Start
|
|
86
79
|
|
|
@@ -423,14 +416,14 @@ const user = await users.findOne({ email });
|
|
|
423
416
|
const list = await users.find({ status: 'active' }).toArray();
|
|
424
417
|
```
|
|
425
418
|
|
|
426
|
-
The
|
|
419
|
+
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
420
|
|
|
428
421
|
## Compatibility
|
|
429
422
|
|
|
430
423
|
| Surface | Current Support |
|
|
431
424
|
|---|---|
|
|
432
425
|
| Node.js | `>=18.0.0`; CI covers Node 18 / 20 / 22. |
|
|
433
|
-
| MongoDB driver | `mongodb
|
|
426
|
+
| MongoDB driver | `mongodb@6.21.0` runtime baseline; driver 7.2.0 has additional compatibility coverage. |
|
|
434
427
|
| MongoDB server | Memory-server based 6.x / 7.x validation is covered by the project test matrix. |
|
|
435
428
|
| Module systems | CommonJS and ESM are both validated. |
|
|
436
429
|
| TypeScript | Public declarations are published from `dist/types/index.d.ts`. |
|
|
@@ -438,9 +431,11 @@ The current v2.0.1 release has been validated against the workspace consumers `c
|
|
|
438
431
|
|
|
439
432
|
See the current support and verification documents:
|
|
440
433
|
|
|
441
|
-
- [
|
|
442
|
-
- [
|
|
443
|
-
- [
|
|
434
|
+
- [English documentation](https://github.com/vextjs/monSQLize/blob/main/docs/en/README.md)
|
|
435
|
+
- [Chinese documentation](https://github.com/vextjs/monSQLize/blob/main/docs/zh/README.md)
|
|
436
|
+
- [English recipes](https://github.com/vextjs/monSQLize/blob/main/docs/en/recipes.md)
|
|
437
|
+
- [Support matrix](https://github.com/vextjs/monSQLize/blob/main/docs/en/support-matrix.md)
|
|
438
|
+
- [Verification entry points](https://github.com/vextjs/monSQLize/blob/main/docs/en/verification-entrypoints.md)
|
|
444
439
|
- [test/compatibility/README.md](https://github.com/vextjs/monSQLize/blob/main/test/compatibility/README.md)
|
|
445
440
|
- [test/validation/VERIFICATION-PROGRESS.md](https://github.com/vextjs/monSQLize/blob/main/test/validation/VERIFICATION-PROGRESS.md)
|
|
446
441
|
|
|
@@ -448,7 +443,9 @@ See the current support and verification documents:
|
|
|
448
443
|
|
|
449
444
|
Current TypeScript documentation and examples are the source of truth for the v2 package:
|
|
450
445
|
|
|
451
|
-
- `docs/**` -
|
|
446
|
+
- `docs/en/**` - default English documentation.
|
|
447
|
+
- `docs/zh/**` - Simplified Chinese documentation.
|
|
448
|
+
- `docs/en/recipes.md` / `docs/zh/recipes.md` - shortest copy-ready paths for common setup scenarios.
|
|
452
449
|
- `examples/**` - TypeScript examples.
|
|
453
450
|
- `test/compatibility/**` - package exports and compatibility guards.
|
|
454
451
|
- `test/validation/**` - verification ledgers and mapping notes.
|
|
@@ -470,27 +467,34 @@ npm run build
|
|
|
470
467
|
npm run type-check
|
|
471
468
|
npm test
|
|
472
469
|
npm run verify:fast
|
|
470
|
+
npm run verify:full
|
|
473
471
|
npm run release:preflight
|
|
474
472
|
```
|
|
475
473
|
|
|
476
|
-
Release preflight runs linting, type checks, size guards, runtime checks, compatibility checks, refactor guards, the default test suite, and `npm pack --dry-run`.
|
|
474
|
+
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
475
|
|
|
478
476
|
`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
477
|
|
|
480
478
|
Optional commands:
|
|
481
479
|
|
|
482
480
|
```bash
|
|
481
|
+
npm run check:docs-examples
|
|
483
482
|
npm run test:examples
|
|
484
483
|
npm run test:coverage
|
|
484
|
+
npm run test:audit
|
|
485
485
|
npm run test:server-matrix
|
|
486
486
|
npm run test:real-env:private
|
|
487
487
|
```
|
|
488
488
|
|
|
489
|
-
`
|
|
489
|
+
`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.
|
|
490
|
+
|
|
491
|
+
`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.
|
|
492
|
+
|
|
493
|
+
`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
494
|
|
|
491
495
|
## Release Status
|
|
492
496
|
|
|
493
|
-
The current published release is `v2.0.
|
|
497
|
+
The current published release is `v2.0.3`.
|
|
494
498
|
|
|
495
499
|
Key release-readiness points:
|
|
496
500
|
|
|
@@ -498,11 +502,23 @@ Key release-readiness points:
|
|
|
498
502
|
- Package exports are consolidated under `dist/cjs`, `dist/esm`, and `dist/types`.
|
|
499
503
|
- 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
504
|
- v1 smooth-upgrade compatibility has been validated against the target workspace consumers.
|
|
501
|
-
- `schema-dsl` follows the npm `latest` TypeScript line
|
|
505
|
+
- `schema-dsl` follows the npm `latest` TypeScript line `schema-dsl@2.0.8`; deprecated `2.3.x` mistake releases are intentionally excluded.
|
|
502
506
|
- 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
507
|
|
|
504
508
|
## Roadmap
|
|
505
509
|
|
|
510
|
+
### v2.0.3
|
|
511
|
+
|
|
512
|
+
- v1 compatibility patch for documented `findPage({ cache })` behavior.
|
|
513
|
+
- Public transaction and distributed cache invalidator statistics APIs.
|
|
514
|
+
- Standalone documentation-site link safety and bilingual docs consistency fixes.
|
|
515
|
+
- Release preflight alignment for bilingual docs paths and production dependency audit.
|
|
516
|
+
|
|
517
|
+
### v2.0.2
|
|
518
|
+
|
|
519
|
+
- Deterministic dependency metadata patch.
|
|
520
|
+
- `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.
|
|
521
|
+
|
|
506
522
|
### v2.0.1
|
|
507
523
|
|
|
508
524
|
- 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.
|