@pnpm/write-project-manifest
Advanced tools
Comparing version 4.0.2 to 4.1.0
@@ -0,5 +1,7 @@ | ||
import { CommentSpecifier } from '@pnpm/text.comments-parser'; | ||
import { ProjectManifest } from '@pnpm/types'; | ||
export declare function writeProjectManifest(filePath: string, manifest: ProjectManifest, opts?: { | ||
comments?: CommentSpecifier[]; | ||
indent?: string | number | undefined; | ||
insertFinalNewline?: boolean; | ||
}): Promise<void>; |
@@ -9,2 +9,3 @@ "use strict"; | ||
const path_1 = __importDefault(require("path")); | ||
const text_comments_parser_1 = require("@pnpm/text.comments-parser"); | ||
const json5_1 = __importDefault(require("json5")); | ||
@@ -24,7 +25,16 @@ const write_file_atomic_1 = __importDefault(require("write-file-atomic")); | ||
const trailingNewline = opts?.insertFinalNewline === false ? '' : '\n'; | ||
const json = (fileType === 'json5' ? json5_1.default : JSON) | ||
.stringify(manifest, undefined, opts?.indent ?? '\t'); | ||
const indent = opts?.indent ?? '\t'; | ||
const json = (fileType === 'json5' | ||
? stringifyJson5(manifest, indent, opts?.comments) | ||
: JSON.stringify(manifest, undefined, indent)); | ||
return (0, write_file_atomic_1.default)(filePath, `${json}${trailingNewline}`); | ||
} | ||
exports.writeProjectManifest = writeProjectManifest; | ||
function stringifyJson5(obj, indent, comments) { | ||
const json5 = json5_1.default.stringify(obj, undefined, indent); | ||
if (comments) { | ||
return (0, text_comments_parser_1.insertComments)(json5, comments); | ||
} | ||
return json5; | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@pnpm/write-project-manifest", | ||
"version": "4.0.2", | ||
"version": "4.1.0", | ||
"description": "Write a project manifest (called package.json in most cases)", | ||
@@ -14,3 +14,3 @@ "main": "lib/index.js", | ||
], | ||
"repository": "https://github.com/pnpm/pnpm/blob/main/packages/write-project-manifest", | ||
"repository": "https://github.com/pnpm/pnpm/blob/main/pkg-manifest/write-project-manifest", | ||
"keywords": [ | ||
@@ -24,13 +24,14 @@ "pnpm7", | ||
}, | ||
"homepage": "https://github.com/pnpm/pnpm/blob/main/packages/write-project-manifest#readme", | ||
"homepage": "https://github.com/pnpm/pnpm/blob/main/pkg-manifest/write-project-manifest#readme", | ||
"dependencies": { | ||
"@pnpm/types": "8.9.0", | ||
"json5": "^2.2.1", | ||
"write-file-atomic": "^4.0.2", | ||
"write-yaml-file": "^4.2.0" | ||
"write-yaml-file": "^4.2.0", | ||
"@pnpm/text.comments-parser": "1.0.0", | ||
"@pnpm/types": "8.9.0" | ||
}, | ||
"devDependencies": { | ||
"@pnpm/write-project-manifest": "4.0.2", | ||
"@types/write-file-atomic": "^3.0.3", | ||
"tempy": "^1.0.1" | ||
"tempy": "^1.0.1", | ||
"@pnpm/write-project-manifest": "4.1.0" | ||
}, | ||
@@ -37,0 +38,0 @@ "funding": "https://opencollective.com/pnpm", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
6269
44
0
5
+ Added@pnpm/text.comments-parser@1.0.0(transitive)
+ Addedstrip-comments-strings@1.2.0(transitive)