Skip to content

Commit

Permalink
Minor changes for a test PR
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Sep 15, 2023
1 parent ec2f8ec commit eb2b51c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions scripts/postpublish.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { readFile } from 'node:fs/promises';
import { env } from 'node:process';
import GitHub from 'github-api';
import semverPreRelease from 'semver/functions/prerelease.js';
import { cyan } from './colors.js';
Expand All @@ -18,11 +19,11 @@ PRs and resolved issues. It is only run from CI.
-------------------------------------------------------------------------------`
);

if (!(process.env.CI && process.env.ROLLUP_RELEASE && process.env.GITHUB_TOKEN)) {
if (!(env.CI && env.ROLLUP_RELEASE && env.GITHUB_TOKEN)) {
throw new Error('This script is only intended to be run from CI.');
}

const gh = new GitHub({ token: process.env.GITHUB_TOKEN });
const gh = new GitHub({ token: env.GITHUB_TOKEN });
const [currentBranch, newVersion, changelog, repo, issues] = await Promise.all([
runAndGetStdout('git', ['branch', '--show-current']),
getCurrentCommitMessage(),
Expand Down
5 changes: 5 additions & 0 deletions scripts/prepublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

import { readFile, writeFile } from 'node:fs/promises';
import { resolve } from 'node:path';
import { chdir } from 'node:process';
import { fileURLToPath } from 'node:url';
import { readJson, runWithEcho } from './helpers.js';
import publishWasmNodePackage from './publish-wasm-node-package.js';
import { CHANGELOG, MAIN_PACKAGE } from './release-constants.js';
import { getCurrentCommitMessage, getFirstChangelogEntry } from './release-helpers.js';

// We execute everything from the main directory
chdir(fileURLToPath(new URL('..', import.meta.url)));

const version = await getCurrentCommitMessage();
const matched = /^\d+\.\d+\.\d+(-\d+)?$/.exec(version);

Expand Down
9 changes: 5 additions & 4 deletions scripts/test-options.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { readFile } from 'node:fs/promises';
import { exit } from 'node:process';

const [optionsText, helpText, commandReferenceText] = await Promise.all([
readFile(new URL('../docs/configuration-options/index.md', import.meta.url), 'utf8'),
Expand Down Expand Up @@ -48,7 +49,7 @@ for (const { long, short } of allCliOptions) {
}

if (failed) {
process.exit(1);
exit(1);
}

let current = null;
Expand All @@ -58,7 +59,7 @@ for (const [long, short] of cliOptionsInHelp) {
console.error(
`Options in help.md are not sorted properly. "${long}" should occur before "${current}".`
);
process.exit(1);
exit(1);
}
current = long;
}
Expand All @@ -68,7 +69,7 @@ const splitHelpText = helpText.split('\n');
for (const line of splitHelpText) {
if (line.length > 80) {
console.error(`The following line in help.md exceeds the limit of 80 characters:\n${line}`);
process.exit(1);
exit(1);
}
}

Expand All @@ -88,6 +89,6 @@ for (const [index, line] of helpOptionLines.entries()) {
console.error(
`The command lines in command-line-interface/index.md do not match help.md. Expected line:\n${line}\n\nReceived line:\n${optionListLine}`
);
process.exit(1);
exit(1);
}
}

0 comments on commit eb2b51c

Please sign in to comment.