Skip to content

Commit 4e6d4a3

Browse files
committed
no unnecessary fields and correct main
1 parent f2cedd6 commit 4e6d4a3

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

src/commands/bootstrap.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@ import { rewriteCodeImports } from '../utils/rewrite-code-imports.js';
1212
/** The default bob fields that should be within a package.json */
1313
export const presetFields = Object.freeze({
1414
type: 'module',
15-
main: 'dist/cjs/index.js',
16-
module: 'dist/esm/index.js',
15+
main: 'dist/esm/index.js',
1716
typings: 'dist/typings/index.d.ts',
18-
typescript: {
19-
definition: 'dist/typings/index.d.ts',
20-
},
2117
exports: {
2218
'.': {
2319
require: {
@@ -45,11 +41,7 @@ export const presetFields = Object.freeze({
4541
export const presetFieldsESM = {
4642
type: 'module',
4743
main: 'dist/esm/index.js',
48-
module: 'dist/esm/index.js',
4944
typings: 'dist/typings/index.d.ts',
50-
typescript: {
51-
definition: 'dist/typings/index.d.ts',
52-
},
5345
exports: {
5446
'.': {
5547
import: {

src/commands/build.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -440,14 +440,10 @@ export function validatePackageJson(
440440
if (Object.keys(pkg.bin ?? {}).length > 0) {
441441
if (opts.includesCommonJS === true) {
442442
expect('main', presetFields.main);
443-
expect('module', presetFields.module);
444443
expect('typings', presetFields.typings);
445-
expect('typescript.definition', presetFields.typescript.definition);
446444
} else {
447445
expect('main', presetFieldsESM.main);
448-
expect('module', presetFieldsESM.module);
449446
expect('typings', presetFieldsESM.typings);
450-
expect('typescript.definition', presetFieldsESM.typescript.definition);
451447
}
452448
} else if (
453449
pkg.main !== undefined ||
@@ -459,19 +455,15 @@ export function validatePackageJson(
459455
if (opts.includesCommonJS === true) {
460456
// if there is no bin property, we NEED to check the exports.
461457
expect('main', presetFields.main);
462-
expect('module', presetFields.module);
463458
expect('typings', presetFields.typings);
464-
expect('typescript.definition', presetFields.typescript.definition);
465459

466460
// For now we enforce a top level exports property
467461
expect("exports['.'].require", presetFields.exports['.'].require);
468462
expect("exports['.'].import", presetFields.exports['.'].import);
469463
expect("exports['.'].default", presetFields.exports['.'].default);
470464
} else {
471465
expect('main', presetFieldsESM.main);
472-
expect('module', presetFieldsESM.module);
473466
expect('typings', presetFieldsESM.typings);
474-
expect('typescript.definition', presetFieldsESM.typescript.definition);
475467

476468
// For now, we enforce a top level exports property
477469
expect("exports['.']", presetFieldsESM.exports['.']);

0 commit comments

Comments
 (0)