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 components/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ export async function getMetadata(argv, skipRefs, cli) {
...result,
json: formatMetadataResult(result)
};
};
}
3 changes: 1 addition & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import importPlugin from 'eslint-plugin-import';

export default [
pluginJs.configs.recommended,
...neostandard(),
...neostandard({ semi: true }),
nodePlugin.configs['flat/recommended'],
pluginPromise.configs['flat/recommended'],
importPlugin.flatConfigs.recommended,
Expand All @@ -28,7 +28,6 @@ export default [
ecmaVersion: 'latest',
},
rules: {
'@stylistic/semi': ['error', 'always'],
'@stylistic/space-before-function-paren': ['error', 'never'],
'@stylistic/no-multi-spaces': ['error', { ignoreEOLComments: true }],
camelcase: 'off',
Expand Down
2 changes: 1 addition & 1 deletion lib/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ async function auth(
'and run the following command to add it to your ncu config: ' +
'ncu-config --global set -x jenkins_token'
);
};
}
check(username, jenkins_token);
const jenkins = encode(username, jenkins_token);
setOwnProperty(result, 'jenkins', jenkins);
Expand Down
2 changes: 1 addition & 1 deletion lib/backport_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export default class BackportSession extends Session {
const upstreamCommit = this.getBranchCommit(`${this.upstream}/${branch}`);

return localCommit === upstreamCommit;
};
}

isLocalBranchExists(branch) {
try {
Expand Down
2 changes: 1 addition & 1 deletion lib/ci/failure_aggregator.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class FailureAggregator {
data.push({
reason, type: failures[0].type, failures, prs, machines
});
};
}

const groupedByType = _.groupBy(data, 'type');
for (const type of Object.keys(groupedByType)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export default class CLI {
setExitCode(statusCode) {
process.exitCode = statusCode;
}
};
}

CLI.SPINNER_STATUS = SPINNER_STATUS;
CLI.QUESTION_TYPE = QUESTION_TYPE;
14 changes: 7 additions & 7 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function getMergedConfig(dir, home, additional) {
...Object.getOwnPropertyDescriptors(additional),
})
: mergedConfig;
};
}
export function clearCachedConfig() {
mergedConfig = null;
}
Expand Down Expand Up @@ -117,7 +117,7 @@ export function getConfig(configType, dir, raw = false) {
} catch (cause) {
throw new Error('Unable to parse config file ' + configPath, { cause });
}
};
}

function getConfigPath(configType, dir) {
switch (configType) {
Expand All @@ -135,7 +135,7 @@ function getConfigPath(configType, dir) {
default:
throw Error('Invalid configType');
}
};
}

function writeConfig(configType, obj, dir) {
const configPath = getConfigPath(configType, dir);
Expand All @@ -158,20 +158,20 @@ function writeConfig(configType, obj, dir) {
}
writeJson(configPath, obj);
return configPath;
};
}

export function updateConfig(configType, obj, dir) {
const config = getConfig(configType, dir, true);
writeConfig(configType, Object.assign(config, obj), dir);
};
}

export function getHomeDir(home) {
if (process.env.XDG_CONFIG_HOME) {
return process.env.XDG_CONFIG_HOME;
}
return home || os.homedir();
};
}

export function getNcuDir(dir) {
return path.join(dir || process.cwd(), '.ncu');
};
}
10 changes: 5 additions & 5 deletions lib/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function appendFile(file, content) {
}
// TODO(joyeecheung): what if the file is a dir?
fs.appendFileSync(file, content, 'utf8');
};
}

export function writeFile(file, content) {
const parts = path.parse(file);
Expand All @@ -17,26 +17,26 @@ export function writeFile(file, content) {
}
// TODO(joyeecheung): what if the file is a dir?
fs.writeFileSync(file, content, 'utf8');
};
}

export function writeJson(file, obj) {
writeFile(file, `${JSON.stringify(obj, null, 2)}\n`);
};
}

export function readFile(file) {
if (fs.existsSync(file)) {
return fs.readFileSync(file, 'utf8');
}
return '';
};
}

export function readJson(file) {
const content = readFile(file);
if (content) {
return JSON.parse(content);
}
return {};
};
}

export function removeDirectory(directory) {
return fs.promises.rm(directory, { recursive: true, force: true });
Expand Down
2 changes: 1 addition & 1 deletion lib/landing_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ export default class LandingSession extends Session {
cli.log('A git rebase/am is in progress.' +
' Please complete it before running git node land --final');
return;
};
}

const stray = this.getStrayCommits();
if (stray.length > 1) {
Expand Down
8 changes: 4 additions & 4 deletions lib/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ export function parsePRFromURL(url) {
};
}
return undefined;
};
}

export function getPrURL({ owner, repo, prid }) {
return `https://github.com/${owner}/${repo}/pull/${prid}`;
};
}

export function getMachineUrl(machine) {
return `[${machine.hostname}](${machine.url})`;
};
}

const PR_URL_RE = /PR-URL: https:\/\/github.com\/.+/;
export function parsePrURL(text) {
Expand All @@ -120,4 +120,4 @@ export function parsePrURL(text) {
return undefined;
}
return parsePRFromURL(match[0]);
};
}
2 changes: 1 addition & 1 deletion lib/pr_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ export default class PRData {
const assoc = this.pr.authorAssociation;
return assoc === FIRST_TIME_CONTRIBUTOR || assoc === FIRST_TIMER;
}
};
}
2 changes: 1 addition & 1 deletion lib/pr_summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ export default class PRSummary {
for (const { name, email } of committers.values()) {
cli.log(` - ${name} <${email}>`);
}
};
}
}
4 changes: 2 additions & 2 deletions lib/prepare_release.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ export default class ReleasePreparation extends Session {
arr.splice(idx, 1, `<b>${newRefLink}</b><br/>`, `${lastRefLink}<br/>`);
break;
}
};
}

await fs.writeFile(mainChangelogPath, arr.join('\n'));
}
Expand Down Expand Up @@ -640,7 +640,7 @@ export default class ReleasePreparation extends Session {
arr.splice(idx, 0, ...toAppend);
break;
}
};
}

await fs.writeFile(majorChangelogPath, arr.join('\n'));
}
Expand Down
2 changes: 1 addition & 1 deletion lib/prepare_security.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export default class PrepareSecurityRelease extends SecurityRelease {
- git push -u origin ${NEXT_SECURITY_RELEASE_BRANCH}
- open a PR on ${this.repository.owner}/${this.repository.repo}`);
return;
};
}

// commit and push the vulnerabilities.json file
const commitMessage = 'chore: create vulnerabilities.json for next security release';
Expand Down
10 changes: 5 additions & 5 deletions lib/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function forceRunAsync(cmd, args, options) {
throw error;
}
});
};
}

export function runPromise(promise) {
return promise.catch((error) => {
Expand All @@ -86,11 +86,11 @@ export function runPromise(promise) {
}
exit();
});
};
}

export function runAsync(cmd, args, options) {
return runPromise(runAsyncBase(cmd, args, options));
};
}

export function runSync(cmd, args, options) {
if (cmd instanceof URL) {
Expand All @@ -111,8 +111,8 @@ export function runSync(cmd, args, options) {
} else {
return child.stdout.toString();
}
};
}

export function exit() {
process.exit(1);
};
}
2 changes: 1 addition & 1 deletion lib/security-release/security-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export async function checkoutOnSecurityReleaseBranch(cli, repository) {
`This checks out or recreates the ${NEXT_SECURITY_RELEASE_BRANCH} branch locally.`
);
cli.ok(`Checkout on branch: ${NEXT_SECURITY_RELEASE_BRANCH} `);
};
}
}

export async function commitAndPushVulnerabilitiesJSON(
Expand Down
2 changes: 1 addition & 1 deletion lib/team_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ TeamInfo.update = async function(cli, request, content) {
const opening = `<!-- ncu-team-sync.team(${org}/${team}) -->`;
const ending = '<!-- ncu-team-sync end -->';
blocks.set(mapKey, `${opening}\n\n${teamData}\n\n${ending}`);
};
}
}

if (blocks.size === 0) {
Expand Down
6 changes: 3 additions & 3 deletions lib/update-v8/backport.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function checkOptions(options) {
return true;
}
}
};
}

export function doBackport(options) {
const todo = [
Expand Down Expand Up @@ -54,7 +54,7 @@ export function doBackport(options) {
return task.newListr(todo);
}
};
};
}

function commitSquashedBackport() {
return {
Expand All @@ -77,7 +77,7 @@ function commitSquashedBackport() {
await ctx.execGitNode('commit', ['-m', messageTitle, '-m', messageBody]);
}
};
};
}

const commitTask = (patch, extraArgs, trailers) => async(ctx) => {
const messageTitle = formatMessageTitle([patch]);
Expand Down
2 changes: 1 addition & 1 deletion lib/update-v8/commitUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ export default function commitUpdate() {
},
skip: (ctx) => ctx.skipped
};
};
}
4 changes: 2 additions & 2 deletions lib/update-v8/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function getV8Version(label) {
ctx[`${label}Version`] = await getNodeV8Version(ctx.nodeDir);
}
};
};
}

export function checkCargoAvailable() {
return {
Expand Down Expand Up @@ -56,4 +56,4 @@ export async function checkCwd(ctx) {
);
}
return ctx;
};
}
2 changes: 1 addition & 1 deletion lib/update-v8/deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ export default function updateV8Deps() {
return task.newListr(subtasks, { concurrent: ctx.concurrent });
}
};
};
}
8 changes: 4 additions & 4 deletions lib/update-v8/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ export function major(options) {
getOptions(options)
);
return tasks.run(options);
};
}

export function minor(options) {
const tasks = new Listr(
[updateV8Clone(), minorUpdate(), commitUpdate()],
getOptions(options)
);
return tasks.run(options);
};
}

export async function backport(options) {
const shouldStop = await checkOptions(options);
Expand All @@ -42,15 +42,15 @@ export async function backport(options) {
getOptions(options)
);
return tasks.run(options);
};
}

export async function deps(options) {
const tasks = new Listr(
[updateDeps()],
getOptions(options)
);
return tasks.run(options);
};
}

/**
* Get the listr2 options.
Expand Down
2 changes: 1 addition & 1 deletion lib/update-v8/majorUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function majorUpdate() {
]);
}
};
};
}

function checkoutBranch() {
return {
Expand Down
2 changes: 1 addition & 1 deletion lib/update-v8/minorUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function minorUpdate() {
]);
}
};
};
}

function getLatestV8Version() {
return {
Expand Down
2 changes: 1 addition & 1 deletion lib/update-v8/updateV8Clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function updateV8Clone() {
return task.newListr([fetchOrigin(), createClone()]);
}
};
};
}

function fetchOrigin() {
return {
Expand Down
Loading
Loading