Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,16 @@
| false
| {
/** Files to copy from the package root to dist */
copy?: Array<string>;
};
copy?: Array<string>
}
/** Whether the package should be checked. */
check?:
| false
| {
/** Exports within the package that should not be checked. */
skip?: Array<string>;
};
};
skip?: Array<string>
}
}
```

## 2.0.0
Expand Down
12 changes: 12 additions & 0 deletions src/commands/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ async function applyPackageJSONPresetConfig(
packageJSON: Record<string, unknown>,
) {
Object.assign(packageJSON, presetFields);
// Clear package-manager specific fields
if ('engines' in packageJSON && packageJSON.engines && typeof packageJSON.engines === 'object') {
if ('pnpm' in packageJSON.engines) {
delete packageJSON.engines.pnpm;
}
if ('yarn' in packageJSON.engines) {
delete packageJSON.engines.yarn;
}
if ('npm' in packageJSON.engines) {
delete packageJSON.engines.npm;
}
}
await fse.writeFile(packageJSONPath, JSON.stringify(packageJSON, null, 2));
}

Expand Down
3 changes: 2 additions & 1 deletion test/__fixtures__/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "simple",
"type": "module",
"engines": {
"node": ">= 12.0.0"
"node": ">= 12.0.0",
"pnpm": ">= 8.0.0"
},
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
3 changes: 2 additions & 1 deletion test/integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ it('can bundle a simple project', async () => {
{
"name": "simple",
"engines": {
"node": ">= 12.0.0"
"node": ">= 12.0.0",
"pnpm": ">= 8.0.0"
},
"main": "cjs/index.js",
"module": "esm/index.js",
Expand Down