mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-18 12:47:50 +01:00
setup: ignore scripts during bootstrap
This commit is contained in:
@@ -24,12 +24,11 @@ import os from "os";
|
|||||||
import parser from "yargs-parser";
|
import parser from "yargs-parser";
|
||||||
import { fdir } from "fdir";
|
import { fdir } from "fdir";
|
||||||
import Listr from "listr";
|
import Listr from "listr";
|
||||||
|
import { existsSync } from "fs";
|
||||||
|
|
||||||
const args = parser(process.argv, { alias: { scope: ["s"], offline: ["o"] } });
|
const args = parser(process.argv, { alias: { scope: ["s"], offline: ["o"] } });
|
||||||
const IS_CI = process.env.CI;
|
const IS_CI = process.env.CI;
|
||||||
const THREADS = IS_CI
|
const THREADS = Math.max(4, process.env.THREADS || os.cpus().length / 2);
|
||||||
? 1
|
|
||||||
: Math.max(4, process.env.THREADS || os.cpus().length / 2);
|
|
||||||
const scopes = {
|
const scopes = {
|
||||||
mobile: "apps/mobile",
|
mobile: "apps/mobile",
|
||||||
web: "apps/web",
|
web: "apps/web",
|
||||||
@@ -98,11 +97,14 @@ async function bootstrapPackages(dependencies) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function bootstrapPackage(cwd, outputs) {
|
function bootstrapPackage(cwd, outputs) {
|
||||||
|
const cmd = `npm ${
|
||||||
|
IS_CI ? "ci" : "i"
|
||||||
|
} --legacy-peer-deps --no-audit --no-fund ${
|
||||||
|
args.offline ? "--offline" : "--prefer-offline"
|
||||||
|
} --progress=false --ignore-scripts`;
|
||||||
return new Promise((resolve, reject) =>
|
return new Promise((resolve, reject) =>
|
||||||
exec(
|
exec(
|
||||||
`npm ${IS_CI ? "ci" : "i"} --legacy-peer-deps --no-audit --no-fund ${
|
cmd,
|
||||||
args.offline ? "--offline" : "--prefer-offline"
|
|
||||||
} --progress=false`,
|
|
||||||
{
|
{
|
||||||
cwd,
|
cwd,
|
||||||
env: process.env,
|
env: process.env,
|
||||||
@@ -115,8 +117,25 @@ function bootstrapPackage(cwd, outputs) {
|
|||||||
outputs.stdout.push(stdout);
|
outputs.stdout.push(stdout);
|
||||||
outputs.stderr.push(stderr);
|
outputs.stderr.push(stderr);
|
||||||
|
|
||||||
|
if (!existsSync(path.join(cwd, "patches"))) return resolve();
|
||||||
|
|
||||||
|
exec(
|
||||||
|
`npx patch-package`,
|
||||||
|
{
|
||||||
|
cwd,
|
||||||
|
env: process.env,
|
||||||
|
stdio: "inherit"
|
||||||
|
},
|
||||||
|
(err, stdout, stderr) => {
|
||||||
|
if (err) return reject(err);
|
||||||
|
|
||||||
|
outputs.stdout.push(stdout);
|
||||||
|
outputs.stderr.push(stderr);
|
||||||
|
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user