|
@@ -0,0 +1,23 @@
|
|
1
|
+const fs = require("fs");
|
|
2
|
+
|
|
3
|
+const excalidrawDir = `${__dirname}/../src/packages/excalidraw`;
|
|
4
|
+let data = fs.readFileSync(`${excalidrawDir}/README_NEXT.md`, "utf8");
|
|
5
|
+
|
|
6
|
+// remove note for unstable release
|
|
7
|
+data = data.replace(
|
|
8
|
+ /<!-- unstable-readme-start-->[\s\S]*?<!-- unstable-readme-end-->/,
|
|
9
|
+ "",
|
|
10
|
+);
|
|
11
|
+
|
|
12
|
+// replace "excalidraw-next" with "excalidraw"
|
|
13
|
+data = data.replace(/excalidraw-next/g, "excalidraw");
|
|
14
|
+data = data.trim();
|
|
15
|
+
|
|
16
|
+const demoIndex = data.indexOf("### Demo");
|
|
17
|
+const excalidrawNextNote =
|
|
18
|
+ "#### Note\n\n**If you don't want to wait for the next stable release and try out the unreleased changes you can use [@excalidraw/excalidraw-next](https://www.npmjs.com/package/@excalidraw/excalidraw-next).**\n\n";
|
|
19
|
+// Add excalidraw next note to try out for unreleased changes
|
|
20
|
+data = data.slice(0, demoIndex) + excalidrawNextNote + data.slice(demoIndex);
|
|
21
|
+
|
|
22
|
+// update readme
|
|
23
|
+fs.writeFileSync(`${excalidrawDir}/README.md`, data, "utf8");
|