Skip to content

Commit

Permalink
Fix npm publish warnings about the package.json format
Browse files Browse the repository at this point in the history
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 npm/cli#6918 and
denoland/dnt#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.
  • Loading branch information
timvandermeij committed Jun 30, 2024
1 parent f3eaff5 commit b137543
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -2231,6 +2231,7 @@ function packageJson() {
engines: {
node: ">=18",
},
scripts: {},
};

return createStringSource(
Expand Down

0 comments on commit b137543

Please sign in to comment.