From 1aada01feed3cc34e62332f581fca0e8ed5adeba Mon Sep 17 00:00:00 2001 From: Oleg Borodin Date: Thu, 28 Aug 2025 11:40:56 +0200 Subject: [PATCH] updated --- devel/yarn/Makefile | 37 ++++++++++++++ devel/yarn/distinfo | 3 ++ devel/yarn/files/patch-lib_cli.js | 80 +++++++++++++++++++++++++++++++ devel/yarn/pkg-descr | 6 +++ devel/yarn/pkg-plist | 16 +++++++ 5 files changed, 142 insertions(+) create mode 100644 devel/yarn/Makefile create mode 100644 devel/yarn/distinfo create mode 100644 devel/yarn/files/patch-lib_cli.js create mode 100644 devel/yarn/pkg-descr create mode 100644 devel/yarn/pkg-plist diff --git a/devel/yarn/Makefile b/devel/yarn/Makefile new file mode 100644 index 00000000..ea4f4bbd --- /dev/null +++ b/devel/yarn/Makefile @@ -0,0 +1,37 @@ +# $FreeBSD: head/www/yarn/Makefile 478946 2018-09-04 09:56:04Z pizzamig $ + +PORTNAME= yarn +DISTVERSIONPREFIX= v +DISTVERSION= 1.22.19 +CATEGORIES= www +MASTER_SITES= https://yarnpkg.com/downloads/${PORTVERSION}/ + +MAINTAINER= pizzamig@FreeBSD.org +COMMENT= Package manager for node, alternative to npm + +RUN_DEPENDS= node>=10.0:lang/node22 + +NO_ARCH= yes +NO_BUILD= yes + +RLN?= ${INSTALL} -l rs + +post-patch: + ${RM} ${WRKSRC}/bin/*.cmd + ${REINPLACE_CMD} -i '' \ + -e 's|"installationMethod": "tar"|"installationMethod": "pkg"|g' \ + ${WRKSRC}/package.json + ${REINPLACE_CMD} -i '' -e 's%Linux)%Linux|FreeBSD)%g' \ + ${WRKSRC}/bin/yarn + +do-install: + ${MKDIR} ${STAGEDIR}${PREFIX}/lib/node_modules/yarn + cd ${WRKSRC}/ && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/lib/node_modules/yarn + ${RLN} ${STAGEDIR}${PREFIX}/lib/node_modules/yarn/bin/yarn.js \ + ${STAGEDIR}${PREFIX}/bin/yarn + ${RLN} ${STAGEDIR}${PREFIX}/lib/node_modules/yarn/bin/yarnpkg \ + ${STAGEDIR}${PREFIX}/bin/yarnpkg + + ${CHMOD} a+x ${STAGEDIR}${PREFIX}/lib/node_modules/yarn/bin/* + +.include diff --git a/devel/yarn/distinfo b/devel/yarn/distinfo new file mode 100644 index 00000000..32b27ee5 --- /dev/null +++ b/devel/yarn/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1679769318 +SHA256 (yarn-v1.22.19.tar.gz) = 732620bac8b1690d507274f025f3c6cfdc3627a84d9642e38a07452cc00e0f2e +SIZE (yarn-v1.22.19.tar.gz) = 1244259 diff --git a/devel/yarn/files/patch-lib_cli.js b/devel/yarn/files/patch-lib_cli.js new file mode 100644 index 00000000..0165be16 --- /dev/null +++ b/devel/yarn/files/patch-lib_cli.js @@ -0,0 +1,80 @@ +--- lib/cli.js.orig 2020-03-09 15:51:47 UTC ++++ lib/cli.js +@@ -56939,10 +56939,10 @@ function getRcConfigForFolder(cwd) { + } + + function loadRcFile(fileText, filePath) { +- var _parse = (0, (_lockfile || _load_lockfile()).parse)(fileText, filePath), ++ var _parse = (0, (_lockfile || _load_lockfile()).parse)(fileText, 'yarnrc'), + values = _parse.object; + +- if (filePath.match(/\.yml$/) && typeof values.yarnPath === 'string') { ++ if (filePath.match(/\.yml$/)) { + values = { 'yarn-path': values.yarnPath }; + } + +@@ -64532,27 +64532,16 @@ function parse(str, fileLoc) { + var parser = new Parser(str, fileLoc); + parser.next(); + +- if (!fileLoc.endsWith(`.yml`)) { ++ try { ++ return parser.parse(); ++ } catch (error1) { + try { +- return parser.parse(); +- } catch (error1) { +- try { +- return safeLoad(str, { +- schema: FAILSAFE_SCHEMA +- }); +- } catch (error2) { +- throw error1; +- } ++ return safeLoad(str, { ++ schema: FAILSAFE_SCHEMA ++ }); ++ } catch (error2) { ++ throw error1; + } +- } else { +- var result = safeLoad(str, { +- schema: FAILSAFE_SCHEMA +- }); +- if (typeof result === 'object') { +- return result; +- } else { +- return {}; +- } + } + } + +@@ -90319,7 +90308,7 @@ var _buildSubCommands = (0, (_buildSubCommands2 || _lo + var rcPath = `${config.lockfileFolder}/.yarnrc.yml`; + reporter.log(`Updating ${chalk.magenta(rcPath)}...`); + +- yield (_fs || _load_fs()).writeFilePreservingEol(rcPath, `yarnPath: ${(0, (_stringify || _load_stringify()).default)(targetPath)}\n`); ++ yield (_fs || _load_fs()).writeFilePreservingEol(rcPath, `yarnPath: ${(0, (_stringify || _load_stringify()).default)(yarnPath)}\n`); + } else { + var _rcPath = `${config.lockfileFolder}/.yarnrc`; + reporter.log(`Updating ${chalk.magenta(_rcPath)}...`); +@@ -101330,11 +101319,7 @@ function parseRcPaths(paths, parser) { + try { + return parser((0, (_fs || _load_fs()).readFileSync)(path).toString(), path); + } catch (error) { +- if (error.code === 'ENOENT' || error.code === 'EISDIR') { +- return {}; +- } else { +- throw error; +- } ++ return {}; + } + }))); + } +@@ -153406,4 +153391,4 @@ module.exports = require("dns"); + module.exports = require("domain"); + + /***/ }) +-/******/ ]); +\ No newline at end of file ++/******/ ]); diff --git a/devel/yarn/pkg-descr b/devel/yarn/pkg-descr new file mode 100644 index 00000000..2cc35079 --- /dev/null +++ b/devel/yarn/pkg-descr @@ -0,0 +1,6 @@ +Yarn is a new node package manager that replaces the existing workflow for the +npm client or other package managers while remaining compatible with the npm +registry. It has the same feature set as existing workflows while operating +faster, more securely, and more reliably. + +WWW: https://yarnpkg.com/blog/ diff --git a/devel/yarn/pkg-plist b/devel/yarn/pkg-plist new file mode 100644 index 00000000..91eac5e1 --- /dev/null +++ b/devel/yarn/pkg-plist @@ -0,0 +1,16 @@ +bin/yarn +bin/yarnpkg +lib/node_modules/yarn/bin/yarn +lib/node_modules/yarn/bin/yarn.js +lib/node_modules/yarn/bin/yarnpkg +lib/node_modules/yarn/lib/cli.js +lib/node_modules/yarn/lib/cli.js.orig +lib/node_modules/yarn/lib/v8-compile-cache.js +lib/node_modules/yarn/LICENSE +lib/node_modules/yarn/package.json +lib/node_modules/yarn/preinstall.js +lib/node_modules/yarn/README.md +@dir lib/node_modules/yarn/bin +@dir lib/node_modules/yarn/lib +@dir lib/node_modules/yarn +@dir lib/node_modules