pnpm 11.5.3 → 11.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "12.3.0"
2
+ ".": "12.4.0"
3
3
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.22.1"
2
+ ".": "0.22.2"
3
3
  }
@@ -4,20 +4,20 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "gyp-next"
7
- version = "0.22.1"
7
+ version = "0.22.2"
8
8
  authors = [
9
9
  { name="Node.js contributors", email="ryzokuken@disroot.org" },
10
10
  ]
11
11
  description = "A fork of the GYP build system for use in the Node.js projects"
12
12
  readme = "README.md"
13
- license = { file="LICENSE" }
13
+ license = "BSD-3-Clause"
14
+ license-files = ["LICENSE"]
14
15
  requires-python = ">=3.9"
15
- dependencies = ["packaging>=24.0", "setuptools>=69.5.1"]
16
+ dependencies = ["packaging>=24.0", "setuptools>=77.0.3"]
16
17
  classifiers = [
17
18
  "Development Status :: 3 - Alpha",
18
19
  "Environment :: Console",
19
20
  "Intended Audience :: Developers",
20
- "License :: OSI Approved :: BSD License",
21
21
  "Natural Language :: English",
22
22
  "Programming Language :: Python",
23
23
  "Programming Language :: Python :: 3",
@@ -1,5 +1,5 @@
1
1
  const { Readable } = require('stream')
2
- const { EnvHttpProxyAgent } = require('undici')
2
+ const { Agent, EnvHttpProxyAgent, RetryAgent, fetch } = require('undici')
3
3
  const { promises: fs } = require('graceful-fs')
4
4
  const log = require('./log')
5
5
 
@@ -48,7 +48,7 @@ async function createDispatcher (gyp) {
48
48
  const env = process.env
49
49
  const hasProxyEnv = env.http_proxy || env.HTTP_PROXY || env.https_proxy || env.HTTPS_PROXY
50
50
  if (!gyp.opts.proxy && !gyp.opts.cafile && !hasProxyEnv) {
51
- return undefined
51
+ return new RetryAgent(new Agent(), { maxRetries: 3 })
52
52
  }
53
53
 
54
54
  const opts = {}
@@ -69,7 +69,7 @@ async function createDispatcher (gyp) {
69
69
  if (gyp.opts.noproxy) {
70
70
  opts.noProxy = gyp.opts.noproxy
71
71
  }
72
- return new EnvHttpProxyAgent(opts)
72
+ return new RetryAgent(new EnvHttpProxyAgent(opts), { maxRetries: 3 })
73
73
  }
74
74
 
75
75
  async function readCAFile (filename) {
@@ -11,7 +11,7 @@
11
11
  "bindings",
12
12
  "gyp"
13
13
  ],
14
- "version": "12.3.0",
14
+ "version": "12.4.0",
15
15
  "installVersion": 11,
16
16
  "author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)",
17
17
  "repository": {
@@ -277,6 +277,11 @@ const parseComparator = (comp, options) => {
277
277
 
278
278
  const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
279
279
 
280
+ const invalidXRangeOrder = (M, m, p) => (
281
+ (isX(M) && !isX(m)) ||
282
+ (isX(m) && p && !isX(p))
283
+ )
284
+
280
285
  // ~, ~> --> * (any, kinda silly)
281
286
  // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
282
287
  // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
@@ -373,10 +378,10 @@ const replaceCaret = (comp, options) => {
373
378
  if (M === '0') {
374
379
  if (m === '0') {
375
380
  ret = `>=${M}.${m}.${p
376
- }${z} <${M}.${m}.${+p + 1}-0`
381
+ } <${M}.${m}.${+p + 1}-0`
377
382
  } else {
378
383
  ret = `>=${M}.${m}.${p
379
- }${z} <${M}.${+m + 1}.0-0`
384
+ } <${M}.${+m + 1}.0-0`
380
385
  }
381
386
  } else {
382
387
  ret = `>=${M}.${m}.${p
@@ -402,6 +407,10 @@ const replaceXRange = (comp, options) => {
402
407
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
403
408
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
404
409
  debug('xRange', comp, ret, gtlt, M, m, p, pr)
410
+ if (invalidXRangeOrder(M, m, p)) {
411
+ return comp
412
+ }
413
+
405
414
  const xM = isX(M)
406
415
  const xm = xM || isX(m)
407
416
  const xp = xm || isX(p)
@@ -6,6 +6,22 @@ const { safeRe: re, t } = require('../internal/re')
6
6
 
7
7
  const parseOptions = require('../internal/parse-options')
8
8
  const { compareIdentifiers } = require('../internal/identifiers')
9
+
10
+ const isPrereleaseIdentifier = (prerelease, identifier) => {
11
+ const identifiers = identifier.split('.')
12
+ if (identifiers.length > prerelease.length) {
13
+ return false
14
+ }
15
+
16
+ for (let i = 0; i < identifiers.length; i++) {
17
+ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
18
+ return false
19
+ }
20
+ }
21
+
22
+ return true
23
+ }
24
+
9
25
  class SemVer {
10
26
  constructor (version, options) {
11
27
  options = parseOptions(options)
@@ -309,8 +325,9 @@ class SemVer {
309
325
  if (identifierBase === false) {
310
326
  prerelease = [identifier]
311
327
  }
312
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
313
- if (isNaN(this.prerelease[1])) {
328
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
329
+ const prereleaseBase = this.prerelease[identifier.split('.').length]
330
+ if (isNaN(prereleaseBase)) {
314
331
  this.prerelease = prerelease
315
332
  }
316
333
  } else {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semver",
3
- "version": "7.8.1",
3
+ "version": "7.8.4",
4
4
  "description": "The semantic version parser used by npm.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
15
15
  },
16
16
  "devDependencies": {
17
- "@npmcli/eslint-config": "^6.0.0",
17
+ "@npmcli/eslint-config": "^7.0.0",
18
18
  "@npmcli/template-oss": "5.0.0",
19
19
  "benchmark": "^2.1.4",
20
20
  "tap": "^16.0.0"
@@ -78,22 +78,45 @@ class Header {
78
78
  if (!buf || !(buf.length >= off + 512)) {
79
79
  throw new Error('need 512 bytes for header');
80
80
  }
81
- this.path = ex?.path ?? decString(buf, off, 100);
82
- this.mode = ex?.mode ?? gex?.mode ?? decNumber(buf, off + 100, 8);
83
- this.uid = ex?.uid ?? gex?.uid ?? decNumber(buf, off + 108, 8);
84
- this.gid = ex?.gid ?? gex?.gid ?? decNumber(buf, off + 116, 8);
85
- this.size = ex?.size ?? gex?.size ?? decNumber(buf, off + 124, 12);
86
- this.mtime = ex?.mtime ?? gex?.mtime ?? decDate(buf, off + 136, 12);
81
+ // Decode the typeflag (independent of any pending PAX/GNU extended header)
82
+ // up front so we can tell whether THIS block is itself an intermediary
83
+ // extension header (PAX `x`/`g`, GNU long-name `L`, GNU long-link `K`).
84
+ // Per POSIX pax, a PAX extended header describes the *next file entry*, not
85
+ // the extension headers that may sit between it and that file. Applying the
86
+ // pending PAX overrides (notably `size`) to an intervening `L`/`K`/`x`/`g`
87
+ // header desynchronizes the stream relative to other tar implementations
88
+ // and enables tar interpretation-conflict / file-smuggling attacks.
89
+ const t = decString(buf, off + 156, 1);
90
+ const isNormalFS = types.normalFsTypes.has(t);
91
+ const exForFields = isNormalFS ? ex : undefined;
92
+ const gexForFields = isNormalFS ? gex : undefined;
93
+ this.path = exForFields?.path ?? decString(buf, off, 100);
94
+ this.mode =
95
+ exForFields?.mode ??
96
+ gexForFields?.mode ??
97
+ decNumber(buf, off + 100, 8);
98
+ this.uid =
99
+ exForFields?.uid ?? gexForFields?.uid ?? decNumber(buf, off + 108, 8);
100
+ this.gid =
101
+ exForFields?.gid ?? gexForFields?.gid ?? decNumber(buf, off + 116, 8);
102
+ this.size =
103
+ exForFields?.size ??
104
+ gexForFields?.size ??
105
+ decNumber(buf, off + 124, 12);
106
+ this.mtime =
107
+ exForFields?.mtime ??
108
+ gexForFields?.mtime ??
109
+ decDate(buf, off + 136, 12);
87
110
  this.cksum = decNumber(buf, off + 148, 12);
88
111
  // if we have extended or global extended headers, apply them now
89
112
  // See https://github.com/npm/node-tar/pull/187
90
- // Apply global before local, so it overrides
91
- if (gex)
92
- this.#slurp(gex, true);
93
- if (ex)
94
- this.#slurp(ex);
113
+ // Apply global before local, so it overrides. Never slurp the pending
114
+ // extended-header fields onto an intermediary extension header.
115
+ if (gexForFields)
116
+ this.#slurp(gexForFields, true);
117
+ if (exForFields)
118
+ this.#slurp(exForFields);
95
119
  // old tar versions marked dirs as a file with a trailing /
96
- const t = decString(buf, off + 156, 1);
97
120
  if (types.isCode(t)) {
98
121
  this.#type = t || '0';
99
122
  }
@@ -111,12 +134,24 @@ class Header {
111
134
  this.linkpath = decString(buf, off + 157, 100);
112
135
  if (buf.subarray(off + 257, off + 265).toString() === 'ustar\u000000') {
113
136
  /* c8 ignore start */
114
- this.uname = ex?.uname ?? gex?.uname ?? decString(buf, off + 265, 32);
115
- this.gname = ex?.gname ?? gex?.gname ?? decString(buf, off + 297, 32);
137
+ this.uname =
138
+ exForFields?.uname ??
139
+ gexForFields?.uname ??
140
+ decString(buf, off + 265, 32);
141
+ this.gname =
142
+ exForFields?.gname ??
143
+ gexForFields?.gname ??
144
+ decString(buf, off + 297, 32);
116
145
  this.devmaj =
117
- ex?.devmaj ?? gex?.devmaj ?? decNumber(buf, off + 329, 8) ?? 0;
146
+ exForFields?.devmaj ??
147
+ gexForFields?.devmaj ??
148
+ decNumber(buf, off + 329, 8) ??
149
+ 0;
118
150
  this.devmin =
119
- ex?.devmin ?? gex?.devmin ?? decNumber(buf, off + 337, 8) ?? 0;
151
+ exForFields?.devmin ??
152
+ gexForFields?.devmin ??
153
+ decNumber(buf, off + 337, 8) ??
154
+ 0;
120
155
  /* c8 ignore stop */
121
156
  if (buf[off + 475] !== 0) {
122
157
  // definitely a prefix, definitely >130 chars.