@@ -18,6 +18,7 @@ const ExportsMapEntry = zod.object({
1818} ) ;
1919
2020const ExportsMapModel = zod . record (
21+ zod . string ( ) ,
2122 zod . union ( [
2223 zod . string ( ) ,
2324 zod . object ( {
@@ -30,7 +31,7 @@ const ExportsMapModel = zod.record(
3031
3132const 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
3536export 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 }
0 commit comments