From dddb74d5e4d422b2be80ee93c26396830be2cfb3 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 30 Jun 2024 15:47:14 +0200 Subject: [PATCH] Fix `npm publish` warnings about the `package.json` format This commit removes the following warnings from the `npm publish` output: ``` npm warn publish npm auto-corrected some errors in your package.json when publishing. Please run "npm pkg fix" to address these errors. npm warn publish errors corrected: npm warn publish Removed invalid "scripts" npm warn publish "repository.url" was normalized to "git+https://github.com/mozilla/pdfjs-dist.git" ``` For the "scripts" section it turns out that if the package doesn't have any scripts it's expected to explicitly set it to an empty object; refer to https://github.com/npm/cli/issues/6918 and https://github.com/denoland/dnt/pull/414. --- gulpfile.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gulpfile.mjs b/gulpfile.mjs index 475c7bd3ea2be..49dce5da39a68 100644 --- a/gulpfile.mjs +++ b/gulpfile.mjs @@ -2226,11 +2226,12 @@ function packageJson() { }, repository: { type: "git", - url: DIST_REPO_URL, + url: `git+${DIST_REPO_URL}.git`, }, engines: { node: ">=18", }, + scripts: {}, }; return createStringSource(