From c4439e86a2500df7027f760f57913dc7bd4eedfd Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Mon, 29 Apr 2024 22:39:52 +0200 Subject: [PATCH] Prettier: add new package (#43866) --- .../builtin/packages/prettier/package.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 var/spack/repos/builtin/packages/prettier/package.py diff --git a/var/spack/repos/builtin/packages/prettier/package.py b/var/spack/repos/builtin/packages/prettier/package.py new file mode 100644 index 0000000000..bb71668d7b --- /dev/null +++ b/var/spack/repos/builtin/packages/prettier/package.py @@ -0,0 +1,25 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Prettier(Package): + """Prettier is an opinionated code formatter.""" + + homepage = "https://prettier.io/" + url = "https://github.com/prettier/prettier/archive/refs/tags/3.2.5.tar.gz" + + maintainers("adamjstewart") + license("MIT") + + version("3.2.5", sha256="0ac58fbe50859feb06099670526460cef7f51c83fee458b02fc67e53ffd23f57") + + depends_on("node-js", type=("build", "run")) + depends_on("npm", type="build") + + def install(self, spec, prefix): + npm = which("npm", required=True) + npm("install", "--global", f"--prefix={prefix}")