@lobehub/editor 4.27.1 → 4.27.2

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": "@lobehub/editor",
3
- "version": "4.27.1",
3
+ "version": "4.27.2",
4
4
  "description": "A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -245,10 +245,19 @@ function patchPackage({ displayName, fileHashes, packageName, patchFile, ...conf
245
245
  );
246
246
  }
247
247
 
248
- fs.writeFileSync(
249
- targetPath,
250
- restoreLineEndings(patchedContent, detectLineEnding(currentContent)),
251
- );
248
+ // Peer-dependent editor instances can patch the same dependency concurrently.
249
+ // Publish a complete file so other patchers never read a partial write.
250
+ const temporaryPath = `${targetPath}.${crypto.randomUUID()}.tmp`;
251
+ try {
252
+ fs.writeFileSync(
253
+ temporaryPath,
254
+ restoreLineEndings(patchedContent, detectLineEnding(currentContent)),
255
+ { flag: 'wx', mode: fs.statSync(targetPath).mode },
256
+ );
257
+ fs.renameSync(temporaryPath, targetPath);
258
+ } finally {
259
+ fs.rmSync(temporaryPath, { force: true });
260
+ }
252
261
  patchedFiles.push(filename);
253
262
  }
254
263