Skip to content

build: replace dynamic require with import statement for ESM #25064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"test-linker-jit": "bazel test --partial_compilation --test_tag_filters=partial-compilation-integration,-firefox --build_tests_only --//tools:force_partial_jit_compilation=True -- //integration/... //src/...",
"check-mdc-tests": "ts-node --project scripts/tsconfig.json scripts/check-mdc-tests.ts",
"check-mdc-exports": "ts-node --project scripts/tsconfig.json scripts/check-mdc-exports.ts",
"check-tooling-setup": "yarn tsc --project tools/tsconfig.json && yarn tsc --project .ng-dev/tsconfig.json",
"check-tooling-setup": "yarn tsc --project tools/tsconfig.json && yarn tsc --project scripts/tsconfig.json && yarn tsc --project .ng-dev/tsconfig.json",
"tsc": "node ./node_modules/typescript/bin/tsc",
"ci-push-deploy-docs-app": "ts-node --esm --project scripts/tsconfig.json scripts/docs-deploy/deploy-ci-push.mts",
"ci-docs-monitor-test": "ts-node --esm --project scripts/tsconfig.json scripts/docs-deploy/monitoring/ci-test.mts",
Expand Down
7 changes: 3 additions & 4 deletions scripts/circleci/notify-slack-job-failure.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* will be a noop when running for forked builds (i.e. PRs).
*/

import sh from 'shelljs';
import {
isVersionBranch,
getConfig,
Expand All @@ -30,21 +31,19 @@ if (isPublishBranch === false) {
process.exit(0);
}

const {echo, set} = require('shelljs');

const text = `\`${jobName}\` failed in branch: ${branchName}: ${jobUrl}`;
const payload: {text: string; channel?: string} = {text};
const [channelName] = process.argv.slice(2);

set('-e');
sh.set('-e');

// If an explicit channel has been specified, override the default
// webhook channel to the specified one.
if (channelName !== undefined) {
payload.channel = channelName;
}

echo(JSON.stringify(payload, null, 2)).exec(
sh.echo(JSON.stringify(payload, null, 2)).exec(
`curl -d@- -H "Content-Type: application/json" ${webhookUrl}`,
);
console.info('Notified Slack about job failure.');