Skip to content

Commit 7ea746e

Browse files
committed
fix: release monsqlize 2.0.6 compatibility
1 parent 7510cdd commit 7ea746e

15 files changed

Lines changed: 161 additions & 47 deletions

‎CHANGELOG.md‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# CHANGELOG
22

3-
> Summary index — current release details are packaged in [changelogs/v2.0.5.md](./changelogs/v2.0.5.md); historical details live in the repository changelog archive.
4-
> **Last updated**: 2026-06-13
3+
> Summary index — current release details are packaged in [changelogs/v2.0.6.md](./changelogs/v2.0.6.md); historical details live in the repository changelog archive.
4+
> **Last updated**: 2026-06-15
55
66
---
77

88
## Version Overview
99

1010
| Version | Date | Summary | Details |
1111
|---------|------|---------|---------|
12+
| [v2.0.6](./changelogs/v2.0.6.md) | 2026-06-15 | Patch: dependency alignment to `schema-dsl@2.0.11` so downstream frameworks inherit the ESM/CJS shared custom type registry fix | [View](./changelogs/v2.0.6.md) |
1213
| [v2.0.5](./changelogs/v2.0.5.md) | 2026-06-13 | Patch: Model schema adapter delegates DSL type authority to `schema-dsl@2.0.10`, removing the duplicated monSQLize allowlist while preserving legacy aliases and business literals | [View](./changelogs/v2.0.5.md) |
1314
| [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) |
1415
| [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) |
@@ -448,7 +449,8 @@ const result = await msq.collection('orders').insertOne(dataFromMongoose);
448449
changelogs/
449450
├── README.md # 变更文档说明
450451
├── TEMPLATE.md # 变更文档模板
451-
├── v2.0.5.md # 当前发布详细变更
452+
├── v2.0.6.md # 当前发布详细变更
453+
├── v2.0.5.md # v2.0.5 详细变更
452454
├── v2.0.4.md # v2.0.4 详细变更
453455
├── v2.0.3.md # v2.0.3 详细变更
454456
├── v2.0.2.md # v2.0.2 详细变更
@@ -504,7 +506,8 @@ changelogs/
504506

505507
## 相关文档
506508

507-
- [changelogs/v2.0.5.md](./changelogs/v2.0.5.md) - 当前发布详细变更文档
509+
- [changelogs/v2.0.6.md](./changelogs/v2.0.6.md) - 当前发布详细变更文档
510+
- [changelogs/v2.0.5.md](./changelogs/v2.0.5.md) - v2.0.5 详细变更文档
508511
- [changelogs/v2.0.4.md](./changelogs/v2.0.4.md) - v2.0.4 详细变更文档
509512
- [changelogs/v2.0.3.md](./changelogs/v2.0.3.md) - v2.0.3 详细变更文档
510513
- [changelogs/v2.0.2.md](./changelogs/v2.0.2.md) - v2.0.2 详细变更文档
@@ -514,5 +517,5 @@ changelogs/
514517

515518
---
516519

517-
**最后更新**: 2026-06-13
520+
**最后更新**: 2026-06-15
518521

‎README.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,19 +518,25 @@ npm run test:real-env:private
518518

519519
## Release Status
520520

521-
The current published release is `v2.0.4`.
521+
The current release train targets `v2.0.6`.
522522

523523
Key release-readiness points:
524524

525525
- TypeScript rewrite completed for the current runtime and test entry points.
526526
- Package exports are consolidated under `dist/cjs`, `dist/esm`, and `dist/types`.
527527
- 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`.
528528
- v1 smooth-upgrade compatibility has been validated against the target workspace consumers.
529-
- `schema-dsl` follows the npm `latest` TypeScript line `schema-dsl@2.0.9`; deprecated `2.3.x` mistake releases are intentionally excluded.
529+
- `schema-dsl` follows the npm `latest` TypeScript line `schema-dsl@2.0.11`; deprecated `2.3.x` mistake releases are intentionally excluded.
530530
- 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.
531531

532532
## Roadmap
533533

534+
### v2.0.6
535+
536+
- Dependency alignment to `schema-dsl@2.0.11`, carrying the shared ESM/CJS custom type registry fix to downstream vext applications.
537+
- NodeNext declaration compatibility for ESM consumers through generated `*.d.mts` mirrors and import-side `types` conditions.
538+
- Restored v1-compatible root option type exports.
539+
534540
### v2.0.4
535541

536542
- Production-safe Model index rollout controls with `autoIndex`, dry-run preflight, conflict reporting, and explicit `ensureIndexes()` / `ensureModelIndexes()` APIs.

‎changelogs/v2.0.6.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# monSQLize v2.0.6
2+
3+
Released: 2026-06-15
4+
5+
## Changes
6+
7+
- Upgrade runtime dependency `schema-dsl` from `2.0.10` to `2.0.11`.
8+
- This keeps monSQLize aligned with the schema-dsl ESM/CJS shared custom type registry fix used by downstream vext applications.
9+
- Restore v1-compatible root type exports: `FindOptions`, `CountOptions`, `AggregateOptions`, and `DistinctOptions`.
10+
- Add NodeNext-safe type-only import attributes for ESM `cache-hub` declarations consumed from monSQLize's CommonJS package boundary.
11+
- Generate ESM declaration mirrors (`*.d.mts`) and point the import-side package `types` condition at `dist/types/index.d.mts`, preserving default import constructability for NodeNext ESM consumers.
12+
13+
## Validation
14+
15+
- Dependency-only release; full release preflight should run after `schema-dsl@2.0.11` is available from npm.
16+
- `npm run type-check`

‎docs/en/file-dependency-governance.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ The current root package adopts the **precise version dependency strategy**:
44

55
| Dependencies | Strategy | Reasons |
66
|------|------|------|
7-
| `cache-hub` | Exact version `2.2.4` | The npm latest release has passed compatibility verification; the root direct dependency is fixed to 2.2.4, and `schema-dsl@2.0.10` declares the same transitive dependency version |
8-
| `schema-dsl` | Exact version `2.0.10` | The release chain targets the current non-deprecated TypeScript line; monSQLize relies on schema-dsl for DSL parsing, validation and alias diagnostics, and uses 2.0.10 for type-check and Model schema verification |
7+
| `cache-hub` | Exact version `2.2.4` | The npm latest release has passed compatibility verification; the root direct dependency is fixed to 2.2.4, and `schema-dsl@2.0.11` declares the same transitive dependency version |
8+
| `schema-dsl` | Exact version `2.0.11` | The release chain targets the current non-deprecated TypeScript line; monSQLize relies on schema-dsl for DSL parsing, validation and alias diagnostics, and uses 2.0.11 for type-check and Model schema verification |
99

10-
> `schema-dsl@2.0.10` is the intended latest for this release chain; the historical `2.3.x` line exists on npm but has been marked as misreleased/deprecated and must not be followed by upgrades.
10+
> `schema-dsl@2.0.11` is the intended latest for this release chain; the historical `2.3.x` line exists on npm but has been marked as misreleased/deprecated and must not be followed by upgrades.
1111
1212
## Current Risk
1313

@@ -20,8 +20,8 @@ The current root package adopts the **precise version dependency strategy**:
2020

2121
## Development status
2222

23-
- The root direct `cache-hub` dependency is fixed to `2.2.4`; `schema-dsl@2.0.10` also declares `cache-hub@2.2.4`, so no additional override is needed.
24-
- `schema-dsl` is fixed to `2.0.10`.
23+
- The root direct `cache-hub` dependency is fixed to `2.2.4`; `schema-dsl@2.0.11` also declares `cache-hub@2.2.4`, so no additional override is needed.
24+
- `schema-dsl` is fixed to `2.0.11`.
2525
- Local sibling `../schema-dsl` is only used for debugging the upstream library itself and is no longer a prerequisite for monSQLize root package installation.
2626

2727

@@ -36,21 +36,21 @@ npm run release:preflight
3636

3737
## schema-dsl 2.x upgrade verification
3838

39-
The dependency governance baseline has upgraded and fixed `schema-dsl` from the historical `^1.2.5` to `2.0.10`. The verification standard is as follows:
39+
The dependency governance baseline has upgraded and fixed `schema-dsl` from the historical `^1.2.5` to `2.0.11`. The verification standard is as follows:
4040

41-
1. The upstream released the **non-deprecated** 2.x latest version on npm: `2.0.10`.
42-
2. `npm install schema-dsl@2.0.10 --save-exact` followed by `npm run type-check`.
41+
1. The upstream released the **non-deprecated** 2.x latest version on npm: `2.0.11`.
42+
2. `npm install schema-dsl@2.0.11 --save-exact` followed by `npm run type-check`.
4343
3. All model-related unit tests/integration tests passed (covered with `npm run test:unit` and `npm run test:integration`).
4444
4. `npm run test:examples` all passed.
4545
5. `npm run release:preflight` still needs to be used as the final access control before release.
46-
6. This file, Profile, CHANGELOG, and lockfile must be synchronized to `2.0.10`.
46+
6. This file, Profile, CHANGELOG, and lockfile must be synchronized to `2.0.11`.
4747

4848
## cache-hub 2.2.4 upgrade verification
4949

5050
The dependency governance baseline has upgraded and fixed `cache-hub` from `1.0.0` to `2.2.4`. The verification standard is as follows:
5151

5252
1. The upstream npm `latest` is `2.2.4`, and the Node.js engine requirement remains `>=18`, matching the current monSQLize baseline.
53-
2. The root direct dependency resolves to `2.2.4`; `schema-dsl@2.0.10` also declares `cache-hub@2.2.4`.
53+
2. The root direct dependency resolves to `2.2.4`; `schema-dsl@2.0.11` also declares `cache-hub@2.2.4`.
5454
3. `npm run type-check`, targeted cache / function-cache tests, website build, and memory probe must pass.
5555
4. This file, Profile, CHANGELOG, package manifest, and lockfile must be synchronized with the root direct dependency `2.2.4` baseline.
5656

‎docs/en/index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pageType: home
33

44
hero:
5-
badge: v2.0.5 TypeScript release
5+
badge: v2.0.6 TypeScript release
66
name: monSQLize
77
text: TypeScript MongoDB Engine
88
tagline: MongoDB-native APIs with cache-hub L1/L2 caching, multi-pool routing, Saga workflows, and schema-ready models.

‎docs/zh/file-dependency-governance.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
| 依赖 | 策略 | 原因 |
66
|------|------|------|
7-
| `cache-hub` | 精确版本 `2.2.4` | 上游 npm latest 已发布稳定版本并通过兼容验证;根包 direct dependency 固定到 2.2.4,`schema-dsl@2.0.10` 声明的传递依赖同为 2.2.4 |
8-
| `schema-dsl` | 精确版本 `2.0.10` | 本次发布链路目标为当前非 deprecated 的 TypeScript 正式线;monSQLize 依赖 schema-dsl 统一负责 DSL 解析、验证与 alias diagnostics,并以 2.0.10 执行 type-check 与 Model schema 验证 |
7+
| `cache-hub` | 精确版本 `2.2.4` | 上游 npm latest 已发布稳定版本并通过兼容验证;根包 direct dependency 固定到 2.2.4,`schema-dsl@2.0.11` 声明的传递依赖同为 2.2.4 |
8+
| `schema-dsl` | 精确版本 `2.0.11` | 本次发布链路目标为当前非 deprecated 的 TypeScript 正式线;monSQLize 依赖 schema-dsl 统一负责 DSL 解析、验证与 alias diagnostics,并以 2.0.11 执行 type-check 与 Model schema 验证 |
99

10-
> `schema-dsl@2.0.10` 是本次发布链路的预期 latest;npm 上历史 `2.3.x` 已标记为误发布 / deprecated,不得跟随升级。
10+
> `schema-dsl@2.0.11` 是本次发布链路的预期 latest;npm 上历史 `2.3.x` 已标记为误发布 / deprecated,不得跟随升级。
1111
1212
## 当前风险
1313

@@ -19,8 +19,8 @@
1919

2020
### 开发态
2121

22-
- 根包 direct `cache-hub` 固定为 `2.2.4`;`schema-dsl@2.0.10` 声明的 `cache-hub` 版本同为 `2.2.4`,不需要额外 override。
23-
- `schema-dsl` 固定为 `2.0.10`。
22+
- 根包 direct `cache-hub` 固定为 `2.2.4`;`schema-dsl@2.0.11` 声明的 `cache-hub` 版本同为 `2.2.4`,不需要额外 override。
23+
- `schema-dsl` 固定为 `2.0.11`。
2424
- 本地 sibling `../schema-dsl` 仅用于上游库自身调试,不再作为 monSQLize 根包安装前提。
2525

2626
### 发布态
@@ -34,21 +34,21 @@ npm run release:preflight
3434

3535
## schema-dsl 2.x 升级验证
3636

37-
依赖治理基线已将 `schema-dsl` 从历史 `^1.2.5` 升级并固定到 `2.0.10`,验证标准如下:
37+
依赖治理基线已将 `schema-dsl` 从历史 `^1.2.5` 升级并固定到 `2.0.11`,验证标准如下:
3838

39-
1. 上游在 npm 发布了**非 deprecated** 的 2.x latest 版本:`2.0.10`。
40-
2. `npm install schema-dsl@2.0.10 --save-exact` 后通过 `npm run type-check`。
39+
1. 上游在 npm 发布了**非 deprecated** 的 2.x latest 版本:`2.0.11`。
40+
2. `npm install schema-dsl@2.0.11 --save-exact` 后通过 `npm run type-check`。
4141
3. model 相关单测 / 集成测试全通过(随 `npm run test:unit` 与 `npm run test:integration` 覆盖)。
4242
4. `npm run test:examples` 全通过。
4343
5. 发布前仍需以 `npm run release:preflight` 作为最终门禁。
44-
6. 本文件、Profile、CHANGELOG 与 lockfile 必须同步到 `2.0.10`。
44+
6. 本文件、Profile、CHANGELOG 与 lockfile 必须同步到 `2.0.11`。
4545

4646
## cache-hub 2.2.4 升级验证
4747

4848
依赖治理基线已将 `cache-hub` 从 `1.0.0` 升级并固定到 `2.2.4`,验证标准如下:
4949

5050
1. 上游 npm `latest` 为 `2.2.4`,Node.js 引擎要求仍为 `>=18`,与 monSQLize 当前基线一致。
51-
2. 根包 direct dependency 解析到 `2.2.4`;`schema-dsl@2.0.10` 也声明 `cache-hub@2.2.4`。
51+
2. 根包 direct dependency 解析到 `2.2.4`;`schema-dsl@2.0.11` 也声明 `cache-hub@2.2.4`。
5252
3. `npm run type-check`、缓存 / function-cache 定向测试、文档站构建与内存探针必须通过。
5353
4. 本文件、Profile、CHANGELOG、package manifest 与 lockfile 必须同步 root direct dependency 的 `2.2.4` 口径。
5454

‎docs/zh/index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pageType: home
33

44
hero:
5-
badge: v2.0.5 TypeScript 正式版
5+
badge: v2.0.6 TypeScript 正式版
66
name: monSQLize
77
text: TypeScript MongoDB 增强引擎
88
tagline: 保留 MongoDB 原生体验,整合 cache-hub 两级缓存、多连接池路由、Saga 编排与可选 Model 层。

‎package-lock.json‎

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
{
22
"name": "monsqlize",
3-
"version": "2.0.5",
3+
"version": "2.0.6",
44
"description": "TypeScript-native MongoDB ODM with multi-level caching (cache-hub), distributed locks, Saga orchestration, unified expression system (122 operators), connection pool management, ChangeStream sync, slow-query logging, and full v1 API compatibility",
55
"type": "commonjs",
66
"main": "./dist/cjs/index.cjs",
77
"module": "./dist/esm/index.mjs",
88
"types": "./dist/types/index.d.ts",
99
"exports": {
1010
".": {
11-
"types": "./dist/types/index.d.ts",
11+
"types": {
12+
"import": "./dist/types/index.d.mts",
13+
"require": "./dist/types/index.d.ts"
14+
},
1215
"require": "./dist/cjs/index.cjs",
1316
"import": "./dist/esm/index.mjs"
1417
},
@@ -18,6 +21,8 @@
1821
"dist/**/*.cjs",
1922
"dist/**/*.mjs",
2023
"dist/**/*.d.ts",
24+
"dist/**/*.d.mts",
25+
"changelogs/v2.0.6.md",
2126
"changelogs/v2.0.5.md",
2227
"changelogs/v2.0.4.md",
2328
"changelogs/v2.0.3.md",
@@ -117,7 +122,7 @@
117122
"cache-hub": "2.2.4",
118123
"ioredis": "5.8.2",
119124
"mongodb": "6.21.0",
120-
"schema-dsl": "2.0.10",
125+
"schema-dsl": "2.0.11",
121126
"ssh2": "1.17.0"
122127
}
123128
}

‎scripts/build-p1.cjs‎

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,35 @@
1-
const { cpSync, mkdirSync, rmSync } = require('node:fs');
1+
const { cpSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } = require('node:fs');
2+
const { join } = require('node:path');
23
const { build } = require('esbuild');
34

45
const emitSourceMaps = process.env.MONSQLIZE_BUILD_SOURCEMAPS === '1';
56

7+
function toEsmDeclaration(content) {
8+
return content
9+
.replace(/from '((?:\.\/|\.\.\/)[^']+)'/g, (_match, specifier) => {
10+
return specifier.endsWith('.mjs') ? `from '${specifier}'` : `from '${specifier}.mjs'`;
11+
})
12+
.replace(/import\('((?:\.\/|\.\.\/)[^']+)'\)/g, (_match, specifier) => {
13+
return specifier.endsWith('.mjs') ? `import('${specifier}')` : `import('${specifier}.mjs')`;
14+
});
15+
}
16+
17+
function writeEsmDeclarations(dir) {
18+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
19+
const fullPath = join(dir, entry.name);
20+
21+
if (entry.isDirectory()) {
22+
writeEsmDeclarations(fullPath);
23+
continue;
24+
}
25+
26+
if (!entry.name.endsWith('.d.ts')) continue;
27+
28+
const content = readFileSync(fullPath, 'utf8');
29+
writeFileSync(fullPath.replace(/\.d\.ts$/, '.d.mts'), toEsmDeclaration(content));
30+
}
31+
}
32+
633
async function main() {
734
rmSync('lib', { recursive: true, force: true });
835
rmSync('dist', { recursive: true, force: true });
@@ -57,6 +84,7 @@ async function main() {
5784
}
5885

5986
cpSync('types', 'dist/types', { recursive: true });
87+
writeEsmDeclarations('dist/types');
6088
}
6189

6290
main().catch((error) => {

0 commit comments

Comments
 (0)