Skip to content

Commit

Permalink
deps: @npmcli/[email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Apr 9, 2024
1 parent a0f5048 commit 84bbbd4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
13 changes: 7 additions & 6 deletions node_modules/@npmcli/package-json/lib/normalize.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
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')

// used to be npm-normalize-package-bin
Expand Down Expand Up @@ -130,10 +128,10 @@ const normalize = async (pkg, { strict, steps, root, changes, allowLegacyCase })
if (!data.version) {
data.version = ''
} 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) {
changes?.push(`"version" was cleaned and set to "${version}"`)
data.version = version
Expand Down Expand Up @@ -333,6 +331,7 @@ const normalize = async (pkg, { strict, steps, root, changes, allowLegacyCase })

// populate "gitHead" attribute
if (steps.includes('gitHead') && !data.gitHead) {
const git = require('@npmcli/git')
const gitRoot = await git.find({ cwd: pkg.path, root })
let head
if (gitRoot) {
Expand Down Expand Up @@ -518,6 +517,8 @@ const normalize = async (pkg, { strict, steps, root, changes, allowLegacyCase })
}

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 () {
changes?.push(legacyMakeWarning.apply(null, arguments))
}
Expand Down
18 changes: 6 additions & 12 deletions node_modules/@npmcli/package-json/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@npmcli/package-json",
"version": "5.0.0",
"version": "5.0.1",
"description": "Programmatic API to update package.json",
"main": "lib/index.js",
"files": [
Expand All @@ -10,7 +10,7 @@
"scripts": {
"snap": "tap",
"test": "tap",
"lint": "eslint \"**/*.js\"",
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
"lintfix": "npm run lint -- --fix",
"posttest": "npm run lint",
"postsnap": "npm run lintfix --",
Expand All @@ -25,8 +25,8 @@
"license": "ISC",
"devDependencies": {
"@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",
"tap": "^16.0.1"
},
Expand All @@ -48,14 +48,8 @@
},
"templateOSS": {
"//@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"
},
"tap": {
"nyc-arg": [
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"@npmcli/config": "^8.0.2",
"@npmcli/fs": "^3.1.0",
"@npmcli/map-workspaces": "^3.0.4",
"@npmcli/package-json": "^5.0.0",
"@npmcli/package-json": "^5.0.1",
"@npmcli/promise-spawn": "^7.0.1",
"@npmcli/redact": "^1.1.0",
"@npmcli/run-script": "^7.0.4",
Expand Down Expand Up @@ -1866,9 +1866,9 @@
}
},
"node_modules/@npmcli/package-json": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-5.0.0.tgz",
"integrity": "sha512-OI2zdYBLhQ7kpNPaJxiflofYIpkNLi+lnGdzqUOfRmCF3r2l1nadcjtCYMJKv/Utm/ZtlffaUuTiAktPHbc17g==",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-5.0.1.tgz",
"integrity": "sha512-WdwGsRP/do+94IXEgfD/oGGVn0VDS+wYM8MoXU5tJ+02Ke8ePSobMwnfcCHAfcvU/pFwZxyZYWaJdOBsqXRAbA==",
"inBundle": true,
"dependencies": {
"@npmcli/git": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@npmcli/config": "^8.0.2",
"@npmcli/fs": "^3.1.0",
"@npmcli/map-workspaces": "^3.0.4",
"@npmcli/package-json": "^5.0.0",
"@npmcli/package-json": "^5.0.1",
"@npmcli/promise-spawn": "^7.0.1",
"@npmcli/redact": "^1.1.0",
"@npmcli/run-script": "^7.0.4",
Expand Down

0 comments on commit 84bbbd4

Please sign in to comment.