aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/release.js
diff options
context:
space:
mode:
authorkj_sh6042026-03-15 16:19:36 -0400
committerkj_sh6042026-03-15 16:19:36 -0400
commit72ece7c00b091011617fccf719df7f602cf4f7c7 (patch)
tree75a085594679b4282faac3b3646d589bf5a67ea5 /scripts/release.js
parentc142734224f6263180e4cbe6fabec591a27972a1 (diff)
refactor: scripts/
Diffstat (limited to 'scripts/release.js')
-rw-r--r--scripts/release.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/release.js b/scripts/release.js
new file mode 100644
index 0000000..21f9f25
--- /dev/null
+++ b/scripts/release.js
@@ -0,0 +1,28 @@
+const { execSync } = require("child_process");
+
+const excalidrawDir = `${__dirname}/../packages/excalidraw`;
+const excalidrawPackage = `${excalidrawDir}/package.json`;
+const pkg = require(excalidrawPackage);
+
+const publish = () => {
+ try {
+ console.info("Installing the dependencies in root folder...");
+ execSync(`yarn --frozen-lockfile`);
+ console.info("Installing the dependencies in excalidraw directory...");
+ execSync(`yarn --frozen-lockfile`, { cwd: excalidrawDir });
+ console.info("Building ESM Package...");
+ execSync(`yarn run build:esm`, { cwd: excalidrawDir });
+ console.info("Publishing the package...");
+ execSync(`yarn --cwd ${excalidrawDir} publish`);
+ } catch (error) {
+ console.error(error);
+ process.exit(1);
+ }
+};
+
+const release = () => {
+ publish();
+ console.info(`Published ${pkg.version}!`);
+};
+
+release();