@tslock/mongo 1.0.2 → 2.0.0

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.
Files changed (2) hide show
  1. package/README.md +12 -0
  2. package/package.json +9 -4
package/README.md CHANGED
@@ -41,6 +41,18 @@ await executor.executeWithLock(
41
41
 
42
42
  The lock document's `_id` is the lock name; it also stores `lockUntil`, `lockedAt`, and `lockedBy` (hostname).
43
43
 
44
+ > **Lock-name safety:** Lock names must be non-empty, contain no control characters, and be at most 1024 UTF-8 bytes.
45
+
46
+ ## Integration tests
47
+
48
+ The shared MongoDB contract runs against a MongoDB 7 Testcontainers instance:
49
+
50
+ ```bash
51
+ pnpm --filter @tslock/mongo test:integration
52
+ ```
53
+
54
+ A running Docker daemon is required. The suite starts and removes its own container.
55
+
44
56
  ## Requirements
45
57
 
46
58
  - Node.js >= 22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tslock/mongo",
3
- "version": "1.0.2",
3
+ "version": "2.0.0",
4
4
  "description": "TSLock provider for MongoDB",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -12,7 +12,8 @@
12
12
  "types": "./dist/index.d.ts",
13
13
  "import": "./dist/index.js",
14
14
  "require": "./dist/index.cjs"
15
- }
15
+ },
16
+ "./package.json": "./package.json"
16
17
  },
17
18
  "files": [
18
19
  "dist"
@@ -22,7 +23,7 @@
22
23
  },
23
24
  "peerDependencies": {
24
25
  "mongodb": "^6.0.0",
25
- "@tslock/core": "1.0.2"
26
+ "@tslock/core": "2.0.0"
26
27
  },
27
28
  "peerDependenciesMeta": {
28
29
  "@tslock/core": {
@@ -37,7 +38,9 @@
37
38
  "tsup": "^8.0.0",
38
39
  "vitest": "^2.0.0",
39
40
  "mongodb": "^6.0.0",
40
- "@tslock/core": "1.0.2"
41
+ "@testcontainers/mongodb": "^12.0.4",
42
+ "@tslock/core": "2.0.0",
43
+ "@tslock/test-support": "2.0.0"
41
44
  },
42
45
  "publishConfig": {
43
46
  "access": "public"
@@ -47,9 +50,11 @@
47
50
  "url": "git+https://github.com/drmaas/tslock.git",
48
51
  "directory": "packages/mongo"
49
52
  },
53
+ "sideEffects": false,
50
54
  "scripts": {
51
55
  "build": "tsup",
52
56
  "test": "vitest run",
57
+ "test:integration": "vitest run --config vitest.integration.config.ts",
53
58
  "test:watch": "vitest",
54
59
  "typecheck": "tsc --noEmit"
55
60
  }