diff options
| author | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-01-02 23:52:33 +0100 |
|---|---|---|
| committer | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-02-08 21:23:36 +0100 |
| commit | 9da154727c176227a59857d78745c07d1cfd3a9c (patch) | |
| tree | 2b15eb93e35c589d2aa9d37b890d934b8ccf8bf2 /gnu | |
| parent | 5e16fb3f0d7997a36ba89c1a1c24e3e3c8c15358 (diff) | |
gnu: Add node-yaml.
* gnu/packages/node-xyz.scm (node-yaml): New variable.
Change-Id: I79fa7c40c9a023242da33dfc779d917b29a64aa1
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/node-xyz.scm | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm index a8dcedb3a61..d451e6829fc 100644 --- a/gnu/packages/node-xyz.scm +++ b/gnu/packages/node-xyz.scm | |||
| @@ -4496,6 +4496,55 @@ function with browser support.") | |||
| 4496 | implementation.") | 4496 | implementation.") |
| 4497 | (license license:expat))) | 4497 | (license license:expat))) |
| 4498 | 4498 | ||
| 4499 | (define-public node-yaml | ||
| 4500 | (package | ||
| 4501 | (name "node-yaml") | ||
| 4502 | (version "2.6.0") | ||
| 4503 | (source | ||
| 4504 | (origin | ||
| 4505 | (method git-fetch) | ||
| 4506 | (uri (git-reference | ||
| 4507 | (url "https://github.com/eemeli/yaml") | ||
| 4508 | (commit (string-append "v" version)))) | ||
| 4509 | (file-name (git-file-name name version)) | ||
| 4510 | (sha256 | ||
| 4511 | (base32 "1w9qajkjshp2imrxmps96phg4iqgxr7pfzqx9518fymzwzpjkdvr")))) | ||
| 4512 | (build-system node-build-system) | ||
| 4513 | (arguments | ||
| 4514 | (list | ||
| 4515 | #:tests? #f | ||
| 4516 | #:phases | ||
| 4517 | #~(modify-phases %standard-phases | ||
| 4518 | (add-after 'patch-dependencies 'delete-dev-dependencies | ||
| 4519 | (lambda _ | ||
| 4520 | (modify-json (delete-dev-dependencies)))) | ||
| 4521 | (replace 'build | ||
| 4522 | (lambda* (#:key inputs native-inputs #:allow-other-keys) | ||
| 4523 | (let ((esbuild (search-input-file (or native-inputs inputs) | ||
| 4524 | "/bin/esbuild"))) | ||
| 4525 | ;; Compile TypeScript to JavaScript using esbuild | ||
| 4526 | ;; Output to dist/ directory to match package.json exports | ||
| 4527 | (mkdir-p "dist") | ||
| 4528 | (for-each | ||
| 4529 | (lambda (ts-file) | ||
| 4530 | (let* ((relative (substring ts-file (string-length "src/"))) | ||
| 4531 | (js-file (string-append "dist/" | ||
| 4532 | (string-drop-right relative 3) | ||
| 4533 | ".js"))) | ||
| 4534 | (mkdir-p (dirname js-file)) | ||
| 4535 | (invoke esbuild ts-file | ||
| 4536 | (string-append "--outfile=" js-file) | ||
| 4537 | "--format=cjs" | ||
| 4538 | "--platform=node" | ||
| 4539 | "--target=es2020"))) | ||
| 4540 | (find-files "src" "\\.ts$")))))))) | ||
| 4541 | (native-inputs (list esbuild)) | ||
| 4542 | (home-page "https://eemeli.org/yaml/") | ||
| 4543 | (synopsis "JavaScript YAML parser and stringifier") | ||
| 4544 | (description "This package provides a library for YAML. Supports both | ||
| 4545 | YAML 1.1 and YAML 1.2.") | ||
| 4546 | (license license:isc))) | ||
| 4547 | |||
| 4499 | (define-public node-yazl | 4548 | (define-public node-yazl |
| 4500 | (package | 4549 | (package |
| 4501 | (name "node-yazl") | 4550 | (name "node-yazl") |
