Skip to content

Commit 74f443b

Browse files
🏗 Partial updates for core devDependencies (#39765)
* Remove CircleCI debugging code from unit.js * Upgrade `commander` to v11.1.0 * Upgrade `dedent` to v1.5.1 * Upgrade `typescript` to v5.3.3
1 parent 420fb5e commit 74f443b

8 files changed

Lines changed: 123 additions & 143 deletions

File tree

build-system/release-tagger/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* 4. channel (beta-percent|stable|lts)
99
*/
1010

11-
const dedent = require('dedent');
11+
const {default: dedent} = require('dedent');
1212
const {action, base, channel, head, sha} = require('minimist')(
1313
process.argv.slice(2),
1414
{

build-system/release-tagger/make-release.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Make release for the release tagger.
44
*/
55

6-
const dedent = require('dedent');
6+
const {default: dedent} = require('dedent');
77
const {GitHubApi} = require('./utils');
88

99
/** @typedef {import('@octokit/graphql').GraphQlQueryResponseData} GraphQlQueryResponseData */

build-system/release-tagger/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* GitHub API util functions.
44
*/
55

6-
const dedent = require('dedent');
6+
const {default: dedent} = require('dedent');
77
const {graphql} = require('@octokit/graphql');
88
const {Octokit} = require('@octokit/rest');
99

build-system/task-runner/amp-task-runner.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
const argv = require('minimist')(process.argv.slice(2));
7-
const commander = require('commander');
7+
const {program} = require('commander');
88
const esprima = require('esprima');
99
const fs = require('fs-extra');
1010
const os = require('os');
@@ -218,15 +218,15 @@ function createTask(
218218
argv._.length === 0 && taskName == 'default' && !isHelpTask; // `amp`
219219

220220
if (isHelpTask) {
221-
const task = commander.command(cyan(taskName));
221+
const task = program.command(cyan(taskName));
222222
const description = getTaskDescription(taskSourceFileName, taskFuncName);
223223
task.description(description);
224224
}
225225
if (isInvokedTask || isDefaultTask) {
226226
startAtRepoRoot();
227227
ensureUpdatedPackages(taskSourceFileName);
228228
const taskFunc = getTaskFunc(taskSourceFileName, taskFuncName);
229-
const task = commander.command(taskName, {isDefault: isDefaultTask});
229+
const task = program.command(taskName, {isDefault: isDefaultTask});
230230
task.description(green(taskFunc.description));
231231
task.allowUnknownOption(); // Fall through to validateUsage()
232232
task.helpOption('--help', 'Print this list of flags');
@@ -267,18 +267,18 @@ function validateUsage(task, taskName, taskFunc) {
267267
* was called.
268268
*/
269269
function finalizeRunner() {
270-
commander.addHelpCommand(false); // We already have `amp --help` and `amp <task> --help`
270+
program.addHelpCommand(false); // We already have `amp --help` and `amp <task> --help`
271271
if (isHelpTask) {
272-
commander.helpOption('--help', 'Print this list of tasks');
273-
commander.usage('<task> <flags>');
272+
program.helpOption('--help', 'Print this list of tasks');
273+
program.usage('<task> <flags>');
274274
}
275-
commander.on('command:*', (args) => {
275+
program.on('command:*', (args) => {
276276
log(red('ERROR:'), 'Unknown task', cyan(args.join(' ')));
277277
log('⤷ Run', cyan('amp --help'), 'for a full list of tasks.');
278278
log('⤷ Run', cyan('amp <task> --help'), 'for help with a specific task.');
279279
process.exitCode = 1;
280280
});
281-
commander.parse();
281+
program.parse();
282282
}
283283

284284
module.exports = {

build-system/tasks/unit.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ const {compileJison} = require('./compile-jison');
1010
const {css} = require('./css');
1111
const {getUnitTestsToRun} = require('./runtime-test/helpers-unit');
1212
const {maybePrintArgvMessages} = require('./runtime-test/helpers');
13-
const {log} = require('../common/logging');
14-
const whyIsNodeRunning = require('why-is-node-running');
15-
const {red} = require('kleur/colors');
16-
const {isCircleciBuild} = require('../common/ci');
1713

1814
class Runner extends RuntimeTestRunner {
1915
/**
@@ -45,26 +41,8 @@ async function unit() {
4541
const runner = new Runner(config);
4642

4743
await runner.setup();
48-
// TODO(danielrozenberg): temporary debugging output.
49-
const timeoutHandler = isCircleciBuild()
50-
? setTimeout(() => {
51-
log(red('[TEMPORARY DEBUGGING STATEMENT]'), 'See #39501 for details.');
52-
log(
53-
'Unit tests on CircleCI are still running after 7 minutes, probably indicating that the tests are stuck. The following output indicates which handles are still live in Node:'
54-
);
55-
console./*OK*/ groupCollapsed('why-is-node-running');
56-
whyIsNodeRunning();
57-
console./*OK*/ groupEnd();
58-
process.exit(1);
59-
}, 420_000)
60-
: null;
61-
6244
await runner.run();
6345
await runner.teardown();
64-
65-
if (timeoutHandler) {
66-
clearTimeout(timeoutHandler);
67-
}
6846
}
6947

7048
module.exports = {

0 commit comments

Comments
 (0)