mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 02:08:57 +00:00
Run lint in parallel
This commit is contained in:
@@ -18,7 +18,10 @@
|
||||
"postinstall": "pnpm run build:acknowledgments && pnpm run electron:install-app-deps",
|
||||
"postuninstall": "pnpm run build:acknowledgments",
|
||||
"start": "electron .",
|
||||
"generate": "npm-run-all build-protobuf build:esbuild build:icu-types build:compact-locales build:styles get-expire-time copy-components",
|
||||
"generate": "run-s generate:phase-0 generate:phase-1",
|
||||
"generate:phase-0": "run-p build:esbuild:scripts",
|
||||
"generate:phase-1": "run-p --aggregate-output --print-label generate:phase-1:bundle build:icu-types build:compact-locales build:styles get-expire-time copy-components",
|
||||
"generate:phase-1:bundle": "run-s build-protobuf build:esbuild:bundle",
|
||||
"build-release": "pnpm run build",
|
||||
"sign-release": "node ts/updater/generateSignature.js",
|
||||
"notarize": "echo 'No longer necessary'",
|
||||
@@ -51,7 +54,7 @@
|
||||
"test-eslint": "mocha .eslint/rules/**/*.test.js --ignore-leaks",
|
||||
"test-lint-intl": "ts-node ./build/intl-linter/linter.ts --test",
|
||||
"eslint": "eslint --cache . --cache-strategy content --max-warnings 0",
|
||||
"lint": "run-s --print-label lint-prettier lint-css check:types eslint",
|
||||
"lint": "run-p --aggregate-output --print-label lint-prettier lint-css check:types eslint",
|
||||
"lint-deps": "node ts/util/lint/linter.js",
|
||||
"lint-license-comments": "ts-node ts/util/lint/license_comments.ts",
|
||||
"lint-prettier": "pprettier --check '**/*.{ts,tsx,d.ts,js,json,html,scss,md,yml,yaml}' '!node_modules/**'",
|
||||
@@ -87,6 +90,8 @@
|
||||
"build:tray-icons": "ts-node ts/scripts/generate-tray-icons.ts",
|
||||
"build:dev": "run-s --print-label generate build:esbuild:prod",
|
||||
"build:esbuild": "node scripts/esbuild.js",
|
||||
"build:esbuild:scripts": "node scripts/esbuild.js --no-bundle",
|
||||
"build:esbuild:bundle": "node scripts/esbuild.js --no-scripts",
|
||||
"build:esbuild:prod": "node scripts/esbuild.js --prod",
|
||||
"build:styles": "pnpm run \"/^build:styles:.*/\"",
|
||||
"build:styles:sass": "sass stylesheets/manifest.scss:stylesheets/manifest.css stylesheets/manifest_bridge.scss:stylesheets/manifest_bridge.css --fatal-deprecation=1.80.7",
|
||||
|
||||
@@ -10,6 +10,8 @@ const BUNDLES_DIR = 'bundles';
|
||||
|
||||
const watch = process.argv.some(argv => argv === '-w' || argv === '--watch');
|
||||
const isProd = process.argv.some(argv => argv === '-prod' || argv === '--prod');
|
||||
const noBundle = process.argv.some(argv => argv === '--no-bundle');
|
||||
const noScripts = process.argv.some(argv => argv === '--no-scripts');
|
||||
|
||||
const nodeDefaults = {
|
||||
platform: 'node',
|
||||
@@ -84,16 +86,27 @@ const sandboxedBrowserDefaults = {
|
||||
};
|
||||
|
||||
async function build({ appConfig, preloadConfig }) {
|
||||
const app = await esbuild.context(appConfig);
|
||||
const preload = await esbuild.context(preloadConfig);
|
||||
let app;
|
||||
let preload;
|
||||
|
||||
if (!noScripts) {
|
||||
app = await esbuild.context(appConfig);
|
||||
}
|
||||
if (!noBundle) {
|
||||
preload = await esbuild.context(preloadConfig);
|
||||
}
|
||||
|
||||
if (watch) {
|
||||
await Promise.all([app.watch(), preload.watch()]);
|
||||
await Promise.all([app && app.watch(), preload && preload.watch()]);
|
||||
} else {
|
||||
await Promise.all([app.rebuild(), preload.rebuild()]);
|
||||
await Promise.all([app && app.rebuild(), preload && preload.rebuild()]);
|
||||
|
||||
await app.dispose();
|
||||
await preload.dispose();
|
||||
if (app) {
|
||||
await app.dispose();
|
||||
}
|
||||
if (preload) {
|
||||
await preload.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user