git: a3e5136e420d - 2026Q3 - Mk/Uses/npm.mk: Copy pnpm-workspace.yaml from PKGJSONSDIR to WRKSRC when it exists

From: Hiroki Tagato <tagattie_at_FreeBSD.org>
Date: Thu, 10 Sep 2026 20:54:50 UTC
The branch 2026Q3 has been updated by tagattie:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a3e5136e420d34fd10d038146ff813d6f7483be9

commit a3e5136e420d34fd10d038146ff813d6f7483be9
Author:     Hiroki Tagato <tagattie@FreeBSD.org>
AuthorDate: 2026-07-19 14:09:15 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2026-09-10 20:54:26 +0000

    Mk/Uses/npm.mk: Copy pnpm-workspace.yaml from PKGJSONSDIR to WRKSRC when it exists
    
    (cherry picked from commit b700ef8ce3d6fb688dc59a428f6cd4edeb961c2f)
---
 Mk/Uses/npm.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Mk/Uses/npm.mk b/Mk/Uses/npm.mk
index ec5cd61d4489..c886b3623dea 100644
--- a/Mk/Uses/npm.mk
+++ b/Mk/Uses/npm.mk
@@ -211,6 +211,7 @@ NPM_REBUILD_CMD?=	${NPM_CMDNAME} rebuild
 .    endif
 .  elif ${_NPM_NAME} == pnpm
 NPM_LOCKFILE?=		pnpm-lock.yaml
+NPM_WORKSPACEFILE?=	pnpm-workspace.yaml
 NPM_MODULE_CACHE?=	pnpm-store
 NPM_CMDNAME?=		pnpm
 NPM_CACHE_SETUP_CMD?=	${DO_NADA}
@@ -460,6 +461,15 @@ npm-copy-package-file:
 		fi; \
 		${CP} ${PKGJSONSDIR}/$${f} ${NPM_EXTRACT_WRKSRC}/$${f}; \
 	done
+.      if defined(NPM_WORKSPACEFILE) && !empty(NPM_WORKSPACEFILE)
+	@for f in `${FIND} ${PKGJSONSDIR} -type f -name ${NPM_WORKSPACEFILE} -print | ${SED} -e 's|${PKGJSONSDIR}/||'`; do \
+		${MKDIR} -p `${DIRNAME} ${NPM_EXTRACT_WRKSRC}/$${f}`; \
+		if [ -f ${NPM_EXTRACT_WRKSRC}/$${f} ]; then \
+			${MV} -f ${NPM_EXTRACT_WRKSRC}/$${f} ${NPM_EXTRACT_WRKSRC}/$${f}.bak; \
+		fi; \
+		${CP} ${PKGJSONSDIR}/$${f} ${NPM_EXTRACT_WRKSRC}/$${f}; \
+	done
+.      endif
 .    endif
 
 npm-install-node-modules: