Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/files/references.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions scripts/buildPackages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"fs-extra": "^11.3.5",
"listr2": "^10.2.1",
"load-json-file": "^7.0.1",
"node-notifier": "^10.0.1",
"serialize-error": "^13.0.1",
"tsx": "4.21.0",
"write-json-file": "^7.0.0",
Expand Down
24 changes: 23 additions & 1 deletion scripts/buildPackages/src/buildPackages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import { getBuildMeta } from "./getBuildMeta";
import { buildPackage } from "./buildSinglePackage";
import { getHardwareInfo } from "./getHardwareInfo";
import execa from "execa";
import notifier from "node-notifier";

import path from "path";
import { hideBin } from "yargs/helpers";
import { PackageBuildError } from "./PackageBuildError";
import { queueMetaWrite } from "./writeMetaQueue";
Expand All @@ -18,6 +20,12 @@ const argv = yargs(hideBin(process.argv)).parse();

const { green, red } = chalk;

const projectFolder = path.basename(process.cwd());

const sendNotification = (title: string, message: string) => {
notifier.notify({ title, message });
};

interface BuildOptions {
p?: string | string[];
debug?: boolean;
Expand Down Expand Up @@ -74,7 +82,13 @@ export const buildPackages = async () => {

if (allPackages.length === 1) {
const [pkg] = allPackages;
await buildPackage(pkg, options.buildOverrides, "inherit", options.safeReplace);
try {
await buildPackage(pkg, options.buildOverrides, "inherit", options.safeReplace);
sendNotification(`Webiny Build (${projectFolder})`, "Build completed successfully");
} catch (err) {
sendNotification(`Webiny Build (${projectFolder})`, "Build failed");
throw err;
}
} else {
const start = Date.now();

Expand Down Expand Up @@ -176,10 +190,18 @@ export const buildPackages = async () => {
console.log();
});

sendNotification(
`Webiny Build (${projectFolder})`,
`Build failed after ${duration} seconds`
);
console.log(`Build failed in ${red(duration)} seconds.`);
process.exit(1);
}

sendNotification(
`Webiny Build (${projectFolder})`,
`Build finished in ${duration} seconds`
);
console.log(`\nBuild finished in ${green(duration)} seconds.`);
}
};
Expand Down
49 changes: 48 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10802,6 +10802,7 @@ __metadata:
fs-extra: "npm:^11.3.5"
listr2: "npm:^10.2.1"
load-json-file: "npm:^7.0.1"
node-notifier: "npm:^10.0.1"
serialize-error: "npm:^13.0.1"
tsx: "npm:4.21.0"
write-json-file: "npm:^7.0.0"
Expand Down Expand Up @@ -18678,6 +18679,13 @@ __metadata:
languageName: node
linkType: hard

"growly@npm:^1.3.0":
version: 1.3.0
resolution: "growly@npm:1.3.0"
checksum: 10/77f9abc3a854ec628580939f004ba8f05c677f9a6c957be817525f20f68f75368c4879c64d12551f262a9a00de33fbefc4deb24f8f2124429c906ef20ec3c678
languageName: node
linkType: hard

"gunzip-maybe@npm:1.4.2":
version: 1.4.2
resolution: "gunzip-maybe@npm:1.4.2"
Expand Down Expand Up @@ -19348,6 +19356,15 @@ __metadata:
languageName: node
linkType: hard

"is-docker@npm:^2.0.0":
version: 2.2.1
resolution: "is-docker@npm:2.2.1"
bin:
is-docker: cli.js
checksum: 10/3fef7ddbf0be25958e8991ad941901bf5922ab2753c46980b60b05c1bf9c9c2402d35e6dc32e4380b980ef5e1970a5d9d5e5aa2e02d77727c3b6b5e918474c56
languageName: node
linkType: hard

"is-docker@npm:^3.0.0":
version: 3.0.0
resolution: "is-docker@npm:3.0.0"
Expand Down Expand Up @@ -19655,6 +19672,15 @@ __metadata:
languageName: node
linkType: hard

"is-wsl@npm:^2.2.0":
version: 2.2.0
resolution: "is-wsl@npm:2.2.0"
dependencies:
is-docker: "npm:^2.0.0"
checksum: 10/20849846ae414997d290b75e16868e5261e86ff5047f104027026fd61d8b5a9b0b3ade16239f35e1a067b3c7cc02f70183cb661010ed16f4b6c7c93dad1b19d8
languageName: node
linkType: hard

"is-wsl@npm:^3.1.0":
version: 3.1.1
resolution: "is-wsl@npm:3.1.1"
Expand Down Expand Up @@ -21615,6 +21641,20 @@ __metadata:
languageName: node
linkType: hard

"node-notifier@npm:^10.0.1":
version: 10.0.1
resolution: "node-notifier@npm:10.0.1"
dependencies:
growly: "npm:^1.3.0"
is-wsl: "npm:^2.2.0"
semver: "npm:^7.3.5"
shellwords: "npm:^0.1.1"
uuid: "npm:^8.3.2"
which: "npm:^2.0.2"
checksum: 10/b238ffe16fd3b14df4c021e7d2a64483a3ac549b22d93e3c0bcfd9557a12d1c370ce6d8889308bc9c31c7464d99b224e7056dbd8cf4fb37b0f6296185972774a
languageName: node
linkType: hard

"node-releases@npm:^2.0.36":
version: 2.0.46
resolution: "node-releases@npm:2.0.46"
Expand Down Expand Up @@ -25174,6 +25214,13 @@ __metadata:
languageName: node
linkType: hard

"shellwords@npm:^0.1.1":
version: 0.1.1
resolution: "shellwords@npm:0.1.1"
checksum: 10/c122808ca53c828747ee69503755a5d35d8c1493e943d15ebfd6fe028517ec1af6f8a4c2dc9d995b0df75bd4246382c0dd2dc792a82ce5a6448307a643fc5a38
languageName: node
linkType: hard

"shimmer@npm:^1.2.1":
version: 1.2.1
resolution: "shimmer@npm:1.2.1"
Expand Down Expand Up @@ -27631,7 +27678,7 @@ __metadata:
languageName: node
linkType: hard

"which@npm:^2.0.1":
"which@npm:^2.0.1, which@npm:^2.0.2":
version: 2.0.2
resolution: "which@npm:2.0.2"
dependencies:
Expand Down
Loading