Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

desktop: use yarn instead of npx for build scripts

Abdullah Atta626d3933769d
diff --git a/apps/desktop/scripts/build.mjs b/apps/desktop/scripts/build.mjs
index 67a12455d..97e7cd808 100644
--- a/apps/desktop/scripts/build.mjs
+++ b/apps/desktop/scripts/build.mjs
@@ -38,7 +38,7 @@ await fs.rm("./build/", { force: true, recursive: true });
if (args.rebuild || !existsSync(path.join(webAppPath, "build"))) {
await exec(
- "npx nx build:desktop @notesnook/web",
+ "yarn nx build:desktop @notesnook/web",
path.join(__dirname, "..", "..", "..")
);
}
@@ -48,7 +48,7 @@ if (os.platform() === "linux") await patchBetterSQLite3();
if (os.platform() === "win32")
await exec(
- `npx prebuildify --arch=arm64 --strip -t electron@${packageJson.devDependencies.electron}`,
+ `yarn prebuildify --arch=arm64 --strip -t electron@${packageJson.devDependencies.electron}`,
path.join(__dirname, "..", "node_modules", "sodium-native")
);
@@ -58,15 +58,15 @@ await fs.cp(path.join(webAppPath, "build"), "build", {
});
if (args.variant === "mas") {
- await exec(`npm run bundle:mas`);
+ await exec(`yarn run bundle:mas`);
} else {
- await exec(`npm run bundle`);
+ await exec(`yarn run bundle`);
}
-await exec(`npx tsc`);
+await exec(`yarn tsc`);
if (args.run) {
- await exec(`npx electron-builder --dir --x64`);
+ await exec(`yarn electron-builder --dir --x64`);
if (process.platform === "win32") {
await exec(`.\\output\\win-unpacked\\Notesnook.exe`);
} else if (process.platform === "darwin") {
diff --git a/apps/desktop/scripts/dev.mjs b/apps/desktop/scripts/dev.mjs
index 0f7c70cd7..76800d673 100644
--- a/apps/desktop/scripts/dev.mjs
+++ b/apps/desktop/scripts/dev.mjs
@@ -53,11 +53,11 @@ async function onChange(first) {
if (first) {
await fs.rm("./build/", { force: true, recursive: true });
- await exec("npx electron-builder install-app-deps");
+ await exec("yarn electron-builder install-app-deps");
}
- await exec(`npm run bundle`);
- execAsync(`npx`, [`tsc`]);
+ await exec(`yarn run bundle`);
+ execAsync(`yarn`, [`tsc`]);
if (await isBundleSame()) {
console.log("Bundle is same. Doing nothing.");
@@ -66,7 +66,7 @@ async function onChange(first) {
if (first) {
await spawnAndWaitUntil(
- ["npx", "nx", "start:desktop", "@notesnook/web"],
+ ["yarn", "nx", "start:desktop", "@notesnook/web"],
path.join(__dirname, "..", "..", ".."),
(data) => data.includes("Network: use --host to expose")
);
@@ -78,7 +78,7 @@ async function onChange(first) {
}
execAsync(
- "npx",
+ "yarn",
["electron", path.join("build", "electron.js")],
true,
cleanup