mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-12 01:54:53 -04:00
fix(publish): remove the "pnpm" settings from package.json
The "pnpm" settings should not be published with the package to the registry. PR #3081
This commit is contained in:
5
.changeset/tame-cats-reply.md
Normal file
5
.changeset/tame-cats-reply.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/exportable-manifest": minor
|
||||
---
|
||||
|
||||
Remove the "pnpm" property that stores pnpm settings from the manifest.
|
||||
1
packages/exportable-manifest/jest.config.js
Normal file
1
packages/exportable-manifest/jest.config.js
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('../../jest.config.js')
|
||||
@@ -12,10 +12,11 @@
|
||||
"node": ">=10.16"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint -c ../../eslint.json src/**/*.ts",
|
||||
"test": "pnpm run compile",
|
||||
"lint": "eslint -c ../../eslint.json src/**/*.ts test/**/*.ts",
|
||||
"test": "pnpm run compile && pnpm run _test",
|
||||
"prepublishOnly": "pnpm run compile",
|
||||
"compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build"
|
||||
"compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build",
|
||||
"_test": "jest"
|
||||
},
|
||||
"repository": "https://github.com/pnpm/pnpm/blob/master/packages/exportable-manifest",
|
||||
"keywords": [
|
||||
|
||||
@@ -22,9 +22,7 @@ const PUBLISH_CONFIG_WHITELIST = new Set([
|
||||
])
|
||||
|
||||
export default async function makePublishManifest (dir: string, originalManifest: ProjectManifest) {
|
||||
const publishManifest = {
|
||||
...originalManifest,
|
||||
}
|
||||
const publishManifest = R.omit(['pnpm'], originalManifest)
|
||||
for (const depsField of ['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies']) {
|
||||
const deps = await makePublishDependencies(dir, originalManifest[depsField])
|
||||
if (deps) {
|
||||
|
||||
23
packages/exportable-manifest/test/index.test.ts
Normal file
23
packages/exportable-manifest/test/index.test.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/// <reference path="../../../typings/index.d.ts"/>
|
||||
import exportableManifest from '@pnpm/exportable-manifest'
|
||||
|
||||
test('the pnpm options are removed', async () => {
|
||||
expect(await exportableManifest(process.cwd(), {
|
||||
name: 'foo',
|
||||
version: '1.0.0',
|
||||
dependencies: {
|
||||
qar: '2',
|
||||
},
|
||||
pnpm: {
|
||||
overrides: {
|
||||
bar: '1',
|
||||
},
|
||||
},
|
||||
})).toStrictEqual({
|
||||
name: 'foo',
|
||||
version: '1.0.0',
|
||||
dependencies: {
|
||||
qar: '2',
|
||||
},
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user