Skip to content

Commit fcbf319

Browse files
committed
Fixes
1 parent d6e318f commit fcbf319

File tree

3 files changed

+30
-29
lines changed

3 files changed

+30
-29
lines changed

src/commands/check.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const ExportsMapEntry = zod.object({
1818
});
1919

2020
const ExportsMapModel = zod.record(
21+
zod.string(),
2122
zod.union([
2223
zod.string(),
2324
zod.object({
@@ -30,7 +31,7 @@ const ExportsMapModel = zod.record(
3031

3132
const EnginesModel = zod.record(zod.string(), zod.string());
3233

33-
const BinModel = zod.record(zod.string());
34+
const BinModel = zod.record(zod.string(), zod.string());
3435

3536
export const checkCommand = createCommand<{}, {}>(api => {
3637
return {
@@ -129,9 +130,9 @@ async function checkExportsMapIntegrity(args: {
129130
if (exportsMapResult.success === false) {
130131
throw new Error(
131132
"Missing exports map within the 'package.json'.\n" +
132-
exportsMapResult.error.message +
133-
'\nCorrect Example:\n' +
134-
JSON.stringify(presetFieldsDual.exports, null, 2),
133+
exportsMapResult.error.message +
134+
'\nCorrect Example:\n' +
135+
JSON.stringify(presetFieldsDual.exports, null, 2),
135136
);
136137
}
137138

@@ -192,9 +193,9 @@ async function checkExportsMapIntegrity(args: {
192193
if (result.exitCode !== 0) {
193194
throw new Error(
194195
`Require of file '${file}' failed.\n` +
195-
`In case this file is expected to raise an error please add an export to the 'bob.check.skip' field in your 'package.json' file.\n` +
196-
`Error:\n` +
197-
result.stderr,
196+
`In case this file is expected to raise an error please add an export to the 'bob.check.skip' field in your 'package.json' file.\n` +
197+
`Error:\n` +
198+
result.stderr,
198199
);
199200
}
200201
}),
@@ -310,18 +311,18 @@ async function checkExportsMapIntegrity(args: {
310311
await fse.access(path.join(args.cwd, filePath), fse.constants.X_OK).catch(() => {
311312
throw new Error(
312313
"Binary file '" +
313-
absoluteFilePath +
314-
"' is not executable.\n" +
315-
`Please set the executable bit e.g. by running 'chmod +x "${absoluteFilePath}"'.`,
314+
absoluteFilePath +
315+
"' is not executable.\n" +
316+
`Please set the executable bit e.g. by running 'chmod +x "${absoluteFilePath}"'.`,
316317
);
317318
});
318319

319320
const contents = await fse.readFile(absoluteFilePath, 'utf-8');
320321
if (!contents.startsWith('#!/usr/bin/env node\n')) {
321322
throw new Error(
322323
"Binary file '" +
323-
absoluteFilePath +
324-
"' does not have a shebang.\n Please add '#!/usr/bin/env node' to the beginning of the file.",
324+
absoluteFilePath +
325+
"' does not have a shebang.\n Please add '#!/usr/bin/env node' to the beginning of the file.",
325326
);
326327
}
327328
}

src/config.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,50 @@ const BobConfigModel = zod.optional(
66
zod.literal(false),
77
zod.object({
88
commonjs: zod
9-
.boolean({
9+
.boolean(/* {
1010
description:
1111
'Enable CommonJS output creating a dual output ESM+CJS. If set to `false`, will generate only ESM output.',
12-
})
12+
} */)
1313
.optional()
1414
.default(true),
1515
build: zod.union(
1616
[
1717
zod.literal(false),
1818
zod.optional(
1919
zod.object({
20-
copy: zod.optional(zod.array(zod.string()), {
20+
copy: zod.optional(zod.array(zod.string()),/* {
2121
description:
2222
'Specify a list of files that should be copied the the output directory.',
23-
}),
23+
} */),
2424
}),
2525
),
2626
],
27-
{
28-
description:
29-
'Build configuration. Set to false for skipping the build of this package.',
30-
},
27+
/* {
28+
description:
29+
'Build configuration. Set to false for skipping the build of this package.',
30+
}, */
3131
),
3232
check: zod.optional(
3333
zod.union([
3434
zod.literal(false),
3535
zod.object({
36-
skip: zod.optional(zod.array(zod.string()), {
36+
skip: zod.optional(zod.array(zod.string()), /* {
3737
description:
3838
'Skip certain files from being checked. E.g. modules with side-effects.',
39-
}),
39+
} */),
4040
}),
4141
]),
42-
{
43-
description:
44-
'Check whether the built packages comply with the standards. (ESM & CJS compatible and loadable and Node.js engines specified)',
45-
},
42+
/* {
43+
description:
44+
'Check whether the built packages comply with the standards. (ESM & CJS compatible and loadable and Node.js engines specified)',
45+
}, */
4646
),
4747
}),
48-
],
48+
],/*
4949
{
5050
description:
5151
'Bob configuration. Set this value to false in order to disable running bob on this package.',
52-
},
52+
}, */
5353
),
5454
);
5555

test/__fixtures__/tsconfig-build-json/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tsconfig-build-json",
3-
"type": "module",
3+
"type": "commonjs",
44
"engines": {
55
"node": ">= 14.0.0"
66
},

0 commit comments

Comments
 (0)