Skip to content

Commit

Permalink
🏗 Partial updates for core devDependencies (#39765)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
danielrozenberg authored Jan 26, 2024
1 parent 420fb5e commit 74f443b
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 143 deletions.
2 changes: 1 addition & 1 deletion build-system/release-tagger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* 4. channel (beta-percent|stable|lts)
*/

const dedent = require('dedent');
const {default: dedent} = require('dedent');
const {action, base, channel, head, sha} = require('minimist')(
process.argv.slice(2),
{
Expand Down
2 changes: 1 addition & 1 deletion build-system/release-tagger/make-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Make release for the release tagger.
*/

const dedent = require('dedent');
const {default: dedent} = require('dedent');
const {GitHubApi} = require('./utils');

/** @typedef {import('@octokit/graphql').GraphQlQueryResponseData} GraphQlQueryResponseData */
Expand Down
2 changes: 1 addition & 1 deletion build-system/release-tagger/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* GitHub API util functions.
*/

const dedent = require('dedent');
const {default: dedent} = require('dedent');
const {graphql} = require('@octokit/graphql');
const {Octokit} = require('@octokit/rest');

Expand Down
16 changes: 8 additions & 8 deletions build-system/task-runner/amp-task-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

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

if (isHelpTask) {
const task = commander.command(cyan(taskName));
const task = program.command(cyan(taskName));
const description = getTaskDescription(taskSourceFileName, taskFuncName);
task.description(description);
}
if (isInvokedTask || isDefaultTask) {
startAtRepoRoot();
ensureUpdatedPackages(taskSourceFileName);
const taskFunc = getTaskFunc(taskSourceFileName, taskFuncName);
const task = commander.command(taskName, {isDefault: isDefaultTask});
const task = program.command(taskName, {isDefault: isDefaultTask});
task.description(green(taskFunc.description));
task.allowUnknownOption(); // Fall through to validateUsage()
task.helpOption('--help', 'Print this list of flags');
Expand Down Expand Up @@ -267,18 +267,18 @@ function validateUsage(task, taskName, taskFunc) {
* was called.
*/
function finalizeRunner() {
commander.addHelpCommand(false); // We already have `amp --help` and `amp <task> --help`
program.addHelpCommand(false); // We already have `amp --help` and `amp <task> --help`
if (isHelpTask) {
commander.helpOption('--help', 'Print this list of tasks');
commander.usage('<task> <flags>');
program.helpOption('--help', 'Print this list of tasks');
program.usage('<task> <flags>');
}
commander.on('command:*', (args) => {
program.on('command:*', (args) => {
log(red('ERROR:'), 'Unknown task', cyan(args.join(' ')));
log('⤷ Run', cyan('amp --help'), 'for a full list of tasks.');
log('⤷ Run', cyan('amp <task> --help'), 'for help with a specific task.');
process.exitCode = 1;
});
commander.parse();
program.parse();
}

module.exports = {
Expand Down
22 changes: 0 additions & 22 deletions build-system/tasks/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ const {compileJison} = require('./compile-jison');
const {css} = require('./css');
const {getUnitTestsToRun} = require('./runtime-test/helpers-unit');
const {maybePrintArgvMessages} = require('./runtime-test/helpers');
const {log} = require('../common/logging');
const whyIsNodeRunning = require('why-is-node-running');
const {red} = require('kleur/colors');
const {isCircleciBuild} = require('../common/ci');

class Runner extends RuntimeTestRunner {
/**
Expand Down Expand Up @@ -45,26 +41,8 @@ async function unit() {
const runner = new Runner(config);

await runner.setup();
// TODO(danielrozenberg): temporary debugging output.
const timeoutHandler = isCircleciBuild()
? setTimeout(() => {
log(red('[TEMPORARY DEBUGGING STATEMENT]'), 'See #39501 for details.');
log(
'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:'
);
console./*OK*/ groupCollapsed('why-is-node-running');
whyIsNodeRunning();
console./*OK*/ groupEnd();
process.exit(1);
}, 420_000)
: null;

await runner.run();
await runner.teardown();

if (timeoutHandler) {
clearTimeout(timeoutHandler);
}
}

module.exports = {
Expand Down
Loading

0 comments on commit 74f443b

Please sign in to comment.