@npmcli/package-json
Advanced tools
Comparing version 5.0.0 to 5.0.1
@@ -1,9 +0,7 @@ | ||
const semver = require('semver') | ||
const valid = require('semver/functions/valid') | ||
const clean = require('semver/functions/clean') | ||
const fs = require('fs/promises') | ||
const { glob } = require('glob') | ||
const legacyFixer = require('normalize-package-data/lib/fixer.js') | ||
const legacyMakeWarning = require('normalize-package-data/lib/make_warning.js') | ||
const path = require('path') | ||
const log = require('proc-log') | ||
const git = require('@npmcli/git') | ||
const hostedGitInfo = require('hosted-git-info') | ||
@@ -133,6 +131,6 @@ | ||
} else { | ||
if (!semver.valid(data.version, loose)) { | ||
if (!valid(data.version, loose)) { | ||
throw new Error(`Invalid version: "${data.version}"`) | ||
} | ||
const version = semver.clean(data.version, loose) | ||
const version = clean(data.version, loose) | ||
if (version !== data.version) { | ||
@@ -337,2 +335,3 @@ changes?.push(`"version" was cleaned and set to "${version}"`) | ||
if (steps.includes('gitHead') && !data.gitHead) { | ||
const git = require('@npmcli/git') | ||
const gitRoot = await git.find({ cwd: pkg.path, root }) | ||
@@ -523,2 +522,4 @@ let head | ||
if (steps.includes('normalizeData')) { | ||
const legacyFixer = require('normalize-package-data/lib/fixer.js') | ||
const legacyMakeWarning = require('normalize-package-data/lib/make_warning.js') | ||
legacyFixer.warn = function () { | ||
@@ -525,0 +526,0 @@ changes?.push(legacyMakeWarning.apply(null, arguments)) |
{ | ||
"name": "@npmcli/package-json", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Programmatic API to update package.json", | ||
@@ -13,3 +13,3 @@ "main": "lib/index.js", | ||
"test": "tap", | ||
"lint": "eslint \"**/*.js\"", | ||
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", | ||
"lintfix": "npm run lint -- --fix", | ||
@@ -29,4 +29,4 @@ "posttest": "npm run lint", | ||
"@npmcli/eslint-config": "^4.0.0", | ||
"@npmcli/template-oss": "4.18.0", | ||
"read-package-json": "^6.0.4", | ||
"@npmcli/template-oss": "4.21.3", | ||
"read-package-json": "^7.0.0", | ||
"read-package-json-fast": "^3.0.2", | ||
@@ -53,10 +53,4 @@ "tap": "^16.0.1" | ||
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", | ||
"version": "4.18.0", | ||
"publish": "true", | ||
"ciVersions": [ | ||
"16.14.0", | ||
"16.x", | ||
"18.0.0", | ||
"18.x" | ||
] | ||
"version": "4.21.3", | ||
"publish": "true" | ||
}, | ||
@@ -63,0 +57,0 @@ "tap": { |
# @npmcli/package-json | ||
[![npm version](https://img.shields.io/npm/v/@npmcli/package-json)](https://www.npmjs.com/package/@npmcli/package-json) | ||
[![Build Status](https://img.shields.io/github/workflow/status/npm/package-json/node-ci)](https://github.com/npm/package-json) | ||
[![Build Status](https://img.shields.io/github/actions/workflow/status/npm/package-json/ci.yml?branch=main)](https://github.com/npm/package-json) | ||
@@ -235,2 +235,1 @@ Programmatic API to update `package.json` files. Updates and saves files the | ||
[ISC](./LICENSE) | ||
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
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
37012
871
235