Skip to content

Commit 9babced

Browse files
chore: format code and improve readability in various scripts and logger types
1 parent dc52709 commit 9babced

7 files changed

Lines changed: 58 additions & 21 deletions

File tree

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/prettier.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/logger/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export type AppLogger = Logger;
88

99
export type LoggerBindings = {
1010
requestId?: string;
11-
traceId?: string;
11+
traceId?: string;
1212
route?: string;
1313
method?: string;
1414
userId?: string;

scripts/build-create-package.mjs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#!/usr/bin/env node
22

3-
import { chmodSync, cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
3+
import {
4+
chmodSync,
5+
cpSync,
6+
existsSync,
7+
mkdirSync,
8+
readFileSync,
9+
rmSync,
10+
writeFileSync,
11+
} from 'node:fs';
412
import { dirname, join, relative, resolve } from 'node:path';
513
import { fileURLToPath } from 'node:url';
614

@@ -180,7 +188,10 @@ const writePublishPackageJson = () => {
180188
},
181189
};
182190

183-
writeFileSync(join(publishDir, 'package.json'), `${JSON.stringify(publishPackageJson, null, 2)}\n`);
191+
writeFileSync(
192+
join(publishDir, 'package.json'),
193+
`${JSON.stringify(publishPackageJson, null, 2)}\n`,
194+
);
184195
};
185196

186197
rmSync(publishDir, {

scripts/create-package-cli.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#!/usr/bin/env node
22

3-
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
3+
import {
4+
cpSync,
5+
existsSync,
6+
mkdirSync,
7+
readFileSync,
8+
readdirSync,
9+
rmSync,
10+
writeFileSync,
11+
} from 'node:fs';
412
import { basename, resolve, join } from 'node:path';
513
import { fileURLToPath } from 'node:url';
614

scripts/verify-create-package.mjs

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ const pnpmCommand = 'pnpm';
1818
const runCommand = (
1919
command,
2020
args,
21-
{
22-
cwd = rootDir,
23-
expectFailure = false,
24-
captureOutput = false,
25-
} = {},
21+
{ cwd = rootDir, expectFailure = false, captureOutput = false } = {},
2622
) => {
2723
const result = spawnSync(command, args, {
2824
cwd,
@@ -113,9 +109,21 @@ for (const scriptName of [
113109
);
114110
}
115111

116-
assert.equal(templatePackageJson.repository, undefined, 'Template package.json should not carry repository metadata');
117-
assert.equal(templatePackageJson.homepage, undefined, 'Template package.json should not carry homepage metadata');
118-
assert.equal(templatePackageJson.bugs, undefined, 'Template package.json should not carry bugs metadata');
112+
assert.equal(
113+
templatePackageJson.repository,
114+
undefined,
115+
'Template package.json should not carry repository metadata',
116+
);
117+
assert.equal(
118+
templatePackageJson.homepage,
119+
undefined,
120+
'Template package.json should not carry homepage metadata',
121+
);
122+
assert.equal(
123+
templatePackageJson.bugs,
124+
undefined,
125+
'Template package.json should not carry bugs metadata',
126+
);
119127

120128
const workspaceTempRoot = mkdtempSync(join(tmpdir(), 'create-acme-platform-verify-'));
121129
const directTarget = join(workspaceTempRoot, 'from-bin');
@@ -138,14 +146,10 @@ assert.match(
138146

139147
runCommand(nodeCommand, [cliPath, directTarget, '--force']);
140148

141-
const tarballResult = runCommand(
142-
npmCommand,
143-
['pack', publishDir, '--json'],
144-
{
145-
cwd: workspaceTempRoot,
146-
captureOutput: true,
147-
},
148-
);
149+
const tarballResult = runCommand(npmCommand, ['pack', publishDir, '--json'], {
150+
cwd: workspaceTempRoot,
151+
captureOutput: true,
152+
});
149153
const tarballInfo = JSON.parse(tarballResult.stdout ?? '[]');
150154
const tarballFilename = tarballInfo[0]?.filename;
151155

scripts/write-release-notes.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ const version = tagName.replace(/^v/, '');
1717
let notes = `Release ${tagName}\n\nSee CHANGELOG.md for the full release history.\n`;
1818
if (existsSync(changelogPath)) {
1919
const changelog = readFileSync(changelogPath, 'utf8');
20-
const headings = Array.from(changelog.matchAll(/^##\s+(?:\[(?<linked>[^\]]+)\]|(?<plain>[^\s]+)).*$/gm));
20+
const headings = Array.from(
21+
changelog.matchAll(/^##\s+(?:\[(?<linked>[^\]]+)\]|(?<plain>[^\s]+)).*$/gm),
22+
);
2123

2224
for (let index = 0; index < headings.length; index += 1) {
2325
const match = headings[index];

0 commit comments

Comments
 (0)