@mintlify/cli 4.0.1509 → 4.0.1511

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/cli",
3
- "version": "4.0.1509",
3
+ "version": "4.0.1511",
4
4
  "description": "The Mintlify CLI",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -45,12 +45,12 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@inquirer/prompts": "7.9.0",
48
- "@mintlify/common": "1.0.1155",
49
- "@mintlify/link-rot": "3.0.1357",
50
- "@mintlify/models": "0.0.358",
51
- "@mintlify/prebuild": "1.0.1309",
52
- "@mintlify/previewing": "4.0.1381",
53
- "@mintlify/validation": "0.1.860",
48
+ "@mintlify/common": "1.0.1156",
49
+ "@mintlify/link-rot": "3.0.1358",
50
+ "@mintlify/models": "0.0.359",
51
+ "@mintlify/prebuild": "1.0.1310",
52
+ "@mintlify/previewing": "4.0.1382",
53
+ "@mintlify/validation": "0.1.861",
54
54
  "adm-zip": "0.6.0",
55
55
  "chalk": "5.2.0",
56
56
  "color": "4.2.3",
@@ -86,7 +86,7 @@
86
86
  "keytar": "7.9.0"
87
87
  },
88
88
  "devDependencies": {
89
- "@mintlify/editor": "0.0.393",
89
+ "@mintlify/editor": "0.0.395",
90
90
  "@mintlify/ts-config": "2.0.2",
91
91
  "@tsconfig/recommended": "1.0.2",
92
92
  "@types/detect-port": "1.3.2",
@@ -105,5 +105,5 @@
105
105
  "vitest": "2.1.9",
106
106
  "vitest-mock-process": "1.0.4"
107
107
  },
108
- "gitHead": "49752096a147708d0c2a45ad0228838e76914ac1"
108
+ "gitHead": "992dfe00b7789227fed0ec5c4d23e317074ddff5"
109
109
  }
@@ -1,5 +1,6 @@
1
1
  import { randomUUID } from 'node:crypto';
2
2
  import fs from 'node:fs/promises';
3
+ import type { FileHandle } from 'node:fs/promises';
3
4
  import path from 'node:path';
4
5
  import { setTimeout as delay } from 'node:timers/promises';
5
6
  import { z } from 'zod';
@@ -145,27 +146,31 @@ async function acquireIndexLock(docsRoot: string): Promise<() => Promise<void>>
145
146
  const deadline = Date.now() + LOCK_TIMEOUT_MS;
146
147
 
147
148
  while (Date.now() < deadline) {
149
+ let lock: FileHandle;
148
150
  try {
149
- const lock = await fs.open(lockPath, 'wx');
150
- try {
151
- await lock.writeFile(token);
152
- } finally {
153
- await lock.close();
154
- }
155
- return async () => {
156
- const owner = await fs.readFile(lockPath, 'utf8').catch(() => undefined);
157
- if (owner === token) await fs.unlink(lockPath).catch(() => undefined);
158
- };
151
+ lock = await fs.open(lockPath, 'wx');
159
152
  } catch (error) {
160
- if (errorCode(error) !== 'EEXIST') throw error;
161
- }
162
-
163
- const stats = await fs.stat(lockPath).catch(() => undefined);
164
- if (stats && Date.now() - stats.mtimeMs > STALE_LOCK_MS) {
165
- await fs.unlink(lockPath).catch(() => undefined);
153
+ const code = errorCode(error);
154
+ // Windows can deny opening a lock while another writer's deletion is still pending.
155
+ if (code !== 'EEXIST' && !(process.platform === 'win32' && code === 'EPERM')) throw error;
156
+
157
+ const stats = await fs.stat(lockPath).catch(() => undefined);
158
+ if (stats && Date.now() - stats.mtimeMs > STALE_LOCK_MS) {
159
+ await fs.unlink(lockPath).catch(() => undefined);
160
+ continue;
161
+ }
162
+ await delay(LOCK_RETRY_MS);
166
163
  continue;
167
164
  }
168
- await delay(LOCK_RETRY_MS);
165
+ try {
166
+ await lock.writeFile(token);
167
+ } finally {
168
+ await lock.close();
169
+ }
170
+ return async () => {
171
+ const owner = await fs.readFile(lockPath, 'utf8').catch(() => undefined);
172
+ if (owner === token) await fs.unlink(lockPath).catch(() => undefined);
173
+ };
169
174
  }
170
175
  throw new Error('Timed out updating mint test run history');
171
176
  }