non port: Mk/Uses/npm.mk

Number of commits found: 16

Friday, 4 Dec 2026
11:35 Hiroki Tagato (tagattie) search for other commits by this committer
Mk/Uses/npm.mk: Introduce NPM_PREFETCH_REVISION variable

The prefetch function of USES=npm automatically generates an archive
of node modules needed for a port. The versioning for the archive only
include DISTVERSION and not PORTREVISION to avoid generating duplicate
node modules archive on each port revision bump.

There is a case that a porter wants to update the contents of the node
modules archive (without port version bump) due to some changes to
package.json and/or lockfile. The prefetch function cannot overwrite a
pre-existing node modules archive with one with updated distinfo due
to a limitation of the ports framework.

In such a case, a porter can set NPM_PREFETCH_REVISION to a non-zero
value to produce a new name for node modules archive to work around
the limitation.

NPM_PREFETCH_REVISION should be left undefined unless absolutely
necessary.

PR:		301272
Reported by:	Derek Schrock <dereks@lifeofadishwasher.com>
commit hash: f122051394023bc881978114f20c894b40ab8951 commit hash: f122051394023bc881978114f20c894b40ab8951 commit hash: f122051394023bc881978114f20c894b40ab8951 commit hash: f122051394023bc881978114f20c894b40ab8951 f122051
Saturday, 21 Nov 2026
04:25 Hiroki Tagato (tagattie) search for other commits by this committer
Mk/Uses/npm.mk: Add FETCH_ENV to command for prefetching node modules
commit hash: 5419027217551f1f27aadea365c4aff6bb56bdea commit hash: 5419027217551f1f27aadea365c4aff6bb56bdea commit hash: 5419027217551f1f27aadea365c4aff6bb56bdea commit hash: 5419027217551f1f27aadea365c4aff6bb56bdea 5419027
Tuesday, 17 Nov 2026
08:32 Hiroki Tagato (tagattie) search for other commits by this committer
Mk/Uses/npm.mk: Remove extraneous "projects" directory before archiving pnpm
store
commit hash: 4dbed3f12028ecc72204cf8cb00ef77099c88c52 commit hash: 4dbed3f12028ecc72204cf8cb00ef77099c88c52 commit hash: 4dbed3f12028ecc72204cf8cb00ef77099c88c52 commit hash: 4dbed3f12028ecc72204cf8cb00ef77099c88c52 4dbed3f
Wednesday, 30 Sep 2026
11:50 Hiroki Tagato (tagattie) search for other commits by this committer
Mk/Uses/npm.mk: Add support for pnpm >= 12

pnpm 12 has been rewritten in Rust and introduced an
architecture-dependent node module, which is required to be installed
separately from the main node module.

By default, the installation occurs upon the first pnpm execution and
breaks poudriere builds. So prefetch and extract the native executable
to the expected location in advance to avoid breakage.
commit hash: 8a2e817ddae3c8ecbb4d30869f753f6ea53ee43d commit hash: 8a2e817ddae3c8ecbb4d30869f753f6ea53ee43d commit hash: 8a2e817ddae3c8ecbb4d30869f753f6ea53ee43d commit hash: 8a2e817ddae3c8ecbb4d30869f753f6ea53ee43d 8a2e817
Tuesday, 22 Sep 2026
19:53 Hiroki Tagato (tagattie) search for other commits by this committer
Mk/Uses/npm.mk: Preserve WRKDIR itself after archiving node modules

Removing WRKDIR itself breaks the makesum phase. So only removes the
contents of WRKDIR (node-modules-cache directory and
node-modules-cache.mtree file).
commit hash: e0297e9ec6a26fa9e198b78a642611e8b9a28127 commit hash: e0297e9ec6a26fa9e198b78a642611e8b9a28127 commit hash: e0297e9ec6a26fa9e198b78a642611e8b9a28127 commit hash: e0297e9ec6a26fa9e198b78a642611e8b9a28127 e0297e9
Friday, 18 Sep 2026
13:23 Hiroki Tagato (tagattie) search for other commits by this committer
Mk/Uses/npm.mk: Move --frozen-lockfile from NPM_FETCH_FLAGS to NPM_EXTRACT_FLAGS

`pnpm fetch` does not read a package manafest and only relies on a
lockfile. So specifying --frozen-lockfile here is redundant. We need
the flag when we extrace (install) node modules from a pre-fetched
node modules cache.
commit hash: 639f273472ce73b6716a8af8742ea8ae1e15c98a commit hash: 639f273472ce73b6716a8af8742ea8ae1e15c98a commit hash: 639f273472ce73b6716a8af8742ea8ae1e15c98a commit hash: 639f273472ce73b6716a8af8742ea8ae1e15c98a 639f273
Saturday, 15 Aug 2026
04:02 Hiroki Tagato (tagattie) search for other commits by this committer
Mk/Uses/npm.mk: Add new variable NPM_PREFETCH_ARCHS

A node modules archive created by the prefetch function may vary
depending on the architecture, especially if the archive contains
architecture-specific node modules.

This variable can be used to indicate which architectures the node
modules archives are prepared for.

If you prepared the archives for amd64 and aarch64 architecutres,
specify:
NPM_PREFETCH_ARCHS= aarch64 amd64
commit hash: 0b23ce8d9eea396f867085461ad8761c80da7173 commit hash: 0b23ce8d9eea396f867085461ad8761c80da7173 commit hash: 0b23ce8d9eea396f867085461ad8761c80da7173 commit hash: 0b23ce8d9eea396f867085461ad8761c80da7173 0b23ce8
Thursday, 13 Aug 2026
04:45 Hiroki Tagato (tagattie) search for other commits by this committer
Mk/Uses/npm.mk: Always use X' for denoting BLOB data type

SQLite's .dump always uses X' (capital X) for BLOB. So it's better we
use X' in the code for securing reproducibility of node modules
tarball created by pnpm.

Also, conversion from x' to X' in output dump file in case x' is
accidentally mixed in.

Reported by:	pkg-fallout
commit hash: f3216dad74a016485bfcf09c6acbc830129cdf86 commit hash: f3216dad74a016485bfcf09c6acbc830129cdf86 commit hash: f3216dad74a016485bfcf09c6acbc830129cdf86 commit hash: f3216dad74a016485bfcf09c6acbc830129cdf86 f3216da
Wednesday, 12 Aug 2026
01:39 Hiroki Tagato (tagattie) search for other commits by this committer Author: Bryan Everly
Mk/Uses/npm.mk: Fix typo (!defied -> !defined)

PR:		297455
Reported by:	Bryan Everly <bryan@theeverlys.com>
commit hash: df0c9b0dabc8975edfa75747711d5709bd6ea92b commit hash: df0c9b0dabc8975edfa75747711d5709bd6ea92b commit hash: df0c9b0dabc8975edfa75747711d5709bd6ea92b commit hash: df0c9b0dabc8975edfa75747711d5709bd6ea92b df0c9b0
Friday, 31 Jul 2026
09:15 Hiroki Tagato (tagattie) search for other commits by this committer Author: Shin-ichi Nagamura
Mk/Uses/npm.mk: Quote TMPDIR and WRKDIR in shell comparisons

When TMPDIR is unset, the generated shell command becomes:
    if [ != ${WRKDIR} ]; then
and /bin/sh reports:
    [: !=: unexpected operator

Quoting both variables fixes the issue.

PR:		297181
Reported by:	Shin-ichi Nagamura <core@zsc.jp>
commit hash: cbeb1be34ba3107114345e52c6b57adc2ec34060 commit hash: cbeb1be34ba3107114345e52c6b57adc2ec34060 commit hash: cbeb1be34ba3107114345e52c6b57adc2ec34060 commit hash: cbeb1be34ba3107114345e52c6b57adc2ec34060 cbeb1be
Sunday, 19 Jul 2026
14:09 Hiroki Tagato (tagattie) search for other commits by this committer
Mk/Uses/npm.mk: Copy pnpm-workspace.yaml from PKGJSONSDIR to WRKSRC when it
exists
commit hash: b700ef8ce3d6fb688dc59a428f6cd4edeb961c2f commit hash: b700ef8ce3d6fb688dc59a428f6cd4edeb961c2f commit hash: b700ef8ce3d6fb688dc59a428f6cd4edeb961c2f commit hash: b700ef8ce3d6fb688dc59a428f6cd4edeb961c2f b700ef8
13:15 Hiroki Tagato (tagattie) search for other commits by this committer
Mk/Uses/npm.mk: Remove temp directory in pnpm store before making archive

Leaving the directory in place may cause the node modules archive to
be unreproducible.
commit hash: 89e5e41d60c17231cadec381931ae4f095e1752a commit hash: 89e5e41d60c17231cadec381931ae4f095e1752a commit hash: 89e5e41d60c17231cadec381931ae4f095e1752a commit hash: 89e5e41d60c17231cadec381931ae4f095e1752a 89e5e41
Tuesday, 14 Jul 2026
12:30 Hiroki Tagato (tagattie) search for other commits by this committer
Mk/Uses/npm.mk: Unbreak make index

In the previous commit, NPM_VER_MAJOR and NPM_VER_MINOR are left
undefined when NPM_VER is manually specified. This change corrects the
error.

Reported by:	Xavier Humbert <xavier@groumpf.org> (via ports),
		antoine (via ports-committers)
Fixes:		dad28f35db5a (Mk/Uses/npm.mk: Correct NPM version comparison)
commit hash: ed58cdeda4a8c595ead11be29c8548b2153d6d47 commit hash: ed58cdeda4a8c595ead11be29c8548b2153d6d47 commit hash: ed58cdeda4a8c595ead11be29c8548b2153d6d47 commit hash: ed58cdeda4a8c595ead11be29c8548b2153d6d47 ed58cde
07:46 Hiroki Tagato (tagattie) search for other commits by this committer
Mk/Uses/npm.mk: Correct NPM version comparison

Assuming NPM version follows the semantic versioning, NPM_VER:R was
used to obtain the major and the minor version of NPM. However, when
the minor version is equal or greater than 10, the comparison
NPM:R >= 11.3 does not make sense. This change corrects version
comparison using major and minor combination.
commit hash: dad28f35db5afc535469fdffc9b6042e5dc25871 commit hash: dad28f35db5afc535469fdffc9b6042e5dc25871 commit hash: dad28f35db5afc535469fdffc9b6042e5dc25871 commit hash: dad28f35db5afc535469fdffc9b6042e5dc25871 dad28f3
Tuesday, 30 Jun 2026
20:03 Tijl Coosemans (tijl) search for other commits by this committer
*/*: Use C.UTF-8 locale

Ports 02f27a83b44d fixed the ports tree to the C locale so it would work
correctly in environments where users use a locale that isn't compatible
with the C locale, e.g. xx_YY.UTF-8 where [A-Z] includes more than just
upper case letters.  USE_LOCALE was introduced to let ports use another
locale if they needed it.  The C.UTF-8 locale was created later on to be
mostly compatible with the C locale.

Switch the ports tree locale to C.UTF-8 and remove USE_LOCALE.  The
world has moved to Unicode so all ports either require it or know how to
build correctly in a Unicode environment.

PR:		295945
Exp-run by:	antoine
commit hash: b6ec06f079e1c883d32c788c0285c6d492eeb1c0 commit hash: b6ec06f079e1c883d32c788c0285c6d492eeb1c0 commit hash: b6ec06f079e1c883d32c788c0285c6d492eeb1c0 commit hash: b6ec06f079e1c883d32c788c0285c6d492eeb1c0 b6ec06f
Saturday, 27 Jun 2026
08:37 Hiroki Tagato (tagattie) search for other commits by this committer
Mk/Uses/electron.mk: Split fetch- and extract-related codes out to npm.mk

Prefetch and extract functions are not necessarily limited to electron
ports. Those functions can be utilized by any ports which needs an
offline node modules installation.

Previously, non-electron ports wanting to use prefetch and/or extract
functions needs to use USES=electron:env, which is now removed in
favor of USES=npm:<package manager name>.

The following description:
USES=		electron:env
USE_ELECTRON=	npm:npm-name prefetch extract

is simplified to:
USES=		npm:npm-name
commit hash: ed6a84c1c9793271c9cf948458808b47b2622d21 commit hash: ed6a84c1c9793271c9cf948458808b47b2622d21 commit hash: ed6a84c1c9793271c9cf948458808b47b2622d21 commit hash: ed6a84c1c9793271c9cf948458808b47b2622d21 ed6a84c

Number of commits found: 16