From b13754379c9f957d28b2c4dcd93d8a297b759633 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 warning logs 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. For the "repository.url" section it turns out that the URL must point to a Git URL that doesn't resolve to an HTML page in the browser; refer to https://docs.npmjs.com/cli/v10/configuring-npm/package-json#repository. --- gulpfile.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gulpfile.mjs b/gulpfile.mjs index 475c7bd3ea2bed..ab856dac12aa3b 100644 --- a/gulpfile.mjs +++ b/gulpfile.mjs @@ -78,7 +78,7 @@ const COMMON_WEB_FILES = [ ]; const MOZCENTRAL_DIFF_FILE = "mozcentral.diff"; -const DIST_REPO_URL = "https://github.com/mozilla/pdfjs-dist"; +const DIST_REPO_URL = "https://github.com/mozilla/pdfjs-dist.git"; const CONFIG_FILE = "pdfjs.config"; const config = JSON.parse(fs.readFileSync(CONFIG_FILE).toString()); @@ -2231,6 +2231,7 @@ function packageJson() { engines: { node: ">=18", }, + scripts: {}, }; return createStringSource(