diff options
Diffstat (limited to 'pkgs/by-name/pr/prettierd')
-rw-r--r-- | pkgs/by-name/pr/prettierd/package.json | 45 | ||||
-rw-r--r-- | pkgs/by-name/pr/prettierd/package.nix | 55 |
2 files changed, 100 insertions, 0 deletions
diff --git a/pkgs/by-name/pr/prettierd/package.json b/pkgs/by-name/pr/prettierd/package.json new file mode 100644 index 0000000000000..085e4ab73f7c3 --- /dev/null +++ b/pkgs/by-name/pr/prettierd/package.json @@ -0,0 +1,45 @@ +{ + "name": "@fsouza/prettierd", + "version": "0.25.3", + "description": "prettier, as a daemon", + "bin": { + "prettierd": "./bin/prettierd" + }, + "scripts": { + "prepare": "yarn build", + "build": "tsc -b", + "run": "node bin/prettierd", + "start": "node bin/prettierd start", + "prettier:check": "prettier --check .", + "prettier:fix": "prettier --write ." + }, + "repository": { + "type": "git", + "url": "git+https://github.com/fsouza/prettierd.git" + }, + "author": "Francisco Souza", + "license": "ISC", + "bugs": { + "url": "https://github.com/fsouza/prettierd/issues" + }, + "homepage": "https://github.com/fsouza/prettierd", + "devDependencies": { + "@types/node": "^20.12.7", + "@types/prettier": "^3.0.0", + "typescript": "^5.4.5" + }, + "dependencies": { + "core_d": "^6.1.0", + "prettier": "^3.2.5" + }, + "files": [ + "bin", + "dist", + "LICENSE", + "README.md" + ], + "optionalDependencies": { + "@babel/parser": "^7.24.4", + "@typescript-eslint/typescript-estree": "^7.6.0" + } +} diff --git a/pkgs/by-name/pr/prettierd/package.nix b/pkgs/by-name/pr/prettierd/package.nix new file mode 100644 index 0000000000000..1025a90fbd377 --- /dev/null +++ b/pkgs/by-name/pr/prettierd/package.nix @@ -0,0 +1,55 @@ +{ + lib, + mkYarnPackage, + fetchFromGitHub, + makeWrapper, + nodejs, + fetchYarnDeps, +}: +mkYarnPackage rec { + pname = "prettierd"; + version = "0.25.3"; + + src = fetchFromGitHub { + owner = "fsouza"; + repo = "prettierd"; + rev = "v${version}"; + hash = "sha256-3lvFZ5/p+1kPnHIR2PlQtCY3SVo1rs8IuBigLaabxAE="; + }; + + offlineCache = fetchYarnDeps { + yarnLock = src + "/yarn.lock"; + hash = "sha256-Ti2b102pzUKB6Xy3LwZ7DlrnW0cRscgNLTUIAKz+6Us="; + }; + + packageJSON = ./package.json; + + nativeBuildInputs = [ makeWrapper ]; + + buildPhase = '' + runHook preBuild + export HOME=$(mktemp -d) + yarn --offline build + runHook postBuild + ''; + + # prettierd needs to be wrapped with nodejs so that it can be executed + postInstall = '' + wrapProgram "$out/bin/prettierd" --prefix PATH : "${nodejs}/bin" + ''; + + doDist = false; + + meta = { + mainProgram = "prettierd"; + description = "Prettier, as a daemon, for improved formatting speed"; + homepage = "https://github.com/fsouza/prettierd"; + license = lib.licenses.isc; + changelog = "https://github.com/fsouza/prettierd/blob/${src.rev}/CHANGELOG.md"; + platforms = with lib.platforms; linux ++ darwin; + maintainers = with lib.maintainers; [ + NotAShelf + n3oney + ]; + }; +} |